Battery percentage gone wild [SOLVED]
-
I always think about this battery percentage. Where it gives its limits.
Then I see some project - "NodeManager"
GitHub
And there was some functions :// [11] the expected vcc when the batter is fully discharged, used to calculate the percentage (default: 2.7) void setBatteryMin(float value); // [12] the expected vcc when the batter is fully charged, used to calculate the percentage (default: 3.3)```@kimot If there were a problem with the sketch it would equally apply when the ftdi is connected with the sensors connected.
I believe that is why @sundberg84 suggested measuring the voltage at A0... ;) -
@zboblamont
The voltage at A0 is at steady 0,8V with batteries.
Which should give sensor value 744.
The voltage of the two batteries is 2,88V.But as I wrote earlier it must be so that my multimeters internal resistance is not high enough. And is messing up the divider when measuring.
The calculated voltage at A0 should be 0,89V
Which should give sensorValue 828My sensors right now is reporting 100% then 253% and now 236%.
-
Ok. So connecting the node to serial interface, but without power from it. And power from same batteries.
The calculations is correct and multimeter is not measuring correct.This is debug out put:
First loop:Sensor value: 1023 Battery Voltage: 3.30 V Battery percent: 100 %Second and the following loops:
Sensor value: 877 Battery Voltage: 2.83 V Battery percent: 21 %So back to square one. When serial output is connected it works perfect.
When disconnected it starts reporting all messed up readings! -
Do you have an ldo voltage regulator? Maybe you could try 3 batteries for 4.5v output and use a linear regulator to have 3.3v or use 2 fully charged alkaline and power node without booster, as it could be the booster a bit too noisy.
My personal favorite solution is using a single LiFePo4 AA battery and vcc library, no buck/booster and voltage divider, everything much simpler -
I meant if you have one regulator to try, I think there may be something related to the booster. Try also a bigger capacitor on the booster output, and a big ceramic one if you have on the vcc of arduino
-
I meant if you have one regulator to try, I think there may be something related to the booster. Try also a bigger capacitor on the booster output, and a big ceramic one if you have on the vcc of arduino
@gohan Something doesn't make sense here, if the onboard voltage regulator is removed and battery power is connected to Vcc via a booster it should provide a constant supply.
If the divider to A0 is fed with the raw battery supply, it should be relatively constant although decaying over time.
Something is wrong with the circuit I suspect.... -
@gohan Something doesn't make sense here, if the onboard voltage regulator is removed and battery power is connected to Vcc via a booster it should provide a constant supply.
If the divider to A0 is fed with the raw battery supply, it should be relatively constant although decaying over time.
Something is wrong with the circuit I suspect....@zboblamont Yes. It looks like bad wiring. I am testing right now. And it looks like my Arduino clone has some bad markings of the pins.... I am documenting and posting the solution (if it is what I am suspecting right now) later today. Right now I am doing test cycles while doing some paid work.. :-)
-
Ok. So my strange error was due to connecting GND to the wrong PIN.
I was connecting GND next to VCC on the side of the Pro Mini.
Accordning to pics on the MySensors homepage and to the marking of my Arduino that pin is GND.But when connecting the FTDI with jumper cables I notice that PIN was marked with CTS.
So instead I connected GND to the pin one step out.
This PIN is also marked GND on my Arduino, and on the FTDI. But marked BLK on the pictures on MySensors home page.So it seems that both these pins are GND on my board, because everything else was working fine except the reference for analogue pins.
So topic solved. Thanks for all input. And specally @gohan that made me use the jumper cables and therfore found the error.