Measuring Power Consumption on D1 Mini



  • I'm trying to create a waterproof temperature sensor that will be attached to a buoy in a reservoir and will ping back a temp reading every hour for inclusion on a website. The Reservoir is used by open water swimmers.

    So the basic kit is built - WeMOS D1 Mini with a waterproof DS18B20 sensor. Waterproof enclosure.

    Power to come from a Solar Battery Bank like this:
    http://www.ebay.co.uk/itm/122053677351

    If I leave the D1 Mini on all the time I believe it draws about 80mA, so this charger could in theory last 10days plus a bit for topping it up. But it has one of those annoying "power savers" that switches off if no current draw. For now I've rigged a little delay with a transistor to pulse about 200mA through an LED every 5 seconds for 10mSec.

    But doing that means I can't (I don't think) use a deep sleep mode because I'd need to wake it every 5 seconds but then have it know only to connect to the internet every 1200 wakes which I don't think I can do with deep sleep as it re-run's the setup doesn't it?

    So I'm now looking to put a separate low power arduino in (or possibly just a transistor and capacitor (https://www.dorkbotpdx.org/blog/paul/battery_pack_load) that will do the keeping the battery awake bit and then I can put the wemos D1 to sleep and wake it when its time to do the internet bit...

    I bought a USB Voltmeter that I thought would be useful for all this and its pretty useless in honesty - it doesn't go low enough mA and even the 70mA doesn't show up as 0.07A it shows as 0.01 and the hour meter doesn't get tiggered. The 200mA pulses do show up. To be fair it is probably fine for testing if your iPad is getting 0.5A or 2.1A which is its purpose.

    My multimeter has a 200mA scale but that is as low as it goes - so I should be able to measure normal running current, but if I was hoping to drop to 5mA or less I have some doubts over its usefulness.

    I don't need mega efficient power. Ideally this will run for 8 months maintenance free during "summery" months. The Solar panel is rated 1.5W, I'm working on the theory it will actually give about 500mW for maybe 6-8 hours /day. So I'd ideally like to make my unit's daily power draw 3W/24hr so ~25mA/h. There will be days I'll get more, and days less. But the power bank should cope.

    If I pulse 0.2A every 5 seconds for 10msec, and it sleeps at say 5mA the rest of the time, over an hour the average power use should be 5mA/h + 12 pulses/minute x 60minutes = 720 pulses at 200mA, so ~ 1.5mA/h. Plus 70mA for 2 minute to connect to WiFi, read the probe and upload the data, 2.3mA/h. Based on all that I'm under 10mA/h and so well within the scope of what I'm expecting the battery to churn out...

    But - very long post to get to the point - what's the best way to measure the current use on home kit? I have no 'scope, a basic multimeter, and a USB dongle that isn't anywhere near sensitive enough. I have some basic electronic skills. I wouldn't be opposed to getting an arduino scope kit and building it but will it actually be any use? Is there a better option in the £ - ££ range rather than £££££! Or would I be better with a decent multimeter? Or a better dongle? Or a regulated power supply that reports current draw (but needs to be able to do it in the single figure mA / 100-9000uA range to be useful?)

    Up till now I've been a RasPi tinker - so anything <800mA of draw was unlikely!



  • Re: Measuring Power Consumption on D1 Mini

    Try this
    It should be easy to adapt it to be powered at 3.3V directly by the Wemos and to read the voltage through the ADC (A0 pin).



  • You can buy INA219 modules quite cheaply and use them to measure power draw. If you swap out the stock 0.1 ohm resistor for a 1 ohm resistor you get very good resolution (10uA or so) with a max of 320 mA.
    https://www.aliexpress.com/item/INA219-I2C-interface-High-Side-DC-Current-Sensor-Breakout-power-monitoring-sensor-module/32676454542.html

    Another good trick is to measure the voltage drop across a 1 ohm resistor with a voltmeter. Whatever it reads in volts is the same in amps: 0.1mV = 0.1mA. It's only as precise as your resistor, but it works in a pinch, especially with a good voltmeter.

    Finally, this thing gives you 100uA resolution. RD makes a few other similar things that would work:
    https://www.aliexpress.com/item/RD-USB-3-0-OLED-Comprehensive-Tester-5-bit-current-4-bit-voltage-voltmeter-ammeter-power/32804740758.html

    Many of those solar power banks are absolute crap by the way.

    And in sleep the D1 Mini uses a lot less than 5ma.


Log in to reply
 

Looks like your connection to WEMOS Forum was lost, please wait while we try to reconnect.