How To Sense Quick Neon Bulb Flashes w/Phototransistor

djsfantasi

Joined Apr 11, 2010
9,156
By the way, there are several models of Arduino as well as clones. Which model are you using? It may make a difference.

Plus, I reviewed all of your posts and I don’t see a schematic of how you’re wiring your phototransistors. That would be useful. Include your connection to the Arduino. Just draw one on paper and take a clear photo. Then attach it here.

Also, you’ve been asked to post your Arduino sketch. Please use code tags and paste your code into a post. Ask if you don’t know how to use code tags.

You have been given lots of suggestions to a problem which you haven’t described in sufficient detail. A good answer needs to know this information.
 

Thread Starter

prairietech

Joined Mar 12, 2013
24
By the way, there are several models of Arduino as well as clones. Which model are you using? It may make a difference.

Plus, I reviewed all of your posts and I don’t see a schematic of how you’re wiring your phototransistors. That would be useful. Include your connection to the Arduino. Just draw one on paper and take a clear photo. Then attach it here.

Also, you’ve been asked to post your Arduino sketch. Please use code tags and paste your code into a post. Ask if you don’t know how to use code tags.

You have been given lots of suggestions to a problem which you haven’t described in sufficient detail. A good answer needs to know this information.
My post #9 shows the dirt simple schematic I'm using. Too simple to work that is. I tried an Uno thinking it would be more real-time than the Raspberry Pi / Node Red application I started with.
 

Thread Starter

prairietech

Joined Mar 12, 2013
24
What if I were to use TIL199s with limiting resistors to just get the emitters to fire? I loose the high voltage isolation I was hoping for by using phototransistors.
 

Reloadron

Joined Jan 15, 2015
7,501
Yeah, I agree with the ouch and honestly I am not sure that is the problem or solution. You could try as suggested a pulse stretcher (One Shot) refrigerable circuit. That can be done with an inexpensive 555 timer chip and a few discrete components or actually while I have never played around with a Raspberry Pi if there is a pulse there it should be able to trigger on it. That assumes enough amplitude. I would think a 10 uS pulse would be able to trigger the Pi but again I have never played around with a Pi. Since your LEDs have a visible on time the pulse can't be all that fast.

I wish I could be more help. I don't want to tell you run out and buy a $15 phototransistor and make a bad call. :(

Ron
 
Last edited:

djsfantasi

Joined Apr 11, 2010
9,156
My post #9 shows the dirt simple schematic I'm using. Too simple to work that is. I tried an Uno thinking it would be more real-time than the Raspberry Pi / Node Red application I started with.
Ok, but the schematic in post #9 won’t work necessarily with an Uno. The thresholds for an Uno are 0 up to 0.2 x Vcc = low. (0.5V 1.0V with 5V VCC). Vcc down to 0.7 x Vcc = high (3.5V and above for 5V VCC)

If your pull-up is to 3.3V, you’re in no man’s land and the Uno won’t be able to switch successfully. That is if post #9 is accurate.

AND, I want to see the actual code you are using in the Uno. When you modified the sample sketch, do you think you may have made a mistake? I do and I’m not being condescending. It’s just that I’ve programmed enough to know that there are an almost infinite number of ways an insidious bug can creep into your code.

EDIT: corrected silly math oops
 
Last edited:

Reloadron

Joined Jan 15, 2015
7,501
Ok, but the schematic in post #9 won’t work necessarily with an Uno. The thresholds for an Uno are 0 up to 0.2 x Vcc = low. (0.5V with 5V VCC). Vcc down to 0.7 x Vcc = high (3.5V and above for 5V VCC)
I need a channel check. I thought the thread starter was using a Rasbery Pi but now reading post #1 I do see mention of an Arduino. Now I see what I missed.
I tried an Uno thinking it would be more real-time than the Raspberry Pi / Node Red application I started with.
Well alrighty, the Uno would be 5 volt logic. The Pi would be 3.3 volt logic. So yes, with an Uno the logic in post #9 won't work unless the V+ is changed to 5.0 volts.

