detecting the state of a 240VAC neon lamp?

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
uberhund
 
Posts: 154
Joined: Tue Dec 02, 2008 4:06 pm

detecting the state of a 240VAC neon lamp?

Post by uberhund »

I wish my Arduino to know the state of a neon oven lamp; i.e., whether it's ON or OFF.

Does anyone have a favorite, economical circuit to civilize the 240VAC required by the neon bulb to a saner, more logic-friendly, Arduino level?
Last edited by uberhund on Sun Jul 08, 2012 4:33 pm, edited 2 times in total.

User avatar
easternstargeek
 
Posts: 347
Joined: Mon Dec 13, 2010 1:39 pm

Re: detecting the state of a 220VAC neon lamp?

Post by easternstargeek »

Use a CdS photocell. You can stick one onto the neon lamp with some clear hot-melt, or other adhesive. You may also have to blank out ambient light- try some black nail-polish. Then, see the lessons in this tutorial:
http://www.ladyada.net/learn/sensors/cds.html
That isn't the most elegant solution, but it certainly is the fastest and easiest...

I do get the sense, however, that you are wanting to tap into the AC circuit. Please be careful doing that. If you choose to, you will need some kind of isolating element, either a transfomer or an optoisolator. Again, a quick-and-dirty, albeit ugly, approach would be to get your hands on a small wall-wart with a 220VAC input, and 5V output. Connect the output to an arduino pin through a 1K resistor. Done.

If you want to go more sophisticated, you can use a clamp-on current transformer like this one: http://www.seeedstudio.com/depot/noninv ... th=144_154
But you will need a little extra circuitry. I would get the voltage output model.

There are also ways to do this with optoisolators, but you have to be very careful keeping safe conductor spacings. Don't go there unless you know what you're doing.

Please tell us if any of these suggestions look attractive, and if you would like more info.

User avatar
uberhund
 
Posts: 154
Joined: Tue Dec 02, 2008 4:06 pm

Re: detecting the state of a 220VAC neon lamp?

Post by uberhund »

Thanks for the comprehensive review of options, EasternStar, and the nice links provided.

I did indeed want to tap into the AC circuits as they are relative available. I really loved your wall wart idea - I had not thought of that.

Also, I was hoping to avoid the CdS photocell approach given ambient light issues, space constraints, the iffy mechanics of affixing the sensor to the bulb, etc., all of which you correctly mention.

But, I happen to have a CdS from an old Big Mouth Billy Bass around here somewhere, and I do not have the 240VAC wall wart on hand. Therefore, CdS it is. The sooner I close up the exposed 240VAC components the better I'll feel.

Besides, my wife, for reasons she is not sharing with me, does not understand why the oven is in 187 pieces on and around the kitchen table. She should know that I'm motivated to get it working again also because I have a vacuum-forming project planned for later this weekend.

Anyway, thanks for the push in the right direction; I'll post pictures when/if I get something interesting working.
Attachments
One of the goals of this mod is to update this old clock with an ethernet and xBee based Arduino equivalent
One of the goals of this mod is to update this old clock with an ethernet and xBee based Arduino equivalent
old clock front.jpg (53.52 KiB) Viewed 4997 times
I called the Smithsonian. They said the round discs with notches are called "gears"
I called the Smithsonian. They said the round discs with notches are called "gears"
old clock back.jpg (53.19 KiB) Viewed 4997 times
Last edited by uberhund on Sat Jul 07, 2012 6:37 pm, edited 1 time in total.

User avatar
uberhund
 
Posts: 154
Joined: Tue Dec 02, 2008 4:06 pm

Re: detecting the state of a 220VAC neon lamp?

Post by uberhund »

