My Mains Monitor


Every so often, the mains power circuit breaker in the van trips for no apparent reason. Sometimes, it even trips for a good reason (air-conditioner + hair dryer + microwave oven + etc. >15 amps).  Keeping an absorption fridge at temperature in very hot weather can be challenging. We went to bed one night expecting the relative cool overnight to help get the fridge temp down to something reasonable but woke the next morning to find that the van and hence the fridge had lost mains power sometime during the night.


I built a simple mains power monitor to alert us to mains power failures. It uses old technology: lights and buzzer. Maybe one day its successor will use Twitter (or its successor) to send us the bad news.

Green is Good
“Green is Good!”

In summary, it:

  1. is powered from the van battery (even when van is connected to mains);
  2. lights a green LED to show that both battery power and mains power are present;
  3. takes its “mains on/off” signal from an off-the-shelf AC-DC power adaptor;
  4. lights a red, flashing LED and sounds a buzzer when mains power is not present.

It has not yet experience a real life mains failure but it is tested regularly: every time we decamp I forget to turn it off before I remove the mains power lead and the monitor always reminds me!


For those interested, here is the circuit I used.



In essence, it is just two transistor switches in series, each driving an LED, and with the first transistor inverting the input signal for the second transistor.

  • The monitor is powered from the van’s 12V system and therefore, importantly, from the van’s 12V battery when mains is not connected. I use a short cable between J2 and one of the van’s “cigarette lighter” sockets.
  • An 240V AC to 12V DC adaptor (not shown in schematic above) is plugged into J1. It provides safety isolation of the monitor from the high voltage AC mains supply as well as a conveniently low voltage DC signal that indicates the presence or absence of mains power (note 2).
  • The voltage divider R1 & R2 reduces the input signal voltage from 12V to approximately 2V, which saturates T1 without cooking it.
  • R3 & R6 are current-limiting resistors for LED1 & LED2, respectively.
  • Jumper JP1 is normally shunted; removing the shunt mutes the buzzer.
  • Both transistors operate as switches rather than amplifiers, i.e. they are either fully off or fully on (note 4).
  • When input signal is present:
    • voltage applied to base of T1 is significantly more than 0.7V above its emitter;
    • T1 turns fully on and current flows through LED1;
    • base of T2 is pulled down to ground by T1;
    • with its base voltage less than 0.7V, T2 is fully off and no current flows through LED2 or B1.
  • When input signal is not present:
    • base voltage of T1 is pulled down by R2 to less than 0.7V above its emitter;
    • so, T1 is fully off and no current flows through LED1 (note 3);
    • T1 is not pulling down the base of T2;
    • so, R5 pulls the base of T2 to significantly more than 0.7V above its emitter, turning  it fully on;
    • With T2 on, current flows through LED2 and B1.
  1. If you leave the monitor turned on when travelling, it flashes and buzzes continuously. If you turn it off but forget to turn it on when you are next connect to mains power, it is a waste of space. A future redesign could indicate the loss of mains rather than the absence of mains (i.e. trigger on a falling edge rather than a low level).
  2. Depending on the internals of the AC-DC adapter you use, there may be a delay before loss of mains is indicated by the monitor (mine takes about 30 seconds). The monitor draws very little current from the adaptor so the smoothing capacitor in the adaptor on the DC side takes that time to discharge to a voltage low enough to trigger the monitor. This is not necessarily a bad thing: it allows deliberate short term disconnection without setting off the alarm.
  3. When the input signal is not present, LED1 may be dimly lit. T1 is off, but a small amount of current flows from the positive supply (VCC) through LED1, R3, R4 and T2’s base-emitter junction to ground.  This could be avoided by a more complex circuit, probably using two more transistors. In practice, with LED2 flashing red and B1 buzzing, a faint, green glimmer in LED1 goes unnoticed.
  4. For a discussion of transistors operating as switches, I suggest


  • J1 is a socket chosen to suit your AC-DC adaptor, in my case J1 is a 2.1mm socket
  • J2 is a socket chosen to suit the cable that you use to connect to 12V battery power: I used a cable with a cigarette lighter plug on one end and a 2.1mm plug on the other so my J2 is also a 2.1mm socket
  • my B1 is a 3-30V DC buzzer (Jaycar part AB3458); any noisemaker that works from 12VDC and does not draw more current than the maximum collector current of T2 should do it
  • for LED1, I used a green, 5mm LED (Jaycar part ZD0150)
  • for LED2, I used a red, flashing, 5mm LED (Jaycar part ZD1785)
  • for each of T1 & T2, I used a BC237 because I had them on hand, but any  NPN transistor with sufficient collector current to drive an LED plus the chosen  buzzer should work (e.g. 2N2222)
  • the value of R3 should be chosen to suit your choice of LED1 when used with a 12V supply
  • the value of R6 should be chosen to suit your choice of LED2 when used with a 12V supply
  • the values of R1 & R2 should be chosen to reduce the input signal voltage to a voltage that will saturate T1 without cooking it. I used a 240V AC to 12V DC power adaptor to generate the input signal because I had one on hand, not because it was 12V. I then choose R1=10K and R2=47K, which reduces that 12V DC by a factor of 10/57 (approximately 1/6), resulting in approximately 2V begin applied to the base of T1 when mains is present (and 0V when it is not)
  • the other resistor values (R4 & R5) are not as critical: I settled on them after experimenting with values that minimised the issue noted above whereby LED1 glimmers dimly when LED2 is on; different transistors may require different resistor values for R4 & R5 to minimise this effect;
  • for the enclosure I used an ABS plastic box (Jaycar part HB6120)
  • the board was cut from a piece of Pre-Punched Experimenter Board (such as Jaycar part HP9550).


If you read this far, you probably know how to solder all of that onto a board and put it into a box. Here is a picture of the insides of mine before it was screwed together.

  • The white, cylindrical component is the buzzer. At 25mm in diameter it is relatively large; fitting it into the box in a way that avoided the board’s mounting screws was a bit of a squeeze.
  • The LEDs are glued using epoxy-resin into holes drilled in the lid of the box.
  • Pairs of breakaway header pins on the board and wire pairs with female sockets on one end are used to connect the LEDs and sockets to the board. (I used female-female breadboard wires cut in half.)
  • The ink doodling on the board itself should be ignored!

Next Episode

Coming up (hopefully), is a Three-Way Fridge Monitor …