Ron
 

Beau Schwabe

Joined Nov 7, 2019
155
As suggested this might be a voltage threshold level issue. Here is an AGC(Automatic Gain Control) that uses a Photo transistor in reverse bias mode. In reverse bias mode, the PN juction looks like a capacitor to the rest of the circuit that discharges (leaks) proportionally to the amount of light exposed to the PN junction. Another benefit using the Photo transistor in this mode is that you minimize the Miller effect because you don't have the gain of the transistor contributing to amplifying the input parasitic capacitance which could dampen (filter) very quick voltage spikes.

Reference: (Miller effect
https://circuitcellar.com/resources/quickbits/miller-effect/

AGC light trigger.PNG
 

Thread Starter

prairietech

Joined Mar 12, 2013
24
As suggested this might be a voltage threshold level issue. Here is an AGC(Automatic Gain Control) that uses a Photo transistor in reverse bias mode. In reverse bias mode, the PN juction looks like a capacitor to the rest of the circuit that discharges (leaks) proportionally to the amount of light exposed to the PN junction. Another benefit using the Photo transistor in this mode is that you minimize the Miller effect because you don't have the gain of the transistor contributing to amplifying the input parasitic capacitance which could dampen (filter) very quick voltage spikes.

Reference: (Miller effect
https://circuitcellar.com/resources/quickbits/miller-effect/

View attachment 280267
Thanks! I'll build this circuit hopefully this weekend and report back.
 

DickCappels

Joined Aug 21, 2008
10,153
Here is the spectral response of the Vishay phototransistor shown in post #21.
1668360391872.png
Orange covers about 600, so the transistor's response will be down to about 40% compared to the peak.
 

djsfantasi

Joined Apr 11, 2010
9,156
Here is the spectral response of the Vishay phototransistor shown in post #21.
View attachment 280591
Orange covers about 600, so the transistor's response will be down to about 40% compared to the peak.
is there a way to calculate the voltage output given this data? I think it’d be just as easy to measure the output directly. I still think the voltage is not high enough to be read as a high by the Arduino and has nothing to do with the pulse width.

In that case, another transistor could be used to provide a high enough level for the Arduino.
 

DickCappels

Joined Aug 21, 2008
10,153
You have to multiply the phototransistor's response as a function of wavelength times the intensity of the neon lamp as the wavelength varies.

Not practical for the most part. I would try it and go from there. There are always photomultiplier tubes and maybe in this case, ways to modulate the neon bulb so as to be detectable with less noise.
 

Reloadron

Joined Jan 15, 2015
7,501
is there a way to calculate the voltage output given this data? I think it’d be just as easy to measure the output directly. I still think the voltage is not high enough to be read as a high by the Arduino and has nothing to do with the pulse width.

In that case, another transistor could be used to provide a high enough level for the Arduino.
That would be my guess and neon lamps are not quite the picture of brilliance.

Ron
 

DickCappels

Joined Aug 21, 2008
10,153
Looking back at the first post in this thread, we are leaning over backwards to detect a 600 volt pule from an electric fence. I would seem much more efficient to sense a 1kv to 6 kv pulse than to try an note the glow of a neon lamp. I think we are on the wrong track.
 

Reloadron

Joined Jan 15, 2015
7,501
Looking back at the first post in this thread, we are leaning over backwards to detect a 600 volt pule from an electric fence. I would seem much more efficient to sense a 1kv to 6 kv pulse than to try an note the glow of a neon lamp. I think we are on the wrong track.
I don't know Dick. My take was the fence pulse were 6 KV and the detector circuit was similar to what I posted in post #8. My guess was the thread starter was using a photo transistor to detect the illumination from a neon bulb. I based my logic on that. Now I don't know what to think with think being the operative word. :)

Ron
 
Top