How long will a 9V alkaline battery power my circuit (Arduino, DHT11, ESP8266)?

Hello all,

I am using Arduino UNO, DHT 11, and ESP8266 WiFi module to measure temperature and humidity in a room every 15 seconds and sending it to ThingSpeak website for storage. I connected the Arduino to a 9V alkaline (from Amazon) battery to power my project.

What I want to know: I need to estimate how long will my project last with a single 9V battery hooked up to the Arduino board. I basically need an autonomous system to collect data.

What I researched so far: People on the web suggest breaking the circuit and measuring the current flowing through the circuit. Then knowing mAh of the battery, I can get a rough estimate of the running time.

What I need help with: Can I actually do what is suggested above? If so, where exactly do I break the circuit? If not, what other techniques can be used to estimate the time?

*** I am looking for a detailed answer here. I am new to Arduino and trying to learn as much as I can.

*** I have included a picture of my circuit and a multimeter that I have on hands.

An update: This is just a test project. For those of you suggesting how to approach things - the actual project is to monitor the weight (later on volume as well) of a compost bin and send that data to a server. So if you have suggestions about load sensors, I am all ears. Thank you.

Hook it up and let the battery run down.
Time how long it takes.

.

with the wifi module probably not very long, i would try to make it wake up with wifi module just before it sends the data then go back to sleep. im not sure if the energizer ultimate lithium would do you any better.

you would need to know how much current everything uses and what the capacity of you specific battery is. then you can do the math and get a rough estimate.

Why the Uno. The ESP is on it's own is more powerful then the Uno. An ESP and DHT could run on ~3.3volt, and sleep between transmissions. Leo..

Temperature and humidity surely don't change that rapidly? How about sampling every few minutes?

Like 2 hours, maybe 3 if you're using an energizer 522 9v battery. And no power management. Uno is 50mA and even in sleep it's a hog because of the other stuff on the board, esp8266 is an even bigger hog if you don't sleep it and the dht is negligible. And 9v batteries are terrible (note also that half the power is getting dissipated as heat in the regulators...)

As mentioned, you don't even need the Arduino.

Furthermore, you should ditch the 9v. An ESP8266 and DHT11 will run happily on a lithium cell.

But as far as your question goes- theoretically you could measure the amperage draw, but in practice your results are not going to be useful as the Wifi power draw is very 'bursty'. The only runtime test you can do is actual runtime testing by running out a battery with use.

Wawa: Why the Uno. The ESP is on it's own is more powerful then the Uno. An ESP and DHT could run on ~3.3volt, and sleep between transmissions. Leo..

Winner winner chicken dinner!

born: I am looking for a detailed answer here. I am new to Arduino and trying to learn as much as I can

Get a mutimeter and measure the current being used. Then if you know the mAhr capacity of the battery, simple sums will tell you how long the battery should last.

Although larryd hit the nail on the head for obviousness, if you want to see how long the battery lasts, just time how long it lasts.

Sorry, but each and every component choice here is wrong :)

  • The battery 9V block batteries have 9V as the name says. your project needs 3.3V (there is no reason to use 5V). With a linear regulator, you are throwing away almost two thirds of your energy. Since your project will sleep most of the time, a buck regulator will almost always have an unnecessarily high quiescent current (consumption without output) and is not a good choice. There is absolutely no reason to use a 9V block battery. It is hardly ever a good choice. For purely digital projects, the voltage is not needed, and IF the voltage is needed, it often cannot provide enough current.

  • The sensor. The DHT11 is shit. It has terrible accuracy for humidity. The DHT22 is ok, but I highly recommend the BME280, especially with the ESP8266, because reding it needs exact timing which the ESP cannot always provide. In my last project with an ESP and a DHT22, using the usual libs, I hat a failure rate of 50-60%.

  • The Arduino Uno, the Uno is a power hog. It is loaded with unnecessary stuff that takes a lot of power. The only applicable Arduino board is the Pro Mini 3.3V, modded for low voltage (you have to remove a jumper, which e.g. disables the power LED). With the ESP, you don't need an Arduino at all, you can program the ESP with the Arduino IDE.

  • The ESP. The ESP is also a power hog that will drain the block battery in hours. Even with sleeping, connecting to the Wifi alone takes 6s in my case, at more than 100mA mean current draw. It is of no use for your measurement interval. If you want radio, you have to look in the 433MHz or 868/916MHz (depending of your location) range or at least at NRF24L01+ 2.4GHz. I recommend the MySensors project. To send the values to ThingSpeak, you need a mains powered gateway to receive the values and send them on.

To get an idea: I have an ESP8266, powered by a 18650 LiPo with around 1800mAh over an HT7333, that reads temperature, humidity and pressure once an HOUR and sends it via MQTT. From the discharge curve, I expect about 6 month runtime from the discharge curve until now (ran 1,5 month and is at 4V now, last project dropped rapidly after 3.6V). Your 9V block would give you 4-8h with a linear regulator and perhaps twice with a buck regulator.

I do understand someone who wants a high update rate, though. The modern sensors are very sensitive and immediately show open windows and even open room doors, people in the room etc. You need a certain sample frequency for that.

A 9v0DC battery tends to be about 500mAh, that means it can supply the same amount of power as a 5v0 USB supply for about an hour

EdsArduino: A 9v0DC battery tends to be about 500mAh, that means it can supply the same amount of power as a 5v0 USB supply for about an hour

That is completely wrong.

1) While the USB (2.0) standard says a device may not take more than 500mA, you will hardly find any supply that can only provide that. Even the weaker once are rated for about an amp, most decent newer once go to 2.1-3A. 2) Power is U*I. When a USB power supply supplies 500mA, it supplies 2.5W power. If a 9V block battery supplies 500mA, it supplies 4.5W power. Only that a 9V block battery will have a very hard time providing 500mA power. Energizer specifies that it will drop to 6V in 12min at that current. 500mA will be reached at 10-15mA discharge current. If the battery is supposed to last an hour, discharge current has to be below 300mA even for a top brand battery.

So over the runtime of 1h, a 9V block battery can provide less than 3W, while any halfway decent USB supply can give you 10W or more.