 Welcome to the show. It is time for JP's product pick of the week. It is me. I'm JP, and here we are on a Tuesday when we normally do this show. So that's all normal. This isn't normal. I apologize for people who are disturbed by that. I was making myself laugh, but it's definitely weird. I have no excuses, sorry. So let's see. Let's get on with this. Shall we? First of all, what I want to do is let you know. What's this all about? Well, on JP's product pick of the week. I pick a product that I want to show you that I think is new and interesting, or sometimes old and interesting, but always interesting. And we show it off for a little bit, take a look at it, do a little bit of a demo, show you how it's hooked up, whatever it may be. And we usually do a substantial discount, no coupon code needed. This week, if you head to that QR code or this URL, you'll see this product pick is half off. So throw it in your cart, you can get up to 10 of them. Like I said, no coupon code needed. Simply check out before the show ends or within a couple of minute grace period. And you will get this terrific discount. So before I go any further, let's have Lady Aida tell us what this product even is. So please take it away, Lady Aida. A new breakout, the PCF 8574. So this is a systemic UT breakout for an iSquad C GPIO expander. You know, if you've been watching our shows, we can't get the MCP 208, sorry, 2301708 series GPIO expander. I love them, but they're not available. So I thought I'd expand my outlook and find some alternatives. So the PCF 8574 is a low-cost expander from TI and it's available, which is the most important thing. It's got eight pins. You can control it over iSquad C. One nice thing about it is it has three address pins on the back, so you can have up to eight of these connected. The default address is 0x20 hex, but you can have eight, so that's like 64 total GPIO. It's got systemic UT, so it's plug and play. So it's interesting about this chip. I do want to mention because it took me like a few minutes to grok what's going on. It's extremely simple. We wrote drivers for Arduino and CircuitPython, but honestly, it's such a common expander. You're going to find drivers for almost any platform. You basically read and write just eight bits directly to the iSquad C address, and there's no specific direction pin. So what you're used to with most IO expanders is you have a direction and then you can also set pull-ups. So you have the input, and then the input can be higher-low, or the output, higher-low, and then you can add pull-ups as well. So this chip doesn't do that. Instead, it actually has two modes. So each IO can either be an input with a very weak pull-up, about 100K, or an output that's sinking current. And what that means is that it basically can act as a bidirectional IO. If you want it to be an input, you turn it on with that weak pull-up, and then you can, you know, by default it reads high, and if the whatever signal is sent low, you read low, and if it's floating, it reads high. So if you have a button, for example, I'll show this on the overhead. So I have two IOs here, because this is actually the most confusing is buttons and LEDs. Note that I didn't have a resistor with the LED because I'm just, I'm being cheap and fast here. So the button goes between ground and the IO number one. You cannot connect a button from an IO pin to high. There's no such thing as a pull-down. It's only this light built-in pull-up. But when I press this button, it can detect that I'm shorting the input to ground. And then what it'll do is the code running in Arduino on this QT Pi, reads that through I2C, and then writes P7 to be that output low. So if you want to read an input, you basically have a built-in pull-up, light pull-up. If you want to drive an LED, like something that's really sinking current, the LED has to be connected from positive, the anode to positive, and then common cathode. So you ground the LED to turn it on. If you tried to connect this LED from the output pin to ground, there's no such thing as sourcing current. You can only sync current. It only matters, again, with an LED. You can only connect it from high to the GPIO, not the other way around. And a button. You can only use that built-in light pull-up. If you're using signal, like you're using this to trigger a reset pin or communicate with another digital circuit, that light pull-up will always signal a high voltage. Sorry about that. I'm not sure what happened to our video there. It got cut off. That may be my fault. Sorry about that. I'll correct that in the notes later. I'll point you at that video. But hopefully that at least gives you a good idea of how this works. And I'll do a real live demo. So jumping back in for a moment, let's grab one of these from my, hey, brand new. OK. I cut this one open. But there it is. Let's get that out of the bag there. And take a look at this little beauty. So this is my product pick of the week this week. It is the PCF 8574. Say it again, it's the PCF 8574. It is a GPIO expander that runs over I squared C with two convenient STEMAQT connectors on it. And this allows you to add up to eight digital inputs or outputs. So you can use these as current syncing LEDs or you can use them as inputs for buttons and switches. So what I'd like to do is actually show you a demo I built here on a little perma proto. So let me jump to my down cam here. So here you can see I've taken one of these little PCF 8574s. I have hooked it up to a perma proto board. And then I have eight little buttons. These are some cute little buttons from our button sampler pack that we have now. And if you follow the traces on here, the wires on here, you can see I'm essentially running each button to a ground rail. And that ground rail goes to this negative input or ground on the PCF 8574. And then each of these, they're labeled pin zero through seven, run to the other side of each of these switches or buttons. If I am using something like a cutie pie, I have barely enough GPIO to do something like this as it is. And if you want to have more and more and more, well, it's one of the best ways that you can go is to add a GPIO expander like this. In particular, since this runs over I squared C, just plug this into the stem of QT port here and you're ready to go. You can change the address jumpers on here to use up to eight of them. So that gives you 64 additional GPIO that you can use on something like a humble little cutie pie. So if I go ahead and plug this in now over USB, you'll see it starts up. We have a little indicator light on here. Just shows us there's power to the board, to the GPIO expander. And what I'll do is actually open up Atom here and you can see as I press buttons on my button board here, I am turning on and off a little print statement here. Earlier I had a demo of this using some MIDI output. It could be anything. Anything you need up to eight GPIO for, it's going to work really well. And they are very easy to code. So we'll take a look at the code here in a second. But you can see I can do, I can press them all if I want and then release them one by one. And it remembers which ones are held, which ones are released really easily. It's easy to communicate with because we have the expander library specific for this expander chip. And we have one that works in Arduino as well as one that works in Circuit Python. Let me grab my code window here. And you can see all I really need to do in code is import, most important things, the PCF 8574 library using this as digital IO. I'm getting a little fancy in using the debouncer. You don't have to necessarily do that. And then I'm setting this up as an object on I squared C, on my I squared C bus. I set up the pins and this is the key right here. Whatever you've named the object, in this case PCF, get pin. And then we name the pins 0 through 7 on this board. So I'm looping through and just setting them all up in one fell swoop. And then switch to input in this case allows me to use them essentially in direction input and I'm setting the pull down or pull up as a pull up. In this case, it's pull up on this board. So switch to input pull equals pull up is just one line that conveniently sets the button up for you. Here's a, if you look here at this commented out section. This is how you do it if you're not doing a whole bunch of them. If you're not setting them as a debouncer, basically we're just set up a button equals PCF get pin pick 0 through 7. And then the same object switch to input pull pull up. And that's right from the sample code, which I'll show you in a second in the learn guide. And then I'm simply saying, okay, here's this demo PCF 8574 demo. And then in my main loop, I am running through 0 through 7 checking a debouncer update if it falls because it's starting out high and it goes low, that means I've pressed it. And then I'm printing out with a little fancy print statement here, something that gives me some spaces so I can move the objects around. I actually wired these up in a kind of funny order. So it goes 0 through 7 bottom right to upper left, which is bizarre. And then when I release one, you can see here I've got button two pressed. When I release it, it rises, the pin goes high again. And then we're printing out the off statement. So easy to use, very similar to other, Expander, i-squared C, StemAQT code that we've created and you may have used before. If you take a look at the learn guide for this, you will see we've got a data sheet for the chip here. So this is a Texas Instruments PCF 8574 chip. Let me get my extra me off of the screen there, there we go. And it says what it is, a remote 8-bit IO expander for the i-squared C bus gives you some stats and operating principles about it. Some curves for response and types of messages that stands over the i-squared C. So all the good data sheet stuff is right there. If we back out again and go to the pin out on the learn guide here, you'll see it tells you what to do if you need to change your address buses to use multiples of these on one i-squared C bus and avoid conflicts. We have all of the i-squared C power ground pins are on both the StemAQT ports and these pins. So if you want to solder to those and not use StemAQT, that's totally fine. And then we have all the expander pins up on the top, including the sort of extra set of the power and ground so that you can use those for the current sink and the ground for checking pins. And then there's some sample code both for Python, CircuitPython and Arduino. If you take a look at the Python docs, it'll show you some setups that you can do, some wiring setups both for a microcontroller as well as a Raspberry Pi that'll work on other platforms. Here it tells you to install that one library is all we need really. And then here's the sample code that shows you the most basic setup for setting up the board on i-squared C, creating a pin for an LED on seven and a pin for a button on zero. And then the key thing here is switch to output for the LED and switch to input for the button. And then that gives you this basic demo here where you can press the button and get the LED to light up. Let's see, I think that covers everything. Let me know if you've got any questions over in the chat. Pop over to my Discord and the YouTube. Let's see, Devon's Workshop said you were talking about the i-squared C multiplexers. They tried picking up some of those last week and they were out of stock. They sold out shortly after the product picked the week like two weeks ago. This very one, I think it was new. I don't think there were that many out. We should have quite a bunch, I think we stashed a bunch for this show. So if I reload my page here, we'll see. Yes, still in stock, you can get up to 10 of them. So if you wanted to get some of these, this is a great time to do it. And yeah, half price, so $2.48, a great time to get these. Let's see, another question we have over in the YouTube chat is from Dave McColl. How does this device compare to the Seasaw series? AT, Tiny is also $5. Yeah, so the Seasaw boards, depending on the chip on them, they have more capabilities. So there are, I think, I want to say they're PWM pins, but I can't remember on Seasaw if there are, I think so. Yeah, it's PWM, this one doesn't PWM. There are, I believe, more than eight ports available. And there's analog, there's at least a couple analog inputs, I think, on the Seasaw chips that we use. But yeah, this is definitely a similar type of thing, and it might be a good alternative if you're just looking to do GPIO and lots and lots and lots of it by adding these together. I don't know how many Seasaw iSquad C addresses we allow. It might be four, I'm not sure if it's eight. It might be more, but yes, very similar. And let's see, other questions, let me check over in our Discord. Yeah, check out that, the guide, actually, I believe Catney and Lady A to put up the guide already, so if you had to learn system, just look up PCF 8574, there's already a guide there. And then if you're interested in doing some multi button setup or multi LED setup, you can use this code that I'm showing here. This is very similar to any kind of set up a bunch of pins for debounce code that I use. I kind of go to the same well, which is a really good one. It's Todd Bot's Circuit Python Tips and Tricks Guide. I'll go there and grab the basic debouncer setup for debouncing multiple pins, a good little routine to use. Let me scroll up there so you can see the rest of the code here. And one other little tip, by the way. I only recently noticed this, but if you take a screenshot of this, just pause the frame and take a screenshot, at least on the Mac, the screenshot when you open up in Preview, does really good optical code or character recognition, OCR. So you can copy and paste text right out of a screenshot, which is pretty wild, but especially when it's nicely neatly, high contrast, a terminal font like this that's good for coding a mono spaced font. And these copy and paste really nicely out of OCR. So if you ever wanted to grab the code, you don't even have to retype it. Just go to a couple frames where I put this up here. Let's see. Trent Gajos over in YouTube says no more pies. Question mark? I think you're referring to Raspberry Pi, single board computers, and we get them in small batches and release them as we get them. One per customer, two-factor authentication to make sure people aren't cheating. We want to make sure as many people who can get one as we can, can. But PiePicos, I know we've got plenty of, but the Raspberry Pi, single board computers, they're making them as fast as they can, and we put them out when we can. Let's see. I think that is going to do it. So let's wrap this up. And let me put a little hanger on this. Put that on my wall there. I've got to stop using Stem-AQ-T cables for these, because then I have to go back and steal them off the board later. So I'm using just a piece of hookup wire as my hanger. There we go. That's my product pick of the week. This week it is the PCF8574 GPIO Expander with Stem-AQ-T. And don't forget, head to the store, go get one or more right now. That's the URL. And if you buy them during this show, they're going to be half off after the show. The price will go back up. No coupon necessary. All right. Thanks everyone so much for stopping by. Free to different industries. I'm John Park. This has been JP's product pick of the week. Goodbye.