💬 Battery Powered Sensors
-
Hello together,
I'm just trying to get the voltage measurement to work. But there is something wrong. I built everything as shown above and uploaded the program to the Arduino pro mini. The only thing I changed is the sensing Pin A0 -> A3
In debug mode I see the following (the supply voltage is constant 3.3V):Battery Voltage: 3.12 V Battery percent: 92 % Battery Voltage: 2.40 V Battery percent: 71 % Battery Voltage: 2.32 V Battery percent: 69 % Battery Voltage: 2.31 V Battery percent: 68 % Battery Voltage: 2.29 V Battery percent: 68 % Battery Voltage: 2.30 V Battery percent: 68 % Battery Voltage: 2.33 V Battery percent: 69 %What could be the reason? That doesn't make sense to me.
@maschler You may be picking up noise which will give an unsteady voltage during the ADC sample.
A 0.1uF electrolytic cap between the analogue pin and ground in parallel with the resistor should stabilise it sufficiently.
I use this arrangement with much higher resistances which are known to increase noise, the capacitor maintains a steady voltage sufficient for the ADC sample period.
One thing worth checking with a multimeter is what the actual voltage is on supply and on the pin. The 1.1v bandgap is sometimes not exactly 1.1v, particularly on clones. Once you know the two values you can modify the ratio and you should get reliable and accurate readings. -
I'm looking for a USB rechargeable battery that can deal with very low power drain, so that I can power an Arduino Nano. Most power packs will not work with very small currents - they turn themselves off. So ideally it should not be too clever..
Does anybody have a favourite?
-
It would be great to add to this arctle that if you want to be battery powered outdoors with temperature below zero - you have to use lithium batteries (FR6 for AA) (yes, batteries, not li-ion accumulators!) (for example ultimate lithium energizer, also could be found lithium batteries from other vendors), because Alkaline (LR6 for AA) will be frozen and loose their capacity heavily. If i remember it is >50% at -10 C and death at -20 C. Same problem for li-ion accumulators - when liquid is frozen - electrons are stucked...
Also would be great to add some link about battery/accumulator types, advanteges and disadvantages, but i have no links in english, easy-to-read and in one place...But i have very great link about battery-powering that really should be added here, but in advanced section:
http://www.gammon.com.au/power -
It would be great to add to this arctle that if you want to be battery powered outdoors with temperature below zero - you have to use lithium batteries (FR6 for AA) (yes, batteries, not li-ion accumulators!) (for example ultimate lithium energizer, also could be found lithium batteries from other vendors), because Alkaline (LR6 for AA) will be frozen and loose their capacity heavily. If i remember it is >50% at -10 C and death at -20 C. Same problem for li-ion accumulators - when liquid is frozen - electrons are stucked...
Also would be great to add some link about battery/accumulator types, advanteges and disadvantages, but i have no links in english, easy-to-read and in one place...But i have very great link about battery-powering that really should be added here, but in advanced section:
http://www.gammon.com.au/power@nekitoss Not sure where you got your information but my Gas Node is on it's second year running on the same two Varta AA alkalines and been down to -20 on more than a few occasions last winter, typically 4 months below -10... Currently the temperature is -3 and headed to -8 overnight, voltage is 2.98, will probably need to replace them in autumn 2019...
-
The tap point could be bypassed with a 0.1 uF capacitor
Can someone explain, how exactly I should connect this capacitor? Should it be between A0 and GND? Would be great to see this capacitor in the graphic.
@benhub That rather depends what you are quoting from, as could not find the original statement.
If it is to do with stabilising voltage from a point on a resistor divider to read it on the analogue pin, the capacitor is from the analogue pin to ground.
It's purpose to dampen oscillations long enough for the ADC to sample the voltage, but usually only where high value resistances are used. -
The quote is from this sample : Measuring and Reporting Battery Level
Use a 1MΩ (R1) and 470KΩ (R2) resistor in series, connected to the positive terminal on the battery and ground and then connected the tap point to the A0 input on the CPU.
The tap point could be bypassed with a 0.1 uF capacitor to keep the noise level low, at this otherwise high impedance point.
-
The quote is from this sample : Measuring and Reporting Battery Level
Use a 1MΩ (R1) and 470KΩ (R2) resistor in series, connected to the positive terminal on the battery and ground and then connected the tap point to the A0 input on the CPU.
The tap point could be bypassed with a 0.1 uF capacitor to keep the noise level low, at this otherwise high impedance point.
-
@skywatch @tonbor @benhub @zboblamont thanks for your input. I have updated the page. I added the text in bold:
The tap point could be bypassed with a 0.1 uF capacitor (connected in parallel with R2) to keep the noise level low
and updated the image. Please let me know if something is still unclear.
-
If you remove the regulator and power with 2xAA batteries, do you only need the TX and RX pins for the FTDI programmer and if so can you use the RX and TX pins on the left side instead of the top FTDI pin connector? Trying to think how to connect the FTDI programmer without connecting to it's VCC and ground when there is no regulator on the pro mini.
-
If you remove the regulator and power with 2xAA batteries, do you only need the TX and RX pins for the FTDI programmer and if so can you use the RX and TX pins on the left side instead of the top FTDI pin connector? Trying to think how to connect the FTDI programmer without connecting to it's VCC and ground when there is no regulator on the pro mini.
-
Is exist something "last wish" in MySensors, when battery go below predefined level the device to send last massage to the GW and go sleep forever.
The idea is the controller/application to have information about the device and to be known this device is dead and need battery change. -
Is exist something "last wish" in MySensors, when battery go below predefined level the device to send last massage to the GW and go sleep forever.
The idea is the controller/application to have information about the device and to be known this device is dead and need battery change. -
@tiana - Of course you can do this in your code.
Just read the battery level and when it gets to the lowest level you decide upon (maybe a little testing needed here) then include the line...
if(battery_level_read < battery_low_level){
send.msg(your last message)
sleep(long time period)
}You need to define all the things above as normal for variables (floats for the battery reading and levels and UL for the long sleep)....
-
Yes but in this case the last massage will be the same like the previous, only the battery level will be below some predefined value. i don't like this. I will think how to solve this.
@tiana I agree with @mfalkvidd , normally it is the Controller which sends out the warning to change battery, certainly Domoticz has this provision incorporated?
Here the batteries are read at approximate 12 hour intervals, and Domoticz is preset to signal a warning below 1.7v, which is days or even weeks from actually dying. If I'm away or forgetful it will cease updating anyway and flag Red on the display.
Once you have established the consumption curve for your batteries until flat, easy enough to set the warning threshhold before the Node dies... -
Yes but in this case the last massage will be the same like the previous, only the battery level will be below some predefined value. i don't like this. I will think how to solve this.
@tiana
Create dummy contact sensor on your node and if node sends last message, it will trigger this contact before "die".
So controller knows, that it was last message and node is off.
But better is allow controller do its job, like wrote all others.
I personally check battery level and "no incoming messages in supposed interval" to send alert to my e-mail ( and SMS ).
In this example tank level sensors sends every 10min, so after 3 messages lost, I will be informed.