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). -
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). -
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... -
If you do serialport.end() before going to sleep and serialport.begin() after waking up, does that lower the power consumption?
@mfalkvidd Haven't tried that.
I'll give it a chance just in case.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login