How To Sense Quick Neon Bulb Flashes w/Phototransistor

Thread Starter

prairietech

Joined Mar 12, 2013
24
I am attempting to design a circuit to monitor an electric fence charger. A commercially available test unit with 6 neon bulbs connects to the fence. With each discharge, the neon bulbs blink. Dropping resistors of different resistance indicate voltages from 1000 to 6000 volts. All I am attempting to do is detect which of the 6 are blinking.

I am using this phototransistor, https://www.adafruit.com/product/2831 with a 10k resistor in series with the phototransistor. Using a scope, I can detect a very quick pulse each time the neon bulb blinks. But the pulse is so short, the Arduino doesn't detect it.

What can I do to stretch the length of the pulse so a microcontroller can detect it?
 

dl324

Joined Mar 30, 2015
16,923
But the pulse is so short, the Arduino doesn't detect it.

What can I do to stretch the length of the pulse so a microcontroller can detect it?
I find it hard to believe that an Arduino wouldn't be fast enough. At any rate, you can use the pulse to trigger a one shot.
 

Thread Starter

prairietech

Joined Mar 12, 2013
24
Thanks Dennis. Could you provide more details regarding a one shot circuit?
I also think there isn't enough voltage swing just using the phototransistor to gate the Arduino input.
 

dl324

Joined Mar 30, 2015
16,923
Could you provide more details regarding a one shot circuit?
An example can be found in a 555 timer datasheet. You could also use a logic gate with some resistors and capacitors.
I also think there isn't enough voltage swing just using the phototransistor to gate the Arduino input.
It would be helpful if you posted a schematic so we can see what you're trying to describe in words.
 

Reloadron

Joined Jan 15, 2015
7,517
I am attempting to design a circuit to monitor an electric fence charger. A commercially available test unit with 6 neon bulbs connects to the fence. With each discharge, the neon bulbs blink. Dropping resistors of different resistance indicate voltages from 1000 to 6000 volts. All I am attempting to do is detect which of the 6 are blinking.

I am using this phototransistor, https://www.adafruit.com/product/2831 with a 10k resistor in series with the phototransistor. Using a scope, I can detect a very quick pulse each time the neon bulb blinks. But the pulse is so short, the Arduino doesn't detect it.

What can I do to stretch the length of the pulse so a microcontroller can detect it?
I am guessing your fence voltage indicator looks a little like this:
Electric Fence Circuit.png

These normally consist of 6 or 7 neon bulbs. In the above example if this is what you have what are you looking at? The lamps light in secession depending on the sensed voltage. For example with greater than 5 KV applied NE2, NE3, NE4, NE5 and NE6 would be illuminated. Your linked phototransistor reflects a reaction time of 2uS rise and fall. To detect which of the six are blinking I don't quite get. Your detector only illuminates 1 of 6 lamps? Not lamps in secession as the above schematic would do? You will need one sensor per neon lamp bulb if I read you right? The reason for the 5 second working time in the above is the resistors will begin heating. Is the fence charger outputting SC pulses? They come in assorted versions as to output. If pulses what is the pulse duration?

Ron
 

Thread Starter

prairietech

Joined Mar 12, 2013
24
The tester schematic above would be a fair representation of what I am using. When the fence is not shorted to ground, all 6 bulbs flash. The closer from to the charger the fence is shorted, the less bulbs fire. I have not noticed the resistors heating in my testing so far. I don't know what SC pulses are and don't have a way to measure the pulse duration.

Here is the phototransistor circuit I am using without the emitter section.

This works fine with a raspberry pi running Node Red. The raspberry will detect rapidly blocking/unblocking the light with my fingers but not with the neon bulb. That's why I thought stretching the pulse would be needed.
1667766028052.png
 

crutschow

Joined Mar 14, 2008
34,452
A small capacitor (e.g. 100nF) from Q1's collector to ground may stretch the pulse sufficiently to allow detection.
Along with the capacitor you could try increasing the value of resistor R2 to further stretch the pulse width..
 

