Mains Distribution Panel

This was originally going to be a quick review and investigation of those cheap panel meter modulues you can buy on eBay for around ten UKP (including postage - how do they do it?). There are many different types, and I bought several, but this article covers the dual AC voltage and current types. I bought a couple, and the plan was to take one apart and investigate it, and build the other into an MDU (mains distribution unit) for my bench.

However, like so many of my projects, it quickly snowballed into something rather more complicated. For anyone thinking about buying these modules, I hope the information presented here is of interest.

Safety warning

Warning: this article deals with mains electricity. The reader must understand the risks associated with this, and be suitably qualified before attempting to try similar things, taking all necessary precautions during design, component selection, construction, and use.

The author disclaims all responsibility for loss or damage, and reading further implies full agreement with this disclaimer.

Cheap mains monitor panels

These modules feature dual readouts showing mains voltage and current, in a compact unit that simply snaps into the front panel of your enclosure. The current is measured using a current transformer, so you simply feed through a wire carrying the current to be measured through the centre of the transformer. The unit is powered from the AC mains, and measures the voltage applied. Very convenient.

      mains monitor units (78k)

I could think of several uses for such a thing as supplied, but I also had other ideas that I wanted to explore. For example, when building bench power supplies, decent monitoring is usually an expensive part of the project, and often you end up having to compromise by having a single meter that must be switched between voltage and current. Could this neat dual display unit be easily adapted for this application?

From the eBay pictures, I could see that there were two PCBs - it looked like one was responsible for signal conditioning, and the other was driving the LCD. They appeared to be joined by a pair of 4-way 0.1" headers. There are a series of annunciators for "AC", "V", "A", etc. Could these be altered? Only one way to find out!

Once I had the units in my grubby hands, it didn't take long to see that my initial guesses were correct. Upon separating the two PCBs, I could see two COBs on the display PCB - no-doubt some variant of the ubiquitous 7106 - and a lot of zero-ohm links that were presumably for setting up display options.

View of the meter
     PCB (92k)

This PCB snaps into the plastic surround, and is connected to the LCD glass by the usual elastomeric strips. There is a plastic diffuser with a blue LED mounted in the end - the red and black wires are connected to that.

From a look at the circuitry on the rear PCB, we see that the power supply is based aroung a capacitive dropper. Be warned - the capacitor is not correctly rated for mains operation - it should be a self-healing X2 rated device. As it stands, a mains surge might cause the capacitor to fail short-circuit, and take out the whole meter. OK, perhaps not a big deal given how cheap these are, assuming that nothing catches fire in the process, but on the other hand, if you've taken the effort to mount one of these in a project, you'd be pretty upset if it fails and you are unable to find an exact replacement some years down the line.

     of the signal PCB (89k)

Another problem is the clearance between the pins and pads carrying the incoming supply voltage. As you can see, the layout is very tight.

Additionally, the 100Ω series resistor is a standard carbon-film unit, and in capacitor-dropper situations, these really need to be surge-proof carbon-composition devices. This failing won't cause fireworks, but it's a possible suspect if the unit suddenly fails in the future.

At the very least, change the capacitor and resistor - I did at first. But as you'll see, I ended up taking things a bit further...

In my opinion, I don't consider these units to be safe for direct connection to the AC mains as supplied. At the very least, use a fuse - perhaps 0.1A time delay. I would strongly recommend that you change the dropper capacitor to one that is rated for mains operation (X2).

Circuit description

Needless to say, there are no schematics available for these, so that was the first thing to put right. This was reverse-engineered from my examples, and no-doubt contains errors. Click to enlarge:

      for large version of the schematic (20k)

The capacitor dropper is pretty straightforward - just the aforementioned component quality to watch here. The supply is held at 9 volts by a Zener diode, which regulates when the input voltage reaches around 90 volts. Current draw at 90V is 13mA, and this rises to 36mA at 240 volts.

For metering purposes, the mains voltage is divided down by a string of resistors and presented to the display PCB via the upper 4-way header.

The current circuitry is rather more complicated. There is a dual op-amp fitted to the PCB, although only one section is used. It is amplifying and rectifying the signal from the current transformer - at a glance I see an amplifier followed by a half-wave rectifier (D3, D4) that is sensing the positive peaks of the waveform. D5 in the feedback loop appears to make the gain of the amplifier asymmetrical so that negative-going exertions have half the amplitude of the positive ones. I would need to spend a bit of time exploring this circuit a bit more to fully explain it, but it does seem like a very economical design. Although I later discovered that it doesn't work very well when you wind up the signal level...

