Skip to content
Denis Stepanov edited this page Feb 28, 2023 · 7 revisions

ESP-01 / ESP-01S

Among all ESP8266 flavors, I decided to use ESP-01 for this project, because it had small footprint and seemed just barely enough for the job (and because I like challenges). I needed one pin for door sensor, one pin to talk to HC-12 radio module, one pin to wake it up from deep sleep, and one pin to send diagnostic output. ESP-01, conveniently, has got just four usable pins, meaning that extensions — like adding one more sensor (say, back door) or serving one more mailbox — would not be easy. Among other inconveniences:

  • battery level had to be measured using internal ADC_VCC mechanism, which proved to be very imprecise (see more in the Battery section);
  • because of missing circuitry, ESP-01 cannot wake itself up, meaning that functionality like "report presence once a day" would not be possible.

ESP-01 Flavors

Further, there are two flavors of ESP-01: ESP-01 (left on the photo) and ESP-01S (right on the photo). Even though they are highly compatible, there is a number of differences. I usually tend to use ESP-01 (without "S") because is has a nice red power indicator. This very feature, however, is a killer for "deep sleep" projects, because the power LED stays active and consumes battery rather quickly. In this case, ESP-01S is better. Other differences important for this project are summarized below:

Feature ESP-01 ESP-01S
Power (red) LED Present Absent
Comm (blue) LED GPIO1 GPIO2
GPIO2 pull up Not required Required

Pay attention to flash mode (DOUT, DIO, QOUT, QIO) when programming. These can differ even within one family. I have ESP-01 boards for some of which QIO works and for other does not. "Does not work" means controller will program successfully but will not boot into your program. A nice guideline is given in the esptool documentation.

For uniformity, perhaps, ESP-01S could also have been used for receiver module. This would require modification of schematic and of the program.

ESP8266 by default sends diagnostic output to TX (GPIO1, UART0, Serial in ESP8266 Arduino Core). In this project, Serial is used to communicate with HC-12; consequently, diagnostic output is redirected to UART1 (Serial1). Since the communication is unidirectional, only a half of Serial is configured (RX on local and TX on remote module), leaving the other pin free for some other job.

For ESP-01 programming recommendations see Schematics.

Clone this wiki locally