ESP-01

ESP-01 are very low cost ESP8266 devices that can be used in a number of scenarios. Since it's WiFi based you can put it anywhere you have a USB power or a USB adapter. For example:

  • A reed switch as a contact sensor. Wire the reed switch between GPIO2 and GND. Use the ESP8266 "MppSensor".
  • A motion sensor (similar to above). Use a 3V3 powered version.
  • A battery or USB powered simple button (e.g. "Panic", "All On", "All Off", "Lock")
  • A powered door lock - Wifi Door Lock

The ESP-01 can be used just as any ESP8266 based device (see ESP8266). The ESP-01 has two I/O pins: GPIO0 as pin3, GPIO2 as pin 4 in MppServer.

From what I could find the GPIO source current is about 12ma, sink current about 20ma. This is marginal for driving a relay if it is active high. Likely an additional driver would be needed. The Sonoff may be a better choice.

You can flash an ESP by shorting GPIO0 and RESET to the ground pin with a stiff wire. Roll off the RESET pin so that GPIO0 is held to ground an instant longer than RESET. This may take some practice and a few tries but you should see your flasher program detect and begin flashing the device (watch the log screen if it has one).

NOTE that GPIO0 must be held high when rebooting the ESP01 or it will go into flash mode and will no longer communicate. This limits the input ability of GPIO0 as it must float or be tied to VCC through a resistor.

The default rate after a flash is 74880 buad, try that if the LuaLoader won't sync. After the base *.lua files have been loaded the device start at 9600 buad.

The ESP-01, about $2. An ESP-01 USB power adapter and flash programmer, also about $2. They fit together as shown.

Pinouts for the ESP-01. The bottom right device in the pinout image is an alternate to the 8 pin USB flash adapter. This type works but can be a little flaky, the USB version is better. Be cautious with VCC, use the 3V3 connection rather than 5V! This inexpensive breakout board is handy for use with the ESP01 USB adapter. Connect it with jumpers to sonoffs or other devices to make connecting easier. Use jumpers to connect RST to GND (reset) and GP0 to ground (program) to make flashing easier for the ESP01 and other devices.