Producing a schematic of the meter board wasn't feasible because of the COB construction. However, I did spend a bit of time exploring all those configuration links. The links are in pairs, and only one of them should be fitted at a time. It seems that they let you decide what to do with certain segments of the LCD glass - they connect to different phases of the LCD drive signals to either enable or disable them. So, time to reach for the soldering iron to move some links:

Table 1 - Link settings - supplied defaults indicated with *
Designation Function
1A Turns on "A" legend on lower meter*
1A0 Turns off "A" legend on lower meter
1V Turns on "V" legend on upper meter*
1V0 Turns off "V" legend on upper meter
1N Turns on "INPUT" legend to the left of the top display
1N0 Turns off "INPUT" legend to the left of the top display*
OUT2 Turns on "OUTPUT" legend to the left of the lower display
OUT20 Turns off "OUTPUT" legend to the left of the lower display*
2N Turns on a Chinese legend to the left of the upper display
2N0 Turns off a Chinese legend to the left of the upper display*
OUT2 Turns on a Chinese legend to the left of the lower display
OUT20 Turns off a Chinese legend to the left of the lower display*
1P02 Turn off decimal point DP2 in lower display (19.99)*
1P12 Turn on decimal point DP2 in lower display (19.99)
1P1 Turn on decimal point DP3 in lower display (199.9)*
1P10 Turn off decimal point DP3 in lower display (199.9)

So, quite a few things can be changed, but overall it's a bit disappointing. As it seems that we can't turn off the "AC" designations on the left of the display, we can't use this module for a general purpose bench power supply. Well, perhaps we could if we were prepared to do some serious investigation and cut some tracks...

Not being able to control the decimal points on the upper display is a shame. A bench PSU might go to 18V, in which case it would be nice to have 18.00V showing on the meter. Or 30V, so 30.0V. But as all the decimal points are off, that's out. But at least we have some control of the lower meter's decimal points.

Having said that, I have spotted another type that might be more suited to DC PSU use. Watch this space!

Modifying an MDU

Time to build one of these units into an MDU (mains distribution panel). My new bench has plenty of mains sockets, but they are at the rear, intended for the test gear. For "equipment under test", I needed to have easily accessable sockets, so an MDU with 13A outlets, mounted in a "bay" at the top of my bench is ideal.

The unit was rescued from a skip some years back, and was missing its mains lead. I decided to fit an IEC socket on the back, as captive mains leads are generally a PITA. But as IEC sockets are only rated to 10A, I added a 10A thermal cutout to the front panel - the same type as used on my isolating transformer, which is mounted in the same part of the bench. This breaker is also very convenient operationally, as the four sockets are unswitched types.

After a bit of careful metalwork, here is how the front panel looks:

The front
      panel of the MDU after cutting openings for the meter and breaker

For peace of mind, I modified the panel meter (an X2 rated dropper capacitor and a nice surge-proof carbon-composition resistor in series) and connected up the meter to the exising wiring inside the MDU.

The panel
      modified with an X2-rated capacitor (64k)

But I wasn't especially happy with it. The voltage readings were close enough from 80 volts and above, but the current meter was a bit useless for this application. Having 100mA resolution on an electronics bench is a bit lacking in granularity - it might be fine if I was routinely fixing toasters and kettles!

Remembering that I could move the decimal point of the current meter to the left, I then wondered if I could increase the sensitivity of the current circuitry by a factor of 10, to give 10mA resolution. The meters appeared to be 1999-count types, so that should be feasible. It seemed to me that the easiest way was to increase the burden resistor connected to the current transformer.

With a 6R8 instead of the original 0R68, things seemed OK. But as I tried a range of different loads, it was obviously very non-linear at the upper end of the scale - say above 5A. I made careful measurements and proved that everything was OK coming from the current transformer, and therefore the strange amplifier/rectifier must have been playing up. Hmm...

At this stage, I could have simply replaced the original 0R68 resistor and lived with it. I didn't fancy trying to optimise the original rectifying circuit - especially as it's all surface-mount. But I'm not one to leave alone, and especially so having come this far. I kept thinking back to how uneasy I was about the safety of the module, and no matter how hard I tried to remove the thought from my mind, there was only one logical course of action:

I was going to rebuild it!

Rebuilding the signal conditioning circuitry

