DIY through-hole multimeter project - Page 1
Forum section: electronics / projects

author: technix
author_rank: Super Contributor
timestamp: November 13, 2016, 03:37:53 pm
content: I have brought this project up before, and I am rounding it up here. This is a design challenge - do build a multimeter that performs good enough for a maker, using only through hole components in 80s fashion.Here is the specs I am shooting for:* 4.5 digit, autoranging, true RMS, 4-wire resistance measurement* Double-layer board, single-side load, through hole only.* Two-board construct (one main board, one display board)* Bench multimeter with built-in mains power supply for 240V (replaceable transformer for 120V operation)* Little to no microcontroller involvement. If MCU is required for some reason, use up to two AT89C2051s (pot-fest)* 7-segment LED display* CMOSThe core ADC chip I am using is ICL7135 @ 100kHz.Here is the ranges:* Volts: 20mV, 200mV, 2V, 20V, 200V, 600V/2kV (10M or 10k input impedence)* Amps: 200uA, 2mA, 20mA, 200mA, 2A, 10A (shared jack)* Ohms: 20R, 200R, 2k, 20k, 200k, 2MAll those ranges covers 6 orders of magnitude, which corresponds to the 6 output pins of the autoranging PLD. Additional modes selectable through the knob:* Diode drop (12V burden voltage so even those high-voltage LEDs will work, uses the 1mA constant current source)* Capacitor ESR (0.2V drive voltage - lower than Schottky diode and some Ge diode voltage drop - how to implement it?)

author: technix
author_rank: Super Contributor
timestamp: November 13, 2016, 03:39:48 pm
content: Display board is fairly simple as it hosts only the LED display and driver chips. The challenge here is to route all things correctly, matching the size of the case.

author: technix
author_rank: Super Contributor
timestamp: November 13, 2016, 03:41:20 pm
content: Here is the reference circuit based on LM399. It emits a buffered 1.0000V reference voltage for the ADC. Resistors R6 and R7 are low tempco precision resistors (hence the different symbol)I have a split rails supply, so the LM399 is heated by the negative half of the power supply while the reference is constructed using the positive half. The TL431 circuit creates a constant current regulator for LM399. Tweak R1 until there is about 3.3V across R6, this gives about 10mA drive current into LM399. Resistors R4-R7 divides the reference voltage to 1V that is intended for ICL7135. Tweak R4 until you get exactly 1.0000V at pin 6 of IC6. Optionally before tweaking R4, tweak R8 to clear out the null point.

author: technix
author_rank: Super Contributor
timestamp: November 13, 2016, 03:42:59 pm
content: The ADC requires clocking. It is done using a crystal oscillator and divider based on CD4060.Here the CD4060 generates the 100kHz clock signal required by the ADC by dividing 12.8MHz crystal oscillator down. I chose 100kHz for its ability to reject both 50Hz and 60Hz noise. The 555 provides a few seconds of delay when the unit is switched on, allowing the LM399 to warm up. (I was thinking about using 300kHz but that frequency was warned against. 100MHz is a bit harder to achieve with CD4060 crystal oscillator though.)

author: technix
author_rank: Super Contributor
timestamp: November 13, 2016, 03:44:03 pm
content: The front end is still up to design considerations. I am thinking about using relay-switched frontend.

author: technix
author_rank: Super Contributor
timestamp: November 13, 2016, 03:46:50 pm
content: RMS converter is simple enough, based on AD736.

author: technix
author_rank: Super Contributor
timestamp: November 13, 2016, 03:49:07 pm
content: The power supply here is based on a linear design. The input connectors corresponds to the output wires of the transformer I am targeting.The four linear regulators generates the +/- 12V and +/- 5V rails for the analog section. The single switch-mode regulator generates the 5V rail used by the digital section.

