Sunday, December 30, 2018

Build a $2 IoT/MQTT Node with a Bare ESP-12F

How to use a bare ESP-12F module as a standalone IoT/MQTT node — powered directly from a USB charger with just a handful of passive components, no base board required. Total cost: under $2.

Completed ESP-12F standalone MQTT node

Finished board — ESP-12F module with USB connector, ready to plug into any 5V charger.

Items needed

Prices based on AliExpress at the time of writing:

  • 1x ESP-12F module (pre-programmed with Tasmota firmware)
  • 1x 10k SMD resistor
  • 1x 10k through-hole resistor
  • 2x 4001 SMD diode
  • 1x USB male connector (PCB mount, SMD)

Schematic

ESP-12F standalone board schematic

Wiring diagram — USB 5V stepped down through two diodes to ~3.6V for the ESP-12F.

Board preparation

Step 1 — Ensure the ESP-12F module is programmed with Tasmota firmware. See the ESP-12F programming post for details.

Step 2 — Mount a 10k SMD resistor between the GND and IO15 pads of the ESP-12F module.

10k SMD resistor between GND and IO15

10k SMD resistor soldered between GND and IO15 pads.

Step 3 — Mount a 10k through-hole resistor between the VCC and EN pads of the ESP-12F module.

10k through-hole resistor between VCC and EN

10k through-hole resistor connecting VCC to EN (chip enable).

Another view of the VCC-EN resistor

Another angle showing the VCC–EN pull-up resistor.

Step 4 — Stick a piece of insulation tape on the right side of the ESP-12F module so the USB connector doesn't short any pads.

Insulation tape applied to ESP-12F

Insulation tape prevents shorts between the USB connector and ESP pads.

Step 5 — Place the USB connector as shown below. The SMD pins of the USB connector should sit over the insulation tape.

USB connector placed on ESP-12F

USB connector positioned over the insulation tape.

Step 6 — On the back side, fix the USB connector to the ESP-12F using hot glue. Don't apply hot glue on the SMD pin side yet — that comes later.

Hot glue fixing USB connector on back side

Hot glue secures the USB connector on the back side.

Step 7 — Solder two SMD diodes in series between the + line of the USB connector and the VCC pad of the ESP-12F module.

Two SMD diodes in series for voltage drop

Two 4001 diodes in series drop 5V USB to ~3.6V for the ESP-12F.

Step 8 — Connect the line of the USB connector to the GND pad of the ESP-12F module.

GND wire from USB to ESP-12F

USB ground connected to the ESP-12F GND pad.

Step 9 — Apply hot glue on both sides of the USB connector and ESP-12F for stability.

Hot glue applied for stability

Hot glue on both sides for mechanical strength.

Completed board from another angle

Completed board — ready for testing.

Testing

Step 10 — Power the board with a 5V USB charger and look for an open Wi-Fi SSID named sonoff-NNNN.

Step 11 — Connect to the SSID and follow the standard Tasmota generic module configuration.

Your $2 IoT/MQTT node is ready. Plug it into any USB charger, configure Tasmota to connect to your MQTT broker, and start automating.

8 comments:

Anonymous said...

pretty cool!!!!!!!

Anonymous said...

Usb connector is just for power?
What about flash the firmware? Where is Flash and Reset button?

brna said...

You can buy node mcu or weemos d1 mini - both have USB-TTL and a nice brakeout board for esp8266

Walid Mafuj said...

Yes, buying wemos d1 mini is a clever idea.

Unknown said...

awesome!

zoobab said...

Next step is to install esp-usb with D+ D- rails:

https://github.com/cnlohr/espusb

I took the picture with the breadboard :-)

Rogan Dawes said...

Very neatly done!

I did something similar to WiFi-enable my Current-Cost Envi R power meter.

My attempt

However, I had a very strange situation with repeatable corruption on the serial TX (from the ESP). It turned out to be ringing on the line, which was solved with a 10pF capacitor (blue).

Gerard said...

This is a clever way to use an ESP-12F without needing a baseboard.