Wrote a testing program that only reads the battery on the SD card... i hope to integrate it with a much larger program that reads 2 CO2 sensors, 1 BME280 and controls one solenoid and saves the data for all these on the SD card. It would help if could add the voltage to my data string. This was my testing program:
Code: Select all
const int cellPin= A0;
int value=0;
float Volts=0;
void setup() {
Serial.begin(9600);
}
void loop() {
value=analogRead(cellPin);
Volts=(value*5.0)/1023.0;
Serial.print( "Value: " );
Serial.print( value );
Serial.print( " Volts: " );
Serial.println( Volts );
delay( 500 );
}
I soldered a wire to the mounting tabs for the battery in the datalogger shield and ran it to A0 pin. My output was not what i expected with values fluctuating from 2.99 V to 0.36V and back up again see output.
am I missing something .... i would suspect a ground but cant figure out how to add it. Also i suspect im draining the battery.
- output file.png (17.45 KiB) Viewed 134 times