Sonoff switches are a great way to start automating your home and adding them to existing circuits. However, what I don't like about them is the fact that they are mostly locked in with their system and app and that they must be connected to the internet for them to operate.
In more closed setups, we kinda want them to be controlled locally and although that is possible with their DIY Mode, many people choose to flash custom firmware to them, like Tasmota or ESPHome.
The switch that I have is the Sonoff Basic R2 version, and the good thing about them is that they have a serial breakout on the PCB where we can easily plug in our USB to Serial adapter and flash the firmware. Depending on the kind of adapter that you have, this is not always easy as the pinout can be quite different so because I wanted to program more than one switch, I decided to make a jig that will help me out making the connections easy.
The jigs are made out of prototyping PCB, where on one side I have a female header pin to plug the USB to Serial adapter, and on the other side I have a 4-pin male header pin to go into the breakout holes on the Sonoff basic switch. The wiring of the jig is done in such a way that it ensures that the connections are always right as long as you properly align the power pin which is with a square PCB pad.
Tools and materials used in the video. Purchasing through the links below helps the channel at no extra cost to you!
- Sonoff Basic Switch - https://s.click.aliexpress.com/e/_ExMtHAt
- Sonoff Mini Switch - https://s.click.aliexpress.com/e/_oo8mEPc
- FT232RL USB to serial - https://s.click.aliexpress.com/e/_ontSmj8
- CP2102 USB to Serial - https://s.click.aliexpress.com/e/_onJnify
- CH9102 USB to Serial - https://s.click.aliexpress.com/e/_Dl7DltF
- CH340 USB to Serial - https://s.click.aliexpress.com/e/_DCv5qYd
- Prototyping PCBs - https://s.click.aliexpress.com/e/_onm931M
- Male pin headers - https://s.click.aliexpress.com/e/_ooxPRtM
- Female pin headers - https://s.click.aliexpress.com/e/_onrUyW6
- Smart Soldering Iron - https://s.click.aliexpress.com/e/_okWE5Vc
- Multimeter - https://s.click.aliexpress.com/e/_okWE5Vc
- Helping hand for soldering - https://s.click.aliexpress.com/e/_m0TjjbO
- Bench Power Supply - https://s.click.aliexpress.com/e/_oo8mEPc