-
Maybe SX1509?
12/19/2020 at 21:34 • 0 commentsIt's been a long while since I made this shield, and the PCA9685 chip that it uses has been in service for driving servos even longer. Meanwhile, I have been on a lookout for a more modern and smaller chip that could provide a similar function. The PCA9685 is not perfect, because it is actually a LED driver, which just happens to have adjustable PWM frequency allowing us to abuse it to generate a 50Hz servo signal. Still, it contains constant-current drivers that we don't need, and we only use a small part of its duty cycle range.
So what could be other chips that we could possibly use? If you look around a little for "PWM chips", it seems that chip manufacturers only recognize two use cases for PWM signal: buck/boost converters and LED drivers, and in both cases they prefer relatively high frequencies, at least 29kHz, if not 33Mhz. That is useless for us, sadly, so we need to look in other places.
Recently I have stumbled upon a really weird chip, SX1509. It's I²C-controlled GPIO multiplexer, but with some extra features, that include voltage level shifters, a keyboard matrix scanner and, last but not least, a PWM LED driver. So maybe we could use it for our servos?
I ordered a breakout board with this chip somewhere at the beginning of this year, and I have been putting away working on it for a looong time. But now with the holiday break, I decided to finally sit down and try it. So I downloaded the datasheet, got a Trinket M0 running CircuitPython out of one drawer, and a pocket oscilloscope out of another, and I started to poke at the registers.
Sadly, this is another failure, for two reasons: first, the slowest frequency I managed to get for the PWM signal is 121Hz, over twice as much as the required 50Hz; second, it only has 8 bits of resolution for the duty cycle length, and that's over the whole range, of which we only need a small part, so it would be even worse than the 12 bits we get with the PCA9685.
But I guess I will keep it in my drawer if I ever need to multiplex GPIO pins while level-shifting to two different voltages, scanning a keyboard matrix and blinking LEDs.
-
New Seller
08/20/2020 at 20:20 • 0 commentsSince there was a large demand for those shields, they can now be bought again at Tindie from @Arsenijs: https://www.tindie.com/products/crimier/16-channel-servo-shield-for-d1-mini-v2-by-deshipu/
-
New Batch
02/21/2019 at 12:37 • 0 commentsI have sold the last of those servo controllers on Tindie a while ago, coming up to the total of 128 units sold, but people keep adding it to their wish list, so I decided to go and make another batch. This time I'm not going to go to a fabricator — I discovered that I actually enjoy the process of assembling them myself, and with just a few orders a month I have more than enough time for that. So I just ordered the PCBs. However, the times have changed — back then you could only order cheap PCBs up to 5x5 cm in size, while today 10x10 cm is the standard. So I panelized the latest version of the design, to optimize the yield:
It's a bit of a pain to do in Fritzing, and I made several mistakes on the way (sorry for the people at the PCB fab who already started reviewing it when I cancelled the order), but after the third try everything seems to be correct.
-
Fabrication and Version 2.0
12/04/2017 at 10:17 • 6 commentsThere is a relatively high demand for this board on Tindie, so when I sold the last of the 75 hand-assembled modules, I stated looking at fabrication options. Unfortunately, for a board with so many soldering points (the servo socket headers), it was relatively expensive. I didn't realize that the work I was doing by hand is worth so much. In any case, I asked several fabrication services for quotes, and since I didn't want to increase the price too much, went with the cheapest one, which turned out to be PCBWay.
They were very helpful all along the way. The bill of materials CSV file I sent them didn't parse quite well for them (probably because I wrote it by hand in Vim), but they had no problem with me just including an ASCII-art table in the e-mail instead. On every step of the process they sent me photos, asking if it looks correct. They also tried to catch possible errors themselves: for example, my BOM didn't include the stacking headers that I add to every module — they saw them in the photo and asked if they need to be added. (I send them unsoldered, so I add them later myself). There was also one small glitch when they initially wanted to use straight pin headers instead of angled ones, but because they sent me the photo I could point out the mistake, and there was no problem switching to the correct headers.
I choose the cheapest shipping (again to keep the price low), but it still arrived without problems in 2 weeks. Here's a photo of the package I got:
The anti-static bags on the bottom contain the soldered panels (I choose to depanelize them myself, again to save costs). The rest of the bags are all the left-over parts, including one unsoldered PCB panel of 5 modules.
A quick test shows that the modules work very well.
All in all, I'm very happy with them. You can buy the new modules on Tindie here: https://www.tindie.com/products/deshipu/16-channel-servo-shield-for-d1-mini-version-20
-
Faster Assembly
08/01/2017 at 20:14 • 0 commentsI recently got myself a cheap hot air gun, and as a test for it, I assembled one panel of the servo controller boards.
I must say that it really changes everything. While applying the solder paste is still a little slow without a template, soldering all the parts is a moment, and they magically snap into their correct positions. I had a few solder bridges due to too much solder paste in some places, but a solder suction tool took care of those easily.
You can see on the photo the testing probes that I'm using to test all the shields. The result this time was 100% working.
Soldering the pin headers was even faster, at least compared to the manual process I used before. How come I didn't get one of those hot air things earlier?
-
Assembling and Testing
04/04/2017 at 11:34 • 0 commentsThe package with the chips finally arrived, so I can assemble the remaining boards. Soldering the TSSOP packages by hand is not terribly difficult, but it can still be tricky. So I'm not trusting myself, and apart from visual inspection I decided to also do at least basic testing of the shields. On the other hand, I have to ship them with the headers unsoldered, so I can't simply plug them in and see if they work. Fortunately, I have some of those testing probes lying around:
With that, I can easily check that the devices show up in an i2c scan, and that they can wiggle the servo. It''s not a full test -- that would have taken way too much time -- but it does cover the most common failure modes. Since I'm only making a few dozens of them, and I can assemble them as they are being ordered, I don't think I need to make a more sophisticated testing rig just yet.
-
Version 1.0 of the 16-channel Shield on Sale
03/24/2017 at 17:48 • 0 commentsAfter the prototypes that I put on sale on Tindie sold within 2 days, I decided to try and make a larger number of the servo controller shields. I choose to do it with the 16-channel PCA9685 shields, because to be honest I don't trust my own C code enough to inflict it on unsuspecting people. In any case, you can now buy the production version of this on Tindie here:
https://www.tindie.com/products/deshipu/16-channel-servo-shield-for-d1-mini-version-10/
I ordered about 90 PCBs (the Elecrow's 10x10cm offer is the best bang for the buck), but so far I only had components to assemble 5 of them. More components ordered, and I will put them in stock as they arrive. Here's a photo of the ready PCBs:
I also wrote proper documentation manual for this board, it's available here: http://16-channel-servo-shield-for-d1-mini.readthedocs.io/
-
Usage Examples
03/01/2017 at 15:43 • 0 commentsSo here is example code you can use to communicate with the 18-channel and 20-channel servo controllers, for different environments that you can run on the ESP8266:
MicroPython
import ustruct from machine import I2C, Pin i2c = I2C(scl=Pin(5), sda=Pin(4)) address = 0x10 servo = 4 position = 1500 i2c.writeto_mem(address, servo, ustruct.pack("<H", position))
NodeMCU
address = 0x10 servo = 4 position = 1500 sda = 2 scl = 1 i2c.setup(0, sda, scl, i2c.SLOW) i2c.start(0) i2c.address(0, address, i2c.TRANSMITTER) i2c.write(0, servo) i2c.write(0, bit.band(position, 0xff)) i2c.write(0, bit.rshift(position, 8)) i2c.stop()
Arduino
#include <Wire.h> void setup() { int address = 0x10; int servo = 4; int position = 1500; Wire.begin(); Wire.beginTransmission(address); Wire.write(servo); Wire.write(position & 0xff); Wire.write(position >> 8); Wire.endTransmission(); } void loop() { }
-
Selling Prototypes on Tindie
02/25/2017 at 02:00 • 0 commentsI decided to give Tindie a try and sell the prototypes of servo shields that I've built. I have three of each of the 16-channel and 20-channel ones. You can get them here: https://www.tindie.com/stores/deshipu/
I'm basically just getting rid of them, since the project is complete and I don't really need so many servo controllers -- there are only so many robots I can build at once. On the other hand, it would be a waste to just throw them away or let them rot in my drawer -- so I'm selling them.
While they are all manually tested, keep in mind that they are still prototypes -- purple PCBs, hand soldering, possible hidden bugs -- I will support them the best that I can, but I can't replace them (because I only have 3 of each and I'm selling them all) if they stop working. I can fix bugs in the firmware for the 20-channel shield, but then you will need an ISP programmer (or any Arduino, in fact) to re-program them -- I can help with that, but it does take some time and effort to setup. The 16-channel servo uses an off-the-shelf chip, so there are not likely to be any bugs.
This is also an experiment in gauging the interest in this. If they get added to a lot of wishlists, I might consider making a larger batch of them.
-
PCA9685
02/23/2017 at 15:56 • 3 comments@Jonathan Beri asked in the comments why I didn't use PCA9685, but instead went with an ATmega and my own code. To be honest, this is mostly because this project is the continuation of my #Servo Controller project, in which I used a Pro Mini board.
But that got me thinking, and I went and checked if I can get some of those chips cheaply, and I went ahead and designed a PCB for them:
I was actually so happy with it, that I went ahead and ordered them from OSHPark. Today the boards arrived, and I assembled one and tested it:
It works perfectly fine. You only get 16 channels (that's why I could fit it on the standard D1 Mini shield), but you can stack 64 of those boards (the address selection jumpers are on the bottom). Pretty neat.