ESP8266: Everything You Need to Know About the Chip That Started It All

Before, we unpacked the single-core L106 architecture, the tight memory constraints, watchdog timers, and the GPIO pins you can trust. Now we turn to the features that make the ESP8266 a connected device: Wi-Fi operation, power-saving modes that can keep a battery running for years, the infamous ADC limitation, and an honest verdict on when this chip still deserves a place in your BOM.

Wi-Fi: How It Really Works and What Breaks It
The ESP8266 Wi-Fi supports 802.11 b/g/n in the 2.4 GHz band. As a station (STA mode), it connects to your router. As an access point (AP mode), it creates its own network. In STA+AP mode, it is both useful for the captive portal setup flow (WI-FI Manager).

8738100775374561280

TX power goes up to +20.5 dBm, that’s quite good for a sub-dollar chip. Receiver sensitivity is down to -91 dBm. In practice, this means the ESP8266 has very decent range, often better than ESP32 modules due to the simple external antenna on the ESP-01 and similar modules.

What breaks Wi-Fi most commonly: blocking code (covered in Part 1), high-frequency interrupt handlers that starve the scheduler, large heap allocations that fragment memory, and poorly timed delays in Wi-Fi event callbacks. The golden rule is never do heavy work inside Wi-Fi event handlers. Post an event to your main loop and handle it there.

Station Connection: The Right Way
Don't call WiFi.begin() and then spin in a while(!WiFi.isConnected()) loop. That blocks everything. Instead, set up event handlers with WiFi.onEvent() and let the connection happen asynchronously. Your main loop continues running, handling other tasks, and your callback fires when the connection is established (or fails).

Power: Deep Sleep Is Your Best Friend
This is where the ESP8266 really shines for battery applications. In deep sleep mode, the chip draws less than 60 µA (with RTC clock still running). Everything is off except the RTC oscillator and a small portion of SRAM. To wake from deep sleep on a timer, you wire GPIO16 directly to RST, the RTC fires a reset signal after your specified sleep duration.

Sleep Mode Current Draw CPU Active? Wake Source
Active (Wi-Fi TX) ~170 mA peak Yes N/A
Active (CPU only) ~15 mA Yes N/A
Modem Sleep ~0.5–1.0 mA Yes Automatic DTIM
Light Sleep ~0.9 mA Paused Timer, GPIO, UART
Deep Sleep <60 µA No Timer (via GPIO16 → RST), GPIO16

For a battery-powered sensor sending data every 10 minutes: wake time is typically 3–5 seconds (boot + Wi-Fi connect + send + disconnect). With a 2000 mAh LiPo, you're looking at 1–2 years of operation. The exact math depends on Wi-Fi reconnect time, which varies wildly based on your router and signal strength

Wireless & IOT

No comments yet. Be the first to comment!