Silicon ChipBuild a Digital Insulation Meter - June 2010 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Unflued gas heaters are a health hazard / Problems with our VOIP phone system
  4. Feature: Unmanned Aerial Vehicles: An Australian Perspective by Bob Young
  5. Feature: Breakthrough Aussie Innovation: Making 3D Movies by Barrie Smith
  6. Project: Air-Quality Meter For Checking CO & CO₂ Levels by John Clarke
  7. Review: LeCroy WaveAce 112 Digital Storage Oscilloscope by Nicholas Vinen
  8. Project: Dual-Tracking ±19V Power Supply, Pt.1 by Nicholas Vinen
  9. Project: Build a Digital Insulation Meter by Jim Rowe
  10. Vintage Radio: How AGC works and why it’s necessary, Pt.2 by Rodney Champness
  11. Project: A Solar-Powered Lighting System, Pt.2 by John Clarke
  12. Advertising Index
  13. Outer Back Cover

This is only a preview of the June 2010 issue of Silicon Chip.

You can view 31 of the 112 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • Radio Control (November 1996)
  • Radio Control (November 1996)
  • Radio Control (February 1997)
  • Radio Control (February 1997)
  • Radio Control (March 1997)
  • Radio Control (March 1997)
  • Radio Control (May 1997)
  • Radio Control (May 1997)
  • Radio Control (June 1997)
  • Radio Control (June 1997)
  • Radio Control (July 1997)
  • Radio Control (July 1997)
  • Radio Control (November 1997)
  • Radio Control (November 1997)
  • Radio Control (December 1997)
  • Radio Control (December 1997)
  • Autopilots For Radio-Controlled Model Aircraft (April 1999)
  • Autopilots For Radio-Controlled Model Aircraft (April 1999)
  • Model Plane Flies The Atlantic (May 1999)
  • Model Plane Flies The Atlantic (May 1999)
  • Tiny, Tiny Spy Planes (July 1999)
  • Tiny, Tiny Spy Planes (July 1999)
  • 2.4GHz DSS Radio Control Systems (February 2009)
  • 2.4GHz DSS Radio Control Systems (February 2009)
  • Unmanned Aerial Vehicles: An Australian Perspective (June 2010)
  • Unmanned Aerial Vehicles: An Australian Perspective (June 2010)
  • RPAs: Designing, Building & Using Them For Business (August 2012)
  • Flying The Parrot AR Drone 2 Quadcopter (August 2012)
  • Multi-Rotor Helicopters (August 2012)
  • Multi-Rotor Helicopters (August 2012)
  • Flying The Parrot AR Drone 2 Quadcopter (August 2012)
  • RPAs: Designing, Building & Using Them For Business (August 2012)
  • Electric Remotely Piloted Aircraft . . . With Wings (October 2012)
  • Electric Remotely Piloted Aircraft . . . With Wings (October 2012)
