I'm trying to make a Battery status tool that's able to measure how much battery is left inside a rechargeable battery. The problem is that I have a nano and I can't exceed 5 volts input into the board, so how would I scale down the output of 42 volt from the battery to acceptable range for nano?
update:
Board: Arduino nan
Battery source: 1866 in a big connection https://wowgoboard.com/products/samsung-lg-sanyo-battery
I'm a computer science major so I have only the basics of electrical engineering.
Code so far:
//load libraries
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
//Define variables
#define I2C_ADDR 0x27 //Define I2C Address where the PCF8574A is
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
//Initialise the LCD
LiquidCrystal_I2C lcd(I2C_ADDR, En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
void setup()
{
//Define the LCD as 16 column by 2 rows
lcd.begin (16,2);
//Switch on the backlight
lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
lcd.setBacklight(HIGH);
//goto first column (column 0) and first line (Line 0)
lcd.setCursor(5,0);
//Print at cursor Location
lcd.print("HAPPY");
//goto first column (column 0) and second line (line 1)
lcd.setCursor(3,1);
lcd.print("Halloween");
}
void loop(){
float analogVal = (analogRead(A1)/1023.0)*5;
lcd.print("V = ");
Serial.println(analogVal);
lcd.setCursor(3,0);
lcd.print(analogVal);
delay(50);
lcd.clear();
}
Google or search this site for resistor voltage divider.
Do you want to measure the final voltage or the voltage of individual cells?
Former see above, latter google
Flying capacitor measurements
groundFungus:
Google or search this site for resistor voltage divider.
MY concern is if the resistors constantly receiving that 42 volts (declining over time), wouldn't it burn out quick?
Grumpy_Mike:
Do you want to measure the final voltage or the voltage of individual cells?
Former see above, latter google
Flying capacitor measurements
the final voltage since it's a bunch of battery cells connected to be one big one.
MY concern is if the resistors constantly receiving that 42 volts (declining over time), wouldn't it burn out quick?
No.
You choose the absolute resistor values so that little current flows so that next to no heat is generated. If you have a total of 100K then the current is only about half a milliampere giving a power of just under 0.02 watts. Normal resistors ( quarter watt ) can take ten times that.
Hi,
Welcome to the forum.
Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html.
Can you please tell us your electronics, programming, Arduino, hardware experience?
What type of batteries are they?
Thanks.. Tom.. 
TomGeorge:
Hi,
Welcome to the forum.
Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html.
Can you please tell us your electronics, programming, Arduino, hardware experience?
What type of batteries are they?
Thanks.. Tom.. 
Oh sorry, I've update the OP with the info!
NeedThatEnergy:
Oh sorry, I've update the OP with the info!
Okay, WOWGO!!!
Batteries calibrated not just in Ah, but in kms!!!!!.
Do you have to sample battery voltage continuously?
Tom..
TomGeorge:
Okay, WOWGO!!!
Batteries calibrated not just in Ah, but in kms!!!!!.
Do you have to sample battery voltage continuously?
Tom..
No, I'm planning on just have the display off and only read the battery (for about 4 seconds) when a button is pressed. Also what do you mean it's measured in kms?