1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

what's best to read ESR with a microchip ADC

Discussion in 'General Electronics Chat' started by be80be, Aug 16, 2015.

  1. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,792
    Likes:
    134
    Location:
    morristown,tn
    I was thinking of making a simple ESR tester using a pic but need ideas of what would be the best way to wire this up to the pic.
     
  2. Mosaic

    Mosaic Well-Known Member

    Joined:
    Jun 3, 2010
    Messages:
    2,568
    Likes:
    128
    Location:
    Caribbean
    This could be a starting point.
     
    • Like Like x 3
  3. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,203
    Likes:
    640
    Location:
    Derbyshire, UK
    If you check out the Bangood component tester kit, which is based on an AVR, it explains how the different modes all work - including ESR. The AVR source code is also available for study.
     
    • Like Like x 2
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. dr pepper

    dr pepper Well-Known Member

    Joined:
    Oct 6, 2008
    Messages:
    4,643
    Likes:
    246
    Location:
    North west UK

    Hi Burt, not heard from you in a while.

    Heres the esr tester I made years ago and have repaired many a thing with:

    http://ludens.cl/Electron/esr/esr.html

    It operates with a meter, but if you do away with the meter and r11 trimpot you could connect it to a uC, fiddle with R8 to get 5v, or 3.3v full scale with the max resistance you want to measure attached.
    The beauty of this circut is the test voltage is less than a diode drop so you can test caps in circuit.
    You could probably do away with U1a too if you got the uC to o/p a squarewave using the pwm block.
    For the transformer I used a 5v standby supply section transformer out of a dead pc power supply.
    There may be other circuits out there better, at the time this was the best I could find.
     
    • Like Like x 2
  6. tomizett

    tomizett Active Member

    Joined:
    Aug 11, 2013
    Messages:
    414
    Likes:
    45
    Location:
    UK
    That's a lovely project there Dr Pepper, and nicely written up too. I'll have to build myself one (in all that spare time I seem to have...).
    Interesting that you felt no need for a "lossless" rectifier, but I suppose if you've plenty of drive from U1b and you can mark your scale to suit, there's no need - and it probably reduces the slew rate demands on the op-amp, too.

    If you where building using a PIC, of course, you could replace the oscillator with an output from the PIC and have your test frequency set by software... if you wanted.
     
    • Like Like x 1
  7. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,203
    Likes:
    640
    Location:
    Derbyshire, UK
    You're best to use a sinewave, and preferably 100KHz (as that's the standard ESR test frequency), rather than a squarewave.
     
    • Like Like x 1
  8. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,203
    Likes:
    640
    Location:
    Derbyshire, UK
    I mentioned the Bangood tester earlier, here's the original documentation it came from:

    http://www.avrtester.tode.cz/upload/ttester_en.pdf

    This should give you some ideas how to do it using a PIC.

    I notice that the Bangood one now has a number of extra facilities added, including an enhanced ESR mode that uses a lower signal voltage to improve in-circuit use.
     
    • Like Like x 1
  9. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,792
    Likes:
    134
    Location:
    morristown,tn
    I was playing with my meter it has a simple scope too but it test caps with a sine wave of 100khs you can output the signal and change it up to 1000 khs it output is weak like .4 volts. And doesn't work well any more for reading caps esr I think I set it worng and messed it up got to keep my glasses on lol.
     
  10. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,026
    Likes:
    951
    Location:
    NJ
    Hi,

    I use a scope because that tells me the whole picture.

    You can see in the diagram there is a place in the waveform where the voltage either shoots up fast or shoots down fast, a straight line up or down, while the rest is a curve or a ramp.

    The place where it shoots up or down vertically is the place where the waveform is showing off the ESR value. The ESR resistance is the difference in voltage divided by the difference in current:
    ESR=dv/di

    and this is very easy to measure with a scope as you just have to estimate the current (based on your drive voltage and series resistor) and measure the vertical line voltage.

    In this diagram one of the caps is very bad as you can see, the ESR is high because the vertical line part of the wave is of high amplitude. The other cap (with the more ramping wave) is good, but you can still see a short vertical line and that shows the ESR for that cap too but it is much shorter because the ESR is much lower.

    So as a simple example, if you see the vertical line go from 0.1v to 0.2v and the drive current is 0.1 amps then the ESR is (0.2-0.1)/0.1=1 ohm.

    The rest of the wave shows the capacitance value.

    The cap on the left shows a vertical part of 0.1 to 0.2v and with a current of 8/600 amps the ESR is around 7.5 ohms which of course is very bad.
    The cap on the right shows a vertical part of about 0.0020 to 0.0025v which is a change of 0.0005v and with a current of 8/600 amps the ESR is about 0.038 ohms. So the good cap is much much better than the old cap in this case.
    Note the cap on the right was really a 1000uf cap.
     

    Attached Files:

    Last edited: Aug 17, 2015
  11. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,203
    Likes:
    640
    Location:
    Derbyshire, UK
    There are a number of problems with that though :D

    1) It's far more expensive.

    2) It's far larger.

    3) Far slower to use.

    4) (and most important) it can only be used on equipment that actually works.

    I do use the scope method occasionally though - mostly when you can't easily get to the bottom of the board :D - and while you can't usually get to the caps with a scope from the top, you can usually get to at least 'some' of the rectifiers.

    But you can't be a service engineer in the 21st century (or later part of the 20th) without an ESR meter.
     
  12. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,026
    Likes:
    951
    Location:
    NJ

    Hi,

    I agree with most of what you said, but you should know that i am coming from a place where i already have the equipment to do the test and also dont really want to have to build or buy an ESR meter. If i did not have the test equipment (which includes a wave generator) then i would think about using an ESR meter either home built or bought. The scope also is my window to the electron world where when i see the waveshape i feel more confident about what is going on than just reading a meter.
    Yeah, the wave generator too, which could be a 555 i guess if you feel like building an oscillator up. The output impedance does not have to be that low if you use a scope.

    I was also really talking about testing it out of circuit, like i did mine, but yeah you have a good idea there where if we could get to the leads we could just look across the cap. For me though i dont trust myself anymore for connecting leads on a power supply or TV that is already running, even if i connect them first. Well maybe, and if i could that would be good because then i wouldnt have to rip any caps out that didnt need it.
    When i did my computer p/s though i took out all the electrolytics because i intended on replacing all of them anyway, and i knew some were bad already because they had leaked.

    BTW, i am not a service engineer i just fix my own stuff when possible :)
    Also BTW, the TV you helped me with in the past just had another problem. The earphone jack suddenly started malfunctioning. What happened was when i plug it in (as usual) nothing changes...the speakers keep right on sounding and the earphone gets nothing. Took it apart and had trouble fixing the jack because it was enclosed in a small metal case with the same jack as the PC input audio jack. What a pain. Resoldered some joints, works again now. Pretty nutty. See if it keeps working now. I am overdue for a new TV anyway and the new ones seem to have all kinds of stuff built in.
     
  13. Tony Stewart

    Tony Stewart Well-Known Member Most Helpful Member

    Joined:
    Aug 31, 2012
    Messages:
    3,151
    Likes:
    281
    Location:
    Richmond Hill , ON Canada near Toronto
    I agree and with 21st century caps, the ESR*C time constant varies over 5 decades

    Generally ESR is also defined by tan delta at 120 Hz or dv/dt in some cases.

    I like to compare Caps by their ESR*C time constant or their discharge time ( when shorted peak current drops to 40% for RC time or drops to 2% of Ipk @ 5RC )
    where V/Ipk is the ESR and 5T gives the 5x cap value * ESR discharged to 1% peak current.

    RC(ms) ESR . . C (uF) Type caps
    0.5ms . . 50 mΩ . 0.01 metal film (MF) caps (best)
    10 ms typ MF
    100ms . . 100Ω 1 uF MF general purpose ( poor)
    1 s . . . . 100mΩ . . 10 uF Alum Electrolytic (best)
    100s . . . 100Ω 100,000uF Double Electric layer Super Caps


    You can get ESR << 1mΩ by going to a bigger more expensive cap or a better quality MF or ceramic cap then bulk up with larger caps.

    Long Life are usually 105'C rated vs lower temp. (85'C)
     
  14. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,203
    Likes:
    640
    Location:
    Derbyshire, UK
    While I would always recommend 105 degree caps (and that's all I stock - where available!) it's not as simple as that. Huge numbers of failing capacitors are 105 degree ones, a cheap crap 105 degree capacitor is no better than a cheap crap 85 degree one.

    So make sure to use good quality capacitors from a good manufacturer, I tend to use Panasonic where I can.
     
  15. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,145
    Likes:
    907
    Location:
    Rochdale UK
    Hi Burt!!!
    Are you still there..... Your thread seems to be going sideways...

    If it can be done with an AVR, I think its more than possible with a PIC... There are many circuits on the net for PIC ESR meters..
     
  16. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,026
    Likes:
    951
    Location:
    NJ
    Hi again,

    I also recommend comparing the test cap to a cap that is known to be good by comparing the waveshapes when driven from the same square wave amplitude and frequency. The difference can be quite extreme. For the example in the diagram i posted, the voltage change due to the ESR alone measured 160 to 1 for the bad cap vs the good cap. Even the peak voltages were measured at 80 to 1, and that is for a good cap that has about half the capacitance so it would be more than that for two 2200uf caps.
    I suppose you could do this in circuit if you use a low enough voltage, but what if there are two caps in parallel...we might read the ESR of the good cap while the other one is bad.

    If i get a chance i'll post some theoretical waveshapes of bad caps of various values with various defects. These are not hard to produce in a simulator...just add some series resistance and plot the voltage across both the series resistance and cap. Of course this should be driven with a voltage source in series with a larger resistor not a current source, because a current source is harder to produce in real life while a voltage source is just about any wave generator or 555 set up for a square wave output.

    LATER:
    I did a quick simulation of 1000uf with 0.030 ohm ESR. Waveform attached. The source is again a plus and minus 4v square wave, and the added series resistance for the test was 600 ohms.
     

    Attached Files:

    Last edited: Aug 18, 2015
  17. dr pepper

    dr pepper Well-Known Member

    Joined:
    Oct 6, 2008
    Messages:
    4,643
    Likes:
    246
    Location:
    North west UK
    I have an oled component tester, bang good style, it does a load of components including cap esr, they are only 8 quid, I wouldnt have made my esr and pic lc meter if I'dve known, still the lc meter is amazingly accurate.
     
  18. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,792
    Likes:
    134
    Location:
    morristown,tn
    I was busy soldering up a board to try out some ideas on. Been reading here found away to get .4 volts and 5 mA to 150 mA some what of a sine wave from the pic's pwm and a small hand full of parts. By looking at some done with a arduino.
     
  19. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,145
    Likes:
    907
    Location:
    Rochdale UK
  20. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,792
    Likes:
    134
    Location:
    morristown,tn
    Hi Ian I read that one its good idea just its a mess cause its not all in one place and you don't no where the code is that makes the whole thing work the op just posted at the beginning his code then there's like five fixing it and know final code. But it looks good. Mine going to be on a pic18f2550
     
  21. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,792
    Likes:
    134
    Location:
    morristown,tn
    This is coming up on Google now so the heat is on to make one with a pic lol
     

Share This Page