Welcome back to the factory! In this episode, we're going to talk about a glaring problem with PiicoDev and how we're going to fix it. We've also got a nice little design upgrade for the PiicoDev buzzer. Let's get into it.
So, the first thing I want to talk about is a really big problem with PiicoDev. PiicoDev is an ecosystem of daisy-chainable devices that all live on an I2C bus, so that you can talk to them all with a single connection from a host microcontroller. These I2C devices have addresses, and that means address collisions. For example, the PiicoDev color sensor has only one hardware address, and this Vemble 6040 has no option for an address other than what is set by the manufacturer. There's no pin that you can toggle to change the address, so that means that you can't have a second color sensor on the same bus and you may have a collision with some other device from some other manufacturer.
I'm sure within manufacturers they all pick a spread of addresses, but between manufacturers it's not like there's some I2C convention where everyone gets together and it's like, "Hey, you have this address, you have this address, mwah, we could all get along." The PiicoDev capacitive touch sensor has only one address as well, so if you want more than three touch inputs on your project, you're out of luck unless you use a second I2C bus, only available on some devices.
Sometimes a manufacturer kind of throws you a bone and includes a pin on the chip that you can break out to like a switch or a solder jumper. In Pikative, we break it out to a switch so you can change the address without any soldering. So, what can you do in the case where you want, for example, more than three touch inputs in your project and you want to use PiicoDev? Enter the PiicoDev Mocks. It's kind of like a proxy device that sits between the host microcontroller and the I2C bus.
It has been a long time coming, but we are now ready to work on something like this. We have had chats with people on the forums who want to work with many of these laser distance sensors, but only one hardware address is available. You can change it in code, but it resets every time it powers up, so it gets tricky.
We have selected the PCA 9546 device, as it is available, abundant, and pretty simple to use. Taking a look at the block diagram, we have in the bottom left our main input bus, the clock and data coming in. These essentially get teed off and brought up to these common buses, where they can be switched in and out independently with say clock zero, clock one, clock two, etc. It's really just a box full of switches.
There is a reset line which will just tie high, and we don't really need to use that, but it's broken out on the board. There is also A0 through A2, the address controls for a maximum of eight muxes. This means that theoretically, you could have a parent mux, and then on one of its channels, you could have multiple muxes, as long as they all have unique addresses in their switched combinations.
You could fan out from one mux to another mux to another Max things could get pretty silly pretty quickly, but it's cool to think about. So here's a quick demo. I have two PiicoDev potentiometers connected to each to a separate channel on the mux and these pots are set to the same address. So normally, if they're on the same bus, they would collide and you can see that I'm getting two values in my shell and I can vary one of those pots and the other part and we're getting two independent readings. This would otherwise be impossible without setting a different Hardware address and this is just to demonstrate that yes the mux is working and we're not doing anything special.
In this example, we're just setting the max channel to the desired channel. So if we want to read potentiometer a here, we have to first select the channel that it's connected to. We're not doing anything fancy with initializing something as a maxed object so that the bus selection is taken care of behind the scenes. This is very simple and intuitive to understand, although you do need to manage the channel numbers. So here when we sample pot a we have to select Channel Zero and when we sample pot B we have to select channel one.
But here I'm just showing that you can also enable one, two and three all simultaneously. So you can use an integer for a single Channel or a list for multiple channels. Now we could do it so that everything was handled behind the scenes, but that would probably not allow you to mux into muxes and this is also much simpler to program for me as well, so that's quite nice.
Now the assembly is nothing special. We've seen this on the factory before: align the stencil, apply the paste. But this is the first project where we're trying something a little new with resistor networks or resistor arrays. This little component here is an array of four.
Resistors are not connected to each other, they are just a bank of four together. These are 0402 size resistors and there are four of them, so you can see it compared to a single 0402, it's about four times the size.
Why might you want to use a resistor array? For one thing, 0402 parts are pretty small and modern SMT machines are happy to place them, but they are still pretty small. If you're going to have a placement error, it's usually because the machine has trouble picking up that part. The bigger the part is, the easier it is to handle, to a limit. With this bigger part, this network of four resistors, maybe you've got a bit more tolerance in your nozzle positioning.
Sometimes nozzles can get a little bit sticky with adhesive from the film on SMT tape. We call this a sticky nozzle failure, where the part sticks to the nozzle even though the nozzle isn't trying to vacuum it on. It's quite insidious. There are also eight pads and those pads are smaller than an 0402 pad, but there are eight of them, so maybe that means that the part self-aligns better during soldering. It's more tolerant to failure.
That's all the tolerance side of things, but there's the DFM side of things, where you know designed for manufacturing. You can place four resistors in one shot and that adds up. Our machine has eight nozzles and for a typical PiicoDev device, we often occupy four of those nozzles, half of the Gantry with just nozzles for placing small passive components like 0402 resistors and 0402 capacitors.
If you can place four resistors in a single go, maybe that means the integer number of Gantry movements per module assembled can be a lot lower. Maybe instead of having four nozzles set aside for small parts, you have just two. Maybe that frees you up for placing other more specialized parts that require individual nozzles.
Like big diodes or the sensor itself that goes onto a board, this experiment could really pay off for manufacturing time and reliability. Turning now to the schematic, it looks pretty similar to any other PiicoDev schematic. We have our boilerplate stuff like the breakouts, the connectors, and the LED. Here we have the Max on the right and how do you actually work with these resistant networks in software? Well, most packages will have a special part to represent the network. Here is a single collected pot that represents four unique resistors and so this package will have the appropriate footprint. This is very intuitive to work with; you've got four separate resistors that just happen to be in a group.
You can see in this case we placed a resistor network with four units and we only used three. No big deal. This is kind of where they really shine when you have many signals together that need to be pulled up or pulled down, like in the case of this address switch. Elsewhere in the schematic, we're also using a network but it's broken apart into single units. Here, for the LED, we're using resistor Network one unit A. So you can actually place the units as individual entities that you can scatter across your schematic, which can be really helpful when you don't have this tight positioning of many signals together.
Here with these single units, one of them is being used for the LED and another two are being used for I2C pull-ups. Then, over on the other side of the schematic, the fourth unit here, Unit D, is being used for the reset line. We've got LED, I squared C, and like chip functionality all collected together into a single placement. I thought that resistant networks would probably only be something that someone with a pick and place machine would be interested in using, but actually...ics and we've upgraded to the latest and greatest
The hand assembly of this prototype was really pleasant. I placed two parts by hand instead of seven by just putting down two resistor networks. These were much easier to handle than an O402 part by itself. Even on some pretty average looking solder paste, the results were really nice. I thought you would only use them during automatic assembly, but if you're hand building stuff at home, consider using a resistor network - they're pretty cool!
The second piece of news that I have for you is that we have worked on an upgrade for the PiicoDev Buzzer. The original PiicoDev Buzzer uses a Piezo transducer to create sound and that's a voltage-driven device. We only have three volts to work with (3.3 volts impicative), so finding a Piezo that creates some sound at that level is actually not that easy, especially to create something that's loud and accessible for most people. This version 1 design used a Piezo transducer. We've upgraded to this tasty little magnetic coil speaker, so now it's more about current than it is about voltage. The speaker will go plenty loud and it's a pretty simple upgrade - we're just driving it with a low side mosfet and there's a little flyback diode as well just for the inductance of the coils, so there's no surprises. It also has these four address switches instead of the previous generation two switches and two solder jumpers, which is really helpful for beginners.
The nice thing about doing a designer vision like this is that we could give it the standard upgrade treatment. The original buzzer was using some pretty previous gen ICs and we've upgraded to the latest and greatest.
Our program and test philosophy is to use a single UPDI pin on the back of the device. This was designed to work with a sliding carriage assembly, which was my first attempt at a program and test jig. Unfortunately, it was complicated to use, as it required two USB leads and an external programmer.
Now, with the new buzzer, we have a standard five pin program and test header. This includes power, ground, I2C connections, and UPDI, so that we can program and test through the single connector. The only small drawback is that it doesn't test the JST connectors that we use in PiicoDev, but they play very reliably, so that's no big deal. This also means that we can use one jig per device.
Just like in more recent Factory episodes, we like to have one test jig specifically for one product. This is equipment 79, the test jig for the PiicoDev buzzer. This means that we can just get it off the shelf, knowing that it has the right firmware on it and is ready to go for this product. The user experience is to just plug it into the acrylic jig, hit the program key on the computer, and then press the test button to get that beat.
Keep an eye out for these latest version buzzers on the website in the next week or so. I'm looking forward to seeing how these resistor networks perform on the assembly line and what kind of reliability and efficiency gain we can get from them. If you've used these before and have any other tips or tricks, I'd love to hear them in the comments below. Until next time, thanks for watching.
Makers love reviews as much as you do, please follow this link to review the products you have purchased.