author: David Hess
author_rank: Super Contributor
timestamp: November 14, 2016, 10:18:37 am
content: I have considered doing the same thing but I would go with a simple microcontroller based design and delta-sigma instrumentation converter and push the performance. One thing which would be really nice is being able to compute and display the standard deviation of DC measurements to measure low frequency noise.I would also consider designing it as an electrometer with a relay switched 10M shunt for general use.Quote from: technix on November 13, 2016, 03:37:53 pmAn ICL7135 at 300Hz what? 300 conversions per second? 300kHz clock for 2 power line cycle integrations?QuoteA switching regulator has the potential to add a lot of noise. I might use one for the LED supply (and float it) though because the current is so much higher than the rest of the circuits.QuoteEven old digital multimeters often used JFETs and MOSFETs for switching. Good relays are awfully expensive.

author: technix
author_rank: Super Contributor
timestamp: November 14, 2016, 10:25:35 am
content: Quote from: David Hess on November 14, 2016, 10:18:37 am300Hz at its clock input pin.Quote from: David Hess on November 14, 2016, 10:18:37 amWell then, 7812/7912 and 7805/7905 can still work.Quote from: David Hess on November 14, 2016, 10:18:37 amI will look into that. I just have to imagine what kind of heatsinking I am subscribing into.

author: David Hess
author_rank: Super Contributor
timestamp: November 14, 2016, 06:36:41 pm
content: Quote from: technix on November 14, 2016, 10:25:35 amI think you mean 300 kHz then.QuoteThere should not be any even if you switch high current ranges.Check out Dave'sdiscussion about designing a better multimeterwhich deals with switching the current ranges.

author: Kleinstein
author_rank: Super Contributor
timestamp: November 14, 2016, 07:09:29 pm
content: Today I would also prefer an sigma delta converter based design - but this is a little hard to get if you want through hole only. There are mainly to choices for an DMM:1) use a display oriented ADC like the ICL7135, so that every ADC step directly corresponds to one display digit. Adjustment is usually done by quite a lot of pots, like one for every range, but no µC needed.2) use an ADC with higher resolution and do adjustment and compensation for divider errors in software. This is how modern DMMs are usually build, as there are no or very few trim pots needed. However there are not many high resolution ADCs available in DIP form.For switching, usually CMOS switches are easy to use as long as the voltage is low (e.g. +-15 V) and inside the supply range. Relais might have trouble with thermal EMF and are bulky. If feasible I would avoid them for low voltage signals, though not at all costs.For the input there is also the choice of classical form with one basic voltage range (like 200 mV) and than a multi tap divider for all the other range. This is how old analog meters and cheap old DMMs were build. The other option is a variable amplification or attenuation behind the initial amplification for ranges of maybe 100 mV/1 V / 10 V and than only one input divider of about 100:1 for all the higher voltage ranges. This allows lower noise and high input impedance (e.g. > 10 GOhms) for the low ranges without using the divider, but it usually needs a higher supply (like +-15 V.. +-20V). So this is mainly an option for mains powered meters.A relatively easy version would be a relay switched 100:1 divider followed by an CMOS switched amplifier for something like times 10 / 1 / 0.1 .

author: David Hess
author_rank: Super Contributor
timestamp: November 14, 2016, 07:36:59 pm
content: Quote from: Kleinstein on November 14, 2016, 07:09:29 pmFor expediency, I settle for small outline, shrink small outline package, or mini small outline parts where absolutely required. Or they can be mounted on a DIP adapter.

author: bitseeker
author_rank: Super Contributor
timestamp: November 14, 2016, 07:49:14 pm
content: technix, this is a cool project. Going to follow along. I agree with David to stick with linear supplies. You're not going to be drawing much power here, so better to minimize the noise.David Hess, interested to see your version as well and what more can be accomplished at the DIY level when not limited to THT.

author: David Hess
author_rank: Super Contributor
timestamp: November 14, 2016, 08:20:13 pm
content: Quote from: bitseeker on November 14, 2016, 07:49:14 pmThe delta-sigma ADC could be the only surface mount part but logic or a microcontroller is required to interpret its output.I have many standard capability bench DMMs so if I went to design something from scratch, I would want to include capabilities that I miss like an electrometer input to medium voltages (at least +/-20V), low current measurement, and automated low frequency noise measurement which is just a firmware function if you have a microcontroller.And at least these three capabilities would be pretty easy to add to a more conventional design.Other all through hole designs which may be more fun perhaps but a lot more work include the multi-slope run-up integrating converter like the old Siliconix LD series (I do not think anybody makes an integrated chip set for this type anymore), the charge balancing voltage-to-frequency converter like that commonly implemented with the LTC1043, and the ratio counting design which a lot of early multimeters used. The ratio counting design is interesting because a universal counter with A/B ratio mode could be used as the display during development.

