Decided to put a smaller, single channel relay in my Garage Door project. I ordered what I believe is an ITead Sonoff Inching Relay.
This module is preloaded with software and you can use an iPhone to trigger the relay using an app called EweLink
Basically you start the chip up, connect to its WiFi network and configure it to yours.
I’m not a fan of EweLink……….it’s okay but it is a stand alone app. I want to incorporate this into my home automation software. Imagine if you had a bunch of smart appliances and an app for each one. That would suck. Having it all in one place does not suck.
But to accomplish this we need to reprogram what is labelled “WiFI Module” on the pic above. That is an ESP8285 Internet of Things (IoT) chip. My firmware of choice for accomplishing such things is called Tasmota.
Flashing this chip is kind of weird. Most of these boards have solder points on the board for voltage, ground, transmit and receive. This board is no exception, it has the requisite 4 holes but they aren’t labelled and the transmit and receive holes don’t connect back to the chip.
If I had to guess it was the manufacturer trying to make it harder for us to use other firmware but the spec sheets for these IoT chips are readily available and it is easy enough to figure out.
First of all the board DOES connect to 3.3v and ground. Figuring that out takes no more than following the board traces back visually to the power source. And usually the Ground connection is a square solder pad anyway and the rest are round.
So taking a look at the PSF-B01 Spec sheet the pins look like this
Ok so staring down at the chip on the top of the board it will look like this:
Sorry about the RX label above. It should say “4th from top”. OK, we have all we need to know to flash.
Open the Sonoff.ino file from Tasmota Source Code in ArduinoIDE, then go to my_user_config.h tab and configure your wifi network SSID and password. Also scroll down to the Application part of the page and change the PulseTime Setting from 0 to 10. You can also set a static IP address and set up your MQTT server from here. At a minimum though you should set up your SSID and password.
That allows the relay to click over for 1 second. (0.1 second increments). Now set Arduino up like this:
And that should get Tasmota on your device. Verify the build. If you are ready to flash just hook the 3.3v and ground wire up. Have the TX and RX wires ready to go from the FTDI.
Put the board in boot loader mode. Hold down both buttons next to the chip. Plug in the board. Let go of the buttons, and the LED near the relay should start flashing. Click the button on the OUTSIDE of the board one time and both board LED’s will be steady on. You are ready to flash.
Hit “Upload” and stick the RX wire on the TX solder pad on the chip and vice versa. I was able to use male breadboard wires and hold the pins on the solder points easily enough. Worked first time.
Now I’m toying around with just adding the door sensor (reed switch) to this device. I’ll use GPIO 14 and can just solder a connector onto the chip or hopefully it maps out on the board somewhere. Pin 5 from the top on the left side of the chip seems like the ticket!
Easy enough to add a breadboard wire to GPIO 14. 5th pin from the top. You can use the ground on the chip or pick a ground up on the board in the unused holes. Simple.
What kind of module type did you choose after flashing, mine goes haywire after using it once via mqtt
Hello, can i use a switch on GPIO 14 with the original firmware? or how can i detectet if the door open or close?
Hey John, I just wanted to say thank you for documenting this process so well. I picked up the same board from Amazon and was having a hell of a time trying to sort out 1) why the vcc and ground plots were wired correctly but not tx and rx, and 2) where the heck to get tx and rx!
Next on my list is to try and augment the antenna for better reception.
Hi Ryan,
did you already try? Do you know the connector for connecting any ext. antenna for trying better reception?
is there any way to flash this without soldering? it has a USB surely this can be used to flash tasmota as well. ?