Sunday, December 30, 2018

Build your own IoT/MQTT node for less than $2

In this post, I will be explaining ESP-12F module usage with minimal set of components.
ESP-12F as a stand-alone module is of no use unless mounted on a base board like wemos-d1-mini.

This blog explains how to use ESP-12F module without the need of a base board but with minimal set of components.

Items needed(total cost of all the components is based on the prices from aliexpress)
1)1x ESP-12F module(pre programmed with tasmota firmware)
2)1x 10k SMD resistor
3)1x 10K thru-hole resistor.
4)2x 4001 SMD diode
5)1x USB male connector(PCB mount - smd).



Schematics:















Board Preperation Steps:
1)Ensure that ESP-12F module is programmed with tasmota firmware(here you can find the details on ESP-12F module programming)

2)mount 10k smd resistor between GND and IO15 pad of the ESP-12F module.













3)mount 10k thru-hole resistor between VCC and EN pad of the ESP-12F module.

4)Stick a piece of insulation tape on the right side of the ESP-12F module so that USB connector doesnt short any pads.
5)Place USB connector as shown below and smd pins of the USB connector shall be placed over the insulation tape.
6)on the backside of the board, fix the USB connector to the ESP-12F using hot-glue(dont apply hot glue on the smd pin side of the USB connector yet, this will be done at later stage)
7)solder two SMD diodes in series between Plus(+) line of the USB connector and VCC pad of the ESP-12F module.
8) Connect Minus(-) line of USB connecotr to the GND pad of ESP-12F module
9)Apply Hot glue on both the sides of the USB connector and ESP-12F for stability.



10)Power the board with 5v USB charger and look for open wifi ssid "sonoff-NNNN"
11)Follow the standard tasmota generic module configuration.

ESP-12F(ESP8266MOD) module programming


ESP 8266 based IoT modules can be purchased from aliexpress for as low as 1.3Euros. These cheap wifi modules can be handy for many home automation DIY projects(especially when used with opensource firmware like tasmota).

In this post, you will find an easy way of programming ESP modules by converting wemos-D1-mini development board as a pogo-pin based docking station.

Items needed:
1)Wemos-D1-Mini board
2)8 pogo pins
3)ESP-12F module
4)USB-to-micro-USB cable
5)clip for holding the ESP module on pogo-pin dock.




Preperation:
1)de-solder existing ESP module from the wemos-D1-mini board(this is the most difficult part, you need good soldering skills).

2)carefully solder 8 pogo pins on the exposed ESP pads on the wemos-D1-Mini(TXD0,RXD0,IO0,IO15,GND,VCC,EN,RST)


3)place a fresh ESP module on the newly prepared wemos-D1-dock



4) On your Linux-Host-PC, run following commands to prepare the programming setup.
  • cd ~
  • git clone https://github.com/espressif/esptool
  • cd esptool
  • wget http://thehackbox.org/tasmota/release/sonoff.bin
5) Connect  USB-to-MicroUSB cable between Linux-Host-PC and wemod-D1-dock and run to the following command on Linux-Host-PC for erasing ESP-12F flash
  • ./esptool.py --port /dev/ttyUSB0 erase_flash 
6) After erase operation, remove and connect the USB cable between host pc and wemos-d1-dock, and run the following command to program tasmota firmware
  • ./esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 sonoff.bin
7) Congratulations! your ESP-12F module is ready for use, check my next blog about using ESP-12F as a standalone board for home automation projects.