author: Kleinstein
author_rank: Super Contributor
timestamp: November 14, 2016, 09:05:13 pm
content: I would not go for a voltage to frequency converter design anymore. The variable frequency causes trouble with nonlinearity due to charge injection. So accuracy is limited. If you really want to build your own ADC, one could do an integrating converter (e.g. similar the HP34401, which is also used in some supplies) based on an µC - even one in an DIP package. Still using a ready made SD ADC is way easier and some come in an still easy to solder SO8 package.A ICL7135 based solution might be still fun, as it can work without an µC. But don't expect the highest performance. It also gets less attractive with more ranges, as individual trimmers are needed. So I would try to keep such an design simple as it will not get ultimate performance (good INL, low noise, flexible reading rates) anyway. I would even skip auto-ranging on this, at least for the beginning.

author: technix
author_rank: Super Contributor
timestamp: November 14, 2016, 09:06:13 pm
content: Quote from: Kleinstein on November 14, 2016, 07:09:29 pmAbout that CMOS switched amplifier, is CD4051 series a good switching element?About controlling the board, I am thinking preferring GAL16V8 or 74HC over AT89C2051 (the only allowed MCU in this design) Is it doable?

author: technix
author_rank: Super Contributor
timestamp: November 14, 2016, 09:07:44 pm
content: Quote from: Kleinstein on November 14, 2016, 09:05:13 pmI know that this is doable and even AT89C2051 have the required hardware for it (a single analog comparator) but as I have said this project requires as little MCU involvement as possible.

author: Kleinstein
author_rank: Super Contributor
timestamp: November 14, 2016, 09:44:43 pm
content: cd4051 (more likely CD 4052/3) switches are cheap, but limited to something like a +-6 .. 8 V supply (depending on the letters at the end / exact version). Otherwise they can be good enough.There are a few switches like ADG409 that also work with higher voltage up to about +-20V, e.g. if you want high impedance even up to +-20 V or so.For Autoranging I would prefer an simple µC, though also just 74HC... can work.AFAIK GAL16V... run pretty hot and are rather outdated - maybe even hard to get. So I would avoid them, even if it takes a few more 74HC chips.

author: David Hess
author_rank: Super Contributor
timestamp: November 14, 2016, 10:46:45 pm
content: Quote from: Kleinstein on November 14, 2016, 09:05:13 pmThe charge balancing types are as good as a dual-slope integrating converter like a ICL7135 though and can be better. They do not have autozero built in of course so that might have to be added which makes them noncompetitive economically; ICL7135 type converters are dirt cheap.QuoteI do not know about the HP34401 but its fully documented predecessors are very similar to the multi-slope run-up LD series made by Siliconix. I do not know that I like them all that much but I have to admit that they are low noise and I guess that is the way to go if you want better than integrated delta-sigma performance. The LD series only went to 4.5 digits and competed with the ubiquitous dual-slope converters. I am not sure why they were discontinued.

author: bitseeker
author_rank: Super Contributor
timestamp: November 14, 2016, 11:51:37 pm
content: Quote from: David Hess on November 14, 2016, 08:20:13 pmHmm, could add some (all?) of those to an existing meter a la uCurrent style external module?QuoteYeah, those sound much more serious. I have yet to get into things like the multi-slope converter in the 34401A.

author: bitseeker
author_rank: Super Contributor
timestamp: November 15, 2016, 01:12:16 am
content: Shouldn't be too hard to adapt to use a micro-USB or barrel jack power supply. Definitely a good idea for those who don't want to mess with mains power.

author: Monkeh
author_rank: Super Contributor
timestamp: November 15, 2016, 01:32:10 am
content: Quote from: technix on November 13, 2016, 03:37:53 pmDon't be silly, just use a dual primary transformer.

