ESR Meter Build - Page 1
Forum section: electronics / projects

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 13, 2014, 01:50:09 am
content: Plan is to build a fairly simple ESR meter with reasonable accuracy.I will base it on Jay_Diddy_B's elegantly simple 5 transistor design:https://www.eevblog.com/forum/projects/5-transistor-esr-meter-design/But slightly modified as I want to use it with a small uC ADC and a display.There might be a simpler way, but adding a dual opamp should do the job to give a voltage output with close to full ADC scale:Output should be something like this:I like the idea of having much higher resolution in the low ohms part of the range. It will of course make it slightly more challenging to translate the ADC values into milliohms, but I can probably get away with a 10-20 point LUT and linear interpolation while maintaining reasonable accuracy.

author: BravoV
author_rank: Super Contributor
timestamp: January 13, 2014, 02:01:17 am
content: Why not this second Jay_Diddy_B's design ? ->ESR Meter Adapter Design and Construction?It has a very linear output that will ease the ADC process there, only need minor adjustment on gain & offset. Coupled with mcu as your plan, it will be handy as the source for the main pulse and for the switchers. At the end of that thread he posted another revision that you can tweak the timing at among the switchers that the result will be no longer sensitive to the inductance and averages out the capacitive part to zero, just pure ESR, cmiiw.Again, I'm no expert on this, just what I've observed all this time on both Jay_Diddy_B's ESR circuits.

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 13, 2014, 02:18:10 am
content: I hope to build the whole thing based on parts I already have, found a couple of these small 8bit PIC16F684, it's a nice little uC.It should do the job. It's got 10 bit ADCs, PWM support and internal oscillator that will run it at up to 8MHz, 2048 word flash and 128 bytes RAM.Datasheet for reference:http://ww1.microchip.com/downloads/en/DeviceDoc/41202C.pdfAnd a standard 1602 display:Transistors will be BC327 and BC337, for opamp I think a TLC2272 will do.

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 13, 2014, 02:27:11 am
content: Quote from: BravoV on January 13, 2014, 02:01:17 amI guess mainly 2 reasons, I'd like to use a cheap/small PIC with only 10bit ADC, that would not give a very good resolution on the low ohms part of the range with the new design. But I could of course switch to the larger and more powerful PIC24H with 12bit ADCs, just seems like a bit overkill. 2nd and probably right now most important, I don't have all the parts for the new and improved design. I want to build, not wait for partsI like the simplicity and the exponential increase in resolution at the low range.Actually I might have a go at both designsStarting with the transistor one this weekend.Cheers

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: January 13, 2014, 02:39:16 am
content: Jaxbird,What you are planning should work. Be carefully with the selection of the diodes D3 & D4 in the meter circuit.You can do a piecewise linear correction in the PIC to linearize the output.Good luck !!Jay_Diddy_B

author: dannyf
author_rank: Super Contributor
timestamp: January 13, 2014, 03:19:34 am
content: It should work.Some suggestions:1) generation of the excitation signal: you could use the pwm generator in the mcu to do that.2) excitation frequency: I would think hard about using 100khz signal, especially if you are primarily measuring large (1100uf+ capacitors) - the approach here is essentially measuring the impedance of the dut. Large capacitors tend to have high ESL and at 100khz, it could overwhelm your ESR. I think 10khz is a good compromise.3) simplicity: in the first schematic, you have a discrete amplifier, taking a differential signal from the bridge. That differential signal is further amplified by the opamp (against, configured differentially). I would do away with the discrete amplifier.4) simplicity again: there are some mcus (atmega32 for example) that have differential adc with high gains. They are superbly suited for this application.5) mcu choices: In a different thread, I started something like yours (however, totally different approach), using a 16f684. I eventually ended up with an avr, for its speed, and adc. You may look at that thread and see if it could be of help to you.6) nulling offset: I think you will find extremely useful if the meter can null offset, generated by either the oscillator or the amplifiers along the way. If the excitation signal is generated by the pwm, you can turn it off to null the offset; if externally generated, you can short the excitation signal (split R1 and insert a pin from the mcu in between the two resistors now consisting of R1) to measure the offset when the input signal is 0. Offset, in situations with high gain + discrete parts, will drift and a mcu-based nulling at the beginning of each measurement would be very handy.Hope it helps.

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 13, 2014, 03:21:06 am
content: Quote from: Jay_Diddy_B on January 13, 2014, 02:39:16 amThanksI have a good selection of diodes to try out.I'll keep the thread updated with progress.

