 And we'll do desk of Lady Aida. Hey everybody, it's a happy Sunday, Easter Sunday, desk of Lady Aida time. Me, Lady Aida, here with me, Mr. Lady Aida on camera control. And just wrapping up a weekend and a week of doing some electronics. It's April, time to spring into action, as it were. Yeah, let's jump right in. What are you working on this week with Lady Aida? So I'm having more fun with keyboard stuff. I know we've been doing like keyboard stuff for the last couple of weeks, but you know, I'd like to stay on target. And in the store we have our Neo-Key breakouts and we also have our Neo-Key feather wings. Let's go to the overhead and I'll just show off some of these keyboards that I've been playing with. So starting off, you know, this is the Neo-Key feather wing that we put to the shop and you can, you know, plug and play two keys. I think this example in particular, one second. Uh-oh. This has the kale sockets that you can plug in. And I think I have this on a feather RP2040 and just having it, it's actually a copy and paste keyboard because I saw that the stack overflowed like a if or full joke. So I was like, okay, well, let's just try making that. So I made that using this feather wing, so two keys. We did get some cool keycap colors. So in addition to like the classic kind of translucent smoke and translucent clear, I also got, let me see some colors. They got some, some like Eastery pastel colors, some yellow and got some blue color keycaps. So these are standard MX compatible keycap colors and these are symmetric, which I kind of like. So it's, you know, you can plug them in any which way. And they don't, let's get this moving better, yeah. So they can plug them in any which way and they're symmetric. So, you know, a couple of colors. I got like pinks and purples and blues and stuff, but these are kind of a peeps color. So I got those. I also came back to, you know, I started designing this a few weeks ago and sort of just never got around to finishing the firmware. There was actually a bit of a bug I had in the code. So here I've got four keys, right, four keys. And then here is a SAM D09, which is a Cortex M0 processor that I'm just using as a, you know, it reads the keys and it lights up the neopixels. And let me plug this in so I can demo. It does basically iSquared C to NeoPixel, so you can have neopixels on and keyboard reading. So, you know, this is called like the CESA protocol that we've got and it's basically just, you know, let's have a chip and it's an iSquared C to whatever converter. And, you know, there's GPIO expanders on iSquared C and then once in a while you get other things like iSquared C analog digital converters, but they're actually pretty expensive, you know, like even like the cheapest iSquared C, the ADC, I think is like a dollar, whereas I can get these little SAM D09s. This is a 48 megahertz processor with 16K of flash and I think maybe a K of RAM or something. And, you know, it's got eight multiple ADCs. It's got lots of GPIOs. It's got timers. You know, it's a full much controller, right? It's a full chip and it's only like 50, 60 cents. So if I can program, if I'm making enough of something, programming the chip to do my iSquared C to whatever conversion is easier than, you know, there's actually no iSquared C in NeoPixel converters. So the fact that this can, you know, drive NeoPixels as well as read GPIO makes it kind of sweet. So I spent a little bit of time in that code base. You know, it's a small chip and so we don't use Arduino, we use just a make file with SimSys, which is the Cortex-M0, you know, code control base. It's all lower level control, but that means it can fit quite a lot of code into this little chip. So I got the little, this little breakout working. So you have iSquared C coming in from both sides here and chain them. And so in this case, I even have, you know, two of these next to each other. I built two protocol breakouts and they're just, they're wired up to a Qt Pi. So Qt Pi is plugged into these and I've got all these nice keys. So I just basically spent all weekend just kind of like clicking these really fast because I did find an edge case where if I had an IRQ coming in while I'm processing the IRQ, you know, very common thing that happens if you're processing an IRQ and you don't have mutexes, you know, you can end up in a kind of a weird state when you're processing two IRQs at the same time. So I just sort of wrote a little bit of code in there and you can even look in the, you know, commit history for the seesaw library where I just sort of ignore it. It's like, oh, if you, if you're already pressing an IRQ and another one comes in, just skip it because if you're pressing the buttons that fast, it's okay if you miss one edge, in my opinion. So this is just doing a little, you know, this code is running on Arduino reading the key presses and then writing the NeoPixel. And then in addition, I went back to an old project which was a rotary encoder to iSquared C converter also using that same chip, the same DO9, but this one, again, doing rotary encoder reading. Rotary encoders are a total pain to do in microcontrollers. You really need to have a timer, deal with them. You know, it's best to have one interrupt and then you're constantly pulling the pins and you can't keep track of all the states and you do the debounding, it's a lot of work. So having multiple rotary encoders over iSquared C could be kind of nice, right? Because it handles all the reading in the state and you just ask it, what's your current position and it'll tell you. So for example, in this demo, keys coming apart, so I've got, you know, if I hold this down, it presses the keys and then I can rotate the rotary encoder and it'll change the color offset for this rainbow. So this is reading the rotary encoder over iSquared C and then there's also a push button which you can read, although my code doesn't do anything with it. But I think this is kind of fun because you could, you know, this has three address pins, you could connect eight rotary encoders up and again, all over iSquared C, which I think will be quite handy. So just using the plain rotary encoder here with a button, but maybe I'll get to an RGB encoder as well. And I also extended the code while again while, you know, if I'm in a code base, I'm like all the things that I wanna do, I kind of go and try to do them all at once. So here, I've got my devs set up, so I've got that same DO9 processor here, hooked up through SWD to my J-Link, so I can debug it. Wonderful having a J-Link because you can do step debugging of this processor and that's how I found that IRQ bug is, you know, I- I'll give you a focus, I don't know, I think the- No focus? Yeah. Okay, there we go. Okay. The same DO9 is fun to step debug with the J-Link. I love doing it and that's how I solved the IRQ bug because I, you know, when it stopped working, I did a backtrace found where it was, you know, did some investigation, was like, okay, this is great. So for, you know, if you're not used to using a debug, I really do recommend getting one, just saves you hours and hours of time. J-Link's on my favorite, although people use OpenOCD. Totally cool. I just like J-Link's, but wired up here so I'm programming and debugging this chip and then I hooked up multiple rotary encoders. So in this case, I actually have three rotary encoders. There's one, two, and then here's the third one. So three rotary encoders, wired up to the same DO9 and then I've got, you know, our basic Arduino here and then I twist this and you can see the neopixel over there changes and this one will change now too. And yeah, as I twist them, it's going through the rainbow colors. So, you know, this was actually supporting four rotary encoders, but I removed one because I wanted to show it off. So this just shows, you know, I can have actually my code supports up to 16 rotary encoders on one same DO9, which is really wonderful. Again, an off the shelf I squared C or SPI to rotary encoder chip is like $3. Why? When you can just have a microcontroller do it. So that'll be exciting. I was thinking of maybe, you know, like this is a four key, you know, like it's four keys to I squared C. You know, I could probably do one where it's like four rotary encoders and then you could plug it in over I squared C and use that to read multiple rotary encoders with maybe a neopixel or something. So that's cool. So I finished that, which is great. You know, the reason that can have so many rotary encoders is again, I'm not using pin interrupts. I have one timer interrupt that's going off every like 10 milliseconds. And I use that to sample all the pins. Do the math. It's fine because rotary encoders, they don't move that fast. If you sample once every 10 milliseconds, you'll catch every edge humans aren't moving that fast. Maybe if it was a robotic encoder, that'd be different, but not for this. Okay, any questions? Nope, so far. Okay, cool. So yeah, a lot of like, you know, I'm doing like a lot of mechanical stuff here. So I've got those rotary encoders and then yeah, so this is the rotary encoder breakout. And so the rotary encoder plugs in here. You see, I have to kind of do it at a 45 degree angle. That was the only way to make it fit because I wanted this to be one inch by one inch. So a little chip on the middle and then I squared C on either side. I also got my Trinkie PCBs. So this is my rotary encoder to Trinkie. So remember this, we actually showed this off. So I made a couple of fixes and this is ready to do a final prototype and then maybe manufacturer. And then I've also got NeoKey Trinkie. So this is like one key. So if I remove this key, I can show this, this is a one mechanical key. So it goes like this, cookie, cookie. This doesn't use a socket. One, because it would just like come undone immediately. And second, because there's only enough room for a socket. So I think, you know, for mechanical stability and overall satisfaction, best to just solder in the key into place and that'll, they'll give you good support. So you can have this be your like escape key. If you have like an old Mac and you want like an escape key because they deleted it for some reason, you got an extra key. And then Phil had an idea for a slide Trinkie. So this actually doesn't work. I was like, oh, is it gonna be, is it gonna, you know, if you yank on this, is it actually gonna pull out? But I got a little extender, USB extender cable and you know, plug it in. And actually, no, like it bends a little bit but I think it'll be fine. Maybe I'll use an extra, extra thick PCB. But I think this will be okay. So that's like a little slide, slide to USB converter. Kind of cool, kind of weird, right? Interesting. So these are Trinkies. And so the next thing I was going to do is, you know, this being done, which is kind of a challenge because we're ordering code or like I said, they're difficult. I thought I could maybe make a version that had a potentiometer instead. So here's, you know, rotary encoders, potentiometers look kind of similar. But what if I made, you know, if I swapped this out and this isn't gonna fit exactly but you know, it'll be a little bit like that. And then, you know, for microcontrollers that don't have analog inputs, you would be able to plug I squared C into a potentiometer thing. I think that could be use cases. I know it's not as incredibly useful as a rotary encoder but I think there are, there are still situations where you're like, look, I want, you know, potentiometer and I don't want to, I don't have an ADC because I've got a single board Linux computer or a propeller chip or whatever, some chip that doesn't have analog digital converter and you just want it easy panel mounted. So the next step is I'm gonna try to get a potentiometer and the thing about the potentiometer is I want, you know, we have some in the shop that they're really like big. So I wanted one that was nice and slim that would fit, you know, maybe close to this footprint because this would make it only one inch by one inch, very compact and convenient. Not like this gigantic potentiometer which we stuck in the shop and I do like them, but these square body ones. So these I have left over actually from the Zoxbox builds from like 15 years ago but I thought this would make for a good, great search is how to get these square body potentiometers. All right, every single week, the great search brought to you by Digikey and Lady Edda, she used all her powers of engineering to show you how to search for things on digikey.com. Okay, and don't forget if in this year of part shortages, if there's a part you're looking for an alternative, let me know. I will help you out find an alternative component. But this week, you know, I was working on this rotary encoder break at board and this is kind of a standard Bourne's Peck 11 rotary encoder with a little switch in it. And I wanted to make a version of this board that was not a rotary encoder, but a potentiometer. So rotary encoder, you know, it goes all the way around, round, round, round, but you don't know where you are, right? All you know is whether you've gone forward or backward to one. You have to kind of count the clicks. Whereas a potentiometer, it doesn't go all the way around. It only goes, let me see if I can move this. Potentiometer doesn't go all the way around. It goes, you know, minimum, maximum. So you can't go around more than I think, you know, usually 270 or 300 degrees. You know, almost a full circle, but not quite. You do know where you are, which is kind of nice. Like you know exactly what position you're at. They're nice and smooth, but you don't get that full rotation. So, you know, there's times when you want a rotary encoder for full rotation. And there's times when you want a potentiometer because you want to know what position you are, like 50%, 25%, 75% from a maximum. So the rotary encoder bodies that we're used to are these square bodies. There's a switch and then the three pins. We're not gonna find something that's probably the same. They're very similar looking, but they're not quite the same size body. That's okay. There are standard size bodies for rotary encoders or about 12 millimeters, you know, 12.5 millimeters. And for potentiometers, they're, you know, about nine millimeters, 10 millimeters square body. And that's just sort of a standardish size. That said, I do watch out potentiometers do vary quite a bit from type to type. There's almost more variation I find in potentiometer sizes than rotary encoders. A lot of people really, they make rotary encoders, they make them in this standard size. The length of the knob may change, whether it's a panel mount or not, but the overall shape and pinout is the same. Potentiometers, I've found quite a bit of variation. So let's take a look. We want a low cost linear 10K resistor without a detent in the center. Get a very bog standard potentiometer that will PCB solder into our breakout like so. And give us a nice strong mechanical connection, especially having these side nubs. Okay. All right, you want a good night computer? Yeah, I was going to my computer. So let's go to Digikey. Oh, while we're at it, I was, you know, one of the things I was looking at when I was searching on Digikey is, if you look for potentiometer, you'll see potentiometers and Rio stats. And like, you might be wondering like, what's a Rio stat? I was like, yeah, what is a Rio stat? A Rio stat is a adjustable value resistor, which is different than a potentiometer. Potentiometer has the top and the bottom and then the middle goes between the two. So you do have a variable resistor, right? But it's only like, you've got two variable resistors, the bottom half and the top half, whereas a Rio stat is only two pans. And as you turn it, the resistance changes. So not good for voltage divider, but much, but good for changing how much current is going through something or the bias load or whatever of your device. So in our case, we're looking for a potentiometer, but they do often get categorized with Rio stats, but Rio stat, two-pin potentiometer, three-pin, you want three-pin. So I'll say that there's a couple other options. There's some wheel potentiometer, trim potentiometer. Trim potentiometer is tricky because it's like, which one do you want and when? So trimmer pots are almost always the surface mount component. They can be through a hole, but they tend to be surface mount or through a hole and they're small. And you use a screwdriver to adjust the value. They're the same idea, but there isn't like a knob that you twist. Usually it's like a little, you can see here like a screwdriver end. Use your screwdriver and you use to twist it. They're called trimmers because they are used to trim a value. You want to adjust a voltage and you want to tweak it a little bit because there's variations. The trimmer will let you tweak it and then you set it and forget it. It's not something that users are constantly messing with. And so there are some cases which will want trimmers. Maybe one day we'll go into a trimmer potentiometer video, but for now we're not looking for a trimmer. We want something with a knob. So that's the difference. There's the slide potentiometers again. That's the kind I showed earlier in this video. It's, you slide it up and down. When I look at that, we're looking for rotary. Okay. So what's interesting to me is actually there aren't as many potentiometers as I thought. There's only 10,000 different potentiometers. We did a lot, but like not as many as I would have imagined considering how often they're used. I think there's like a lot of like standards. So let's go with active. Potentiometers. And then let's go with normally stocking. Now, usually I would pick in stock, but because there's so many part shortages, I'm going to go with normally stocking and then we'll see what comes up. And if necessary, we can, we'll order a variation on it. So for resistance ohms, so there's a lot of resistance values available for potentiometers, but I'm gonna select 10K. And here's the thing. Doesn't actually matter for my use case what the resistance is because I'm doing a voltage divider. So it could be anywhere from 1K to 100K. However, any potentiometer that's made is going to be available in 10K. It's just such a standard value that what I want to do is find like the series, the family of potentiometers, I'll search for 10K. And then if it happens to be out of stock, I can always get the 5K or 100 or whatever. But 10K is like the standard, gold standard potentiometer values. So let's go with 10K. All right, so next up, number of turns. So if you have a precision potentiometer, you can get one that they turn more. It's like a screw basically. It still doesn't go around forever. Eventually do run out of turns. It's mostly a precision thing you spend more for it. I'm looking for something simple, low cost, just twist back and forth. So I'm gonna go with one turn. So that really cuts down the number of availability. Next up is number of gangs. It's like, is this part of like a crew? Now, the number of gangs is how many potentiometers are ganged up on top of each other, like stacked up to make a, you know, like if you have a double gang, that means you can do stereo, right? Because you can adjust two voltages at the same time. Again, in this case it's not necessary, but I will, I'll show you what it looks like. So this is a two gang. So see how there, it looks like, it literally looks like just two potentiometers stacked up on top of each other with six holes total. Those are two independent potentiometers ganged on top. Again, you know, this is useful. Often it's two for stereo. So you have a left channel, right channel, and you twist this and you'd be changing both channels at the same time. But like I said, you know, then this is another double gang one, but this one is two hole. It's very cool. But again, we're not, we don't need that. So let's go with a single gang. Okay, so now we're down to 300. So adjustment type, rear side, top, use defined. I want the top adjust standard. I wasn't gonna select the dash just in case, you know, something is not fully categorized. Side adjust, by the way, is like this. You know, it comes out, you put on the PCB, it comes out perpendicular. And this is also perpendicular. Let me see if I can find, this is, there's a lot of perpendicular ones. This is a top adjust, right? So I found the PCB, it's on the top, and that's what I'm looking for. So let's search for top adjust. And then taper, linear logarithmic versus logarithmic. Logarithmic is used for audio applications or sometimes biasing applications where you need to, where you don't want the resistance to be linear. In my case, I do want it to be linear. I want the 50% point to be 50%, not 10%, one way or the other. So I'm going to pick a linear taper. Okay, great. So now we're down to only 90 or so options. Okay, so then, you know, we're starting to look, okay, this is kind of a weird one. This is kind of also a little bit unusual. It's not something like this. This looks like a good potentiometer. We'll go like this one. But this is a multiple pins, you see how many pins there are. I only want one potentiometer. I don't know if that's possible to say. Oh, for switches. Detent, a detent is the center. So sometimes, especially if you're doing audio applications where you want left and right balance, the center will have a detent so people can tell when you're at 50%. In my case, I don't want either of these. I don't want a switch. I just want a plane, centiometer. And then surface mount, denouille, panel mount, through hole. In this case, I want through hole and also panel mount. Why panel mount? Sometimes the categorizes panel mount if they have panel mount bushing and they are also through hole. So in that case, you really, I really do want all three options to get everything that can solder into a PCB. Okay, so then, yeah. So this is like panel mount because it really does look like it's a panel mount but this would also be considered panel mount and this would also be considered panel mount even though you see it's a through hole potentiometer. All right, so let's see. Next step, let's look at PC pins versus solder lug. Solder lug would be a panel mount that doesn't plug into a PCB. So I want the PC pins. And then for actuator type, you know, remember we talked with rotary encoders, they're T18, 18 tooth, and they're flatted. Those are the two most common for rotary encoders. Now it turns out that potentiometers are even more options, including this kind, which is, sorry, they're slotted. Sorry, this kind, which is slotted. Here you go. So you see at the top, there's a little, I would normally consider this a trim pot but it's under potentiometers. I don't want slotted, I want something that fits the large knobs. So I want flatted or knurled, or knurled or slotted or knob. I think those are good. But I don't want slots, I want ones that look like this. There you go. So now we're talking about like standard potentiometers. This one is a T18. This one you see is a flattant, a D-shaft. This is also, I think a D-shaft. This also looks like a D-shaft. Okay, so now we're kind of at the point where we can look in what, nothing else here is really that important to me. So now let's look at pricing. Let's just sort by price. So this is kind of a Pitchama that we stock. It's a standard, this very inexpensive round-bodied one. I actually don't want this because Cia Dix, it's exposed. I like the ones that are a little bit more sealed. It won't make a huge difference if it's being in enclosure but for my purposes, I don't, I'm a little nervous about having it exposed. So let's look at this one. Okay, so let's look at the data sheet. Oops, sorry. Okay, so this is a kind of standard potentiometer. Looks like it's available in two lengths and two styles. That sounds so bad. Although this one has a, it's a little short bodied. Kind of like the look of this one. This is a Bornes one and one thing I really like about it is it's got 6,000 stock. It's kind of nice. So let's check this out. Looks good. Remember it's got the T18 looks like or otherwise knurled top. Not sure actually that is T18. I'm gonna have to grab some and then compare it to a potentiometer. It looks like it has even more knurls than normal. So I'll probably get a couple of these. This one's pretty good. So I'll keep that one. And then, oh, I like this one too. This one looks good. Couple hundred in stock. This one has a D-shaft. So I'm probably gonna get a couple of each. They're really inexpensive, but you know, they're 50 cents a piece or so. Potentiometers are like, thankfully very inexpensive. I think I'm going to, I'm gonna start with this one because I like that it's kind of like the most popular potentiometer on Digikey. So this is what I'm gonna start with. The PTV series, 10K ohm carbon linear. And you know, start with this. And again, the physical sizes of all these are very similar. I'll pick this and then I'll find the shaft length and type that I like. But so far this looks really good. I like it's got a sealed connection here. It's got a nice body with two mounting slots and a fairly good sized actuator. So this is, this is my great search pick, the PTV 09A series. All right, that's a great search. That's right. Where? Okay, a couple of quick questions. Yeah, sure. We'll bounce a couple of comments to the two gangs are good for cross fading. And then someone said, I guess when you were looking at the standard nuts for the potentiometers, is that the standard one that you showed or is there other ones? Standard nuts. Is that the standard enough for potentiometers? I guess it was, how's the? There's different sizes for the panel mount nuts. So that's not guaranteed. The knobs are pretty standard. But the mounting hardware is gonna be like, as you saw somewhere M7, somewhere M9. Now, no wheel, way to know for sure. It's lighty. That's it, 30 minutes on mark. All right, thanks everybody. We'll see everybody during the week. It's a great discovery, Ada. Tune in this week. We've got some exciting new products coming out. We've got the Funhouse and we've got RP2040 itsy-bitsies and cutie pie parts in stock, ready to fabricate. So we'll probably be fabricating some of those this week. Every single day there'll be videos on our site and I know there's such a many properties. You like this stuff? Go to itford.com and put some in your car. Check out. That's right. ATC will be in the store soon. Some of the stuff you saw from a month ago is in the store now. So you can always- You always know what's happening. You always know what's happening. All right, that's this great, Ada. Thanks, everybody.