author: technix
author_rank: Super Contributor
timestamp: November 15, 2016, 05:03:08 am
content: Quote from: wilfred on November 15, 2016, 12:14:56 amThis makes the power supply subsystem a bit difficult to design. And I have a specific spare mains-rated transformer I want to use.

author: David Hess
author_rank: Super Contributor
timestamp: November 15, 2016, 06:32:47 am
content: Quote from: wilfred on November 15, 2016, 12:14:56 amDoing this adds a serious complication. You do *not* want any possibility of sharing a common ground between the power inputs and the signal inputs. While any given USB power supply may or may not be galvanically isolated including from earth ground, a USB port on a computer or hub shares a common ground with other peripheral ports. Bench voltmeters inputs are galvanically isolated from their power input and earth ground for a very good reason.So if you want to use USB power, you need to also design in an inverter or other scheme for galvanic isolation.

author: David Hess
author_rank: Super Contributor
timestamp: November 15, 2016, 06:38:16 am
content: Quote from: bitseeker on November 14, 2016, 11:51:37 pmExcept for low frequency noise measurement they could and even that could be added if there is a data output but it would be easier to include them in a multimeter design from the start.QuoteAh, so the selection of the ICL7135 was not so much for tradition as simplicity.

author: technix
author_rank: Super Contributor
timestamp: November 15, 2016, 03:40:33 pm
content: The PSU and Reference design is updated. I wonder if the split supply for digital and analog sections are necessary though, and I am not sure if it is necessary to heatsink the regulators.

author: Kleinstein
author_rank: Super Contributor
timestamp: November 15, 2016, 05:08:24 pm
content: With the ICL7135 there is no need for isolated analog and digital part. The digital part is just slow clocked, maybe even static logic to do range selection. Even if using a µC, this could be low noise, e.g. sleep mode most of the time. Isolating the LEDs would be rather high effort. So it is more about making the digital part low noise.However if an external supply like USB or a wall-wart is used, there needs to be an insulation, so that the supply has no direct connection to meter inputs. The obvious way would be something like a Royer-converter (especially if you want it old style).Whether the regulators need heat-sinks is one of the last points to look at. First one needs the general design. The regulator for the LED current might need a heat sink - the other regulators likely not, but it depends. Usually the only part that really needs significant power should be the LEDs.The simple version would use something like the +-5 volts supply of the ICL7135 for everything. So the input range in limited to about +-4.5 V or so, which is just good enough for a 2 V AC range (which has about 2.8 V peak with sine). With just a 2 V input range one might need more than just a 1:100 divider. In this case the CD405x could be used for gain switching, and an AZ OP like ICL7650 could be used for the (DC voltage) input amplifier. With limited bandwidth it could even work for AC too.

author: David Hess
author_rank: Super Contributor
timestamp: November 15, 2016, 05:52:22 pm
content: Quote from: Kleinstein on November 15, 2016, 05:08:24 pmI have actually had problems with this with certain frequency counters where the spikes in the LED drive current got into the counter chain.For my own designs, I do not isolate the LED from the microcontroller unless I have to but I have used a separate low voltage floating supply attached to minimize the loop length which in this case is between the external anode drivers and 7-segment decoder/driver so modulation of the power supply does not get into sensitive circuitry.

author: technix
author_rank: Super Contributor
timestamp: November 15, 2016, 06:36:14 pm
content: Quote from: Kleinstein on November 15, 2016, 05:08:24 pmI do anticipate high current draw from the LEDs and the CD4060 clock generator, the multitude of ATF16V8 (as I implemented most of the glue logic, as well as the entire autoranging mechanism using those) also hogs current, so I gave digital circuitry a standalone power rail from a switch-mode power supply. I just plan to heatsink all five power components just to avoid potential accidents.The +/- 12V is pretty much used only by the LM399 reference and the ohms range constant current generator though.

author: technix
author_rank: Super Contributor
timestamp: November 15, 2016, 06:44:48 pm
content: I was looking around for a possible range switching mechanism but I found none. However this idea caught my eye:There are push buttons with built-in LEDs and panel-mount LEDs, and maybe I can implement the range switching using those backlit buttons, LEDs and a few GALs. How do you think about this layout:micro-voltLow impedence voltsmilli-ampDiode dropkilo-ohmESRmega-OverloadHoldThe prefixes and Overload are LEDs, while the remaining are backlit buttons.

