I have been using the great ESP-01 for a while now, either as a side WiFi chip for software running on various Atmel AVR chips (ATmega328, ATtiny84, ATtiny85) or as a standalone micro controller. While what you can do with an ESP8266 is impressive, it also has its drawbacks: it uses a lot of power.
If you are using batteries to power your project, you need to make sure you can sleep the WiFi chip most of the time or use a different less power hungry radio, like the various RFM69 chips. However, using something different than WiFi also means you need some kind of receiver.
If you are building gadgets for IoT, you will eventually need a way to connect to the Internet. Having WiFi directly on the gadget saves an extra step.
How much power is the ESP really consuming?
While running a test project using an Arduino Uno and the ESP-01 using the provided 3,3V rail on the board, here are some numbers:
If you are prototyping using an Arduino, you might even notice the ESP8266 reboot and output garbage on the serial line. The garbage is actually the unit restarting and outputting data at 74880 bps. To alleviate the power stability issue, some tactics can be used, such as:
- Use a 100nF capacitor close to the ESP-01 between Vcc and GND
- Use a power regulator for the 3,3V rail, bypassing the Arduino onboard regulator.
- Use a power regulator to run the entire project using 3,3V, including the AVR chip itself.
While the capacitor option works great, you are still trying to handle peaks around 70-100mA or more coming from a 3,3V onboard regulator designed for 50mA.
As for running the entire project on 3,3V, this might or might not be practical. Some of my projects need to run GPIOs on 5V. You might also need to downclock the AVR, running at 8MHz instead of 16MHz. You officially need 3,6V for 16MHz and while the AVR chips usually run fine with 3,3V/16MHz, you are still out of specs. If you want to use an Arduino Uno and run the whole thing on 3,3V, there is a great article on how to convert your board on Adafruit.
Last available option; use an external power regulator for 3,3V. Since I had a couple of LM317 available, I decided to use them to power to the ESP. These are variable regulators and you need to adjust the output using 2 resistors. This works great and you can even leave the capacitor used earlier for stability.
Of course, these are mostly for prototypes where you are connected to a stable power source. If running on batteries, ditching the regulators might actually save some amps. You might also adapt the battery to output 3,3V directly and step down the AVR clock.
As stated earlier, if you really need to save power, the best option is to actually perform tasks at regular intervals and sleep the whole processor. If you are using external triggers, you can even run your whole project using interrupts on the AVR. Simply wakeup the ESP8266 on demand by connecting the RST line on one of the AVR GPIO and bring it LOW for a couple of ms. Once the ESP has done its job (for example connecting to a server and push data), it can enter deepSleep() until the next trigger.