SoftSerial battery drain
-
I've built an oil tank level sensor, using the US100 ultrasonic sensor. The sensor, when communicating via serial protocol, has the capability to compensate for temperature variations, and is a lot more accurate than the traditional "ping" method.
My problem is the current drain.
When I enable the software serial port, the current drain during sleep goes from a few nA to 2mA, and the 2 AA batteries powering the node, only last for a couple of weeks.
I take measurements only every 3 hours, but I have the battery reporting it's level every 30 minutes, and it is dropping like rock.
Any suggestions for implementing a serial port for a battery powered sensor? (Pro mini @3.3V/8MHz, with NRF24L01+, powered by 2 AA batteries).
-
@kted could you post your sketch?
-
If you do serialport.end() before going to sleep and serialport.begin() after waking up, does that lower the power consumption?
-
OK, problem solved.
First of all, I stopped using SoftSerial, and I am now using the regular serial port.
I can't debug the node any more, but it is working.
And the drain dropped to 1.9 mA.
This is the US100 idle current, so that was also a problem.
So I chose to power the sensor from pins 3 & 4, as VCC and GND, since just using pin 3 and GND kept the drain to 1.9mA
I turn pin 3 to output high and pin4 to output low, wait 5 seconds to let the sensor stabilize, since it gave erratic readings with anything less, take the measurement, and turn pins 3 & 4 to inputs, so there is no drain.
Seems to work so far, after a whole day of taking readings every minute, I am down by 10mV. I intend to take readings every 2 hours in normal operation, so I figure the batteries will last for about a year.
I am writing this from my phone, so I cannot post the source if anyone is interested, but let me know...
-
@mfalkvidd Haven't tried that.
I'll give it a chance just in case.
Suggested Topics
-
Welcome
Announcements • 23 Mar 2014, 08:24 • hek 2 Apr 2014, 14:39 -
A low cost energy meter
My Project • 25 Jan 2024, 01:03 • OldSurferDude 12 Aug 2024, 06:03 -
Nb of possible nodes in a mysensors networks with domoticz
My Project • 13 Jan 2025, 18:10 • GLAB 27 days ago -
Long time test done with soil sensor!
My Project • 7 Jan 2025, 09:13 • Nicklas Starkel 13 Jan 2025, 09:10 -
Door chime
My Project • 5 days ago • Paul Scarbro 2 days ago -
Alexa Fauxmo - Mysensor Bridge Gateway / BLE - Mysensors Bridge Gateway
My Project • 10 Aug 2024, 08:29 • fsgraz 10 Aug 2024, 08:29