author: Kleinstein
author_rank: Super Contributor
timestamp: November 15, 2016, 07:30:14 pm
content: If the higher supply voltage is needed only for low currents (like the lm399 and ohms source), one could use a lower voltage transformer (e.g. 8 V) suitable for the 5 V supply and create the +12 V or maybe +20 V with a charge pump. This way one should get away without a switched mode regulator.My guess is a +15 V and +-5 V supply could be enough. Separate linear regulators for the 5 V LEDs and logic and the ADC/amps are still possible.For more functions, I would prefer an µC over several GALs. At something like 50 mA per chip they are just to power hungry to use more than one or maybe two.

author: AlxDroidDev
author_rank: Frequent Contributor
timestamp: November 16, 2016, 12:03:43 am
content: I like this project and I have one ICL7135 on hand.For reference voltage, I don't have a LM399, but I do have a MAX6126 (SOT-8), which might fit the bill. For uC I have a few Atmega168, 328 and 1284 and one DS89C450, all of them PDIP.

author: Kleinstein
author_rank: Super Contributor
timestamp: November 18, 2016, 10:01:19 pm
content: For the usual +-2 V range the ICL7135 needs a 1 V reference. No real need for an LM399. The MAX6126 is definitely good enough. One could even go for something simpler, like LT1009.For controlling automatic range switching a simple µC should be good enough, no need for something fancy. The ADC in the µC could be very handy to do range selection based on peak values. So the AVR Mega168 is well good enough. With a display oriented ADC and thus analog trimming one might not want that many ranges / functions anyway, as one would need a multi turn trimmer for essentially every range. Adjustment thus takes quite some time and a suitable calibration source. To ease this a little one might use each shunt for a 1:100 range and use switchable amplification of 1/10 (used for the voltage anyway). This would half the number of shunts to adjust, which is a little difficult anyway. With a good (AZ) amplifier a 20 mV burden could be enough. This would require 1 µV resolution for the shunts - not easy but possible.One should be able to separate the project in the ADC + display part and the input stages and µC. Not many lines between those two and the ADC has differential inputs - thus no need for a common GND level separate GND lines.

author: technix
author_rank: Super Contributor
timestamp: November 19, 2016, 05:43:50 am
content: Quote from: Kleinstein on November 18, 2016, 10:01:19 pmI am just wondering, if I am using the uC-driven form (I will probably use something like ATmega328P or even ATmega32) can I put a MCP41010 somewhere in the chain, use this d-pot as the tuning pot, and store tuning factors in the uC?

author: Kleinstein
author_rank: Super Contributor
timestamp: November 19, 2016, 08:06:35 am
content: One could use a µC and digital pot / DAC to do calibration in software. Doing a small adjustment of the reference voltage divider would be the obvious point, especially if the ref chip is 5 V or less. The ref input is high impedance and the reference is needed only relatively late in the process, so there would not be much delay on range switching.

author: David Hess
author_rank: Super Contributor
timestamp: November 19, 2016, 08:45:28 am
content: Quote from: Kleinstein on November 18, 2016, 10:01:19 pmNone of my display oriented DMMs have a trimmer for each range. For DC volts, at most they have an adjustment for the 2VDC range and the 200mVDC range if that is done by reducing the reference voltage to 1/10th. A set of precision resistors is used to make the 10M decade divider which is one of the few specialty parts you can actually buy:http://www.mouser.com/Passive-Components/Resistors/Resistor-Networks-Arrays/_/N-e89lZscv7?Keyword=decade&Ns=Pricing%7c0&FS=TrueThrough clever switching, the same decade resistor network can be used by the current source for the ohms converter so there is only one adjustment there.

author: dardosordi
author_rank: Regular Contributor
timestamp: November 19, 2016, 04:25:46 pm
content: I like this proyect. I once started doing a similar design trying to use only the parts in my drawer.A very good source of inspiration is the service manual for the Hameg 8012http://frankshospitalworkshop.com/equipment/documents/workshop_equipment/manuals/Hameg%20HM8012%20Multimeter%20-%20Service%20manual.pdf

