DANGER: This project deals with mains voltages which, among other things, can KILL you DEAD. If you choose to replicate any portion of this project I am in no way responsible for any adverse consistences that may result.
So, I have this vapor tight light fixture that I’ve been wanting to make blink on and off, like a radio or cell phone tower signal light but was having a hard time coming up with a practical way to do it.
The main problem is that the light fixture runs off of 120 volts and I was not finding a practical cheep a way to control a mains voltage light. Sure I could use a DMX controller but that’s expensive and overkill. I found light socket flasher buttons (insert the “button” between the bulb and the socket and heat change makes the light blink) but those are old school, hard to find, wear out over time, and the flash rate is not customizable.
Of course I thought about using a microcontroller like my Arduino to control the light, but interfacing mains voltage devices with low voltage microcontrollers seems to be something a lot of people steer away from (the Arduino forums seem to be particularly against it). So, I was having difficulty finding circuit designs that would put me on the right path.
I finally came across this blog post which had a low voltage switching mains circuit; exactly what I was looking for.
Switching 120 Volts with 5 Volts (or less)
The circuit is really nice, it allows you switch mains voltage devices while keeping whatever low voltage trigger (e.g. a microcontroller) you’re using completely isolated from the mains voltage. I only made one change to the circuit by adding a 2200 uF capacitor on the low voltage side to help with flash timing:
The key component in this circuit is the MOC3020M, an opto-isolator/triac. What happens is when light from an internal LED (pins 1 and 2) comes on the emitted light causes a change the resistance between the internal triac (pins 6 and 4) allowing it to conduct. The internal triac on the MOC3020M is used to trigger a second (external) triac, in this case a 2N6073A, which is used to switch the mains voltage device.
By using an opto-isolator you break the physical (i.e. electrical) connection between what’s on the side of pins 1 and 2 (your low voltage trigger) and what’s on the side of pins 6 and 4 (high voltage device). The 2N6073A triac is used simply because it can handle larger loads (up to 4 amps if a proper heat sink is used) than the MOC3020M can handle on its own. I used a 2 amp breaker to keep the 2N6073A well away from its 4 amp limit for a couple of reasons: one, I don’t plan on using a 480+ watt bulb in the light (currently using a 25 watt) and two, I could not fit a proper heat sink on it.
With this circuit you can switch and mains voltage device with as little a 1.5 volts.
Making it Blink
I had originally intended to use my Arduino to control the blinking of the light, and though it works great and offers a lot of control options (variable blink speed, etc.) I decided to go a different route and use a simple LED blinking circuit because I just wanted the light to blink on and off and the Arduino (or other microcontroller) solution felt like overkill.
I decided to use a simple transistor based LED blinking circuit because I already had the parts for it, and it was relatively simple to modify the flashing speed to get what I wanted:

Notice that I used 1Mohm resistors instead of the 100k used in the original circuit. The two 1Mhom resistors along with the capacitors control the blinking speed. Lower resistor and capacitor values means a faster blinking rate. If you wanted to be slick you could probably use potentiometers in place of resistors to make the blink rate adjustable on the fly.
The circuit is designed to flash two LEDs back and fourth and is admittedly superfluous; a single LED flasher would have worked just fine. I decided though that I wanted to use the second LED as an indicator on the enclosure of the flasher circuit.
Instead of connecting an LED on the right side I connect the mains switch. The combination of resistors and capacitors that I used on the flasher circuit gave me a blink rate of nearly 20 flashes per minute from the vapor light. In case your wondering, 20 flashes per minute seems to be the slowest flash rate that the FAA permits(pdf – page 43).
Notes
- The flash rate is controlled by the two 1Mohm resistors and the capacitors on the flasher circut. I had to experiment with various configurations of resistors and capacitors to get the flash rate I wanted. Using the two 1Mohm resistors gives you about 1.6 volts to the LEDs which is not enough to make an LED light up very bright but is enough to trigger the mains switch.
- The 2200uF capacitor used on the mains switch is not necessary but in this case is used to help get the flash rate of the light where I wanted it.
In Action
Build Pictures