author: dannyf
author_rank: Super Contributor
timestamp: January 13, 2014, 03:29:59 am
content: Quotenot at all. I implemented a PIC24-based lcr meter using minimum external parts. The pic generates a 10khz sine output, driving into the dut and two adc modules perform simultaneous sampling, with the result fitting into a LMS algorithm. 1% accuracy down to about 100mohm. The chip I used is a dsPIC33 with four s/h channels. If you don't mind math, one s/h channel is sufficient but two s/h channels make life easier.The newer commercial meters tend to use DFT (=LMS under certain conditions). You can google a msp430-based lcr meter by a russian guy - he used DFT to get similar results.

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 13, 2014, 04:14:03 am
content: Quote from: dannyf on January 13, 2014, 03:19:34 amHi dannyf, thanks for your inputs and suggestionsI have been following your thread with experiments on a different approach.Is is my plan to use the PIC to generate the 100kHz signal, so it should be possible to experiment with different frequencies, even selecting frequency.I plan to use the PIC like this:The 3 ICSP pins (MCLR, PGC & PGD) can double for IO, e.g. extra buttons if needed.It's been a long time since I last used a PIC16F684, so I am doing a quick breadboard (without the actual ESR circuit portion), just to avoid any surprises on what pins can be used in what situationsI don't expect ADC sample speed to be an issue in this case, it only needs to do a loop of sampling (probably lots of averages) translate (using interpolation) and then update the display 2-3 times per second.

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 13, 2014, 05:08:53 am
content: Quote from: dannyf on January 13, 2014, 03:29:59 amThat does sound like a very interesting design, have you published the project anywhere?I believe I have a couple of dsPIC33 in DIP28 somewhere

author: dannyf
author_rank: Super Contributor
timestamp: January 13, 2014, 12:15:59 pm
content: It isn't published - just for self use.the basic structure is simple: a v-I approach where the current is converted to voltage. Two samples each time. Hardware -wise, you need only an opamp.the complications come in the software: from the v and I samples, you have to reconstruct their amplitude and phase differential. While dft routines are abundant, doing it fast, accurately and in integer on a mcu is tricky.in the end, I went with the IEEE approach for a two-parameter sine quantification.having gone through it, I found that you need a fast mcu with two high speed channels, and inboard opamp, and preferably dacs. That points to some msp430 or if money permits, some free scale mcus.

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 13, 2014, 07:07:56 pm
content: Quote from: dannyf on January 13, 2014, 12:15:59 pmIt does sound interesting, but I'm afraid such a design would be slightly above my level of ambition for this projectThanks for sharing, I find the idea of having a mcu do the majority of the work interesting. Maybe one of the new PIC32MZ (330DMIPS and 28Msps ADC)

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 13, 2014, 07:36:40 pm
content: Progress update, I have a PCB layout:I'm using 38mm between the terminals so I can use this DMM adapter for easy testing:And I've made a board:

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 14, 2014, 05:42:58 am
content: Board assembled:After a bit of coding and adjusting resistor values it's fully functional. For D3 and D4 I just use standard 1n4148, seems to work fine. I soldered in the same diodes for protection, but I should probably change them to some higher rated ones, maybe 1n400x.I did have to do a bit of fine tuning on the ratio between R3 and R4 to make sure ESR+ is always above ESR- for the differential amplifier and some slight adjustments on the amplification in the 2nd amplifier for full scale.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: January 14, 2014, 01:10:28 pm
content: Jaxbird,Looks Great !!! Nice work.It looks like the board was cut on a milling machine. What machine did you use?Where did you get the banana jacks from?Thank you for sharing.Jay_Diddy_B

author: dannyf
author_rank: Super Contributor
timestamp: January 14, 2014, 02:00:10 pm
content: Nice work.Would suggest that you use resistors to calibrate - for this approach, a resistor is equivalent to infinite capacitance + ESR. Pick something big (11 - 47ohm for example), and then something small (0.22 - 0.47ohm, or lower if you have one) and see what you have.

