View the battery percentage on an LCD screen :(

Hello :slight_smile: ,

For a personal project I am looking to display on a LCD screen connected in I2C (20,2) the percentage of my lithium ion battery. I think I have to use the voltage of my battery, but I really do not see how to do it :confused: if you could help me would be super nice ^^

ps: Sorry for my bad english :frowning:

Yatcha:
Hello :slight_smile: ,

For a personal project I am looking to display on a LCD screen connected in I2C (20,2) the percentage of my lithium ion battery. I think I have to use the voltage of my battery, but I really do not see how to do it :confused: if you could help me would be super nice ^^

ps: Sorry for my bad english :frowning:

For the moment, forget the computer.

How would you go about determining the battery percentage right now? Write it in English in your response. That will give you a starting point to see how to do it.

Paul

I was thinking of determining the percentage of battery with a voltage divider bridge, I had calculate a resistance R1 of 27k Ohm and a resistor R2 of 10k Ohm then I wanted to make a cross product to calculate the percentage with the voltage determine at the output of my voltage divider bridge.

But I'm not sure how to do it.

:confused:

If it were me, I would start with the examples that are likely included with your I2C LCD library.
Print Hello World to the LCD.
Then change it to print some numbers to the LCD.
Then run an analog read tutorial like this one.
Then combine the two to display the results of the analog read to your LCD.
Then put in your voltage divider and read the value from that and print it to the LCD.
Then do the math to turn that in to battery voltage.

But that’s just me.

Yatcha:
I was thinking of determining the percentage of battery with a voltage divider bridge, I had calculate a resistance R1 of 27k Ohm and a resistor R2 of 10k Ohm then I wanted to make a cross product to calculate the percentage with the voltage determine at the output of my voltage divider bridge.

But I'm not sure how to do it.

:confused:

Start with the Arduino example sketch for analog input. It reads the voltage on a potentiometer using an analog input pin and flashes a LED. You can expand on that program to do what you want.

Replace the pot with your voltage divider and you battery. Check the voltage to ground with your DVM, meter. must be less than 5 volts.

Be sure the battery and voltage divider are connected to the Arduino ground.

Paul

Thank you for your answer I try it all tomorrow when I received my new LCD. :slight_smile: