Homemade DMM again, with a scaled back set of specs. - Page 1
Forum section: electronics / projects

author: technix
author_rank: Super Contributor
timestamp: May 24, 2015, 06:51:37 pm
content: So I have decided to scale my homemade DMM project back to non-volt-nut territory: a 4.5-digit true RMS meter based on ICL7135 chipset. This is mostly for self-educating and practise, and it does fill the gap between easily damaged sub-$25 El-Cheapo and proper meters like Fluke which is very expensive, if I did manage to squeeze it into the price point.Specs:* 4.5 digits, reasonable stability and reliability* Mains rated, at least Cat. III 600V equivalent* Use as few precision components as possible, but without compromising the precision of the instrument* Autoranging on all ranges (since I already have a microcontroller in it)* Volts: 100mV to 1000V FS* Amps: 1mA to 10A FS* Ohms: 1R to 10M FS, 2-wire and 4-wire measurement* Datalogging* USB connection to computer* If it turned out to be a portable unit (preferably), it should operate from a single Li-ion or Li-po cell, and supports USB charging. (this is to say goodbye to battery changing)* Screen: 16x2 character LCD, HD44780 driverSo far parts I have already scored (may or may not be used in final design) include:* ICL7135 A/D converter* AD736 True RMS converter* Reference options: LM399 (used) or ADR02B (used) or MC1403* External op amps: OP07C or OP2177 (I finally decided to buy a sample of the latter)* Integrator cap: metalized polymer capacitor? (old stock, made in Japan)* Internal digital calibration (if needed): MCP41010 8-bit d-pots and TLC5615 10-bit DACs* MCU: ATmega32U4@16MHz or PIC18F2550@48MHz or ATmega328P@16MHz with CH340G as separate USB chipsetQuestions (for now, will edit if more questions arise):1. Beyond the application notes provided by the manufacturers of the chips, how do I design and implement a proper analog section? I don't want to take the circuit from DT890 that I own (which calls for a big rotary switch and does not have proper ratings) but the Keysight 3458A input section seemed like an overkill. Also is it possible to leverage the same 6 orders of magnitude scales I have? Also what analog multiplexer is the better option? Will CD4051 work?2. Based on information on ICL7135, is it a good idea to throw in a priority encoder (74HC148) in the Bn pins, interrupt on the Strobe pin, and capture the ADC output as an entire byte? Or can I get away without the encoder or the interrupt? If I used PIC18F2550 obviously the GPIO pins will be at premium, and probably quite a few of I2C IO expanders will have to be used.3. Since I also have a few CD4511 and ULN2003 as well as 7-segment LED modules, should I get acquainted with such construction without the MCU first, using CD4511 and ULN2003 to drive the LEDs directly? If I did so, how do I design a range selector without using a rotary switch?4. How do I generate the +/- 5V rail from either a single 5V rail (USB) or a Li-ion cell? Isolation preferred. Is there any ready-made solution? Or if I need to wound my own inductor/transformer (I do have spare magnetic wire, toroids and transformer frames,) how to?

author: paulie
author_rank: Frequent Contributor
timestamp: May 24, 2015, 08:31:28 pm
content: Rats! Now I will never catch up to you or dannyf in most number of threads started in a week.Anyway I used that chip before the 5 digit $5 Ebay meters came out and can tell you it is a great IC. Crazy cheap, crazy accurate, and crazy easy to get running. In addition to fun and educational a good way to get a higher resolution unit for 1/10 the cost of big store bought meters. Serial logging capability for free.

author: Macbeth
author_rank: Super Contributor
timestamp: May 24, 2015, 08:58:16 pm
content: I was just looking at the PCB of thefunny Victor 70C, wondering how they did range selection without a rotary selector. From what I can see it uses a single HFD2 DPDT dual latching relay and a HEF4066B quad SPST analog switch. Quite how it's wired up I haven't had a chance to work out yet, but its obviously controlled by that top secret SOIC-18 chip (PIC16F perhaps?). No need for the high voltage and high current relays like in, e.g. the HP 34401A input switching section.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 24, 2015, 09:09:25 pm
content: The ICL7135 is a great chip for building a simple 4,5 Digit DMM with manual range switch and no µC. For the DC ranges this essentially the only chip you need. Its possible to connect to a µC: One way would be reading the sign and let the µC do the counting as well. So Ignore the normal digital outputs. If you want an µC for data-logging, digital calibration and similar a different ADC is more appropriate (e.g. MCP3422). A higher resolution (though not accuracy) makes digital calibration much easier. This is still possibly with the ICL7135 through oversampling / dithering, but this is a little tricky.Neither a OP07 or OP2177 would be the right choice as an amplifier for a 10 M divider. The more likely choice would be something like a AD8551 oder LTC1050 as they have much lower bias currents. Much also depends on the supply and power available and the choice on how to do range switching.Doing automatic range switching (Voltage) is not that simple. There are several possible options:1) use a inverting amplifier with 10 M at the input, and switch the feedback resistor. This how most cheap DMMs do it. The downside is relatively high noise in the low ranges. A 20 mV range may be difficult.2) Use relays - this the old style how a HP3457 and similar do it. It works good but needs space and power and is a little slower. It also allows for high Impedance low voltage ranges (e.g. GOhms at less than 10 V) . For a short time a relatively high current may flow, through input protection of low voltage ranges. There can also be a combination, using a relay only for the initial divider.3) Use some special FETs / Photomos. Some Keithley meters use this way. Its faster, but leakage might be tricky.4) Allways devide first (e.g. divide by 50), and amplify in all ranges except the lowest. Then a CMOS MUX can be used - this is more like the cheap way, if you don't need a 200 mV range on autoscale.The CD4051 MUX is a very cheap one. It may work for some purposes, at least with typical performance. Worst case data are rather bad in leakage, but most samples are much better. Sometimes a 74HC4051 is the slightly better choice. Better but more expensive choice are MAX4051 (same pinout as CD4051) or DGxxx / ADGxxx.For the power supply, going from 5 V to +-xxV is possibly with ready made DCDC converters. However they tend to be rather noisy and isolation is not that good as you may want it. So a DIY part (e.g royer converter with a suitable core) may be helpful here. Getting proper isolation is not that easy.

author: technix
author_rank: Super Contributor
timestamp: May 24, 2015, 09:30:07 pm
content: Quote from: Kleinstein on May 24, 2015, 09:09:25 pmI would like to try to get away without the 10M divider by using a resistive divider and some op amp feedback line voodoo, maybe using two DACs or d-pots in some abused form. A DAC can be considered a d-pot with one terminal grounded so connecting the Vref to the output of the op amp and Vout to the negative input of the op amp makes an adjustable feedback line for an non-inverting op amp. Similar can be said for using a DAC as a divider. For inverting amplifiers a real d-pot have to be used though.

author: macboy
author_rank: Super Contributor
timestamp: May 24, 2015, 10:57:28 pm
content: Quote from: technix on May 24, 2015, 06:51:37 pmFor measuring mains AC in your home, you need CAT I for measuring at the outlets, and CAT II for measuring the wires entering the home. CAT III is not required.As pointed out below , I was one level off... CAT II for outlets, and CAT III for the service entry point would be correct.

author: paulie
author_rank: Frequent Contributor
timestamp: May 24, 2015, 11:01:21 pm
content: Quote from: technix on May 24, 2015, 09:30:07 pmSo much for "scaled back". Maybe starting with the reference design would be a good first step.

author: Lightages
author_rank: Unknown
timestamp: May 24, 2015, 11:04:48 pm
content: Quote from: macboy on May 24, 2015, 10:57:28 pmI think you need to re-read the standards:http://support.fluke.com/find-sales/Download/Asset/1263690_6003_ENG_I_W.PDFCATIII is required for circuits close to the service entry of the building and other high energy circuits, and at least CATII on any other outlet in a building.

author: free_electron
author_rank: Super Contributor
timestamp: May 24, 2015, 11:32:01 pm
content: Why do you want to combine a 7135 with a cpu ? the 7135 is perfectly capable of driving its own display.the big problem with homebrew meters is : how do you calibrate them ? it's no good making a 4 1/2 digit meter of only the first digit is correct ...

author: paulie
author_rank: Frequent Contributor
timestamp: May 24, 2015, 11:37:49 pm
content: Can the hyperbole E, even $1 regulators and references will get you 3 or 4 digits. Beyond that you might have to blow $5 on a cheap AD584 module calibrated to 6 digits from China, good for at least a month or two. Or transfer a 10 cent reference if you are lucky to have buddy or local institution with lab grade instruments.ps. As far as MCU it is the key to logging which was my main personal interest in these projects.pps. Nothing to do with clear cutting timber.

author: moffy
author_rank: Super Contributor
timestamp: May 25, 2015, 02:41:33 am
content: Quote from: technix on May 24, 2015, 06:51:37 pmPolymer just means plastic. You need either polypropylene, polystyrene or preferably teflon for the dielectric to minimize dielectric absorption.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 25, 2015, 09:54:55 am
content: Not using a 10 M divider at the input is OK - the inverting amplifier with switched feedback is a reasonable alternative. However a DAC or digital pot is only of limited use here, as one wants large steps to cover many decades. So Its more like CMOS switches and resistors (e.g. 1 M, 100 K or 10 K). The tricky part is keeping leakage low - so a simple 4066 is not enough. If you want a high CAT rating and auto-ranging this a very viable path, as there is always (measuring voltage) the 10 M resistor at the input.Having high resolution does not necessarily need a very precise calibration. If you are aware of the limitations, a 6 Digit meter with 1 % absolute tolerance is still quite useful. Often It's not about the absolute value but small changes or drift. Also more resolution may be just an excuse to fine switching of ranges and thus might help if the divides are not that accurately calibrated.I would not stick to much to the ICL7135 - it still needs a good capacitor, like polypropylen or better - the capacitor may end up being more expensive than the chip. Another downside of this ADC is, that it samples the input only for something like 1/4 of the time, so signal noise gets amplified like about 2 times. Sigma delta converters are better in this respect, as they average over the whole time.The ICL7135 is good to directly drive a display, but digital calibration would need something like a DAC / digital pot to adjust the ref. voltage. So with a µC controlled DMM I would prefer a Sigma Delta ADC.

author: technix
author_rank: Super Contributor
timestamp: May 25, 2015, 11:38:16 am
content: Quote from: Kleinstein on May 25, 2015, 09:54:55 amThanks. I will start hunt for that sigma-delta for now. Or maybe a 16-bit ADC built into some MCU itself would be good enough? This will greatly reduce component count.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 25, 2015, 12:11:59 pm
content: There are a few µC with integrated high resolution ADCs. I know of MSP430 and two 8051 variations.The extra ADC can be rather small - so I would not learn a new µC type just for saving something as small and cheap as a MCP3421 ( SOT23-6, 18 Bit ADC with internal Ref. priced at about $2).There are many suitable ADCs to choose from, and the differences are not that big. Its usually a 3-5 V supply and something like 1 - 4 V input range, often differential. For a 4-4.5 digit display one would like to have something like 16 stable bits and a little more resolution (e.g 18 bits and up). Just be careful with typical audio converters, as they usually have a rather poor gain stability also the interface may be tricky.Currently my personal choice would be something like a MCP3911. This one is fast enough to do RMS conversion is software up to a reasonable bandwidth (e.g. 20 kHz, if the µC is fast enough). And as a bonus with two channels one could even include true AC power measurement, using voltage and current reading together - this is what this ADC is made for.

author: Kalvin
author_rank: Super Contributor
timestamp: May 25, 2015, 01:37:32 pm
content: Quote from: Kleinstein on May 25, 2015, 12:11:59 pmCypress PSoc 5LP family has also some nice features, for example an ARM Cortex-M3 with plenty of Flash and RAM, up to 20-bit sigma-delta ADC, on-chip voltage reference of 1.024V +/- 0.1% etc. They have also an inexpensive evaluation kit for $10 (Available also from Digikey or other dealers, if it is not sold out):http://www.cypress.com/?rid=108038http://www.cypress.com/?mpn=CY8C5888LTI-LP097Texas Instruments have some fast DSP-processors with 12-bit adc with 286ns conversion time and/or 16-bit adc with 910ns conversion time, which may be handy if wanting to perform RMS measurement with wide bandwidth and high dynamic range. One should read the Silicon Errata before starting development.http://www.ti.com/product/tms320f28377sI haven't been playing with these, but PSoc 5LP looks quite nice platform.

author: technix
author_rank: Super Contributor
timestamp: May 25, 2015, 01:46:31 pm
content: Quote from: Kleinstein on May 25, 2015, 12:11:59 pmSince the chip have an internal reference, how do I calibrate it? Can I set up a LM399 or ADR02B circuit as the internal calibration target and from time to time measure that calibration target and store the reading as a calibration coefficient to be applied to every subsequent measurement?

author: Kleinstein
author_rank: Super Contributor
timestamp: May 25, 2015, 02:08:36 pm
content: It depends on the quality of the internal reference how to use it. If it's relatively good, one may normally just use the internal one and only every few months to years check it, even with an external one. If you have the 2 nd Ref. internal one may check the ref. periodical - e.g. one a day or possibly before each measurement. Though usually one does not want so much time just to check calibration. So something like every hour or day should be OK.I would at least keep a record of the tests, and not silently change the internal factors with every update. The second reference is more like a check and may be needed for long time drift only.

author: TiN
author_rank: Super Contributor
timestamp: May 25, 2015, 03:36:26 pm
content: LM399 will make charging such a meter rather usual thing, with it's ~20mA consumption.It's way too much for just a 4.5-digit DMM.

author: technix
author_rank: Super Contributor
timestamp: May 25, 2015, 08:15:22 pm
content: Quote from: TiN on May 25, 2015, 03:36:26 pmThe LM399 can be handled this way: the LM399 module is only turned on when an internal calibration is about to happen. The heater current is monitored using a sense resistor, and once the current draw of the heater stabilized to within 1 LSB of the built in ADC of the uC for about a minute, a measurement is taken. Since such an internal calibration is not performed only once in a blue moon to calibrate the long term stability of the secondary reference internal to the ADC, this can be performed only when the unit is powered from USB to save battery life.Or I can always use ADR02B as primary reference, which is just as good as LM399.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 25, 2015, 08:54:17 pm
content: The plastic case of the ADR02 can be problematic and make the chip humidity sensitive. Also the SMD form causes quite somer thermal shock to the reference and may thus restart aging. Also a 70 ppm Hysteresis given in the datasheet is not a good sign. So I would not consider the ADR02 and essentially anything in a plastic case a serious reference. So the ADR02 might be about as good and with similar weak spots as the ADC's internal reference.Usage will show how good a ADC internal reference is - changing the separate backup reference later should not be such a big problem. With not so frequent use the LM399 consumption may not be such a big problem.

author: technix
author_rank: Super Contributor
timestamp: May 25, 2015, 11:00:09 pm
content: Quote from: Kleinstein on May 25, 2015, 08:54:17 pmThanks for the info, and since it is only used once in a blue moon the LM399 will serve well as the primary internal reference. And about the true RMS conversion, I already ordered a few proper AD736 true RMS converter so I don't need separate RMS conversion in the ADC. MCP3421 coupled to AD736 seemed to be like a good idea to me now.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 26, 2015, 10:26:46 am
content: The AD736 is possible of cause - an µc internal 12 Bit ADC would be kind of a cheap alternative with some benefits but also drawbacks. The AD736 is usually relatively expensive, while the MSP3421 is a low cost solution.With the MCP3421 suppression of 50 Hz and 100 Hz residuals is a weak spot, as the chip is made for 60 Hz line frequency. So RMS readings might still not be very stable, or slow due to filtering. It kind of still works by averaging multiples of 3 readings.If have not ordered the ADC jet, you might consider a version with internal MUX für 2 or 4 channels, this might save an external MUX to switch between DC and AC and maybe DC current and other functions too.

