## Re: [Sdcc-user] [OT] - ADC Ideas

 Re: [Sdcc-user] [OT] - ADC Ideas From: Rod Boyce - 2007-03-09 23:22:01 ```All, Firstly a correction this is not my circuit I found this on Google and posted the link as a example of what somebody else did. Now some facts I have used a very similar design to charge a 7.2 volt battery pack with an 8-bit ADC my peek detect charger only had a resolution of 2 counts to detect the peek and switch from fast charge to slow charge it is working very well. It reliably detects using a delta slope detection method and I have decided to accept a 55.4mV over charge and use a count difference of -3 counts to detect the charged condition and switch off the charger. Below is the basic charging algorithm I used it is quite simple: * A battery charger that detects it has been plugged in to the charger power supply. * Obtains the current battery status, reads the current battery voltage and waits for a stable reading. * Begin charging * Takes the current battery voltage every second and decides what to do next. * If the charging battery is above the correct voltage threshold then we begin looking for a voltage peek. * Once the peek has been detected the charger is switched off. I wrote this for a customer so don't ask for the source and this is only for NiCad batteries if you are doing other batteries you will need to research your own charging algorithm. You need to make sure that your ADC has enough resolution to detect the switch off point if you don't think that 10-bits are enough then use 16-bits. But a 10-bit ADC wit ha range of 3.3-volts has a resolution of 3.2mV and a 12V NiCad pack will have a peek detect of 20mV per cell or 200mV divide this by the a resistive divider of 6 gives a peek detect of 33.3mV which will give you a count or 10 or 11 counts this should be more that enough resolution to peek detect a 12Volt NiCad battery. Because you don't have to measure the ADC very often you could even over sample the ADC reading to get a cleaner reading. Markos wrote: > Hi Rod, > interesting design! Thanks. > How do you decide when to finish the charge? By the delta Peak. Have a > look at this (Fig 2): > http://www.maxim-ic.com/appnotes.cfm/appnote_number/680 > It is a typical (fast) charging voltage plot. With the divide by 4 > voltage Vsense, I will be loosing resolution, isn't it? > I mean, suposing that we have 0-5V in Vsense, 10 bit ADC gives 4,8 mV > per bit (adc step). Your resolution is divided by 4, so 4,8 x 4 = 20 mV > per bit + we must add the +- LSB ADC accuracy, thats a 40 mV error.... > So I think I won't be able to detect the 10 mV delta Peak.... > > In the description of your circuit you mention an 84 mV delta peak. Is > that peak the result of Delta * Num of Cells? > > Regards > > > Jean-Paul escribió: > >> Hi, >> >> It looks like you don't think that the end-of-charge voltage is above the >> nominal voltage. >> On the schematics given in the link hereafter, it would be safer to put a >> zener diode across the lower resistor of the divider, to protect the >> controller. >> >> Le Jeudi 8 Mars 2007 21:51, Rod Boyce a écrit : >> >> >>> Markos, >>> >>> It is very simple I have done this many times in my days job, use a >>> resistive divider and work out the error by calibrating the input and >>> fix any error in software. One thing you have to be careful of is that >>> you monitor the temperature as well as many resistors vary their >>> resistance with temperature, but it depends on your application if you >>> are charging lead acid batteries then you may only have to calibrate the >>> circuit between the usable voltage range of interest. >>> >>> Have a look at >>> http://www.angelfire.com/electronic/hayles/charge1fig3.html note the >>> divide by 4 voltage sense connecting to the ADC input of the PIC >>> micro-controller. >>> >>> Regards, >>> Rod >>> >>> Markos wrote: >>> >>> >>>> Hi guys, >>>> maybe this is a little offtopic, but i'm sure you could >>>> help me. I'm implementing a simple battery charger, and I need to >>>> messaure voltages ranges from 0 to 12 V. >>>> ¿Could I use the PIC integrated ADC to messaure above 5 V (provided that >>>> I use the voltage reference pins tied to 0 and 12 V, for example)? Most >>>> external ADC have a 0 to 5V input range.... >>>> How would you guys solve this? Any Ideas? >>>> >>>> Thanks in advance. >>>> >>>> >>>> ------------------------------------------------------------------------- >>>> Take Surveys. Earn Cash. Influence the Future of IT >>>> Join SourceForge.net's Techsay panel and you'll get the chance to share >>>> your opinions on IT & business topics through brief surveys-and earn cash >>>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >>>> _______________________________________________ >>>> Sdcc-user mailing list >>>> Sdcc-user@... >>>> https://lists.sourceforge.net/lists/listinfo/sdcc-user >>>> >>>> >>> ------------------------------------------------------------------------- >>> Take Surveys. Earn Cash. Influence the Future of IT >>> Join SourceForge.net's Techsay panel and you'll get the chance to share >>> your opinions on IT & business topics through brief surveys-and earn cash >>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >>> _______________________________________________ >>> Sdcc-user mailing list >>> Sdcc-user@... >>> https://lists.sourceforge.net/lists/listinfo/sdcc-user >>> >>> >> >> > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Sdcc-user mailing list > Sdcc-user@... > https://lists.sourceforge.net/lists/listinfo/sdcc-user > > ```