Solder 3.3kΩ resistors to ESP
- VCC and CH_PD
- VCC and RST
Relay modification part 1/3 (voltage regulator)
Solder voltage regulator BA033. Component's pinouts:
I soldered it directly to bottom of relay. Below I marked places which I used. Before soldering I scratched electronic path in places 2 and 3:
To solder pinout 2 to board you have to add piece of wire. I used wire from resistor. Result:
Relay modification part 2/3 (capacitor)
Solder at least 33uF (max. 1000uF) capacitor to pinout VCC and GND. I used 47uF capacitor.
Relay modification part 3/3 (LED removal)
I had to remove LED from relay, because GPIO current is low and LED current consumption is to high. With LEDs, relay clicking when GPIO is set to HIGH.
USB power cable preparation
I used a cable from old mouse, but you can any usb type cable (miniUSB, microUSB doesn't matter). Usb is only for power from any usb port. I used phone charger which cost me $1 ;-)
Download binaries from github: https://github.com/pawelka/esp8266/tree/master/firmware
Flash your ESP using command:
esptool.py --port /dev/tty.usbserial write_flash 0x00000 0x00000.bin 0x40000 0x40000.bin 0x12000 webpages.espfswhere /dev/tty.usbserial is usb2ttl converter location. This example is for linux & mac, but for windows will be "COM1".
More informations about usb2ttl converter to ESP connection and flashing are available on page: http://taylorcoffelt.com/article/1
Some converter have 3.3V output. Those output can be connected directly to ESP.
I'm using PL2303 converter, but other converters should also works.
- converter 3V3 to ESP VCC
- converter GND to ESP GND
- converter TXD to ESP URXD
- converter RXD to ESP UTXD
- converter GND to ESP GPIO0 (GPIO0 LOW state on start indicate that ESP is in flashing mode)
ESP8266 with relay connections
- ESP8266 GND to relay GND
- ESP8266 VCC to relay VCC
- ESP8266 GPIO0 to relay IN1
- ESP8266 GPIO2 to relay IN2
Relay power connections
- VCC (5V) from USB to relay JD-VCC
- GND from USB to relay GND
Don't connect 5V to VCC on relay there is 3.3V. If you connect there 5V you can burn you ESP.
Power on you switcher, after that you should see wifi network. ( screen in my native language ;-) )
Network name have prefix "ESP_", but after that can be other symbols.
Connect to network and open page http://192.168.4.1
Now you can test your switcher.
There is also wifi settings. There you can connect your ESP to your home wifi network, but at the moment there is no reset button and if you connect to wrong network, there is no easy way to reset ESP (flash standard firmware and reset settings). If I find a time, it will be next feature.