author: technix
author_rank: Super Contributor
timestamp: May 26, 2015, 12:30:52 pm
content: Quote from: Kleinstein on May 26, 2015, 10:26:46 amMaybe I will use the MCP3422 but since I have a two-part analog section (simple current and resistance sense stages and a complex volts range switcher) only two channels are required: DC bypassing the true RMS converter, or AC using the converter. Analog muxes and d-pots are still needed as the range switching mechanism actually switches the analog feedback lines directly.

author: Marco
author_rank: Super Contributor
timestamp: May 26, 2015, 05:47:47 pm
content: How low power can you get the LM399 with extra insulation and wiring? Lets say 5 cm cubed of some high insulation foam and half a meter of magnet wires laid out in a spiral inside the two halves of the foam to the LM399.PS. would need to get a bit tricky with sensing the voltage, you could use sense wires but you'd need to servo the voltage on the non sense wire going to the anode to get the anode voltage close to ground potential.

author: macboy
author_rank: Super Contributor
timestamp: May 26, 2015, 06:13:40 pm
content: Quote from: technix on May 25, 2015, 11:38:16 amPay very special attention to the linearity of the ADC (INL). You may be very surprised how far off many are. There is a very good reason that all high end DMMs use dual slope or multi-slope converters rather than sigma-delta or flash or some other type, it is partly because of they have high inherent linearity.

author: Marco
author_rank: Super Contributor
timestamp: May 26, 2015, 06:16:25 pm
content: Most designs are just slightly tweaked copies of designs unchanged for decades ... if Jim Williams says he can get a LTC2400 to 1ppm I think you can get a LTC2400 to 1ppm.I think the "inherent" linearity of multislope is a bit of a joke considering the amount of voodoo which goes into dielectric absorption compensation.

author: macboy
author_rank: Super Contributor
timestamp: May 26, 2015, 06:24:58 pm
content: Quote from: technix on May 25, 2015, 08:15:22 pmNo, the microcontroller's reference doesn't only drift over long periods of time. It will also drift significantly with temperature, variation in Vcc, even humidity. Definitely use a quality external reference. There are plenty available that will get you into the tens-of-ppm stability/repeatability without much expense. That will be orders of magnitude better than any uC internal Vref but not quite as good as the LM399. The LM399 is overkill for 4.5 digits; it is used in most 6.5 digit (HP 34401A, Keithley 2000, etc. etc.) and even 7.5 digit (Keithley 2001, HP 3457A) meters.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 26, 2015, 07:32:21 pm
content: The LM399 is overkill for a typical 4,5 digit meter. It might be useful as an external reference source to check the meter and possibly others from time to time, like once a month or to check how bad the ref. inside the ADC chip (usually not inside a µC) is. For a 4,5 digit meter a simpler ref. might be good enough. The cheap ref chips in plastic case may have a problem with the influence of humidity, but this a rather slow effect over many hours and days. The same may also apply to many resistors.Bringing down the power of the LM399 by insulation has it's limits. The LM399 even without the heater active needs some power of something like 10-15 mW. If thermal resistance gets to high, temperature stabilization will not work at high environmental temperature, or the temperature needs to be set a too high a value. So it will get hard to bring the typical power to less than about 3 times the minimum power. If the long time reference does not need to run all time, power dissipation is not that critical any more. At low power and if the requirements are not that high there are also good band-gap references - preferable in a metal case.Good sigma delta converters can give something like 2-20 ppm INL. Some may even allow for correction in software, as the shape seems to be rather predictable and fixed. This is well good enough für 4,5 digits, 5 digits and may even work for 6 digits. At the low ppm levels linearity is not that simple - even resistors may not be that linear any more. At least some of the SMUs already use sigma delta chips instead of a multi slope converter at 6 digits.The multislope mechanism should not need that much compensation for dielectric absorption: only a small fraction of the resolution is determined from the change in voltage of the capacitor. As the capacitor is much smaller (e.g. 1 nF instead of around 500 nF in a dual slope) it's easily possible to use capacitors with low DA (e.g. NP0, mica or teflon). Still linearity is influenced by similar effects as in the sigma delta chips: voltage dependent charge injection, leakage, voltage dependent resistance of FET switches. This is not a surprise, as there is not that much difference between high resolution sigma delta converters and multi-slope converters. The difference to the classic dual slope is larger.If you want the option of running on battery (even if rechargeable) I would definitely not use a multi chip, multi slope converter - this part alone would likely use way more power than the LM399. The sigma delta converters are really low power in contrast (e.g. 1 mW for an LTC2400).