The basic idea is to retain the PCB that contains the meter driver ICs, but replace the rear PCB that contains all the signal conditioning. Let's start by soldering a ribbon cable to the pins on the display PCB and the backlight LED:

      meter PCB with a ribbon cable attached (97k)

There is plenty of space in the box for a sizeable piece of Veroboard. So, out goes the capacitor dropper, replaced by a miniature transformer safely powering the electronics. A "textbook" precision rectifier should do the job, and a simple pre-amplifier ahead of that can raise the level from the current transformer. Simple!

Now that the circuit was safely isolated from the mains, another possibility presents itself - something I've been meaning to build for some years... When working on equipment powered from the mains, it's occasionally really handy to be able to look at the current waveform, and as I have a current transformer here, I can provide a copy of the signal from it on a front panel BNC connector. As it happens, the op-amp count was up to 3 (one for the pre-amp and two for the precision rectifier), so providing a buffered version of the current signal neatly uses up the last section of a quad op-amp.

Likewise, another BNC socket for the mains voltage waveform is easy to include. These sockets will fit just below the display. OK, in an ideal world - where I had thought about this first - I would have made the display opening a little higher up from the centre-line, but even so it should work well enough...

Incidentally, I did briefly consider using a couple of AD536 RMS converter ICs for the metering. This would have been very simple, but a criminal waste of two very expensive ICs. True-RMS sensing is very nice, but I had doubts about the linearity of the meters anyway - no-doubt they had to cut corners when it came to the quality of the integrating capacitors. But by providing sockets with accurately scaled versions of the current and voltage waveforms, I could easily make a true-RMS reading using an external DVM if required. Providing adjustment tweaks for the two outputs will ensure that they can be properly calibrated.

Investigating the meter PCB

Time to learn a bit more about the metering. Having attached a 10 way ribbon cable, I was able to hook it up to a bread-board and experiment. With reference to the previously determined schematic, I was able to discover the following:

  1. The meters are set to 2V FSD.
  2. There is no negative indication.
  3. They are not especially linear.
  4. Nor are they accurate when reversing the polarity.
  5. The "reference" input is fixed at 3V below the positive supply, but it can be dragged down.

It's possible that swapping the integrator capacitors might improve the accuracy - I decided to leave that for now. The last point is especially interesting, as it proves that these are indeed 7106 - the "analogue common" pin of these is held to this point, but can easily be brought down as required. Unfortunately, if you do that, the accuracy of the meter suffers.

The negative input appears to be connected to "ref", so everything will have to be referenced to it. Hopefully the op-amps in the rectifier will be able to swing sufficiently to get full-scale deflection without having to power the op-amp from a higher supply than the panel meters recieve. If these are set to 9V, then perhaps 12V could be applied to the op-amp? We'll have to see how this works in practice - in theory, it only needs to be accurate to 10.00 amps, which is 1.000V to the meter input, but it would be nice to have a bit of "headroom" built in.

The new design

After a bit of quality time with the prototype board, I found that the initial ideas worked pretty well. The result isn't perfect, but certainly much better than the original unit, and good enough for the time being. Minor criticisms concern the linearity of the rectifier at very low currents, but as I'm aware of this, it's not a serious problem. If I ever get around to optimising it, I'll update this page with the details.

Power supply

Digging through my stores, I found the perfect transformer: a PCB-mount 3VA unit with dual 20 volt windings. Why so high? After all, the unit only needs 9 volts or so...

The higher the output voltage of the transformer, the better this unit will behave as the mains voltage falls. It does mean that under normal conditions, there will be a high voltage dropped across the power supply regulator, but as the operating current is tiny, this won't be a serious problem.

The power supply
      for the modified meter (11k)

One winding is full-wave rectified and smoothed, and the resulting DC is regulated by a simple 7808, which has a small heat sink fitted. The other winding is used to provide an isolated and scaled down version of the mains waveform - and it is also used to provide the measurement of the mains voltage.

Once complete, I checked the operation of the circuit using a variac, and found that the transformer doesn't seem to saturate at 250V, which is the upper limit of what I could source. The voltage waveform is fed from a 50Ω source impedance, and the exact voltage can be trimmed - it's a simple case of watching two DVMs; one connected directly to the mains, and the other connected to the output. Once they agree, the Voltage meter can be calibrated by tweaking the small pre-set resistor on the meter board.

Current transformer

