Source: http://blog.chinaunix.net/uid-10701701-id-91873.html
2010.1.3
Finally completed. The DV detection series of battery charging pictures, please move:
Http://blog.chinaunix.net/u2/79526/showart_2137867.html
Method:
1) In the ADC part, the hardware RC filtering, the software continuously obtains 5 ADC values for each measurement, removes the highest and lowest values, and finally obtains the average value for the rest.
2) record the maximum voltage value. Once a voltage value is reached, it is recorded in the top variable. if the voltage drops to top-200 for three consecutive times, confirm-DV and the charging is complete.
3) as long as the top node is exceeded, the-DV count is reset.
if( ic->top_voltage > (ic->voltage+0.012) ){ ic->delta_times++; infon(" -dV:",ic->delta_times); _delay_s(2); if(ic->delta_times >3){ ic->i_stage = STOP; /*STOP and update abs voltage*/ lcd_cursor(0,0); lcd_puts("END:"); short x = 1000*ic->voltage; print10(x); pwm_setduty(0); } }
Two mah batteries are charged:
800 mah nicd1
Start Charging 340mah End Time 1.543 --- 1.5a total end time <(Estimated end time, 2c)
Top1896, end 1882, end voltage: 1.38 after 10 mintes 1.371
800 mah nicd2
Start charging at 340 .. 358 mah End Time: 3: 47 1.568 --- 1.3a total end time (Estimated end time:, 600mha ?, 2c) (punch in: About Mha)
Top 2063, end 2048, end voltage: 1.470, after 10 minites: 1.42
Internal Resistance 0.25r, can only be rushed into 500 Mah, in fact, it must be less, 400mah is good, test, rotten battery.
Play listen 8 smart charger-12. finally implement-DV detection (switch)