Sonoff Programming Jigs
Programming jigs save time and frustration.
Maker, coder, and electronics aficionado Bill (AKA Taste The Code) has a custom Home Assistant home automation setup. Recently he’s been adding Sonoff Wi-Fi relays to his rig, reprogramming each one with new Tasmota firmware using a USB-to-serial converter.
This Sonoff reprogramming process is fairly straightforward, as these devices have a row of contacts for this very job. However, one has to match up programming contacts, which most likely won’t align out of the box. One solution would be to use jumpers and/or solder on headers for ad-hoc rearrangement, but this quickly becomes arduous when flashing multiple modules.
Instead of dealing with this, TTC made a jig – actually two jigs and a bent-pin modification – to facilitate the programming process. To create the jigs, he soldered headers that match the USB-to-serial converter to bits of perfboard, routing connections to header pins on the other side–arranged there to match up with the Sonoff switch. This allowed Bill to more easily program the switches, and to even communicate with them via the Arduino serial terminal.
While a fairly basic hack, it’s a good reminder that sometimes a bit of work on your tools can save a tremendous amount of hassle later. As noted in the video, don’t ever attempt to program this type of switch when plugged into mains power. It’s a really bad idea for multiple reasons.
Also, you might consider using pogo pins for custom jig work. These spring-loaded devices can help compensate for minor differences in header pin alignment.