As promised, pictures of the oven mod in progress - the old clock being replaced by an ethernet and xBee equipped Arduino.
Attachments
The old Westinghouse being prepped for surgery
The old Westinghouse being prepped for surgery
patient open.jpg (43.27 KiB) Viewed 4997 times
Center lamp is the 220VAC target. CdS was inserted into a small hole drilled into the side of the neon lamp casing. The black leads to the CdS are visible exiting the hole to the left. Sorry - didn't get a pic of the CdS as it actually inserts into the Neon lamp casing. There was a bit of a rush to get the oven working again.
Center lamp is the 220VAC target. CdS was inserted into a small hole drilled into the side of the neon lamp casing. The black leads to the CdS are visible exiting the hole to the left. Sorry - didn't get a pic of the CdS as it actually inserts into the Neon lamp casing. There was a bit of a rush to get the oven working again.
neon lamp target.jpg (57.82 KiB) Viewed 4997 times
Old clock OUT, ethernet-based, xBee equipped Arduino clock IN
Old clock OUT, ethernet-based, xBee equipped Arduino clock IN
where Arduino clock will go.jpg (45.21 KiB) Viewed 4997 times

User avatar
easternstargeek
 
Posts: 347
Joined: Mon Dec 13, 2010 1:39 pm

Re: detecting the state of a 220VAC neon lamp?

Post by easternstargeek »