Items relevant to "Air-Quality Meter For Checking CO & CO₂ Levels":
  • Air Quality Monitor PCB [04306101] (AUD $10.00)
  • PIC16F88-I/P programmed for the Air Quality Monitor [0430610A.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC16F88 firmware and source code for the CO/CO₂ Air Quality Meter [0430610A.HEX] (Software, Free)
  • Air Quality Monitor for CO & CO₂ PCB pattern (PDF download) [04306101] (Free)
  • Air Quality Monitor for CO & CO₂ lid panel artwork (PDF download) (Free)
Items relevant to "Dual-Tracking ±19V Power Supply, Pt.1":
  • Dual Tracking ±0-19V Power Supply PCB [04206101] (AUD $15.00)
  • Dual Tracking ±0-19V Power Supply front panel PCB [04206102] (AUD $5.00)
  • Dual Tracking ±0-19V Bench Supply PCB patterns (PDF download) [04206101/2/3] (Free)
  • Dual Tracking ±0-19V Supply panel artwork/drilling templates (mains-powered) (PDF download) (Free)
  • Dual Tracking ±0-19V Supply panel artwork/drilling templates (plugpack-powered) (PDF download) (Free)
Articles in this series:
  • Dual-Tracking ±19V Power Supply, Pt.1 (June 2010)
  • Dual-Tracking ±19V Power Supply, Pt.1 (June 2010)
  • Dual-Tracking ±19V Power Supply, Pt.2 (July 2010)
  • Dual-Tracking ±19V Power Supply, Pt.2 (July 2010)
Items relevant to "Build a Digital Insulation Meter":
  • Digital Insulation Meter PCB [04106101] (AUD $15.00)
  • Digital Insulation Meter Power Supply PCB [04106102] (AUD $10.00)
  • PIC16F88-I/P programmed for the Digital Insulation Meter [0410610A.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC16F88 firmware and source code for the Digital Insulation Meter [0410610A.HEX] (Software, Free)
  • Digital Insulation Meter PCB patterns (PDF download) [04106101/2] (Free)
  • Digital Insulation Meter front panel artwork (PDF download) (Free)
Articles in this series:
  • How AGC works and why it’s necessary (May 2010)
  • How AGC works and why it’s necessary (May 2010)
  • How AGC works and why it’s necessary, Pt.2 (June 2010)
  • How AGC works and why it’s necessary, Pt.2 (June 2010)
Items relevant to "A Solar-Powered Lighting System, Pt.2":
  • Solar-powered Lighting System PCB [16105101] (AUD $10.00)
  • PIC16F88-I/P programmed for the Solar Powered Lighting Controller [1610510A.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC16F88 firmware and source code for the Solar Powered Lighting Controller [0610510A.HEX] (Software, Free)
  • Solar-Powered Lighting System PCB pattern (PDF download) [16105101] (Free)
Articles in this series:
  • A Solar-Powered Lighting System (May 2010)
  • A Solar-Powered Lighting System (May 2010)
  • A Solar-Powered Lighting System, Pt.2 (June 2010)
  • A Solar-Powered Lighting System, Pt.2 (June 2010)

Purchase a printed copy of this issue for $10.00.

New design tests up to 1000V, down to 250V Digital Insulation Meter By JIM ROWE Think all your double-insulated power tools are safe, just because they are double insulated? As many have found to their ultimate cost, wear and tear on tools can mean that they become decidedly unsafe. Here’s a meter that will give you back your peace-of-mind – on tools and many other electrical and electronic devices. T his is actually an improved version of the Digital Megohm & Leakage Current Meter we described in the October 2009 issue of SILICON CHIP. Our original design had a distinctly mixed reception from some of our readers. It could be summed up as “OK but ….” The first “but” was that it would not deliver the nominal test voltage of 1000V or 500V DC into the minimum load resistance of one megohm, as specified in the relevant Australian Standard, ie, AS/NZS 3760:2003. 78  Silicon Chip The reason for this drawback was largely because we had set the internal current limit too low and partly because the DC-DC converter could not deliver the current required, even if the current limiting resistor had been removed. Furthermore, some readers pointed out that the test voltage of 500V DC was too high for testing insulation of equipment with EMI suppression and MOVs (metal oxide varistors). These devices should be tested at no more than 250V DC. Faced with that criticism, all we could do was to revise the design so that (a) the inbuilt DC-DC converter can deliver the full test voltage into a 1MΩ resistor and (b) provide the additional test voltage of 250V DC. In fact, the new circuit can deliver the test voltage of 250V or 500V into a load of 100kΩ, if required, for the testing of portable RCDs (residual current devices). The physical presentation of the new meter is also quite similar to the original except that it now has a 3-position switch to select the test voltages of 250V, 500V or 1000V DC. siliconchip.com.au Apart from the redesigned D2 inverter section, the revised 5V K A +5V meter now has two current D3 REGULATOR 250V, 500V OR 1000V K ranges instead of one, under A TEST T1 the control of a PIC micro(S2) controller. 4.7k LCD 9V As before, the Digital MODULE BATTERY + Insulation Meter is easy to TEST build, with most of the maTERMINALS – RD1 jor components mounted directly on two small PC IL 'SMART' ADJUST AMPLIFIER Q3 DC/AC INVERTER DIGITAL TEST boards. These fit snugly A = 3.1 (IC1, Q1, Q2) VOLTMETER VOLTAGE (IC2a) inside a compact UB1 size (IC3) (VR1) jiffy box, along with a 6xAA 100 +1.25V battery holder used to supRLY1 +5V ply the meter’s power. RD4 1000V Q4 SELECT TEST It can be built up in a RD2 VOLTAGE 9.90k AUTO CURRENT 500V few hours and for an outlay (S1) RANGE SWITCHING RD3 much lower than commer250V cially available electronic Fig.1: in this block diagram, the two sections of the circuit can be clearly identified. On the megohm meters. left is the power supply, consisting of a regulated 5V plus a high-voltage supply. On the right So to summarise, it can is the metering and display unit. These can be seen in the two separate PC boards below. now test at 250V, 500V or 1000V and can measure leakage curThe feedback uses a voltage divider The basic voltage divider using RD1 rents from below 1A to above 6mA. (RD1 and RD2) to feed a small proporand RD2 alone is used to set the high As well, it can measure insulation tion of the high voltage DC output back voltage level to 250V, with multi-turn resistance from below 1MΩ up to to one input of a comparator inside trimpot VR1. To change the test voltage 999MΩ. IC1, where it is compared with an level to 500V or 1000V, switch S1 is internal 1.25V reference voltage. used to connect RD3 or RD4 in parallel How it works The output of the comparator is with RD2, increasing the division ratio The block diagram of Fig.1 shows then used to control the operation of of the divider and hence increasing the arrangement of the new meter with the DC-DC converter, turning it on the output voltage maintained by the its somewhat more complex DC-DC when the output voltage is below the feedback loop. converter. This is on the left-hand side. correct level and turning it off again Note that the converter generates The metering section, on the right when the output voltage reaches the the test voltage only when TEST side of the diagram, is used to measure correct level. button switch S2 any leakage current which flows beis pressed and tween the test held down. As terminals and soon as the from this it button is recalculates the leased, the external resistance converter connected between stops and them (knowing the test voltage in use). In more detail, the DC-DC converter converts the 9V DC from the battery into AC, so it can be stepped up to a few hundred volts using an auto-transformer. The resulting high voltage AC is then rectified using ultra-fast diode D3 to produce the test voltage of 250V, 500V or 1000V DC. We use negative feedback to control the converter’s operation and maintain its output voltage at the correct level. Inside our Mk II Insulation meter. The PC board in the bottom of the box is the high voltage generator; the board “hanging” from the front panel handles the metering and display tasks. siliconchip.com.au June 2010  79 D2 POWER A REG1 7805 K S3 TEST 470 F 16V S2 9V BATTERY +5.0V OUT IN GND 100nF D3 +9V (NOM) T1 0.1  5W 6 3 +HV K A 3.3M # 120T 7 Ips 11T 8 DrC SwC Vcc IC1 MC34063 SwE Ct GND 4 1 B 2 C Q1 BC337 E 100 E Cin5 B 2.2k 1nF 3.3M # Q3 IRF540N G 4.7k 1W 3.3M # D 3.3M # S Q2 BC327 100nF 630V 10M # 120k C SET VOLTS +1.25V + TEST 100nF TERMINALS 630V – 10M # VR1 1M (25T) # HV TYPES (1.6kV RATING) Vfb (HV DC-DC CONVERTER BOARD) 22k TP3 680 1000V 68k 1nF 68k TPG 500V 100nF S1a GND 250V SC 2010 SELECT TEST VOLTS DIGITAL INSULATION METER Fig.2: the circuit is based on a PIC16F88 microprocessor which measures the current between the test terminals (and therefore the device under test). The high voltage DC-DC converter supplies up to 1000V for these tests in accordance with the relevant Australian/New Zealand standards. It can also supply lower voltages (250 and 500V) as required. the high voltage leaks away via RD1 and RD2/RD3/RD4. This is both a safety feature and a simple way to achieve maximum battery life. Referring back to Fig.1, the meter section uses a shunt resistor connected between the negative test terminal and ground to sense any leakage current IL which may flow between the test terminals. It is the voltage across this resistor which we measure, to determine the leakage current. The effective shunt resistance is switched between 100Ω and 10kΩ to give the meter two measurement ranges. The switching is done using relay RLY1, under the control of the PIC microcontroller (IC3) inside the metering circuit. Initially the shunt has a value of 100Ω, which means that a leakage current of 10mA produces a voltage drop of 1.00V. This provides the ‘high current’ measuring range. If and when the measured leakage current falls below 100A, RLY1 is turned off to increase the effective shunt resistance to 10kΩ. This provides the ‘low current’ measuring range, where a leakage current of 100A produces a voltage drop of 1.00V. If this shunt resistance relay switching looks familiar, that’s because we used a similar arrangement in the Capacitor Leakage Meter published in the December 2009 issue and in the Capacitor Leakage Adaptor for DMMs in the April 2010 issue. The voltage drop across the shunt resistance is fed 80  Silicon Chip through op amp IC2a which has a voltage gain of 3.1 times. IC2a drives IC3, a PIC16F88 microcontroller which is used as a ‘smart’ digital voltmeter. The amplified voltage from IC2a is fed to one input of the ADC (analog to digital converter) module inside IC3, where it is compared with a reference voltage of 3.2V. The digital output of the ADC is then mathematically scaled, to calculate the level of the leakage current in milliamps or microamps. IC3 is then able to use this calculated current level to work out the insulation resistance, because it can sense the position of switch S1 and hence ‘knows’ whether the test voltage being used is 250V, 500V or 1000V. So all it has to do is calculate the total resistance which will draw that level of leakage current from the known test voltage, and then subtract the ‘internal’ 4.7kΩ and 100Ω/10kΩ resistors from this total value to find the external resistance between the test terminals. The calculated leakage current and insulation resistance values are then displayed on the LCD, along with the test voltage being used. In case you’re wondering about the purpose of the 4.7kΩ resistor connected between the high voltage generation circuit and the positive test terminal (ie, inside the meter), it’s mainly to limit the maximum current that can be drawn from the DC-DC converter – even in the event of a short circuit between the test terminals. siliconchip.com.au +5.0V 2.2k 10k Q4 BC327 E 220 F 3.3k 4 14 Vdd MCLR 2.2k B 100nF 18 Vref+ RA1 +3.2V 2 C 5.6k TP1 1.5k 10k 250V S1b 10k TPG 500V 17 1000V 16 A 13 ZD2 5.1V 100nF 1k 3 2 100 1M 6 K ZD1 6.2V 1W D1 10k IC2a K RB3 1 4 10 6 RS D7 D6 D5 D4 D3 D2 D1 D0 GND 1 14 13 12 11 10 9 8 7 9 180 CLKo A 15 Vss 5 1.8k A K This should make the meter relatively safe to use, especially as it won’t be too easy to connect yourself between the two test terminals while simultaneously holding down the Test button. Of course, if you’re really determined to give yourself a shock it can be done . . . but we wouldn’t recommend it! Incidentally, if you do deliberately short circuit the output terminals while pressing the test switch (S2), you will burn out the 4.7kΩ 1W current-limiting resistor; it can be regarded as a fusible resistor. You will then have to replace the resistor but at least the rest of the circuit will have been protected. If you suspect that you have blown the 4.7kΩ resistor by shorting the output, test the output voltage of the unit with your DMM on a high DCV range. If there is voltage, it’s still working! Circuit details Now let’s look at the full circuit diagram of Fig.2. The DC-DC converter is based on IC1, an MC34063 converter/controller which drives MOSFET Q3 via driver transistors Q1 and Q2. When the inverter is operating, the transistors switch Q3 on for a brief time (about 50s) which allows current to flow from the +9V supply through the primary winding of transformer T1. siliconchip.com.au R/W 5 8 7 RB1 6 RB0 AN2 B-L K 16 IC2: LM358 5 TP2 (2.0MHz) 6 IC2b 7 4 TPG LM7805 D BC327, BC337 D1, D2: 1N4004 D3: UF4007 K 3 EN IRF540N A CONTRAST RB2 2 ZD1 15 B-L A 16 x 2 LCD MODULE RB4 RB6 11 2 Vdd A = 3.10 A 7,8 RB5 IC3 RB7 PIC16F88 8 1 LCD CONTRAST RA0 3.6k RLY1 1,14 12 VR2 10k 22 270 RA7 3 RA4 K +5.0V B E C GND IN G D S GND OUT As a result, energy is stored in T1’s magnetic field. Then Q3 is switched off again, causing the magnetic field to collapse. This causes a high ‘back-EMF’ voltage to be generated in both windings of T1, which are connected in auto-transformer fashion, so that the total voltage applied to the anode of diode D3 is equal to the sum of the back-EMF in both windings plus the 9V supply voltage. D3 then conducts to charge up the series-connected 100nF/630V capacitors to this high voltage. Both of these capacitors have a 1.6kV-rated 10MΩ shunt resistor included to ensure that the converter’s high output voltage is shared equally between them. This is only important when the test voltage setting is 1000V – we want to ensure that neither capacitor has its 630V rating exceeded. The four 3.3MΩ high-voltage resistors, together with the 120kΩ resistor and trimpot VR1, correspond to the upper divider resistor RD1 in Fig.1. The 68kΩ resistor connected between pin 5 of IC1 and ground corresponds to RD2, the fixed lower leg of the feedback divider which provides the converter’s 250V output voltage. The other 68kΩ resistor switched by S1a corresponds to RD3, while the 22kΩ and 680Ω resistors connected in series correspond to RD4. Providing S2 is on, the converter will continue to run until the high voltage output reaches the correct level. That’s because until this level is reached, the proportion of the June 2010  81 Z-7013 (B/L) 16X2 LCD MODULE ALTRONICS & M H O GE M LATI GID RETE M E GAKAEL N OITALUS NI LCD CONT 10150140 100nF IC2 LM358 1.8k +HV FROM DC/DC CONV 6.2V 5.6k ZD1 3.3k 4.7k 1W V++ 3.2V ZD2 TP1 TPG Q4 BC327 REG1 LM7805 1 10k 10k 220 F 1k 100 2.2k 2 D1 3 S1 1M 2.2k 10k RLY1 TPG TEST TERMINALS 5.1V 4004 1 22k 68k POWER 3 4004 + D2 680 2 1 SELECT TEST VOLTS – 1.5k +9V 470 F GND Vfb S2 S3 V-- 100nF IC3 PIC16F88 2MHz 3.6k 180 270 22 1 100nF 100nF TP2 0102 © 14 13 12 11 10 9 8 7 6 5 4 3 2 1 16 15 10k VR2 10k TEST 9V BATTERY ALL LEADS RUN UNDER MAIN BOARD 3.3M 3.3M 100nF 630V Q1 IC1 34063 Q2 1nF TPG 1.25V 0102 © 68k TP3 20150140 0.1  5W VR1 1M ADJUST HV CDT1 - CD V H RETREV N O C 2.2k 1nF 100nF 630V S 100 UF 4007 Q3 IRF540N T F 3.3M 10M D3 10M 3.3M 120k +HV OUT CONVERTER BOARD Vfb GND +9V Fig.3: component layouts for both the main (measurement/display) PC board (top) and the high voltage DC-DC converter PC board (bottom), along with matching photographs alongside. Follow these diagrams exactly, not only to ensure your unit works perfectly but also to minimise the risk of you getting a bite. (It probably won’t do any damage but why risk it!) output voltage fed back to the comparator input (pin 5) of IC1 will not reach the +1.25V reference level inside IC1. However as soon as the high voltage output does reach the correct level, the proportion fed back to pin 5 will rise just above 1.25V and IC1 will stop turning Q3 on – stopping the converter even if S2 is still being held down. The converter gets its power directly from power switch S3 (via S2 and D2), so it is supplied with the full battery voltage less the drop in D2. All of the remaining circuitry in the meter operates from a regulated +5V supply line, derived from the battery via REG1, an LM7805 3-terminal regulator. Smart metering The metering side of the circuit is fairly straightforward, thanks to the use of a PIC16F88 micro (IC3). As noted before, 82  Silicon Chip the signal from op amp IC2a is fed to pin 1 of IC3, which is configured as ADC input channel AN2 and the microcontroller then makes its calculations to drive the LCD. Once it has measured and calculated the leakage current in this way, the micro can then calculate the effective leakage resistance. This is because it is able to sense the position of test voltage selector switch S1, via the contacts of S1b which are connected to input pins 17 (RA0) and 16 (RA7). So knowing the test voltage in use it can calculate the total resistance connected between the test terminals. Then finally it works out the external resistance between the terminals by subtracting the 4.8kΩ or 14.7kΩ internal resistance. Both of the calculated current and resistance values are then displayed on the LCD module, along with the test siliconchip.com.au Winding the transformer Step-up autotransformer T1 has a primary winding comprising 11 turns of 0.7mm enamelled copper wire (one layer), followed by a secondary winding of 120 turns (4 x 30-turn layers) of 0.25mm enamelled copper wire. As shown in the assembly diagram at right, all five layers are wound on a small Nylon bobbin which fits inside a two-piece ferrite pot core measuring 26mm in diameter. First wind on the 11-turn primary using the 0.7mm diameter wire. You’ll find that this will neatly take up the full width of the bobbin providing you wind the turns closely and evenly. Then cover this first layer with a 9mm-wide strip of plastic insulating tape or thin ‘gaffer’ tape, to hold it down. Leave about 50mm of wire free of the bobbin at the ‘start’ end, and cut any surplus wire off about 40mm from the ‘finish/tap’ end (taking it out via one of the ‘slots’). Next take one end of the 0.25mm wire and twist it around the ‘finish/tap’ end of the primary winding to anchor it while you wind the first layer of the secondary. This must be wound on the bobbin in the same direction as the primary, as if it is a continuation of the first layer. If you wind them closely and evenly you should find that you will be able to fit 30 turns across the bobbin. Once you have wound on the 30 turns, cover this second layer (the first secondary layer) with a 9mm-wide strip of plastic insulating tape to hold it in place. Then you can wind the third layer in exactly the same way, covering it with a strip of tape as before. The remaining wire can then be used to wind the two further 30-turn layers, again making sure that you wind them in the same direction as you wound the earlier layers and covering each layer with a strip of tape. With fifth and final layer been wound and taped, the ‘finish’ end of the wire can then be brought out of the bobbin via one of the slots (on the same side as the start and tap leads), and your wound transformer bobbin should be ready to fit inside the two halves of the ferrite pot core. Just before you fit the bobbin inside the bottom half of the pot core, though, there’s a small plastic washer to prepare. This is to provide a thin magnetic ‘gap’ in the pot core when it’s assembled, to prevent the pot-core from saturating (magnetically) when it’s operating. The washer is very easy to cut from a piece of the thin clear plastic that’s used for packaging electronic components, like resistors and capacitors. This plastic is very close to 0.06mm thick, which is just what we need here. So the idea is to punch a 3-4mm diameter hole in a piece of this plastic using a leather punch (or something similar to cut a clean hole) and then use a small pair of scissors to cut around the hole in a circle, with a diameter of 10mm. Your ‘gap’ washer will then be ready to place inside the lower half of the pot core, over the centre hole. Once the gap washer is in position, you can lower the wound bobbin into the pot core around it, and then fit the top half of the pot core. The autotransformer should now be ready for mounting on the converter PC board. To begin this step, place a Nylon flat washer on the 25mm-long M3 Nylon screw that will be used to hold it down on the board. Then pass the screw up through the 3mm hole in the PC siliconchip.com.au UPPER SECTION OF FERRITE POT CORE BOBBIN WITH WINDING (11T OF 0.7mm DIA ENAMELLED COPPER WIRE FIRST (END IS TAP), FOLLOWED BY 4 x 30T LAYERS OF 0.25mm DIA ENAMELLED COPPER WIRE WITH INSULATING TAPE BETWEEN LAYERS) FINISH TAP START 'GAP' WASHER OF 0.06mm PLASTIC FILM LOWER SECTION OF FERRITE POT CORE (ASSEMBLY HELD TOGETHER & SECURED TO CONVERTER PC BOARD USING 25mm x M3 NYLON SCREW & NUT) board corresponding to the centre of the transformer, and lower the assembled pot core down over the Nylon screw, holding it together with your fingers (with the bobbin and gap washer inside) and with the ‘leads’ towards diode D3. Then when the pot-core assembly is resting on the top of the converter board, keep holding it and the board together with the Nylon screw together so you can apply the second M3 Nylon flat washer and M3 nut to the upper end of the screw. Tighten the nut so that the pot core is not only held together but also secured to the top of the PC board. Once this has been done, all that remains as far as the transformer is concerned is to cut the start, tap and finish leads to a suitable length, scrape the enamel off their ends so they can be tinned, and then pass the ends down through their matching holes in the board so they can be soldered to the appropriate pads. Make especially sure that you scrape, tin and solder BOTH wires which form the ‘tap’ lead – ie, the finish of the primary winding and the start of the secondary. If this isn’t done, the transformer won’t produce any output. It’s also a good idea to fit a 25mm length of insulating sleeving over the exposed ‘finish’ lead, between the transformer winding and the PC board. This will help prevent any ‘flashover’ when the transformer is producing 1000V pulses. June 2010  83 PARTS LIST – DIGITAL INSULATION METER 1 UB1 size jiffy box, 157 x 95 x 53mm 1 PC board, code 04106101, 109 x 84mm 1 PC board, code 04106102, 70 x 51mm 1 LCD module, 2 lines x 16 characters with LED back-lighting (Altronics Z-7013, Jaycar QP-5512 or equivalent) 1 Ferrite pot core pair, 26mm OD, with bobbin to suit 1 500mm length of 0.7mm diameter enamelled copper wire 1 8m length of 0.25mm diameter enamelled copper wire 1 100mm length 0.7mm diameter tinned copper wire 1 10x AA battery holder (flat), cut down to 6x 1 2-pole rotary switch, PC board mounting, with 16mm knob (S1) 1 SPST pushbutton switch, panel mounting (S2) 1 SPDT mini toggle switch, panel mounting (S3) 1 Mini DIL reed relay, SPST with 5V coil 2 Binding post/banana jacks (1 red, 1 black) 2 4mm solder lugs 1 16-pin length of SIL socket strip 1 16-pin length of SIL pin strip 1 18-pin IC socket 2 8-pin IC sockets 4 25mm M3 tapped metal spacers 2 12mm M3 tapped Nylon spacers 11 6mm M3 machine screws, pan head 4 6mm M3 machine screws, csk head 3 M3 hex nuts, metal 4 12mm M3 machine screws, Nylon 1 25mm M3 machine screw, Nylon 9 M3 hex nuts, Nylon 6 M3 flat washers, Nylon 12 1mm diameter PC board terminal pins Semiconductors 1 MC34063A converter controller (IC1) 1 LM358 dual op amp (IC2) 1 PIC16F88 microcontroller, programmed with 0410610A.hex (IC3) 1 LM7805 5V regulator (REG1) 1 BC337 NPN transistor (Q1) 2 BC327 PNP transistor (Q2,Q4) 1 IRF540N 100V N-channel Mosfet (Q3) 1 6.2V 1W zener diode (ZD1) 1 5.1V 1W zener diode (ZD2) 2 1N4004 1A diode (D1,D2) 1 UF4007 ultra-fast 1000V diode (D3) Capacitors 1 470F 16V RB electrolytic 1 220F 10V RB electrolytic 2 100nF 630V metallised polyester 2 100nF 100V MKT metallised polyester 2 100nF multilayer monolithic ceramic 2 1nF 100V MKT metallised polyester Resistors (0.5W 1% metal film unless specified) 2 10MΩ HV* 4 3.3MΩ HV* 1 1MΩ 1 120kΩ 2 68kΩ 1 22kΩ 4 10kΩ 1 5.6kΩ 1 4.7kΩ1W 1 3.6kΩ 1 3.3kΩ 3 2.2kΩ 1 1.8kΩ 1 1.5kΩ 1 1kΩ 1 680Ω 1 270Ω 1 180Ω 2 100Ω 1 22Ω 1 0.1Ω 5W wirewound 1 1MΩ mini 25T vertical trimpot (VR1) 1 10kΩ mini horizontal trimpot (VR2) 84  Silicon Chip * HV (1.6kV rated) e.g, MH25 series Farnell 110-0295 (10MΩ) and Farnell 110-0288 (3.3MΩ) voltage being used. IC3 is using its internal clock oscillator, running at very close to 8MHz. This gives an instruction cycle time of 2MHz, which may be monitored using a scope or frequency counter at test point TP2. Trimpot VR2 allows the LCD module’s contrast to be adjusted for optimum visibility, while the 22Ω resistor connected to pin 15 sets the current level for the module’s inbuilt LED back-lighting. This was chosen for the best compromise between display brightness and battery life, as the LED back-lighting is a major component of total battery current. Construction As you can see from the photos and diagrams, most of the components used in the new meter are mounted directly on two small PC boards. The high voltage converter circuitry all mounts on the smaller of the two boards, which measures 70 x 51mm and is coded 04106102. This board sits in the bottom of the UB1 box, at the front of the 6xAA cell battery holder. Most of the remaining components mount on the larger board, which measures 109 x 94mm and is coded 04106101. This board attaches to the underside of the box lid/front panel via four 25mm long M3 tapped spacers. The only components not mounted on either board are the test terminals, pushbutton switch S2 and power switch S3; these all mount directly on the lid/front panel. The location of all of the components mounted on both boards, along with their correct orientation, should be clear from the overlay diagram of Fig.3. There are only two wire links to be fitted to each board, so these are best soldered first so they won’t be forgotten. After both pairs of links are in place you can fit the terminal pins on the larger board, for test points TP1 and TP2 and their reference grounds plus those for the 9V battery connections (at lower left) and the three at lower right for the interconnections to the converter board. There are a further six terminal pins to fit on the smaller board: for TP3 and its ground, the three interconnection wires to the larger board (at lower right) and finally for the high voltage output (upper left). Once the terminal pins have been siliconchip.com.au NEGATIVE TEST TERMINAL POSITIVE TEST TERMINAL (S3 BEHIND) MAIN BOARD MOUNTED BEHIND LID USING 4 x 25mm M3 TAPPED SPACERS LCD MODULE MOUNTED ABOVE MAIN BOARD USING 2 x 12mm LONG M3 TAPPED NYLON SPACERS 16-WAY SIL PIN STRIP S1 S2 S1 16-WAY SIL SOCKET RLY1 104K 630V T1 POTCORE HELD TO CONVERTER PC BOARD USING 25mm x M3 NYLON SCREW WITH NUT & FLAT WASHERS CONVERTER PC BOARD MOUNTED IN BOTTOM OF BOX USING 4 x 12mm M3 NYLON SCREWS WITH 4 x FLAT WASHERS & 8 x NYLON M3 NUTS 6xAA CELL HOLDER (CUT DOWN FROM 10xAA HOLDER) MOUNTED IN BOTTOM OF BOX USING DOUBLE-SIDED TAPE Fig.4 (at top): an “X-ray” diagram, through the side of the case, to show how it all goes together. The matching photo underneath is of the main PC board and panel removed from the case.. fitted you can fit the sockets for IC1 (on the smaller converter board), IC2 and IC3. Next come all of the fixed resistors, taking particular care to fit each value in its correct position. Follow these with the two trimpots, making sure you fit these with the orientation shown in Fig.3. The capacitors are next, starting with the lower value ceramic and metallised polyester caps and following these with the 1nF (on the converter board) and the two polarised electrolytics on the main board – again matching their orientation to that shown in Fig.3. The 100nF 630V polyester caps can be fitted also at this stage. After the capacitors you can fit diodes D1 and D2 on the main board and D3 on the converter board, taking care to orientate them as shown in Fig.3 and also to fit the UF4007 diode as D3. These diodes can then be followed by zener diodes ZD1 and ZD2, siliconchip.com.au which both go just above the centre of the main board. Note that these are orientated in opposite ways as shown in Fig.3, and also that the 6.2V zener is ZD1 while the 5.1V zener is ZD2. Now you can solder transistors Q1 and Q2 to the converter board, making sure that you fit the BC337 device as Q1. You can also fit the remaining BC327 transistor (Q4) on to the main board. After the transistors you can fit reed relay RLY1, making sure you orientate it with the ‘notch’ end uppermost as indicated in Fig.3. Then comes the rotary switch (S1), after first cutting its spindle to a length of about 15mm from the threaded mounting sleeve and filing off any burrs. Mount the switch in the board so that it is orientated with the locating spigot in the ‘5 o’clock’ position, and push the switch pins through the board holes as far as they’ll go before soldering to the pads underneath. Once the switch is fitted, you should remove its main nut/lockwasher/position stopwasher combination and turn the spindle by hand to make sure it’s at the fully anticlockwise limit. Then refit the position stopwasher, making sure that its stop pin goes down into the hole between the moulded ‘3’ and ‘4’ digits. After this refit the lockwasher and nut to hold it down securely, allowing you to check that the switch is now ‘programmed’ for the correct three positions – simply by clicking it around through them by hand. Next fit the LM7805 regulator (REG1) on the main board. This is in a TO-220 package and mounts flat against the top of the board, with its leads bent down by 90° about 6mm from the case so they pass down through the board holes. The regulator is then attached to the board using a 6mm long M3 screw and nut, passing through the hole in its tab. The screw and nut should be June 2010  85 tightened to secure the regulator in position before its leads are soldered to the pads underneath. Mosfet Q3 is also in a TO-220 package and is mounted on the smaller converter board in exactly the same way. The final component to be mounted directly on the main board is the 16-way length of SIL (single in-line) socket strip used for the ‘socket’ for the LCD module connections. Once this has been fitted and its pins soldered to the pads underneath, you’ll be almost ready to mount the LCD module itself. However, before this can be done fasten two 12mm long M3 tapped nylon spacers to the board in the module mounting positions (one at each end) using a 6mm M3 screw passing up through the board from underneath and then ‘plug’ a 16-way length of SIL pin strip into the socket strip you have just fitted to the board. Make sure the longer ends of the pin strip pins are mating with the socket, leaving the shorter ends uppermost to mate with the holes in the LCD module. Next remove the LCD module from its protective bag, taking care to hold it between the two ends so you don’t touch the board copper. Then lower it carefully onto the main board so the holes along its lower front edge mate with the pins of the pin strip, allowing the module to rest on the tops of the two 12mm long nylon spacers. Then you can fit another 6mm M3 screw to each end of the module, passing through the slots in the module and mating with the spacers. When the screws are tightened (but not over tightened!) the module should be securely mounted in position. The final step is then to use a finetipped soldering iron to carefully solder each of the 16 pins of the pin strip to the pads on the module, to complete its connections. The final component to mount on the converter board is step-up transformer T1, which needs to be wound first. This may sound daunting, but there are only 131 turns of wire in all. You’ll find all of the information on winding the transformer and mounting it on the converter board in the box panel. After this is done you can plug the three ICs into their respective sockets IC1 on the converter board and IC2 and IC3 on the main board – making sure to orientate them all as shown in Fig.3. At this stage both of your PC board 86  Silicon Chip 17 20 A 39 A 15 53 x 17mm LCD CUTOUT B 17 53 37 20 C HOLE B: 3.5mm DIA 38 HOLES C: 9.0mm DIA 25.5 103 HOLES A: 3mm DIAM, C HOLES D: 7.0mm DIA HOLE E: 12mm DIA 19 D E 7.5 D 28 A 28 39 A 39 CL assemblies should be nearly complete. All that remains is to attach one of the 25mm long mounting spacers to the top of the main board in each corner, using 6mm long M3 screws. Then the board assemblies can be placed aside while you prepare the case and its lid. Preparing the case There are only four holes to be drilled in the lower part of the case, to take the mounting screws for the converter board. These should be 3mm in diameter and with their centres marked out using the converter board itself as a ‘template’, by sitting it temporarily inside the box spaced only about 1mm from the front. Once these four holes are drilled and de-burred, you can mount the Fig.5: drilling diagram for the UB-1 box lid, which becomes the front panel. All dimensions are in mm. ALL DIMENSIONS IN MILLIMETRES converter board inside the box using four 12mm long M3 Nylon screws, with a Nylon flat washer and Nylon nut fitted to each screw first to act as board mounting pillars or ‘standoffs’. Then the board can be slipped down over the screws, and another M3 Nylon nut placed on each screw to hold the board in place. You don’t need mounting holes for the battery holder, because it can be held securely in place using two strips of ‘industrial’ double-sided adhesive foam tape. However before it can be fitted into the case it must be cut down to accommodate only six cells. This involves cutting off the last four cell positions altogether (at the ‘negative lead’ end), and then drilling a 2.5mm hole in the end of the sixth cell siliconchip.com.au Insulation Testing LCD CONTRAST SILICON CHIP + CAUTION: HIGH VOLTAGE! 250 500 – 1000 POWER TEST SELECT TEST VOLTAGE Digital Insulation Meter position, at the negative spring end. The end of the spring is then carefully bent inwards and around in a circle, so that it can be held in place using a 6mm long M3 machine screw and nut, which will also attach the negative lead connection lug on the outside. The converted battery holder can now be fitted inside the main section of the box behind the converter board, with the connection lead side to the left. Mount it using double-sided adhesive foam as mentioned earlier. The box lid needs several holes drilled, plus a rectangular cutout near the upper end for the LCD. The location and dimensions of all these holes are shown in Fig.5, which can also be used (or a photocopy of it) as a drilling template. The 12mm hole siliconchip.com.au Fig.5: samesize front panel artwork which can be photocopied and glued to the panel. For protection, it should first be laminated or sealed with self-adhesive clear plastic. for S2 and the 9mm holes for the test terminals are easily made by drilling them first with a 7mm twist drill and then enlarging them to size carefully using a tapered reamer. The easiest way to make the rectangular LCD window is to drill a series of closely-spaced 3mm holes around just inside the hole outline and then cut between the holes using a sharp chisel or hobby knife. Then the sides of the hole can be smoothed using small needle files. We have prepared an artwork for the front panel which be either photocopied from the magazine (Fig.5) or downloaded as a PDF file from our website and then printed out. The resulting copy can be attached to the front of the lid and then covered with Testing the insulation of mainspowered equipment and cables is an important step in ensuring that they are safe to use and don’t pose a shock hazard. According to the Australian and New Zealand standards for safety inspection and testing of electrical equipment (AS/NZS 3760:2003), tests on the insulation of ‘domestic’ cables and equipment operating from 230V AC should be carried out with a testing voltage of 500V DC. However where the equipment includes MOV surge protection devices, the testing can be carried out with a voltage of 250V DC. The recommended testing voltage for insulation tests on industrial equipment such as ovens, motors and power converters operating from three-phase 400V AC is 1000V DC. Insulation tests on domestic 230V equipment can be performed by measuring either the leakage current or the insulation resistance. For Class I (earthed) equipment with accessible earthed metal parts, the leakage current should be no greater than 5mA, except for portable RCDs (residual current devices) where it should not be greater than 2.5mA. The insulation resistance for these devices should be not less than 1MΩ or not less than 100kΩ for a portable RCD. For Class II (double insulated) equipment, the insulation resistance with the power switch ‘on’ measured between the live supply conductors (connected together) and external unearthed metal parts should again be not less than 1MΩ. The same insulation resistance figure of 1MΩ applies to extension cables and power boards (between the live conductors and the earth conductor), to power packs (between the live input pins and both output connections), portable isolation transformers (between the primary winding and external earthed or unearthed metal parts, between primary and secondary windings, and also between the secondary winding and external earthed or unearthed metal parts). June 2010  87 The three LCD screens which should greet you when you turn the Digital Insulation Tester on. The one on the left is self explanatory. It changes automatically to the middle one, which tells you what to do (it’s not rocket science). The right screen shows the test voltage (as set by S1), the leakage current (in this case zero – bewdy!) and the measured resistance. self-adhesive clear film for protection against finger grease, etc. (A more robust alternative is to hotlaminate the paper panel in a clear pouch, cut it to size and then attach it using thin double-sided tape.) You might also like to attach a 60 x 30mm rectangle of 1-2mm thick clear plastic behind the LCD viewing window, to protect the LCD from dirt and physical damage. The ‘window pane’ can be attached to the rear of the lid using either adhesive tape or epoxy cement. Once your lid/front panel is finished, you can mount switches S2 and S3 on it using the nuts and washers supplied with them. These can be followed by the binding posts used as the meter’s test terminals. Tighten the binding post mounting nuts quite firmly, to make sure that they don’t come loose with use. Then use each post’s second nut to attach a 4mm solder lug, together with a 4mm lockwasher to make sure these don’t work loose either. Now you can turn the lid assembly over and solder ‘extension wires’ to the connection lugs of the three switches, and also to the solder lugs fitted to the rear of the binding posts. These wires should all be about 30mm long and cut from tinned copper wire (about 0.7mm diameter). Once all of the wires are attached, they should be dressed vertical to the lid/panel so they’ll mate with the corresponding holes in the main PC board when the two are combined. You should now be ready for the only slightly fiddly part of the assembly operation: attaching the main PC board assembly to the rear of the lid/ front panel. This is only fiddly because you have to line up the extension wires from switches S2, S3 and the two test terminals with their matching holes in the PC board, as you bring the lid and board together. This is not too difficult though, so just take your time and the lid will soon be resting on the tops of the board mounting spacers. Then you can secure the two together using four 6mm long machine screws. Then it’s a matter of turning the complete assembly over and soldering each of the switch and terminal extension wires to their board pads. Once they are all soldered you can clip off the excess wire with side-cutters. The final assembly step is fitting the four wires used to make the interconnections between the two PC boards, and also soldering the ends of the battery holder leads to the terminal pins on the lower end of the main board. The interconnecting lead connections are shown clearly in Fig.3, but there are two points which should be stressed. One is that while light-duty insulated hookup wire (even rain- bow cable, which we used) is fine for the three low voltage leads (+9V, GND and Vb), you’ll need to use wire with mains-rated insulation for the high voltage lead. The second point is that although this is not shown in Fig.3 for clarity, all four of the interconnecting leads are run underneath the main board, and connect to it on the copper side. Note too that although the high voltage lead connects to a terminal pin on the converter board, it solders directly to the board copper at the main board end. A terminal pin can’t be used here, because it would protrude down too far when everything is assembled (and risk flashover to one of the cells in the battery holder). Once the interconnecting leads and battery leads have been fitted, your new Digital Insulation Meter is almost ready for its initial checkout. All that remains is to make sure S3 is in the Off position and then fit six AA-size alkaline (or lithium) cells into the battery holder. Initial checkout When you turn power switch Another view of the completed PC boards, ready for installation in the case. The smaller board (above) is actually an early prototype – there are a few differences in the final version (shown in the overlay). 88  Silicon Chip siliconchip.com.au What the PIC firmware does . . . When power is turned on via S3, the PIC firmware ‘starts work’ by turning on RLY1 via Q4, to ensure that the metering circuit is set for the higher current range. It also initialises the LCD module, and then displays an initial greeting message on it to show that the meter is ‘active’. After pausing a few seconds it then displays a second message, advising the user to first set the test voltage (via S1) and then press the Test button (S2) to start testing. As soon as it senses (via RA4) that the Test button has been pressed, it first checks the test voltage you have selected using S1. (It does this by checking the logic levels on RA0 and RA7.) Then it directs the PIC’s ADC module to make a sequence of 10 measurements of the voltage applied to the AN2 input (which is the voltage across the 100Ω leakage current shunt, amplified by IC2a). After taking the 10 measurements, it then works out the average of these measurements by calculating their sum and then dividing by 10. This averaging is done to give more steady readings, because the individual measurements tend to vary as a result of ‘ripple’ on the output of the DC-DC converter. This average of the 10 measurements is then checked to see if it is a ‘full scale’ reading, and if so the firmware checks to determine the meter’s current range setting. If it isn’t set for the higher current range, the meter is S3 on, a reassuring glow should appear from the LCD display window – from the LCD module’s back-lighting You may also be able to see the Meter’s initial greeting ‘screen’, as shown in one of the display photos at right. If not, adjust contrast trimpot VR2 with a tiny screwdriver until you get a clearly visible display. (VR2 is adjusted through the small hole just to the left of the LCD window.) After a few seconds, the display should change to the Meter’s measurement guide ‘screen’, where it reminds you to first set the test voltage using S1 and then press button S2 to perform the test. As soon as you do press the test button, the display should change into the Meter’s test result ‘screen’, where it displays the test voltage plus the measured leakage current and resistance. At this stage it will show a leakage current of 0A and a resistance of 999MΩ because you haven’t connected anything between the two test terminals to draw any current. Now try switching voltage selector switch S1 to the other positions. When you then press and hold down S2 you should find that the test voltage setting displayed on the top line of the LCD screen changes to match. siliconchip.com.au switched to the higher current range and the firmware loops back to take another sequence of 10 measurements, and work out their average. If the average reading was not a full-scale one, or if it is already set for the higher current range, the firmware then does another check to see if the reading is below 10% of full scale. If this is so, it checks to see if the meter is switched to the lower current range. If not, the meter is switched to the lower current range and the firmware loops back once again to take another sequence of 10 measurements and work out their average. By doing this automatic range changing, the firmware finally achieves an average reading with the best resolution it is able to provide. This reading is then processed by the firmware and its 24-bit floating point maths routines to calculate both the leakage current (in mA or A) and the equivalent leakage resistance in megohms. These calculated values are then displayed on the LCD screen, along with the test voltage being used. One further little job done by the firmware is to check the values being displayed for current and leakage resistance, and if there are any ‘leading zeroes’ they are changed into blanks. This is another improvement over the firmware in the first version. If this occurs it will show that your Digital Insulation Meter is working correctly. Setting the test voltage If everything seems OK at this stage, it’s time to do the final adjustment: setting the test voltage levels. This is easy enough to do because it simply involves monitoring the DC-DC converter’s output voltage on a single range with your DMM, while carefully adjusting trimpot VR1 using a long and narrow insulated screwdriver. Here’s the procedure: first turn off the power to the Digital Insulation Meter using S3. Then swing up the lid and main board assembly to allow you to access the DC-DC converter board. Next connect the DMM’s positive lead to the “+HV out” terminal pin at the rear of the converter board just above D3 and connect the DMM’s negative lead to one of the two ‘earth’ terminal pins of the same board. The TPG pin just above TP3 may be easier to access, but you can use the centre (GND) pin on the right-hand end of the board if you prefer. Now turn the DMM on, and select the 500V DC range (or higher). Then turn on the meter using S3, switch S1 to its ‘250V’ position and then care- fully press and hold down S2 and the DMM reading should be around 250V. Then adjust trimpot VR1 to give a reading of 225V. By doing this, the resultant test voltage across a 1MΩ load should be very close to the setting. Alternatively, if you envisage testing equipment with internal MOVs, etc and possibly portable RCDs, do the voltage adjustment on the 250V range. In this case, adjust trimpot VR1 to give a reading of 265V. This will result in a test voltage across a 100kΩ load of close to 250V. (Those pedantic readers who have very accurate DMMs may prefer to make the adjustment to 262V but the resulting test voltage will still depend on the overall resistor tolerances.) Either way, you only have to adjust VR1 on one range as the other ranges will be pretty close to their nominal values. Once you are satisfied with the voltage adjustment, you can turn off the power via S3, remove your DMM measuring leads and refit the lid assembly into the box. You can then fit the screws which hold the lid and box together and your Digital Insulation Meter is now ready for use. SC June 2010  89