# Battery charger not working properly

Discussion in 'Homework Help' started by Cristi Someșan, Apr 28, 2018.

1. ### Cristi Someșan Thread Starter New Member

Apr 17, 2018
2
0
Hello!

I have a school project in which i have to charge a NiMh battery. I look on the internet and found a nice and simple project on this site ( link: https://l.facebook.com/l.php?u=http...NLn9J5SIZhg2UZwJX7AG16cc0FEEq-7E8rYlqLVIN5SYQ ).

I did everything exactly as said in the project mentioned above but it is not working properly. I measured with a multimeter the voltages that I read with the arduino uno on the 2 analogs :A0 and A1 ( on the sides of the 10ohm resistance) and they are accurate (the arduino shows the correct voltages) . They are most of the time identical which is not good at all. When the battery voltage is finally starting to rise, the arduino shows way too much voltage, around 2.2 V when the battery voltage is actually around 1.57V and the charging stops because the maximum voltage exceeded.
I tried to see what happens if I don't put a cutoff batery voltage : the battery voltage rises to around 1.6V and the charging current is around 90mA. But the arduino says the battery voltage is around 2.6V and the current is around 147 mA. But the values on the 2 probes are still corect , they are accurate. I put a photo with the values returned when I eliminate the cutoff voltage.

What can I do to fix it?

Thanks!

File size:
86.3 KB
Views:
9
2. ### AlbertHall AAC Fanatic!

Jun 4, 2014
7,946
1,958
The arduino is powered from Vin with 5V. That pin feeds power to the arduino through a 5V regulator. That means that the arduino supply will be significantly less than 5V but the code for converting ADC readings to voltage assumes it is 5v.

Connect the 5V supply to the Arduino 5V pin.

3. ### Cristi Someșan Thread Starter New Member

Apr 17, 2018
2
0
So I no longer power the ardunio through Vin ,but thpugh the 5V pin. The same thing happens unfortunately. I attached a photo with the reading from the serial. I tried to read the voltage from where the + of the battery is connected ( the same where the + from the 5V supply is) and the reading is wrong,it shows around 6V , but when I measure with a multimter, it's actually 5V, which is correct.

File size:
91.1 KB
Views:
6