I re-used the current transformer from the original unit. It is a 500:1 device, meaning that for every amp that flows in the single-turn primary, 2mA flows in the 500 turn secondary. With this connected to a 10Ω resistor, you get 20mV/A developing. This is fed into an op-amp with a gain of x5, so at the output of this, there is 100mV for every amp flowing in the primary.

      current transformer and amplification (9k)

The output of the first op-amp is fed into another op-amp; this time working as a unity-gain buffer, which feeds the output connection on the front panel. As with the voltage monitor, the source impedance is 50Ω. Also in common with the voltage monitor, there is a pre-set to ensure the current output is accurate - this one affects the meter reading as well, so the pre-set resistor on the meter board shouldn't need re-adjusting after the initial calibration (in theory, at least).

The output of the first op-amp is also fed to the rectifer circuit.

The rectifier

For this, the standard "precision rectifier" seemed to give reasonable results. Having completed it and tested it more thoroughly, it does become inaccurate at low amplitudes (below about 200mA), so I plan to try some more development on this in the future. To be honest, the readings from the unit are just an indication anyway; if I need precision, I can simply connect a true-RMS DVM to the front panel socket.

As a result, I don't recommend trying to copy this part of the circuit at this stage - regard it as an "early prototype"!

The precision
      rectifier (9k)

This version is discussed in many text books and on-line articles - I used the diagram on page 222 of The Art of Electronics as my starting point. For more background, I'd recommend reading Rod Elliot's AN001 for more information on rectifier circuits.

Full schematic

Several details have been omitted so far, including +Vref, which is derived by the ICs on the meter board. The full schematic covers all these loose ends - click to enlarge:

      for large version of the schematic (24k)


The circuit was built on a piece of Veroboard. As there is no shortage space inside the case, the layout is fairly "relaxed". Needless to say, the mains traces were done extremely carefully, with strips of copper removed from around the traces to increase the clearances.

      new signal conditioning board (72k)

This picture shows the board mounted in the case:

The new
      signal conditioning board fitted (58k)

As you can see, a sheet of Paxolin has been fitted behind the board to prevent any accidents. A heat sink has been added to the voltage regulator IC - not that it gets especially hot in practice. You can see the various connections that are made to the board, starting with the LCD module on the 10 way ribbon cable on the left. The two BNC sockets are connected via the 2-way connectors (red/black twisted wires), and the mains input on the right. That is a 3-way 0.1" Molex connector, but the centre pin has been removed from the header to increase the distance between Live and Neutral. Finally, the Live wire travelling through the current transformer is clear to see.

The finished
      mains distribution unit (36k)

This top view shows the mains wiring, which has been neatly bundled together using cable-ties. Note the loop of brown wire at the right hand side - this was left to allow easy calibration with a current clamp:

Loop for calibration with a current-clamp (69k)

Here it is installed in the "power bay", along with my isolation transformers and the 1U MDU (with IEC outlets on the rear) that feeds all the gear mounted in the bays above the desk. Since the earlier picture of the front panel, it has been spray-painted using RAL 7035 (light grey), which is a reasonable match with other gear. The paint job wasn't perfect, but not bad for an an aerosol, and certainly better than the chipped and scratched panel. Ideally, it could do with being labelled, but I'll never get around to doing that!

New MDU installed in bay (42k)

Behind these is a twin 13A socket that both MDUs plug into. The isolation transformers are powered from an outlet of the 1U MDU. All these are switched off when the bench isolator is operated.

It's interesting that my new camera (a Canon S120) has made the blue backlight appear to be purple. My previous camera (a Canon IXUS 850) did a much better job - although in reality the blue is actually somewhat deeper in real life. Perhaps the high-sensitivity CMOS sensor in the new camera is more sensitive to UV?

A more accurate shade of blue (32k)


A relatively simple project, but one that is an essential part of the new workshop bench and is already proving to be very useful. I do intend to revisit the rectifier to improve the accuracy of the low current readings, but there is a bench DMM within a short distance, so on the odd occasions that accurate current measurements are required, it's no hardship to plug that up to the BNCs. Far more useful in practice is the ability to observe the voltage and current waveforms provided by the BNCs - I've already used these extensively when investigating equipment.

In addition to the rectifier, I also plan to measure the frequency response of the current monitor output. It's just a case of using a good audio power amplifier to drive current through the current transformer while sweeping the signal. It will be nice to ensure there are no unexpected peaks or other artefacts, and to know what the bandwidth actually is. But don't hold your breath - my to-do list is growing all the time!