Here is the mains switch laid out on a breadboard for testing. I tested that the circuit worked several times before connecting mains voltage to it.

The flasher circuit laid out on the bread board. The tape on the left transistor is there to identify it as bad (I fried it during testing).

I hadn't really worked out enclosures for everything before starting the project. I finally decided that there was enough room to put the mains switch inside the vapor light's junction box and run a cable out to control it.

I cut a piece of acrylic for the mains switch to sit on when mounted in the junction box.

Belive it or not I managed to get everything to fit in the junction box, even the breaker. The red CAT5 cable (with the two orange wires) will connect to the flasher circuit.

The breaker is as much for safety as it is to protect the 2N6073A from being overworked since it does not have a heat sink. Since the junction box walls were a little too thick for the retaining clips on the breaker, I used a little hot-glue to help keep it in place.
Tip – I used a stepper bit/Unibit to drill the hole for the breaker. Stepper bit/Unibits are great for drilling holes like this, if you don’t have a set, seriously get yourself one. You will not regret it.

I used a CAT5 cable from the light to the flasher box so I could plug it in with an RJ45 plug. This way I can easily change what controls the light if I want. I used a barrel adapter for power so I'd have the option to use a wall wart; here it's powered by a 9v battery pack.
Mains Switch Parts List
| Part | Supplier | Part # | Quantity | Price (ea) | Total |
|---|---|---|---|---|---|
| Opto-isolator/triac | DigiKey | MOC3020MFS-ND | 1 | $0.82 | $0.82 |
| Triac | DigiKey | 2N6073AGOS-ND | 1 | $0.57 | $0.57 |
| IC socket | DigiKey | AE10022-ND | 1 | $0.88 | $0.88 |
| 2 amp circuit breaker | DigiKey | PB183-ND | 1 | $5.40 | $5.40 |
| 200 ohm resistor | DigiKey | P200BACT-ND | 10 | $0.078 | $0.78 |
| 1 kohm resistor | DigiKey | P1.0KBACT-ND | 10 | $0.078 | $0.78 |
| 2200uF 16v capacitor | DigiKey | P13115-ND | 1 | $0.80 | $0.80 |
Flash Circuit Parts List
| Part | Supplier | Part # | Quantity | Price (ea) | Total |
|---|---|---|---|---|---|
| NPN transistor | DigiKey | 2N3904TFCT-ND | 2 | $0.33 | $0.66 |
| 10uF capacitor | DigiKey | P966-ND | 10 | $0.077 | $0.77 |
| 470 ohm resistor | DigiKey | P470BACT-ND | 10 | $0.078 | $0.78 |
| 1 mohm resistor | DigiKey | P1.0MBACT-ND | 10 | $0.078 | $0.78 |









Hi there! Congrats on the website! I especially liked the iPhone Call Recorder (I actually found this website while searching for the app), and the whole fuss around it in Gizmodo
.
I’m a noob in electronics, just now starting using arduino (as I am more of a programmer..)
So, if it’s not too much of a bother:
I THINK I get the flasher circuit, though I’m not sure – didn’t find a decent explanation on the web.. But why does the capacitator on the switch help with the flash timer?
@Tiago Rolão
Here is a good explanation of a capacitor – http://en.wikipedia.org/wiki/Capacitator
In the case of my circuit – The capacitor is is charged by the blinking circuit. That charge takes a little time (milliseconds) to dissipate out of the capacitor (think of the capacitor like a battery with a really short life). If the capacitor was not in place the 120v light would go off immediately when the blink circuit was not powering the MOC3020M. The delay created by using the capacitor affects the blink rate of the light.
In reality the capacitor on the switch circuit is not necessary – you could simply adjust the timing of the blink circuit. I had the cap in place already so it’s important to note that if it’s eliminated the blink rate will be affected.