author: dardosordi
author_rank: Regular Contributor
timestamp: November 19, 2016, 04:34:13 pm
content: Also check Hameg 8011https://www.eevblog.com/forum/repair/hameg-8011-3-4-5-digit-dmm-(not-so-broken)-repair/

author: David Hess
author_rank: Super Contributor
timestamp: November 20, 2016, 12:56:35 am
content: There are lots of old and fully documented digital multimeter designs. The Tektronix DM501, DM501A, DM502, DM502A, and 7D13 come to mind and I suspect HP has a bunch from the 1970 to 1990 as well. The Tektronix ones have great theory sections explaining their operation at the circuit level but the designs include a massive number of mechanical switches except for maybe the DM502A which has automatic ranging.

author: dardosordi
author_rank: Regular Contributor
timestamp: November 20, 2016, 03:24:06 am
content: Are those Tek DMM based on ICL7135 ? The hamegs are, so thats why I like them.

author: David Hess
author_rank: Super Contributor
timestamp: November 20, 2016, 07:24:45 am
content: Quote from: dardosordi on November 20, 2016, 03:24:06 amI think the ICL7000 series came later. The DM501 uses the Fairchild 3814 and a discrete integrator, the 7D13 is a fully custom design, and the others use the Siliconix LD120/LD121A and LD111A/LD110 which might be considered more advanced than the ICL7000 series.None of these ADCs have been in production for a long time so I do not recommend building anything based on them. However the input signal conditioning circuits for current and ohms and AC measurements apply to an ICL7135 based design.

author: Kleinstein
author_rank: Super Contributor
timestamp: November 20, 2016, 09:52:23 am
content: The Hameg 8012 is also not based on the ICL7135, but uses an sigma-delta ADC (LTC2400) and µC. So not more analog calibration and direct ADC step to display step connection. The input stage is still similar, but with one important difference so it can not be directly copied as it includes an auto zero step. But one could still use the concept of using only one divider for higher voltages and variable amplification and attenuation behind the input amplifier.Those meters use very low tolerance resistors instead of adjustment. Depending on the circuit they can use the 1:10 amplification step for more than one range. So the number of critical resistors / adjustments can be reduced a little.

author: dardosordi
author_rank: Regular Contributor
timestamp: November 21, 2016, 03:11:27 am
content: You are right, HM8012 deos not use the ICL7135 is the HM3011. I have both manuals printed and got them mixed

author: dardosordi
author_rank: Regular Contributor
timestamp: November 21, 2016, 03:15:19 am
content: Technix keep us posted, looking forward to see your progress. Thanks for sharing!

author: technix
author_rank: Super Contributor
timestamp: November 21, 2016, 09:20:39 am
content: Since it is a common suggestion to use some microcontroller involvement, how about this idea:* Emit the 100kHz reference clock from the microcontroller* Use the microcontroller to switch ranges* Use DACs and digital pots to calibrate the circuit digitallyDelta-Sigma ADC is still out of the scope as I still don't want to touch SMT on this design.About the choice of the microcontroller, which one seemed better? I am relaxing the MCU selection from AT89C2051-only:* AT89C2051-24PI @ 24MHz (12T 8051 architecture)* IAP15F2K61S2-35I-SKDIP28 @ 30MHz (1T 8051 architecture, built-in SPI master hardware for DAC)* IAP15W4K61S4-30I-PDIP40 @ 30MHz* ATmega328P-20PU @ 16MHz (AVR - Arduino, we all know it)* PIC18F45K20-I/P @ 64MHz (3.3V PIC)* PIC18F4550-I/P @ 64MHz (3.3V PIC with USB)If a 40-pin MCU is used, maybe I will also move the display decoding and driving into the MCU, and simplify the display board into a MAX7219-driven one, or a HD44780-based display module.