Reloadron

Joined Jan 15, 2015
7,517
Based on that a few considerations. Neon lamp bulbs do not really put out much light. Your phototransistor has a response in the 480 to 1050 nm range which should cover the orange / red spectrum of the light from a neon bulb. The phototransistor also has a linear output proportional to how much light is striking it.

This works fine with a raspberry pi running Node Red. The raspberry will detect rapidly blocking/unblocking the light with my fingers but not with the neon bulb.
This leads me to wonder if the neon bulbs are providing adequate light? Also in a circuit with a fence charger if the power to the fence is pulsed AC the neon bulbs are alternating elements 50 or 60 times per second. Here is an example of neon lamps with DC and AC applied. Note in the far right image both elements in the lamp appear to be lit but they are alternating at the AC mains line frequency.

neon lamps.png

Since the phototransistor works when you block and unblock light but not with the neon lamps my best guess is the lamps do not emit enough light. While the phototransistor data sheet reflects a supply voltage of 3 to 15 volts I am not sure how the response will be using a 3.3 volt supply detecting a neon bulb light source. I also assume the phototransistor is shielded from any ambient light?

This is all pure speculation on my part..
 

Thread Starter

prairietech

Joined Mar 12, 2013
24
I can certainly agree with your statements regarding the neon bulbs. My intent was to keep my sensing circuit away from the high voltage and using a phototransistor certainly seemed like the right direction......but now this unexpected brick wall. So far in all my "experimenting" I haven't got nailed by the fencer yet!

Any suggestions? Circuit design is not something I am good at. More of a copy and paste kind of guy.
 

Thread Starter

prairietech

Joined Mar 12, 2013
24
P.S. the phototransistor is able to detect my LED 60hz shop light just fine. I turn off all lights when testing and the phototransistor fits slightly inside a recessed window in the fence tester so outside light should not be a factor.
 

WBahn

Joined Mar 31, 2012
30,062
Using a scope, I can detect a very quick pulse each time the neon bulb blinks. But the pulse is so short, the Arduino doesn't detect it.
I don't see anywhere in the thread (perhaps I missed it) where you tell us how short the pulse is.

Describe the pulse (or, better yet) capture the scope trace (or take a picture of it, or sketch it) so that we can see what the pulse looks like that you are trying to detect.
 

WBahn

Joined Mar 31, 2012
30,062
The tester schematic above would be a fair representation of what I am using. When the fence is not shorted to ground, all 6 bulbs flash. The closer from to the charger the fence is shorted, the less bulbs fire. I have not noticed the resistors heating in my testing so far. I don't know what SC pulses are and don't have a way to measure the pulse duration.
In your first pulse you said that you could see them on a scope. Why doesn't that give you a means to measure their duration?
 

Thread Starter

prairietech

Joined Mar 12, 2013
24
The pulse appears only as a very short vertical line appearing in various places on the sweep. I have a 30 year old non-storage scope that doesn't work very well for this type of application. I tried to make a short video but the frame rate of my phone and the scope make the pulse invisible. A still shot is even worse as the horizontal sweep is even broken.
 

Reloadron

Joined Jan 15, 2015
7,517
Well OK we eliminate ambient light. Next as drawn in your post #9 when light is present your GPIO line to your Pi will be going low. I figure you have that covered in your code. If you have a voltmeter or common off the shelf DMM you could look at that GPIO line and see what you get for logic high and logic low. Since it works running fingers over the phototransistor we know the high and low works with that trick. My best guess is the neon light simply lacks in needed intensity (brightness) and I know from experience a neon lamp bulb is very low lumens. Again, this is all speculation on my part. Based on that speculation if you can find an inexpensive phototransistor that has an added base lead like an NTE 3032 it would allow you to slightly bias the phototransistor so less light would be needed to turn it on.

Next reading WBahn's post I also wonder what the pulse looks like and at what frequency and duty cycle. The Pi should be fast enough to nail it. OK, I get it as to your scope. :)

Ron
 
Top