[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 574: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 630: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 494: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5348: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3937)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5348: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3937)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5348: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3937)
Plum Geek Forum • Trying to read battery level
Page 1 of 1

Trying to read battery level

Posted: Sat May 21, 2016 8:37 pm
by AngoLito

Re: Trying to read battery level

Posted: Sat May 28, 2016 3:27 pm
by Kevin
The BattVolts line was intended to provide a warning before the battery reach it's cut off around 3.2 volts (it can go lower, but that's when the volt monitor switch cuts out) and not so much of a running voltage monitor - but it certainly could be used for that. I can't remember why R55 was never populated. With all the time I spent going over every detail of the Ringo hardware I'm can't remember the reasoning for this.

Because the Vcc to the processor is 3.5v, this battery voltage is measured in reference to the 3.5. If it's above, it's going to read high numbers. The R55 pad was added to bring this down as you suggest, but I see in all the schematics that it is listed as non-populated. If a resistor is added for R55 to create a divider off the 27k R50, it would be readable. Any divider that would bring 4.2 volts down to below 3.5 volts and you would be able to have a useful reading.

I'm glad you pointed this out. Don't know how we missed this all this time.

Thanks,
-Kevin

Re: Trying to read battery level

Posted: Mon May 30, 2016 8:39 pm
by AngoLito
Hi Kevin!

Thank you very much for your answer and info; i've add a 47KOhm on R55 and it works. But first code shared here was wrong... :o
I had a big mistake attempting to set MotorCapBattVolts to 1 (line 2 of code); MotorCapsBattVolts defines the pin number of ADC!! (0 for Arduino A0) :oops:

Source_Select is line to control U8 digital switch; yes...looking schematics Is easy to understand... ;)

Now, I can measure Batt voltage; simple battery indicator is easy to implement. When I have some more time to test battery levels, I will share code


Please Kevin, let me tell you something: scanning the electronic scheme I was pleasantly surprised how tremendously well thought are electronic design.
During KS campaign I did not think it was so well made.

Congratulations

Best regards...

Re: Trying to read battery level

Posted: Sat Jun 04, 2016 8:02 pm
by AngoLito

Trying to read battery level

Posted: Mon Sep 24, 2018 3:38 pm
by KSenijawib
Hi,
which are the units that apeears on the .txt file in the channel of the battery? I mean, the column that represents the battery level channel 6 in my case is a number around 580 or 570 that represents the battery level of charge, isnt? How can i translate this number into voltage units?
Thanks

Re: Trying to read battery level

Posted: Tue Oct 02, 2018 9:19 pm
by Kevin
I can't remember the units of the ADC, it should be whatever is standard for Arduino. The processor runs on 3.5 volts, so readings will be referenced from there. Going from memory here, I think max range of that ADC is 1024 at 3.5 volts. The main reason for that battery read line is to tell when battery voltage begins to drop below 3.5 volts. Normally the battery is 3.7 to 4.2, which is above the readable range.

On the original Ringo1 robot (the one with the ribbon cable to the programmer) you need to set Source_Select to HIGH, otherwise it is going to read the voltage of the motor capacitors (which after we actually made the robots we realized we didn't need because it is generally stable). This Source_Select is the same line that selects between the ambient light sensors and the bottom light sensors - so just set the robot to read the ambient sensors, then you can read the ADC on this channel (ADC0) to read the battery voltage.

On the Ringo2 robot, we got rid of the source select for the battery/motor. It now always reads the battery, so there's no need to care what the Source_Select is set to, since we don't need the Motor_Cap reading for anything.

Let me know if that helps.

Thanks,
-Kevin