Welcome to the first post in my new blog.
I've just had a delivery of circuit boards from JLCPCB and I thought I'd start the blog off by talking about the simplest of those boards. It's designed to help me flash the excellent Shelly RGBW2 controller
It might seem like a bit of an overkill to design a PCB just to enable an FTDI adapter to be connected to the programming port on the RGBW2, but the problem is that the port uses 1.27mm pitch pins (0.05") instead of the more usual 2.54mm (0.1") pitch. This means that the pins are very small and close together, so even if you make-up a custom lead to allow you to connect your FTDI programmer it's still very fiddly.
As I planned to flash a few of these devices, and as I was ordering some other PCBs from JLCPCB I designed this board and added it to my order.
The first image shows the 3D design in EasyEDA, and the other images show both sides of the assembled board and how it fits onto the RGBW2 controller with the FTDI attached.
As I said, it's as simple as it gets, but it's now really easy to flash your own code to these devices.
The button is used to pull GPIO0 to GND, to put the Shelly device into programming mode, so its simply a case of inserting the pins into the device then pressing the button and connecting the USB cable. The button can then be released, and the new sketch uploaded.
If you'd like to use the gerber files for this so that you can order your own PCBs then you can download them from here
For reference, here are the GPIO's used by the RGBW2:
Description | GPIO | |
---|---|---|
Red output channel | 12 | |
Green output channel | 15 | |
Blue output channel | 14 | |
White output channel | 4 | |
Physical button (recessed in the hole near the programming interface) | 13 | LOW when pressed |
LED (recessed in the hole near the programming interface) | 2 | LOW = On |
Switch Contact (labeled "I" on the screw terminal block) | 5 | Use INPUT_PULLUP |
Add comment
Comments
Hi Pete,
I just found your blog, this article and therefore this, for me new, device.
I have switched very much to Shelly devices as they have MQTT. This has also resulted in that I don't reflash the devices (as more needed for sonoff) anymore.
‐ may I ask why you want to reflash? Something important missing?
(Or just for fun, which is a fully understandable reason ...)
Jonas
Hi Jonas, I tend to use devices from many different manufactures, all of which use different apps. I have a requirement to integrate them all into Node-Red, using MQTT messaging, and use Blynk as my mobile and desktop UI.
I've tried a variety of different ways to achieve this, including Tasmota and Node-Red contribs for each type of device, but I get the maximum flexibility and functionality using my own firmware.
I also have some devices that I've built myself (weather station, RFID door entry, MQTT to IR gateway, MQTT to 433MHz gateway etc) which also run basically the same firmware. Having this common codebase makes maintenance, upgrades and troubleshooting much easier, and also simplifies the Node-Red integration.
I also want my devices to be controlled by my system, not via some unknown server in China. This isn't because I'm paranoid about data privacy, but because I want to be in control and not rely on a 3rd party.
Thanks for finding the blog BTW, I need to find some time to add a bit more interesting content though!
A very nice blog Pete, some good information and nicely laid out.
Excellent info, Pete. I have a less elegant flashing rig for the Shelly RGBW2 and a Big Gap understanding the auxiliary GPIO pins. Thanks for these missing pieces.
Love these Shelly devices. They’re more compact than the SONOFFs, and there’s nothing else like the RGBW2. Much appreciated.
Thanks again for this. Good on Button (INPUT_PULLUP) and LED (OUTPUT) pins, haven't yet had success with USER pin as INPUT_PULLUP. Doing a digitalRead on the USER pin, seeing nothing different with "I" connected to GND. Did you manually put in a pullup resistor? Almost there. Love this little device.
I used pinMode ( ..., INPUT_PULLUP ) for the Button GPIO, simply INPUT for the USER_GPIO.
All is right with the world. Thank you for documenting this. MUCH appreciated.