Output DataloggerBattery Voltage to SD card

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
mromero
 
Posts: 94
Joined: Fri Mar 18, 2016 12:10 pm

Output DataloggerBattery Voltage to SD card

Post by mromero »

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
output file.png (17.45 KiB) Viewed 134 times

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: Output DataloggerBattery Voltage to SD card

Post by adafruit_support_mike »

Post a photo showing your hardware and connections and we'll take a look. 800x600 images usually work best.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”