Hi,
Cool!
Don't be too quick to write off the wall-wart idea- most modern ww's based on switching power supplies have universal global inputs that will take between 100 and 240 volts, even if the plug is designed to fit a 120V receptacle. (if so, it would say so on the label!). Maybe you have one laying around from a broken Bluetooth headset (doesn't everyone?)

If you do use the neon, please consider what will happen if the CdS cell falls off of the bulb (especially if you use hot-melt!). I wouldn't necessarily use that approach for any critical-path control.

Also- are you sure that there is 220V on the neon lamp? In North America, most electric ranges use a 4-wire 240VAC circuit, which means you have access to a neutral (white) wire. In some ranges, the control circuitry, and even some of the elements, actually run on 120VAC, taken from one of the two hots and returned to the neutral. If this doesn't make sense to you, please don't noodle around with the AC stuff, m'kay?

Finally, be very careful modifying any wiring near stuff that gets hot. Electric ranges use nickle-plated wire with high-temp insulation and hight-temp alloy crimp terminals in those areas. Conventional wiring and terminals will eventually fail (perhaps not right away, either) with catastrophic results. The heat hazard comes from the high currents involved, as well as the high ambient temperatures.

In any case, I always wanted to hot-rod my electric range, so have fun, just be smart about it!

User avatar
philba
 
Posts: 387
Joined: Mon Dec 19, 2011 6:59 pm

Re: detecting the state of a 220VAC neon lamp?

Post by philba »

I'm not sure a neon lamp pulls all that much current so it may not be a good candidate for a current transformer.

I'd take a look at using an opto isolator. The LED, limiting resistor and a diode would be wired in parallel to the neon lamp. This would give you an open collector output that is safe for digital use. Any opto will work. You use the diode to rectify the voltage and the resistor to limit the current. Assumptions:
- 220 VAC
- 10 mA LED current
- 0.7V rectifier drop
- 2V Vf for LED
Then you will need a (220-0.7-2)/.01 resistor. For the purposes of simplification, make it 220/.01 or 22K ohms. It will need to be a pretty high power one though - 220 * .01 or 2.2 Watts. 2.5W or 5W standard resistor. The collector of the output transistor is pulled to what ever +v your system uses. High indicates off and low indicates on. You will get a series of 50 hz pulses so will need to deal with that.

Note that some optos are set up for AC so you might not need the diode.

However, you should check the voltage across the neon lamp to make sure. If the voltage is less, adjust the resistor accordingly.

The advantage of using the opto isolator is that it's cheap and you get a digital output that is compatible with what ever voltage your system is.

Phil

User avatar
uberhund
 
Posts: 154
Joined: Tue Dec 02, 2008 4:06 pm

Re: detecting the state of a 220VAC neon lamp?

Post by uberhund »

I like your opto-isolator solution, philba. Thanks for taking the time to run the math.

If the CdS implementation causes me problems, your nice opto-isolator method will for sure be next.

User avatar
uberhund
 
Posts: 154
Joined: Tue Dec 02, 2008 4:06 pm

Re: detecting the state of a 240VAC neon lamp?

Post by uberhund »

Oh - and about my 220/240 typo - my apologies. But as famous electrical engineer Michael Keaton says, "220, 221, whatever it takes."

thefatmoop
 
Posts: 352
Joined: Tue Aug 19, 2008 4:36 pm

Re: detecting the state of a 240VAC neon lamp?

Post by thefatmoop »

Actually not to muddy things up and i'm sure the 22k resistor would work fine, but remember that you're working in AC so watch those peaks:

(240*sqrt(2)-.7-2)/10mA = 33.7kOhm and at 3.4 watts so 5W standard resistor. I'm guessing 10mA isn't the absolute limit of your optocoupler though. you may want to also put a small cap in parallel to the optocoupler's input to help a little with any spikes.


And don't forget that if the optocoupler's peak is 10mA, try going around 8mA.

User avatar
uberhund
 
Posts: 154
Joined: Tue Dec 02, 2008 4:06 pm

Re: detecting the state of a 240VAC neon lamp?

Post by uberhund »

Excellent points, moop. Thanks for adding to the discussion.

This interface has become it's own, no-longer-inconsiderable circuit board now.

User avatar
philba
 
Posts: 387
Joined: Mon Dec 19, 2011 6:59 pm

Re: detecting the state of a 240VAC neon lamp?

Post by philba »

thefatmoop wrote:Actually not to muddy things up and i'm sure the 22k resistor would work fine, but remember that you're working in AC so watch those peaks:

(240*sqrt(2)-.7-2)/10mA = 33.7kOhm and at 3.4 watts so 5W standard resistor. I'm guessing 10mA isn't the absolute limit of your optocoupler though. you may want to also put a small cap in parallel to the optocoupler's input to help a little with any spikes.


And don't forget that if the optocoupler's peak is 10mA, try going around 8mA.
True but not an issue at all. Take the 4N25 for example (cheap, readily available), it is rated up to 60 mA continuous and 3A (!) burst. With the blocking diode we are talking about 50% duty cycle. Also, figuring power consumption of the resistor uses RMS voltage, not peak. In fact, it will actually be 1/2 Vrms * current, though, I'd opt for a conservative approach when playing with 220VAC.

These optos are fairly forgiving so I wouldn't worry about being perfectly exact.

User avatar
jpbot
 
Posts: 27
Joined: Mon Jun 20, 2011 11:41 pm

Re: detecting the state of a 240VAC neon lamp?

Post by jpbot »

I might consider building my own opto-isolator with a neon lamp, cds cell and some heat shrink tubing. Perhaps a little clear silicon sealant or hot melt for fill and to hold everything in the right place and keep strain on the leads from moving parts around within the heat shrink tubing.

It might even be possible to get these pre-built (I think I saw a project that used some).

Then just run the neon/cds opto-isolator in parallel with the original indicator.

User avatar
uberhund
 
Posts: 154
Joined: Tue Dec 02, 2008 4:06 pm

Re: detecting the state of a 240VAC neon lamp?

Post by uberhund »

Neat idea, jpbot. Thanks. I'm a bit far into things to implement this now, but this is a good fall back, should my current version fall apart, explode, or catch on fire. Stay tuned.

User avatar
uberhund
 
Posts: 154
Joined: Tue Dec 02, 2008 4:06 pm

Re: detecting the state of a 240VAC neon lamp?

Post by uberhund »

Here's a photo of the end result - the old analog clock now replaced by a Boarduino/xBee combination of the exact same footprint. When the oven is turned on (as detected by the Cds juxtaposed next to the high voltage, neon bulb oven-on-indicator), the Boarduino/xBee transmits various messages throughout the house (to Adafruit WavShields disguised as books and jewelry boxes) so that 1) fewer dinners get burned, and/or 2) the oven is not forgotten and left on for several days, both frequent occurrences in our house.

I'm glad this worked, but no more ovens for me. It's dangerous in there.

Thanks to everyone in this thread for the generous, thoughtful help.
Attachments
Boarduino oven clock in place.jpg
Boarduino oven clock in place.jpg (64.11 KiB) Viewed 4637 times

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”