Experimenting with a new gadget: Electrodragon's relay board
My first wifi connected board was the now discontinued Wemos D1. It offered Arduino UNO compatible shape/size and also hosted the mysterious ESP8266 on it. It also made it easy to experiment with the ESP8266 by allowing Arduino IDE to flash programs to it the usual/easy way without any extra hardware/buttons etc being necessary.
I used that board to build a simple light on/off control for a hard to reach area at my home. It works like a charm to this day. From any phone/browser I can turn that light on/off. Still, there are few things I do not like about it.
On the hardware side: I ended up with 3 boxes interconnected with wires just to control 1 lamp;
- Wemos D1 in its nice see-thru box,
- 1 project box that hosts the relay with connections to AC on one side and control wires on the other side,
- and a power adapter for the wemos board.
Imagine that just to control one floor lamp 3 boxes on the floor.
On the software side: I was quite happy to see my first DIY IoT work so I did not bother to code for changes in IP addresses when DHCP assignments change, or I did not mind that D1 code contained a hard-coded ssid/password for my home wifi.
Fast forward a year, and we now have Electrodragon’s relay board. The board offers esp8266/power adapter and 2 relays in one package that would fit in a 2x4.5” area.
Before I begin with how to work with the board, let me tell you that this board has ==AC power on BOTH ends!== There are also people who question the general safety of this board in blogs. There are ==no safety certificates== presented about these boards by the manufacturer either. If you decide to try this board on your own ==proceed with caution==. ==Read about the risks mentioned in Scargill’s blog/comments ==.
Here is the Electrodragon’s Wiki on the relay board.
Now on the positive side, besides the small footprint/all in one package of the board, the price is also very attractive at merely $6. It allows 2 relay control at that price but the output connections have to be to AC devices! See the picture below and convince yourself you should not connect anything but AC devices on the output and be careful handling this board when it is connected to the mains power.
For me it is important to use Arduino IDE at least to flash the code to the board. To make use of Arduino IDE in preferences paste the following address to Additional Boards Manager URLs area.
Once your IDE is ready it is time to connect the board to your PC. I used a USB-TTL Serial cable (aka a console cable). The 2 pictures below show where to connect what. (I DO NOT recommend to connect to mains power while flashing programs to this board, just use the USB cable as shown)
The board has the following pins and buttons of importance.
The button is important. You have to press that button BEFORE powering on, keep it pressed DURING power and let go only after that. That way you will be able to push/flash sketches from Arduino IDE once you confirm the port connected after each flash. It is a hassle compared to flashing to Arduino.
You can get the blink example from ESP8266 examples in IDE. I changed the blink LED to be 16 (GPIO16) in the example, which is a red LED on the electrodragon board.
If all goes OK, you should see the following message and the blue light on the board should rapidly flicker. The picture below shows my selections with this board during a successful code flash.
This is enough to get you up and running, pushing code to esp8266. Next I will work on getting an AP established and collect input for ssid/password settings for wifi.
To be continued