I want to be able to read the voltage of both the battery pack and the 5V being delivered to the Raspberry PI.
In Nybble.ino at about line 432 is the following code. Nybble reads Analogue port A0 (BATT) and if it is less than 3V, Nybble will meow.
void loop() {
float voltage = analogRead(BATT);
if (voltage <
#ifdef NyBoard_V0_1
650
#else
300
#endif
) { //give the cat a break when voltage drops after sprint
//adjust the thresholds according to your batteries' voltage
//if set too high, Nybble will keep crying.
//If too low, Nybble may faint due to temporary voltage drop
PTL(voltage);//relative voltage
meow();
}
In my Nybble, with a fresh set of batteries (8.1V) analogRead(BATT) returns about 5.6V. Is this the potentiometer setting value or is it the 5V VCC rail into the Arduino and Raspberry PI?
Can I get A0 to read the actual Battery voltage or is it limited to the arduino VCC voltage. In an other way I'm asking what is the voltage divider into A0?. If there is no divider and I am limited to VCC, should I use Analogue port A1 with a suitable voltage divider and connect this to the A1 pinout on Nybble.
Best regards
D L
Hi @Rongzhong Li,
any plans to add the voltage status command into OpenCat.ino?
Will this also work with the new Bittle Battery?