Post topics, source code that relate to the Arduino Platform

User avatar
By Joe Job
#48683 Hi guys I have a number of devices (breadboard) set up now where the ESP8266-01 acts as an MQTT client and sends data from the broker to an ATMEGA328P-PU and vice versa. I am ready to start creating PCB's for the final prototypes but after testing using a 9v battery the devices do not even last a night before the batteries run out. The two devices I am wanting to optimize at this point are:

ESP8266-01
Reed switch magnetic door sensors

ESP8266-01
ATMEGA328P-PU
2 x LED
PIR sensor
TMP36 temperature sensor

Both the ESP8266-01 and AVR chip are powered from the same 9v battery. I am going to start looking at optimizing the ESP8266 chips first which are flashed with Arduino code using Arduino IDE.Could some let me know if 9V are the best to power these types of devices or if there is a more preferable battery to use and what the best steps are to optimize my codes, I have read some about sleep modes and I am thinking interrupts to wake the devices up when MQTT command is received or serial data received from the ATMEGA but this is a new area for me and too sure what would be best. TIA.
User avatar
By trackerj
#48858 You can find a possible solution for you in this thread: viewtopic.php?f=13&t=5747&start=40#p34481

I was running a ESP8266 Board as the one presented in the above thread on a standard Li-ion Cell without charging for more than 3 months. Combined with a small Solar panel I have some that have more than a Year already. They are reading at every 10 or 30 or 60 min (depending on specific request) some environmental data and uploading them over WIFI in a remote DB.
User avatar
By lethe
#48860 9V batteries are a poor choice for most applications, since they have rather poor power density.
See https://cds.linear.com/docs/en/design-note/dn63f.pdf

Apart from that, unless you are using sleep modes (preferably deep-sleep) or disable the ESP (CH_PD pulled low), you won't get decent battery life.