I assembled the ESP8266MOD on a breadboard, seen below. For now the bicycle speedometer project is just the microcontroller, without the output LEDs or the reed switch sensor input.
Measuring the power consumption in mA without doing anything special resulted in around 90mA. Trying to turn the WiFi off with the code below resulted in a decrease to 72mA.
void setup() {
// put your setup code here, to run once:
//Serial.begin(9600);
WiFiMode(WIFI_STA);
WiFi.disconnect();
WiFi.mode(WIFI_OFF);
WiFi.forceSleepBegin();
delay(100);
pinMode(sensor, INPUT);
//gpio_init();
}
Such current is not what I was expecting, it is a bit too high. There is a mode that disables WiFi and it is said to reduce the current to around 15mA. It is called modem sleep, but as far as I read it needs a WiFi connection beforehand to work. I will not have this in the field.
Another option is to refactor my entire code and put it in deep sleep, waking it up from time to time to check on the reed switch sensor input. The only caveat is that GPIO 16 needs to be connected to the reset pin, but as is my reed switch sensor is connected to GPIO 16.
What should I do?
For now I will wait for the PCB to arrive and when it does I will assemble and test the hardware. Such high ESP8266MOD power consumption is now a deal-breaker for the project. It needs to be addressed but the speedometer will work as is.
Want to be informed about this entire project? check my previous update.
Leave a Reply