author: technix
author_rank: Super Contributor
timestamp: May 27, 2015, 03:40:18 am
content: Quote from: Kleinstein on May 26, 2015, 07:32:21 pmI am aiming for a cheap, simple construction that works well enough for day-to-day use yet have better precision and construction than those El Cheapo meters, not volt-nuttery. The Sigma-Delta method is under investigation currently.The LM399 internal reference's power consumption is limited by turning the entire portion of the circuit off when unused. Its usefulness is also extended by allow outputting this reference voltage from the meter (since I do support 4-wire resistor measurement, there is a set of output jacks that is otherwise unused) so I can use this reference to calibrate other things.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 27, 2015, 08:07:57 pm
content: Depending on the source where you get parts from, the LM399 may not be so much more expensive than another suitable reference in a metal case.So it may be much better than needed and higher power, but still not overly expensive. Especially when using setup with a normal working reference at the ADC and an additional one to check drift, it's very easy to change the reference. So this is the least problem in the design.The bigger questions are how to do auto-ranging and switching ranges.Also the choice of the amplifier for the voltage ranges has several options. A supply higher (e.g. +-15 V) than found in usual hand-held meters would allow using CMOS switches for much of the functions, but lead to a little more power usage. With a rechargeable option this may be still viable.Using the inverting amplifier setup may have trouble (due to leakage) in the low voltage rangesso if accuracy is important, I would still consider a relay to switch the input divider, similar to the input stages of high end DMMs.Also switching current ranges has several options - if the ADC has enough resolution, or switchable amplification one might even use only 1:100 stepped shunts.So the next step would be to draw a few general design possibilities.

author: technix
author_rank: Super Contributor
timestamp: May 28, 2015, 02:30:27 am
content: Quote from: Kleinstein on May 27, 2015, 08:07:57 pmThe higher +/-15V voltage is not likely to be used in the feedback switched amplifier matrix or I won't be able to do low-cost range switching using d-pots, which is effectively a tempco-matched resistor array coupled to a CMOS switch array on a chip, with surronding support circuitry like shift registers, decoders and latches built in. Also one of the amplifier choices, TLC2272, a CMOS RRIO op amp, won't really work with higher supply voltages.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 28, 2015, 04:21:19 pm
content: There are a view general circuit layouts to choose from: One is switching the feedback of an inverting amplifier. Here you don't need a higher voltage - something like +-5 V might be enough. However this setup is weak in measuring low voltages, as leakage becomes really critical - more than 3.5 digits in the 200 mV range might get challenging in this arrangement. The switches in digital pots might not be a good option, as leakage might be to high. There is hardly a way around some high quality switches, like relays, good CMOS or possibly JFets or Photomos. This setup also needs at least two (usually more) high quality resistors.The other arrangement is the one high end DMMs use. Here one usually needs one relay, one high impedance divider (e.g. 9.9 M and 100 K) and a relatively high supply voltage so the amplifier can handle something like 1/100 of the maximum voltage. Lower Voltage ranges (e.g. up to 10 V) might have very high impedance. Usually the lower ranges are very good - the higher voltages that use the divider have slightly larger errors. The main disadvantage of this method is the need for the higher supply and thus higher power - often to much for a 9 V block but still viable with rechargeable.In both cases a normal CMOS Rail-Rail OP is not a good choice, as they have a double input structure and thus more bias / noise than normal OPs. Also DC drift and LF noise of CMOS OPs can be a problem. The more realistic choices are auto zero OPs or JFET based OPs.