author: technix
author_rank: Super Contributor
timestamp: November 21, 2016, 11:25:54 am
content: I am currently working with the IAP15F2K61S2-35I-SKDIP28 as the MCU. Made in China chip and super cheap.Here is the timing code. I am using a 30MHz crystal on the 8051-based processor. This timing code uses Timer 0 for both millis() and emitting the 100kHz clock to the ADC.Code:void systick_init(void){// To emit a 100kHz clock, the timer should overflow at 200kHz, driving the// T0CKO (P3.5) pin.unsigned long count;// P3.5: push-pull output.P3M0 |= 0x10;P3M1 &= ~0x10;TMOD = TMOD & 0xf0; // Timer 0: 16-bit autoreload timer.AUXR |= 0x80; // Run the timer at F_CPUcount = 65535 - F_CPU / 2 / 100000UL + 1; // The overflow rate is calculated.TL0 = count;TH0 = count >> 8;TF0 = 0; // Start the counterTR0 = 1;INT_CLKO |= 0x01; // Start the clock outputET0 = 1; // Start interrupts.}IAP15F2K61S2 have built in 8-bit ADC, which may be used as internal calibration points?

author: Kleinstein
author_rank: Super Contributor
timestamp: November 21, 2016, 06:24:17 pm
content: The µC does not have to do very much. So anything capable of creating the clock, a better than 5 Bit ADC and some IOs should be fine. Using the µC to do the display decoding is a little strange, but possible. So any of the listed µC should be fine and even simper ones (like Mega88, PIC16, maybe PIC12) should be good enough. An integrated DAC could be used for fine adjustment, but an external one is possible too. I would somewhat prefer 5 V operation as the ICL7135 usually is 5 V supply.There is little use for an µC integrated USB interface, as this would not be isolated from the meter circuit. If wanted, a PC interface would be more practical by an UART output from the µc and than via opto-coupler to an UART to USB chip (powered over USB). This could be an later option if the UART pins are left accessible.The internal ADC would be more for auto-ranging, e.g. measure the approximate positive and negative peak voltages to detect possible clipping. So no high accuracy needed, but 2 or 3 input would be nice. Comparators would also work - but an ADC might be easier.No need to run the µC fast. Something like a 1 or 4 MHz clock should be OK. One may not even need a crystal, as the power grid frequency is not that stable anymore - at least in Europe.

author: technix
author_rank: Super Contributor
timestamp: November 21, 2016, 07:08:08 pm
content: Quote from: Kleinstein on November 21, 2016, 06:24:17 pmI just defaulted to some of my common experimenting clock frequencies there, and some of my existing code assumes that frequency (16MHz on AVR or PIC16, 24MHz on classic 8051, 30MHz on STC15 8051 or 64MHz on PIC18). Since the uC is not doing much, I will probably stick with IAP15F2K61S2-35I-SKDIP28 @ 30MHz. Reusing existing code means I don't have to write everything from scratch.Using the uC to intercept the display signal is to allow it to be reinterpreted. The intercepted signal can be sent over serial port to a computer for datalogging (and I may just go ahead and implement SCPI) and I don't have to stick to LED as HD44780-based display can also work. Although if there exists a high-precision Delta-Sigma in DIP package I may even scrap ICL7135 in favor of that.I think I will still tuck a non-isolated serial or USB port on the board somewhere (not accessible from the outside) to function as a program/debug port. STC15 MCU uses serial port for ICSP and for the specific chip I chose, IAP15F2K61S2, it also supports on-chip debugging through the same serial port, independent of the actual serial port hardware.

author: Kleinstein
author_rank: Super Contributor
timestamp: November 21, 2016, 09:15:36 pm
content: AFAIK there is a way to read the ICL7135 by reading the sign, a sync signal and let the µC count pulses instead of reading the BCD values. This needs less pins on the µC. Still there is not that much room for interpretation for the µC on the ADC data. At most may be scaling with 2 to allow a +-4 V range (last digit always even).One advantage of using an SD converter and µC for scaling would be that one is not bound to the 19999 count ranges. So one could have ranges to maybe 4 V or so which would be about the limits for an ICL7650 amplifier (one of the few available AZ OPs in DIP) for the input.I don't know sigma delta converters in THT case. But there are a few in SMT that are still relatively easy to solder. Something like SOT23-6 or SO-8 are still relatively easy and may go to a small adapter board.

author: David Hess
author_rank: Super Contributor
timestamp: November 21, 2016, 10:45:40 pm
content: Quote from: technix on November 21, 2016, 07:08:08 pmIf there were any through hole delta-sigma converters, they are long gone and honestly I do not consider using an SO (small outline) part on a DIP adapter to be cheating as long as it is a unique part; everything except that may be available in DIP packages.

author: dardosordi
author_rank: Regular Contributor
timestamp: November 22, 2016, 01:26:48 am
content: Quote from: technix on November 21, 2016, 09:20:39 amWhat's your goal? If you are building this just for you then go ahead with the one you have available or some code done. If you plan this as something a beginner may build go for the arduino.

author: dardosordi
author_rank: Regular Contributor
timestamp: November 22, 2016, 01:38:03 am
content: Quote from: Kleinstein on November 21, 2016, 09:15:36 pmYou can read the output counting the pulses and there are outputs to signal over and under range. You probably won't need those if using a micro, though.

author: dardosordi
author_rank: Regular Contributor
timestamp: November 22, 2016, 01:44:13 am
content: Quote from: Kleinstein on November 21, 2016, 06:24:17 pmYou can autorange using just the ADC output.

author: David Hess
author_rank: Super Contributor
timestamp: November 22, 2016, 06:38:43 am
content: Quote from: dardosordi on November 22, 2016, 01:44:13 amI could see using the crummy microcontroller ADC to sample the input allowing for fast autoranging. The ICL7135 is pretty slow.

author: technix
author_rank: Super Contributor
timestamp: November 22, 2016, 12:13:44 pm
content: Quote from: David Hess on November 22, 2016, 06:38:43 amHmm that would be interesting. The frontend, MCU and autoranging logic being one module, and ICL7135 and display being another. (I am stuck in two-board construct anyway)Range switching have to be done on a separate MCU on the display board though. The board-to-baord connection can be 30cm of Cat6 and a 4-pin molex connector: two twisted pairs for RS485 between the two MCUs (generate as little interference as possible) one twisted pair for differential input signal of the ADC, and use the Molex for power (DVCC, GND, AVCC and AVEE.) This gives me a common autoranging frontend that guarantees a 2V FS output, and allows me to try different ADC for the display and output.

author: Kleinstein
author_rank: Super Contributor
timestamp: November 22, 2016, 12:56:44 pm
content: With an MCU there will be not much (if any) logic chips for auto-ranging it is more like quite some CMOS switches and a few relays (e.g. to switch the high voltage dividers and maybe the ohms current source). I would prefer CMOS switches over relays if one has the choice.Auto-ranging just on the ADC output could be tricky, as the average DC output can be still in range, but short time there might be clipping. So one should also have some kind of detection for clipping, e.g. be comparators or maybe diode / capacitor circuits and the ADC to check from time to time. The ADC ICL7135 should have quite some headroom (e.g. up to 3.5 V) - but the input amplifier might not have that much in some ranges.Using the ADC could also check for the limits on the next lower range - so no need to actually switch to higher gain, just to find out that this would cause an over-range due to short time excursions. It somewhat depends on the input stage how much reserve is there beyond the nominal range.It is a little the question if one needs analog peak detection circuits or can use the ADC to just sample the signal relatively fast.

author: David Hess
author_rank: Super Contributor
timestamp: November 22, 2016, 03:53:54 pm
content: Quote from: Kleinstein on November 22, 2016, 12:56:44 pmThe ICL7135 has overrange and underrange outputs but since it typically runs at 3 readings per second, I would at least consider using the MCU ADC for this.I have never seen a digital meter with an integrated ADC bother with crest factor detection. The ICL7135 does not have much input range at maybe +/- 4 volts but the input RC filter shown in the examples has a cutoff of 16Hz making this almost a nonissue.QuoteI think my old Tektronix handheld meter does crest factor detection but it is unusual in not using an integrating ADC; apparently it does RMS measurement digitally implying some type of sampling converter. After one lawsuit, Fluke bought this series of meters from Tektronix and made an agreement that Tektronix say out of the market for handheld meters. I do not know if Fluke continued to make them or just discontinued them which is too bad since I really like their performance and features.