 and welcome to Desk of Lady Aida. Hey, everybody, and welcome to Desk of Lady Aida. It's me, Lady Aida. You can tell I got my hairy pinkify, which is good. It means nature's healing with me, Mr. Lady Aida, on camera control. That's right. Oh, good. Now I was gonna say, we're gonna do this show. We have a thing we're doing. Let me just tell everyone, because you might get your news from all sorts of different sources. New York is amazing right now. There's theater. There's art. There's events everywhere. We have to do a bunch of people. We were walking around New York City and we saw people who spanned all across the US and Lamor ran into some MIT folks. So like, it's happening. It's happening. Come visit New York over the winter. Go to all these things. Fall is like the best. Spring's good, but fall is like prime, good shopping. It's amazing. Good events. The restaurants are open. Pop-ups. Yeah, like it's no big deal. No one cares about the vaccines. And you show your thing and go in. You have a great time. It's awesome. Okay, so let's do some electronics. Okay, cool. To get a 20-minute show tonight, because I'm gonna go get some dinner. We got our reservation, which is cool. Restaurants are back too. And okay, so we got a couple things. First up, getting back to the old designs. I've been trying to kind of catch up with designs like one or two a week because I took a little bit of a break. So the KB2040 is the board that I worked on this week, which is a keyboard controller. Because remember, I did all that keyboard stuff kind of in prep for the MacroPad and the Adabox. And I was like, oh, you know, a lot of these kits, they use a pro micro. So let's go to the overhead real fast and I'll show off what I'm talking about. Yeah, I work with the folks over who do a keyboard newsletter. It's on our site and everything. And I was like, hey, what would be the best thing possible with all this? And so we're gonna do some giveaways with them right now. We're a sponsor of one of their contests. But you'll see this in all the keyboard sites soon because we wanted to do like state of the art, best thing possible, pythons on it. So lady, what did you do? So this is the pro micro. So this is actually, this is a clone of, or you know, a DIY build of the SparkFun pro micro, which is, it has a certain pinout to it and it has a 32U4 Arduino compatible chip and it's got like an Arduino compatible boot loader on it. And it's got like a certain row size and row of pins. And like the capabilities, like the way the power pins are hooked up and what the chips can do is very specific. This one has a, an SMT, which I really don't like. This has an SMT micro USB connector, which is not so great. And so we're like, well, we don't, we don't, we stock the pro mini or probably stock the pro micro as well. But we wanted to do something that was, because we added HID support in Circuit Python for the RP2040 and people are really liking it. Like if you're using Circuit Python and the RP2040, chances are like 50% of the people are doing it because they want that native HID support for keyboards. And we did key matrix scanning and we're adding in, you know, right now we're working on asynchronous concurrency work in Circuit Python so people can do more of that and that's kind of come along. So we wanted to make a board that you could maybe kind of drop in compatible as much as possible. Now I will say a lot of people who use keyboards are using something like QMK, which is this like very interestingly designed and developed software. It's definitely got a little bit the, you know, it like one person developed it and it's very specific about how it works and it requires like an RTOS, I don't remember exactly which one. And so not all chips are supported, but you know, for people who just want to do plain Arduino or they want to do Circuit Python, the RP2040 is supported there even though it's not supported in QMK. Although I think eventually someone's gonna add QMK support but I looked at it and I'm not doing it because I got a lot of shit on my plate. So this RP2040 board, I was actually inspired a little bit by the Elite C which is a derivative of the 32U4 board but with USB type C and a couple other benefits. So let's look quickly at the computer. This way open source is great because we're all building on top of multiple things. And this is a really- And this is a really- People build off our thing. This is a really good looking board. I gotta say this board is really nice. So one thing I thought was kind of nice is that they broke out the D plus and D minus pins up here and I actually thought that would be really useful because a lot of times if you're doing USB stuff and especially with keyboards where it's like it's mounted on a board but then maybe you wanna have a different kind of connector or you wanna have the cable go elsewhere. Getting to the power ground pins is really easy. Those are exposed through the raw pin or the V bus pin but you don't have access to the data plus data minus and sometimes they're brought out in some way. So one of the things I did in my design is that there's just kind of like two pins at the top. This is cast-related which is why it's got that weird. You're like why do you have this really long pads? This is how you make cast-related pads by the way in Eagle. Is it the official way? I don't know but this is the way that works. You basically have, you have two sets of holes. You have one set of holes here which you actually can't quite see because this is overlapping maybe if I press the, now I will show you. Basically, there's a hole here and then you have an oval pad that overlaps with it and I'll show you on the overhead what it looks like at the end. It comes out quite nice as a cast-related pad and then board houses know what you're talking about. So this pin here is D minus and down here is D plus and then there's this jumper to let you get access to like the raw USB power and let's go back to the Elite C. Other than that, it's got USB-C which I like. This has a sunken USB-C which I'm kind of into but it's also would take up a lot of space. So I decided to go with like a plain mounted one and this board also has edge connectors here which I decided I wanted to STMQT port and two buttons which is actually very similar to SparkFun. They made a RP2040 Pro Micro and I was like, that's a really good idea. So I kind of combined kind of a little bit of both. Fun trivia, the SparkFun Pro Micro Arduino is the only open hardware certified Arduino. Oh, that's so. Yep. The Pro Micro or the Pro Mini, really? Yeah, whatever the ones SparkFun did. Yeah. Okay, cool. That is cool. That's a new statement. So check out desk authority because they do have a whole bunch of these boards. And then this is the example because I was like, what are they used for? So there's often these little kits. This is like a 16 key kit and this is what it looks like in the end. It's like a 16, it's a four by four key kit and you DIY it and basically what's nice about when people use Pro Micros is it's a very standard small pinout that people use and then all you need is some through-hole diodes along with it and these through-hole buttons. So it basically takes a project that would be, it's interesting it's people that go, how are you gonna people gonna prototype with SMT microcontrollers? Because back in the day you could get dip microcontrollers like that Mega Series came in dip but none of the USB chips come in dip. What are you gonna do? You end up just using kind of like a moduli type thing and the RP2040 Pico is much, much cheaper. Of course it's sold kind of like at cost from Raspberry Pi Foundation but it's much, much bigger and I wanted to have something that's pin compatible. So one of the things they did while debugging it is you wanna make sure that all the pins are aligned right and we have the pretty pin script that we worked on a couple months ago that allowed us to auto generate these very beautiful pinout diagrams and the way that works is basically just a total like disgusting mess of Python code I wrote and it actually parses out, you give it this CSV file which tells you each GPIO what it is and then it parses the pins.c file in CircuitPython and it parses the Arduino pin definition file as well. If you look at the code it really does some really horrible wonderful things where it includes the Arduino core and then compiles it with a main C that print F's the pin definitions out instead of trying to actually parse it because it's easier to just have it print out all the pins for you and then it kind of mushes it all together and gives you this combination which displays the CircuitPython name, the Arduino pin name and then all the peripherals that are available on those pins in color code order and it's a total pain to add new boards but once I've added a board we can kind of rip through and do them. One of the reasons I did this is one, I want to document boards because people are like I want these pin diagrams and folks in the community were like hey I'll generate a pin diagram for you and they were very very kind and were very very grateful for the people who've done that however there was always one typo and it's not their fault it's really really really hard to make a pin diagram from scratch without making a human error it's like everything's like PB0100 but that's not necessarily D0 it's very easy to get things mixed up quite easily and so having this automatic generation first off we get beautiful diagrams but also when I'm checking that I muxed all the pins where I get a big picture of all the pin muxing which really helps make sure that like okay do I really have a UART on D0 and D1 and I can read over here and be like okay yeah I have a UART, TX is in the right place or I mean they test them in software but it's always good to just have another thing or the analog pins are in the right place and they're all labeled right just it's just another check so this is probably gonna come out soon I'm gonna try ordering from PCB way if you click on the advanced PCB search it takes longer but they do have pink available that's some cool colors orange and transparent and gray we're gonna have all of the colors eventually for all of our boards in a variety of ways so stay tuned to that yeah just remember you have to click on advanced it's not the standard or proto it's just you're gonna pay a little bit more and it's gonna take two weeks okay so that's that and that and that and so the next thing as we lead in so it's like what's the next board I'm trying to finish is so I'm setting up the keyboard 2040 that PCB was sent down we get the tester and so we'll fab that soon thank you very much and then next step I wanted to make a little stepper motor driver also these are kind of a standard pinout and I wanted to it's they take people tend to use like the Allegro like I think it's the A9488 or 9844 or something it's a very standard stepper controller that's used in 3D printers obviously I don't want to manufacture 3D printers but these stepper motor controllers are kind of in a very standard pinout and I thought it would be cool to make a feather wing maybe that takes them or like a motor hat and so I was like I want to make one as well and we saw that ST has this nice motor driver that they're starting to compete with very high step resolution I think it's one 32nd of a step which is really great and ST makes really good motor drivers and so I thought I'd make I start sketching out the design of one of these controller boards using this, the ST Spin low voltage stepper motor drivers, low voltage 10 volts which is still well within a lot of people's voltage driving range they want to drive eight, nine volts maybe five volts stepper motors and up to 1.3 amps one thing that was interesting is as I was doing the design for this is that to do, there's stepper motor controlling but there's also current limiting and that's important because with stepper motors you're often, as they heat up the resistance changes a little bit you want to drive them at a constant current and so there's the sense resistor and the sense resistor is a current sense resistor it's not a current mirrored sense resistor so this resistor actually has to be quite high wattage in order to handle the 1.3 amps times 1.3 amps times whatever the resistance is that sets that current and so it takes a little bit different I think we covered surface mount resistors but I wanted to do a great search where we talk about not just resistors but current sense resistors so if we have a last question before we go to the great search that'll be the great search we're gonna do a great search right now okay The Great Search brought to you by DigiKey and H3 thank you DigiKey for supporting the great search every single week LadyAidUse is a power of engineering to find you all the things on digikey.com LadyAid, what is the great search this week? Okay, so this week I am working on the ST-SPIN breakout board it's an ST stepper motor driver with current limiting and it uses resistors to make sure that the current limiting stays within desired limit and to do that we need to have this breakout board that we're designing and it's a fixed size we need to have these kind of large current sense resistors so I wanted to show how I found the current sense resistors of my dreams let's go to the computer I'll show you the design so this is the data sheet for the ST-SPIN 220 to see the stepper motor and then there is two resistors one for each coil and this resistor actually has the current pass through it and so it's quite a high power resistor and if we search for, you can determine what sense resistor you want the sense resistor sets the current limit so I'm gonna follow the data sheet's recommendation values but of course depending on the stepper motor you wanna drive whether you wanna drive it at a full 1.3 amps or a little bit higher maybe 1.5 or 1, whatever you wanna do the math but in this case it's 0.33 ohms so it's 330 milliohms because it's current sensing you want to measure the voltage going over it and the current is quite high so in this case we're dealing with a 0.33 ohm resistor times maybe 1.25 amps times 1.25 amps so it's over half a watt because it's voltage times current is power but we don't have the voltage necessarily in this case so it's just current times resistance which is like the same thing and it's over half a watt and that's not, usually when people are just buying resistors you're buying 0.402s or 0.603s you don't care about the wattage because it's a pull up resistor or a signal resistor or a voltage divider the amount of current going through is like under a milliamp and so you're never gonna get over a quarter watt or a tenth of a watt or a sixteenth of a watt and so you can use these little itsy bitsy resistors but in this case these current sensor resistors because there is a full amp plus going through them the wattage is quite high which means physically the package has to be larger in order to dissipate that much current which is why you see on like our INA 219 or other current sensing or power sensing breakout boards there's this big ass like 0.1 ohm resistor that's what the current is passing through and it has to be really large in order to dissipate that heat one thing, early in your engineering design you'll probably spec the wrong size resistor for current sensor resistor because it's easy to be like oh I'll just put an 0.805 or 0.603 and then it'll immediately overheat and melt off and it'll be super cool since we just won't just go right off your board, pop. So let's go to Digi-Key to find a current sensor resistor. So again, I'm gonna follow that data sheet recommendation they say 330 milli ohms, one watt, why one watt? Cause you don't wanna have a half a watt if it's like you give yourself some head room where you never know that could be ambient temperature rises it could be plus or minus 10% so they recommend one watt and we'll go with that So in this case, we can look for this resistor I know it's like you think you search for current sense but even though current sensor resistor is what I would consider a subclass of resistor it's not sold separately than plain resistors. There are chassis mount resistors and such but adjustable power resistors which are kind of specialized but in this case it really is just it's just a resistor with a very high wattage. So first off, we're only gonna look at stuff that's in stock and active cause I want to purchase them and I also want to spec them. You might want to purchase them. I want to purchase them. Make sure you can purchase the things that you want. Well, there's always like thousands of you know the resistors, there's literally a million different resistors and so I'm like, look, I just want to get the ones that I can buy. For resistance, you know, you can put it actually uses limit boxes. So let's go from your 250 to 350 milli ohms. So that's kind of nice that it will select for me. The area, I guess if you can't select both. And then of course the most important thing is that wattage. So under power watts, go down here and select one watt. Now there's 0.75 watts and I don't know, you can also select that but I'm gonna stick to one and then, you know, I think as I really, you know, cause I'm just laying out the design to test it, as I do more testing I can actually verify like how much wattage am I burning off of this resistor and then if I can get away with 0.75, you know cause it's still more headroom than necessary but I have to, you want to, you know, verify that. Tolerance 1%, 5%, it doesn't matter. I mean, current sensor resistors are not gonna get high precision because they're just differently made. They're meant to dissipate a lot of heat. And in fact, if you look, there's some cool weird resistors out here. First off, they can come in, you know, a diode mouth because physically they're just larger they can dissipate more current. See, there was a really cool one. I don't know if it's, there's one where you can actually see there was like three elements in it. Let me, let me go with stock with this one. No, there was just, oh yeah, here it is. So this is just kind of cool. I saw this, I was like, oh, that's kind of interesting. So you can literally see there are three resistors in parallel so that each one can dissipate and it has a little bit of this space in between them. So it's the old hack of like, oh, you need a like half watt resistor, you only got a quarter watt. You pick twice the resistance and double them up and you get twice the wattage and half the resistance. Okay, same thing, but done for you in SMT format. So one thing I do want to note is, you know, which I've never seen before and you do have to watch out for is it's like, it's an O805, but it's wide stock, right? It's the wrong way. It's like couch style or whatever. It's, you don't connect across the pads. And that's important because, you know, usually for this resistance, you get 25, 12, right? Which is kind of massive for a resistor. I mean, we can, I think this is the resistor, right? Yeah, so this is 1206. Here's a 1206 on my board. And if you change this package to 2512, it's like half the board is this resistor. I couldn't fit two of these. And so in this design, normally I go with price and I don't care about the size, because who cares? But like, I am fixed. I have to have it in this package so that this breakup board can fit into like the standard, you know, 3D printing stepper motor controller. So the size of it is important. In which case I'm going to do what I normally don't do, which is make sure that I don't have these massive packages. So I'm gonna say, you know, 12, 10, 20, 10, I don't even want 20, 10 to be honest. I kind of want the smallest possible. I think kind of 12, 1218 or 1206 is the largest. And that'll really reduce the number down. And let me see if I can see what, this was the 0805 wide, but this is a weird package. Oh, okay, so what happened is is because it's a weird package, it actually doesn't appear here anymore. Aha, so let me go back. So under supplier device, I think I need to click this little tick, yeah. So what I ended up doing is that the one I found is, oh, interesting, it did not fit in one moment. It was, let me get rid of this, package case. Oh, okay. So yeah, it's sometimes called 0805 or 0508. So I did find this one, which I really liked because it has 48,000 stock, which I really like. However, like I said, it's weird. It's like sideways style. So I actually have to, in Eaglecat, make a new package because there actually is no default resistor package that I've already used that is this like wide style. But what's nice is that it's a really good price. It's like under 20 cents per resistor. And it's 0805, which will like fit quite nicely. It's just like, it's just backwards. So one thing I learned is that, as you saw, when you're searching for the packages, just be careful because it's like, you call this 0805, but it's actually not. It's 0508. And I see this whenever you're dealing with stuff like resistor networks and other like kind of non-standard, like not jelly bean, resistance capacitors. If they come in a slightly unusual package, sometimes you have to be a little bit flexible on how you use the search terms to determine it because this would be categorized under 0805 even though like technically it's not. And then of course, don't forget, you have to create a new package layout in Kycat or Eagle if it doesn't exist yet, because this is an unusual package. But that said, this is a very small resistor for this size and it'll fit very nicely in my design. So I hadn't done the layout for that 0508, but it'll be about this size, just a slightly different layout. And this will give me plenty of space. I can have two of these and not worry about taking up too much space on my tiny little board. So current sensor resistor is very interesting. I've never had to pick one based on size, but as long as you're kind of flexible with your package options, you can get something quite small and there's a lot of it in stock. And that's a great search. Where did you pick up? Okay, one quick question. And then one is for you to answer, the one I'll answer. So since all this part shortage, how many new Eagle footprints have you had to make because you're using different parts than you usually do? Well, I'm actually not using different parts. I'm trying to use the same parts that I can get. So I'm actually being a little less... Do not redesign, you're just like... I'm not redesigning for new different things. I'm trying to design using existing things, if that makes sense. And then someone was asking, am I doing this remote? No, I'm actually, I'm like four feet away. He's just closer, closer. Hi, he's right there. Oh, that would be cool if that was green screened. Bonk. Am I the puppet or are you the puppet? Yeah. Okay. Okay, that's the show. Thanks everybody. Thanks everybody. Thanks for coming by, lots of good conversations. Is it chatting more? Thank you so much. We'll do our weekly shows all week and we'll see you next week. That is your desk of Lady Aida. Bye. For this week.