Neon Lighting controller

Thread Starter

russpatterson

Joined Feb 1, 2010
353
A friend of mine picked up a neon sign and asked if I could help him animate the separate letters with a micro-controller. I did one project a while back where I switched on a large 110VAC water pump with a uC and a large Solid State Relay (SSR), which worked fine. However it seems that with the high voltage transformer and neon tube there is some magnetic issues to consider. I found this article here that recommends switching at the 60 - 90 phase of the incoming 110VAC power.

http://www.allanson.com/wp-content/uploads/Product_PDFs/Flashing_Animating_apps.pdf

There are some interesting graphs in there.

In order to know the phase of the incoming power I was considering a circuit like this:



I would sample the voltage at at the RC0/AN4 pin to know the phase of the AC power. Does this seem like a reasonable approach?
 

JohnInTX

Joined Jun 26, 2012
4,787
Other than violating TOS (mains connection) you should do this with an opto isolator with a 1n4004 diode in series with the LED with appropriate dropping R. You'll get half wave out of the transistor. The edges correspond roughly to zero crossing and high/low indicates the phase.

You can also pick off the secondary of the transformer that powers the low voltage stuff before the rectifier to get an image of what the line is doing.
 

Thread Starter

russpatterson

Joined Feb 1, 2010
353
Thanks for the reply John. I'm not sure what LED your referring to. I want to switch a neon sign light. When you say, 'half wave out of the transistor' what transistor are you referring to?
 

Thread Starter

russpatterson

Joined Feb 1, 2010
353
Thanks #12, so everything in the 'box' in your drawing represents the optoisolator part? The only components you add are the two 15K resistors?
 

JohnInTX

Joined Jun 26, 2012
4,787
A typical one that #12 showed is H11AA1 which will work fine as a zero-crossing detector i.e. when the input crosses zero, the LEDs will be OFF and turn the transistor OFF. The collector resistor will pull the output up until the next 1/2 cycle's voltage is enough to turn on the other LED when the output will go low again. The result is a series of short spikes corresponding to when the line crosses 0.

The above won't tell you the phase, however. To do that I was suggesting something like an H11A1. Its input will only be on on the positive 1/2 cycle making the output low on the positive 1/2 cycle and high (LED off) on the negative 1/2 cycle. Note that in this case zero crossing is indicated by the CHANGE in the output and the phase by what the output changes TO. To work the 1/2 wave method, you'll need add a 1N4004 diode in series with the input in the same direction as the LED because the LED cannot withstand the reverse voltage on the negative 1/2 cycle. A 15K 1 watt R should be OK on the input. The output pullup should be 1500ohms or more.

Either method finds considerable use for applications like yours.
You still need a transformer power supply to isolate the uC from the mains.

As for software, I'd consider using one of the interrupt-on-change pins of the PIC to IRQ on each zero crossing. When servicing the IRQ, poll the input to see which way it changed.

EDIT: Actually, I'm not sure why you need to know the phase of the AC i.e. which 1/2 cycle the line is in. If all you want is some delay after zero crossing, #12's ZVS is the way to go. On each IRQ from it, start a timer that interrupts the PIC after some delay into the 8.33ms 1/2 cycle. Servicing THAT interrupt indicates you are at a specific point in the 1/2 cycle. Since the ZVS interrupts the PIC at each zero crossing, it will automatically be symmetrical over the full wave AC.
 
Last edited:
Top