author: kripton2035
author_rank: Super Contributor
timestamp: January 14, 2014, 02:46:48 pm
content: nice and very quick design ! hope I could do as fast as you do ...how about the source code ? will it be available ?how about the precision : you seems to get the milliohm, do you have any calibration method, any comparaison with a known resistor ?thanks again for sharing your design with us.

author: fcb
author_rank: Super Contributor
timestamp: January 14, 2014, 02:53:38 pm
content: Where did you source that grey block with the component leg connections? - looks interesting.Great project BTW.

author: dannyf
author_rank: Super Contributor
timestamp: January 14, 2014, 06:38:56 pm
content: After calibrated it with resistors, you can try a capacitor: take a ESR reading with just the capacitor, and then another with the capacitor + serial resistor. The differential between the two ESR readings should be your serial resistor. Otherwise, your meter isn'g working right.

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 14, 2014, 08:35:21 pm
content: Quote from: Jay_Diddy_B on January 14, 2014, 01:10:28 pmThanksIt worked out even better than what I'd hoped forYeah, I do have a small machine I built some time ago, mostly use it for wood, acrylic and circuit boards. It's not as precise and nice as the Protomat you showed in the other thread, but I get usable results with a bit care and attention to to it's limitations. Sure beats etching, manual drilling and cuttingFor software I use Eagle with a G-CODE plugin (not ideal, but it works) and then and old PC running Linux CNC for the control.The banana jacks are just some re-purposed cheap binding posts (I seem to remember they were $0.25 each) not the best quality, but for small projects they are great:With the screw top removed, they are deep enough to accept shrouded DMM cables and attachments:Just cut the excess and tightened:

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 14, 2014, 08:51:43 pm
content: Quote from: dannyf on January 14, 2014, 02:00:10 pmThanks dannyfYeah, I used a number of low value resistors for calibration. I built up two look up tables. From memory, I think the values were 0R, 50m, 100m, 200m, 500m, 1R, 2R, 5R, 10R, 20R, 30R and finally 47R. Second table contains the averaged ADC value measured with each resistor combination tightly clamped to the terminals as close to the pcb as possible.Based on the two tables I do a linear interpolation to translate the measured ADC value into milliohms.Some of the resistors and the clamps I used:

author: dannyf
author_rank: Super Contributor
timestamp: January 14, 2014, 09:43:13 pm
content: A real test, after the meter is calibrated, would be if it can measure serial resistance (a cap + resistor) correctly.

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 14, 2014, 10:34:25 pm
content: One of the tests I have done was to find some fresh capacitors in my collection with a usable datasheet, so far I have found these 220uF Panasonic, got about 50 of these:And from the datasheet they are specified as having an impedance of 117 milliohms @ 100kHz (20C):Measuring two of them gave me ~114 milliohms for the first one and ~117 for the 2nd one (readings do fluctuate a few milliohms e.g. between 116 and 119 for the 2nd one)I can't verify whether this is actually correct or not, but it does look encouraging, Much better than what I need or even hoped for.The meter is not long term stable as I didn't add a reference, just the lm317 regulator. It will drift slightly up and down, but the measurements appear to be repeatable as long as they are done within a minute or so from shorting the terminals and using the zero button.

author: dannyf
author_rank: Super Contributor
timestamp: January 14, 2014, 11:07:39 pm
content: It is good, but not as conclusive as the Cap + Resistor test.If you cannot do the Cap + Resistor test, you can test the two capacitors separately, and then test them in serial and in parallel. The ESR readings should be the serial and (close to) the parallel of the two ESR readings - the 2nd reading is actually dependent on the capacitance.

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 14, 2014, 11:38:00 pm
content: Quote from: kripton2035 on January 14, 2014, 02:46:48 pmThanks kripton2035..Most of the design credit goes to Jay_Diddy_B, I just made a digital version of his design.I'll post the proper details with hex/source, but there are a few things I want to experiment with first, e.g. switching frequency, 10kHz and 100kHz. Also if anyone is interested in building one it would probably be best to have some built in calibration method with the values stored in eeprom instead of hardcoded.But in general anyone interested in building one would probably be better off building Jay_Diddy_B's latest and improved design. Or at least have a look at that thread first to get some understanding of the limitations of this simple design.

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 15, 2014, 12:12:18 am
content: Quote from: dannyf on January 14, 2014, 09:43:13 pmQuoteIt is a good pointI will try a few tests with various values and see what results I get.I think for the calibration it would be great to have a known, reasonably low ESR, capacitor and use it in series with the various resistor values.

