This tutorial is a step-by-step guide that shows how to build a standalone ESP8266 Web Server that controls two outputs (two LEDs). This ESP8266 NodeMCU Web Server is mobile responsive and it can be accessed with any device with a browser in your local network.
The AnalysIR crew has published an article showing how to achieve accurate PWM for Infrared carrier signals on the ESP8266 NodeMCU:
Quite simple really – just set the baud rate to 10 times the desired Infrared carrier frequency and send a ‘magic’ 8 bit character to achieve the desired duty cycle. Of course we need to take the 1-start bit and 1-stop bit into account plus the 8 bits in each character. Remember that the UART sends the data inverted, so this needs to be taken into account with the characters sent and also in the IR LED driver circuit above, which required 2 transistors instead of the usual one.
Tinkermax shows us how he reduce the current consumption of his v2 NodeMCU in deep sleep to < 50μA:
Unfortunately, with all this added convenience comes the drawback of added power consumption, which continues even when the ESP8266 is in deep sleep.
I measured 18mA to the NodeMCU board while the ESP8266 was in deep sleep mode – orders of magnitude more power hungry than I was looking for.
So for my project (which I will write up for my next blog post) I sought to retain the convenience of using the NodeMCU, but to address its power consumption shortcomings to allow battery operation.
Read further to hear what I did.
I usually never use libraries… but made an exception for these quick projects !
I’m pretty sure that most people reading this very article know about the (very) cheap ESP8266 Wifi module.
A bit more than a year ago, I actually made a small development board for it, which was recently used in the connected lamp that wakes me up. While what follows pales in comparison to what cnlohr has implemented on this chip over the last months, sometimes you just have small projects that you don’t want to spent days on.
Anyway, the ‘standard’ way of compiling programs for this neat little chip involves installing a cross-compiling toolchain on a Linux computer (or VM), and then using a dedicated tool to flash your program to the ESP8266.
As you can guess, this can quickly get tiring if all you want to do is blink an LED… but then I stumbled upon NodeMCU and Domoticz.