๐ฌ Battery Powered Sensors
-
@gohan between positive end of one of the two aa batteries and where it enters circuit. If I start off by having battery connected, the release it slowly with the multimeter attached and without breaking circuit I get my 6ua. However after the timer runs out and the radio comes back on I'm stuck at 1ma. The radio at that point doesn't want to work and it doesn't return to 6ua
@FatBeard the burden voltage of your multimeter might be too large, which would reduce the voltage to the atmega below its working level.
You're measuring current, so the meter must be in series with the power supply. It's not clear to me how you can remove the multimeter without breaking power to the atmega. -
Hi to all!
I have a issue reading of voltage on pin A0 of an ATMEGA 328 barebone mounted on a breadboard.This is the image

The purple pin goes to A0.
The rail on the bottom coming direct from batteries, with a multimeter I read that they have 2.73V. On monitor serial, % of battery is about 1-2% and voltage reading is about... 0.004 and floating about 0.004 - 0.010 ....
Can I imagine an issue with pin A0 itself? I have about 10 Atmega spares :) and I will test another one... but thinking about this issue.
I did try also removing the 0.1uF cap, without any change.
The reading function is the same of this sketch.
Thank you very much!
-
Hi guys, if your Arduino is equipped with an ATMega 328P then it could go down to 1.8V at lower frequencies like 1MHz (8MHz internal RC oscillator / 8 by default).
Or you can use the internal low power 128KHz RC osc eventually ...
It means you could power both the Arduino and the radio directly from the battery string and consume even less current.
Just wondering if anyone tried these cases so far? -
I am a newbie and have some thoughts about the battery level that I did not find in this forum.
The 8MHz 3.3V Arduino Pro Mini can handle down to roughly 2.8V.
If I have understood the calculations in the sketch correctly then the analog value of A0 is 1023 at 3.44V and 0 at 0V.
This means that at 2.8V the value is about 830 = 83% and under this, the Arduino stops working. Is this right?
If this is correct, I wonder if someone has changed the calculation in the sketch so that the battery percentage becomes 0 at 2.8V?
This would mean that the battery percentage becomes a more real value on the battery level. -
void batM() //The battery calculations { delay(500); // Battery monitoring reading int sensorValue = analogRead(BATTERY_SENSE_PIN); delay(500); // Calculate the battery in % float Vbat = sensorValue * VBAT_PER_BITS; send(msgVBat.set(Vbat, 3)); int batteryPcnt = static_cast<int>(((Vbat - VMIN) / (VMAX - VMIN))*100.); Serial.print("Battery percent: "); Serial.print(batteryPcnt); Serial.println(" %"); // Add it to array so we get an average of 3 (3x20min) batArray[batLoop] = batteryPcnt; if (batLoop > 2) { batteryPcnt = (batArray[0] + batArray[1] + batArray[2] + batArray[3]); batteryPcnt = batteryPcnt / 3; if (batteryPcnt > 100) { batteryPcnt = 100; } Serial.print("Battery Average (Send): "); Serial.print(batteryPcnt); Serial.println(" %"); sendBatteryLevel(batteryPcnt); batLoop = 0; } else { batLoop++; } }This is the function I use, I just define the VMAX and VMIN in the beginning of sketch. The function calculates an average of 3 measurements before sending the value
-
void batM() //The battery calculations { delay(500); // Battery monitoring reading int sensorValue = analogRead(BATTERY_SENSE_PIN); delay(500); // Calculate the battery in % float Vbat = sensorValue * VBAT_PER_BITS; send(msgVBat.set(Vbat, 3)); int batteryPcnt = static_cast<int>(((Vbat - VMIN) / (VMAX - VMIN))*100.); Serial.print("Battery percent: "); Serial.print(batteryPcnt); Serial.println(" %"); // Add it to array so we get an average of 3 (3x20min) batArray[batLoop] = batteryPcnt; if (batLoop > 2) { batteryPcnt = (batArray[0] + batArray[1] + batArray[2] + batArray[3]); batteryPcnt = batteryPcnt / 3; if (batteryPcnt > 100) { batteryPcnt = 100; } Serial.print("Battery Average (Send): "); Serial.print(batteryPcnt); Serial.println(" %"); sendBatteryLevel(batteryPcnt); batLoop = 0; } else { batLoop++; } }This is the function I use, I just define the VMAX and VMIN in the beginning of sketch. The function calculates an average of 3 measurements before sending the value
@gohan said in ๐ฌ Battery Powered Sensors:
Hello, i didn't know why you add 4 measures (batarray) and you divide by 3 the sum . -
@gohan said in ๐ฌ Battery Powered Sensors:
Hello, i didn't know why you add 4 measures (batarray) and you divide by 3 the sum . -
I am a newbie and have some thoughts about the battery level that I did not find in this forum.
The 8MHz 3.3V Arduino Pro Mini can handle down to roughly 2.8V.
If I have understood the calculations in the sketch correctly then the analog value of A0 is 1023 at 3.44V and 0 at 0V.
This means that at 2.8V the value is about 830 = 83% and under this, the Arduino stops working. Is this right?
If this is correct, I wonder if someone has changed the calculation in the sketch so that the battery percentage becomes 0 at 2.8V?
This would mean that the battery percentage becomes a more real value on the battery level.@magnusf It is important to know that the battery voltage is non linear in respect to how much juice left. Just search for "battery discharge curve" to see how much it depends on battery type, current and temperature. So calculating the percentage is actually meaningless unless You exactly know how much current your board sucks at what temperature and what type of battery You use.
-
To answer my own question: yes, it seems to work. Searched around and read a while, found this:
https://forum.mysensors.org/topic/6511/hc-sr501-3-3v-randomly-sends-tripped-when-radio-is-on/22
Best addition imho ,no need for step up / down. :D -
Hi,
I'm trying to build a Soil Moisture sensor with NiMh battery and solar panel as in another post. I use a stepup converter to 3.3V connected on the VCC of a pro-mini 3.3V. The sensor seems working when connected to FTDI USB device, ut once I remove the power from FTDI, no more communication. I measured the voltage on the output of the stepup which indicates 3.26V. Is it norml or a defective step-up ? And should I remove the regulator of the pro-mini as suggested above or not ? (in article above, it states the regulator is not necessary, but it doesn't say if pro-mini would still work if regulator remains there).
Thanks for your support -
Hi,
I'm trying to build a Soil Moisture sensor with NiMh battery and solar panel as in another post. I use a stepup converter to 3.3V connected on the VCC of a pro-mini 3.3V. The sensor seems working when connected to FTDI USB device, ut once I remove the power from FTDI, no more communication. I measured the voltage on the output of the stepup which indicates 3.26V. Is it norml or a defective step-up ? And should I remove the regulator of the pro-mini as suggested above or not ? (in article above, it states the regulator is not necessary, but it doesn't say if pro-mini would still work if regulator remains there).
Thanks for your support@ricorico94 what does the debug output from the node and the gateway say?
What regulator are you using? Most regulators produce power that is too noisy to be usable by the nrf24 radio (you didn't state which radio you're using so I'm just guessing here, based on the most common problems). What capacitor(s) are you using after the regulator?
See https://forum.mysensors.org/topic/666/debug-faq-and-how-ask-for-help/ for the most common problems and how to diagnose them.
Also see https://www.mysensors.org/build/battery for more information about battery powered sensors.