author: dannyf
author_rank: Super Contributor
timestamp: January 15, 2014, 12:50:54 am
content: QuoteNot necessary. The beauty of the Cap + Resistor test is that it only requires the resistor value to be known.

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 15, 2014, 08:11:27 pm
content: Quote from: dannyf on January 15, 2014, 12:50:54 amTrue, but in this case it will have to be at least lower ESR/impedance than the resistance of probe cables/attachment as it's not possible to get a reading on anything below the lowest calibration value because of the method used for translation.Anyway, I did a couple of non scientific tests (not really conclusive, need more tests to confirm if a capacitor in series must be used for best calibration)1st test: using 2 capacitors, 470uF, #1 measures 144 milliohms and #2 @134 milliohms. In series I measured 276 milliohms and in parallel 69 milliohms.2nd test: I attached a large 12uF/250V capacitor and then zeroed out the meter. After that I measured with a couple of 100 milliohm resistors in series, first 1 then 2.Couple of pictures (meter was zeroed with the large cap attached)

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 16, 2014, 01:57:41 am
content: Time to get the little meter into an enclosure. Designed a little enclosure for 3D printing.Here being printed (takes more than an hour to print):

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 16, 2014, 02:24:52 am
content: While waiting for the printer I have done a measurement on the power consumption:It runs reliably down to around 6.3V, so I guess from a standard 9V alkaline it will provide 4-6 hours of measurements. Could use a ldo regulator instead of the LM317 to squeeze the rest out of the battery, or adjust the circuit to run at a lower voltage, but I don't think it's worth the trouble.

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 16, 2014, 03:06:59 am
content: And the enclosure fits nicelyI have been pretty lucky with everything in this build, probably something will go up in flames soon.Anyway, a picture of the nearly finished device:

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 16, 2014, 11:27:29 am
content: Quote from: fcb on January 14, 2014, 02:53:38 pmThanks, sorry I missed your post earlier.The grey attachment thingy came with a UT61E DMM, so far I have mostly used it for quick resistor matching etc, but it is actually really nice for this project as well

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 16, 2014, 11:36:59 am
content: Another result on the cap + resistor test suggested by dannyf.Here using the Panasonic ~117 milliohms together with a 500 milliohms resistor.Note: I have not done any re-calibration since before the first test results. But I do use a short + zero before each test.I think it's safe to say that good results can be achieved with just pure resistor calibration. I don't think there will be much difference in using a cap + resistor for calibration. It is still a very good test though.

author: dannyf
author_rank: Super Contributor
timestamp: January 16, 2014, 04:23:00 pm
content: It looks nice. Job well done.

author: jaxbird
author_rank: Frequent Contributor
timestamp: January 18, 2014, 12:08:03 am
content: Quote from: dannyf on January 16, 2014, 04:23:00 pmThanks.. I think the result is not too bad for a total of about $10 in materials.I have completed the box, the added foot at the back contains battery and the on/off switch. Plus it give a nice angle for easy reading of the display.I am now much better equipped to hunt down bad capacitorsJust needs a bit of playing around with the firmware, would be nice to store cal data in the eeprom, but I will have to optimize the code first to make space for a calibration procedure. I think I can shave a bit off the LCD code.Also a 10kHz mode would be nice.

author: jaxbird
author_rank: Frequent Contributor
timestamp: March 23, 2014, 04:39:40 pm
content: I've been lucky enough to acquire one of JDB's new design boards, calibrated by the man himselfTheoretically there should be a reasonable difference between this and the updated design by JDB, but a quick (non-scientific) comparison does not show much difference:All tests done with the same capacitors and zero before recording result.Stitched together pictures for easy comparison:Although not a scientific test, I did have supervision, by a technological superior creature, to ensure no funny business:(the superior cat race generally finds puny human technology interesting, but not exciting)As kind of conclusion, I still have more confidence in JDB's latest design, plus it consumes much less power so batteries will last a lot longer[edit: JDB not JDP, Sorry]