ESP8266 – Power usage

How much power does a 8266 use?

Having got to the point that I can use an ESP-12E/F I was interested to see just how much current it draws.

So I modified the test/programmer lead by adding a 1R0 resistor inline, this then allowed me to use my multi-meter in voltage mode and measure the drop across the resistor.

With 1R0 as the test, we get a simple 1mV = 1mA ratio. If I was testing a higher power unit, then I would use lower resistor values to minimise the voltage loss to the device, but as the values are small this keeps things easy.

As a first test I used the blinky 50/50 program with 1/2 second on and 1/2 second off.

Measuring the current this shows a steady state value of around 24mA. But with a much higher initial draw (around 70mA). This seems to be a startup draw, my thoughts on this later.

Changing the timing ratios to on for 100ms and off for 5s, brought the current average down to 22mA.

Repeating with reversed timing, i.e. LED mostly on, took the current to 25mA, so not a huge difference. Certainly not enough that I would worry about using the LED in normal operation.

For a more realistic test, I put together a multi-role application, which had the following functionality:

  1. Every 10 seconds, gets the time (NTP) from a local server
  2. Every 1 second prints out the time to the serial port
  3. Has a simple web server with a text based reply
  4. Has a nominal 100ms sleep every loop
  5. Uses 74880 baud for output

For reference the webserver just prints the server name, a count, the time and the voltage from the ADC input. It does include a simple javascript to make the web client (chrome) do a page refresh every 2 seconds.

By default without accessing the webserver, I again noticed the initial higher current draw, but settling down to a long term value of 63mA.

For reference I took out the sleep, and re-ran, which then showed a constant draw of around 70mA, this seemed to show no separation between the startup and the main current draw. Again comments on this later.

Increasing the sleep to 250ms gives a long term current of 56mA, and further increase to 500ms drops the current further to 44mA.

Returning to the reference 100ms sleep, but disabling the webserver totally, made a slight drop from 63mA to 62mA, this may well just be measurement error.

Returning to the 500ms sleep, and the webserver on but not used retested as 45mA.

Adding 1 chrome client brought the current up to 53mA, and adding 2 clients (from different PCs) took the current up to 68mA.

Changing the javascript to do the update every 1second, seemed to make no noticable difference to the current at 68mA, but both clients were seeing updates every second.

Disconnecting the clients and the current dropped back to the 44-45mA range.

I disabled the NTP polling and the current drop to around 43mA.

Turning off serial output altogether seemed to have no affect on the current which remained at 43mA.

My takeaways on current use

These are my takeaways from the tests so far:

  • The unit itself seems to draw up to 70mA during startup and in the most busy cases of normal operation.
  • If nothing else is happening, then the longer the sleep in the main loop, the lower the current. For me the 500ms seemed a good compromise and still allows web activity to occur without obvious delays.
  • Serial output really doesn’t impact the current draw significantly, so use it appropriately.
  • Background WiFi activity does affect the current draw and can push the load right back up to the 70mA max. But soon after the activity ceases the power will drop down.
  • During startup and in the main loop, if you don’t include any sleep, then it will draw the full current. Don’t worry about this during startup as that only happens once (hopefully), but do consider the relevant sleep in the main loop.

Real world test

I took the above code, and added a small 32×128 OLED display (0.91″) which I used to display the IP address, the time and the ADC voltage.

I then used a small DC to DC buck/boost converter that can take a wide voltage range (1V-6V) and gives a 3.3V output. This I connected to a 18650 Cell (output voltage 4.2V full, 2.7V empty) and used this to power the test board.

Again I added the 1ohm resistor, but in this case, directly into the feed from the battery to see the raw drain.

Not the tidiest build, but good for testing

As you can see the modules, ESP-12F, OLED and DC DC converter are all quite small units and are significantly smaller than the battery itself. I also added a resistor divider on the raw battery voltage to allow the module to measure it’s own power supply voltage.

This allowed me to test the current in actual operation, and when the battery voltage was around 3.4V it was drawing around 120mA, without the OLED this dropped to just under 100mA.

Using a 3000mAh cell (tested), I found that it would give well over a days operation without any problems. Based on the 120mA and 3000mAh, it should work out at 25 hours, so this fits well. In reality I think you will get more as the DC DC converter is more efficient when the battery voltage is higher and so you get more run time than the 3.4V test would indicate.

More Colours

After yesterdays post, I had a bit of feedback asking if there would be other vendors colours (not just the Vallejo Game Colour range). The original post with how I got these charts can be found here. As I was able to get the RGB values from a few other ranges, I have now generated…

Investigations into colour theory and painting

One of my hobbies is miniature painting, it’s something I did a long time ago and found myself getting back into a year or so back. Now I am nowhere near an expert on this, but do like to work on techniques and ideas I see online and on the dreaded Youtube. That’s where I…

Formatting in WordPress

This page is a test, but might help. I originally was using this page to help me to try out new layout styles and techniques. But it ended up having information which might be useful to others, so it’s published rather than being internal only. I would like to use the various plug-ins and in…

ESP8266 – A small WiFi enabled microprocessor

This blog page is a bit of a waffle on how I found out about the ESP8266 and my process for getting it working for me. If you want a technical description on connecting one up and getting code running, then the ESP8266 Getting Started Guide should help. My introduction to ESP8266’s Some time ago,…

Loading…

Something went wrong. Please refresh the page and/or try again.

Get new content delivered directly to your inbox.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: