Hi all !
Hope everyone is safe and well
Since the past weekend, the project is live.
First observations
In this end, data collecting, I'm having troubles, in the sense that, a couple of AAA batteries only lasts almost a day.
The code has some battery saving features that I'm going to describe below.
Battery savings
For battery saving, I'm using Arduino's Low Power library.
For the maximum savings, I use the deepSleep function to sleep the Arduino . This puts the MCU in sleep mode, but has the slowest waking time. Time here is not a factor, so, no worries
Still, does was not working, because the batteries would be dead in half a day.
Searching through forums, I've added a couple of function and options to see if I could lower the power usage a bit more while sleeping.
First, I've put the USB into standby mode, using
USBDevice.detach();
This will put the USB port into standby. I'm not using it, so, let's not waste power on it.
This has decreased the power consumption.
Next, another trick, is to put all the input pins into INPUT_PULLUP. This is to not be awake by external interrupts. I was afraid that this could mess up with the sensors readings, but no. Everything was measured.
This decreased the power consumption, but still not enough.
I maybe know what's consuming that much power - it's the sensors. The TDS sensor has a LED, and it's always on. The following picture shows that:
I'm going to assume that the AM2302 is also on and consuming power. I thought that, when sleeping, the VCC pin was also turned off, but apparently it is not.
I searched on how to turn those pins on, but there's not a direct approach.
Reading though the Arduino Low Power Guide, there's a way to turn the sensors off - using mosfets to cut the power.
I'm going to try a solution:
Connect the sensors in a subcircuit, and using a mosfet as a switch. Will let you know how that works.
References
https://forum.arduino.cc/t/how-can-i-achieve-the-104-a-power-consumption/619331/15
https://docs.arduino.cc/learn/electronics/low-power
https://tigoe.github.io/DataloggingExamples/mkr-datalogging.html