# Photo resistor comtrolled signals



## 2869ral (Dec 15, 2015)

I found some really nice, cheap photo resistor light detection modules on ebay. Im going to use them for my crossing gate controls, and block signals. I have made a diagram of the block signal circuit (its a rough diagram, i will clean it up and post later) on paper it looks good. There will be 1 PR module and 1 relay per block. Each module will have 3-4 photo resistors in series to detect train movement. When a train enters the block the module will throw up a red block on that signal. Also the same module will throw a yellow block up at the previous signal and a flashing yellow on the previous block to it. So each module will control 3 block signals: red, yellow(approach), flashing yellow (approach medium), and all the other signals not affected by train movement will go to default: green (clear block). In the next couple of days im going to solder up this circuit with 5-6 signals to see how it works. All the electronics will cost approx. $5.00 per block to make this circuit work. Now this is minus the signal stand and power supply. Other than it will take a lot of soldering and wire, its really a simple circuit. I will post the results when im done.


----------



## gunrunnerjohn (Nov 10, 2010)

A link would be nice.


----------



## wvgca (Jan 21, 2013)

I assume that the emitters / detectors are in the IR frequency to reduce interference from room lighting / random visible light reflections??


----------



## 2869ral (Dec 15, 2015)

These are standard photo resistor, i do not have a layout to test these on yet, so, i can not say for sure they wont have glitches. I have experimented with photo resistors on my previous layout, and i wasn't that happy with them. These modules are adjustable and seem to work VERY well, and placement of lights or even a hidden LED across the tracks im sure will help with that problem. The circuits i have experimented with so far using these PR modules have worked great for detection with the lights on or off on my desk, but have not been tested on an actual layout (real world scenario) yet. Im very happy with these modules so far, they look promising. We will see.


----------



## gunrunnerjohn (Nov 10, 2010)

Here's an eBay link, I'm not sure how well this is going to function, time will tell...

DC12V Light Control Switch Photoresistor with Relay Module (Dark Detection)


----------



## 2869ral (Dec 15, 2015)

http://www.ebay.com/itm/12V-Fire-De...017329?hash=item2ed03ae931:g:h1MAAOSwkZ9UYgee
Or here is the IR detector if you prefer
http://www.ebay.com/itm/272091212534?_trksid=p2057872.m2749.l2649&ssPageName=STRK:MEBIDX:IT
And these IR emitting diodes


----------



## 2869ral (Dec 15, 2015)

Ok, maybe this is a bad idea? I don't want to spend hundreds of dollars on a signal system. Maybe it will have some glitches, maybe not, but probably will. I want my layout to work and look as realistic as possible, but that being said if there are a few glitches with the gates or signals thats ok with me, its a model railroad. I don't mind making a few sacrifices placing some extra light somewhere to make these photo resistors work better. I like building stuff, and model railroading is where i like to apply that. When i build this signal system and if it works (probably with some glitches) i will post it here. And if anyone likes and wants to build their own, i will be happy to help them out. So follow along if you are interested. Well im called to drive the real thing now, i hope these signals don't have any glitches!


----------



## gunrunnerjohn (Nov 10, 2010)

I prefer the reflective signal sensors that bounce IR off the passing train and trigger an action.


----------



## 2869ral (Dec 15, 2015)

I just bought a few of the IR modules and IR emitters. Im going to experiment with them as well. I dont see why they couldnt replace the photo resistor modules if thats what someone prefers.


----------



## gunrunnerjohn (Nov 10, 2010)

It's not like it's a "preference", it's more like what will work reliably.


----------



## 2869ral (Dec 15, 2015)

Ok understood, no interest here for my signal circuit.


----------



## 2869ral (Dec 15, 2015)

wvgca said:


> I assume that the emitters / detectors are in the IR frequency to reduce interference from room lighting / random visible light reflections??


Thanks, i realy do appreciate your input on this. I will experiment with IR modules.


----------



## martink (Oct 30, 2015)

I've used LDRs (light dependent resistors) with my own DIY circuits on two layouts (N and T gauge) for signal and automation control, with good results, and intend to keep using them in the future.

However, there are a few things to watch out for:
- they respond to the same range of light as the human eye
- you can happily run them off room light as long as that is steady and predictable, but it can be a problem if you have daylight coming in through a window, or you lean over the sensor, etc.
- watch out for shadows of trains passing on adjacent tracks - you may need to use masks or baffles.
- in less predictable environments, you really need to provide a suitable light source (I have LEDs hidden in a couple of footbridges over the sensors on my T gauge exhibition layout that has to cope with all sorts of awful lighting conditions) 
- in practice you have to do one of the following: have an adjustable sensitivity setting; or use two LDRs (e.g. one between the rails and the other beside the track) to get a differential signal; or detect a sudden change (lightening/darkening) as a train moves on or off the sensor.


----------



## 2869ral (Dec 15, 2015)

martink said:


> I've used LDRs (light dependent resistors) with my own DIY circuits on two layouts (N and T gauge) for signal and automation control, with good results, and intend to keep using them in the future.
> 
> However, there are a few things to watch out for:
> - they respond to the same range of light as the human eye
> ...


Good information, thank you.


----------



## mikek (Dec 29, 2013)

I'm using photoresistors in my current crossing control. I like them much better than phototransistors, which required another whole board to run them. The photoresistors just need a pot and a transistor to function, the board 2869ral sent to me works fine. 
The pot adjusts for ambient conditions, so when I put it on a track I'll do what's necessary to prevent accidental triggering.
The board Ron sent me should be great for controlling track signal lights or switches. I like the convenience of a ready-made board, just hook up supply and demand, and it's done.


----------



## gregc (Apr 25, 2015)

mikek said:


> I'm using photoresistors in my current crossing control. I like them much better than phototransistors, which required another whole board to run them.


a photo-resistor, photo-diode and photo-transistor are all interchangeable, although they have different sensitivities and require different component values. Photo-resistor are not wavelength dependent and photo-diode/transistors may need a LED source of the correct wavelength. Just to be clear, I've attached an image of a photo-resistor.










in the circuit, the photo-resistor can be replaced by either a photo-diode or photo-transistor. I forget if the resistance of a photo-resistor goes up or down with light. It and the 100k resistor can be swapped to turn on the LED with or without light. Photo-diodes and photo-transistors resistance goes down with light. A transistor will typically conduct more current (have less resistance) than a photo-diode.

the transistor in the circuit simply amplifies the the change in voltage across the photo-resistor and such a circuit (without LED) may be appropriate with any use of a photo-detector to insure that the output (collector of transistor) is fully on/off.


----------



## TomW2034 (Jun 2, 2015)

gunrunnerjohn said:


> I prefer the reflective signal sensors that *bounce* IR off ...


Thanks for the circuit! The 555 appears to be everywhere.

Your wording leads me to think the the sensor & LED are on the same side of the track but the stick figure looks like the photosensor waits for the train to break the light beam emanating from the other side of the track.

Will either case work, or is one better?

Thanks,
Tom


----------



## gunrunnerjohn (Nov 10, 2010)

They can work either way Tom. I have some that bounce off the train, but there are also versions that go across the tracks. Both have their advantages.


----------



## gregc (Apr 25, 2015)

a sensor (e.g. photo resistor) embedded between the rails is fine if there is overhead lighting for detection on a specific track location. This obviously won't work in an unlit tunnel but is simpler that a sensor and source.

a sensor mounted on the side of the track above the height of the trucks with a source on the opposite side is another obvious approach. It must be oriented at a relatively small angle to avoid the problem when the coupler between cars (gap between cars) happens to be at the detector location, if you wish to detect a train when stopped

mounting the same upright detector and source further apart (e.g. many feet) at a sharper angle to the track allows them to detect one or more cars occupying a longer section of straight track. This can work on curves as well, both on the outside of the track. Overlapping detectors could also be used to detect one or more cars on a longer length of track.

the various approaches solve different problems. But the devices and electronics can be the same.


----------



## gunrunnerjohn (Nov 10, 2010)

One way to minimize false triggering is to use careful alignment and put the sensor in a tube so that incident light is less likely to hit it.


----------



## 2869ral (Dec 15, 2015)

I said "its really a simple circuit" WOW IM PULLING MY HAIR OUT!!! I have the signals going from green to red and the previous signal to yellow, but i havnt been able to get the flashing yellow to work. Im going to keep plugging at it today, im bound and determined to get it working. Do i post videos the same way as a picture?


----------



## DonR (Oct 18, 2012)

No. Post the videos to Youtube then use the Youtube icon
above to add them to your forum post.

Or you can copy and past a direct Youtube link. I actually
prefer that because it permits full screen viewing where
the Youtube Icon does not, at least on my Windows 7.

Don


----------



## gunrunnerjohn (Nov 10, 2010)

Actually, there's no problem full screen viewing with the YouTube icon, you just click on the YouTube at the bottom of the video and it takes you to YouTube.


----------



## TomW2034 (Jun 2, 2015)

*Maybe one last observation?*



gunrunnerjohn said:


> I'll refrain from comment further ...


I liked & understood that schematic you posted.

Are you aware of a Chinese offering of a photoTransistor implementation (such as you descibed) on eBay?

I am really tempted to "Buy it now" a handful of the OP's "12V Fire Detection Module Flame Sensor Relay Module Infrared Receiver Module"s to play with. 

Thanks,
Tom


----------



## gunrunnerjohn (Nov 10, 2010)

I have some I bought several years ago, but I can't find them now. It was from a seller called *wehonest*.


----------



## 2869ral (Dec 15, 2015)

Ok thanks DonR, gunrunnerjohn,. I will post a video as soon as i complete this test strip im building and figure out the youtube deal. I got a lot done today, i have my signals going from red to yellow to green but no flashing yellow yet. The problem is i need to attach another relay. The green aspect goes out when the signal drops red, but the green stays illuminated when the aspect goes yellow. For some reason this doesnt allow the yellow to flash on the advance approach. So when i add another relay to make the green aspect go out when the yellow is illuminated then i should be able to make the advance aproach signal flash. While building this circuit, i definitely see how these photo resistors are touchy. I think i can make them work fairly well for my layout, but im definitely going to experiment with the IR modules when i receive them. This has been a lot of work just to make 7 signals work, but it sure is neat to see them work like they do so far.


----------



## 2869ral (Dec 15, 2015)

TomW2034 said:


> I liked & understood that schematic you posted.
> 
> Are you aware of a Chinese offering of a photoTransistor implementation (such as you descibed) on eBay?
> 
> ...


http://api.viglink.com/api/click?fo...ww.ebay.com/itm/12V-Fire-Det...MAAOSwkZ9UYgee


----------



## Patrick1544 (Apr 27, 2013)

Just got a few of these photo resistor relay circuits. They work very well and sensitivity is adjustable. The photocell can fit between the rails nicely. The relay can be used for N.C. green and N.O. red when tripped by train covering the cell. 

http://www.ebay.com/itm/252006360948?_trksid=p2060353.m1438.l2649&ssPageName=STRK:MEBIDX:IT


----------



## mikek (Dec 29, 2013)

Welcome, Tom, to the Rabbit Hole (electronics). I'm having just so much fun blowing LEDs and transistors. Learning the hard way that not all NPN transistors have the same pinouts, and that I need to do a little checking on amp draw to a component before trying to drive it with a little itty bitty transistor, when a power transistor may be needed. The pain is tremendous.
But I'm learning. I just hope I can remember all this stuff. I keep forgetting to see if octocouplers (optoisolators, optopussies like to blow, too, if you overload them) might help, especially when I'm mixing voltages. 
I have made smoke more than once, electricity only gives you one chance, usually. 
While I'm visiting family this weekend I'll search for a Radio Shack to get a better breadboard. All the Radio Shacks by me closed, and the net says they have good ones. The ones I have were cheap e-bay jobs, and some of the holes are worn out from forcing oversize components into them. I hope the new ones are better. It's tough when one time you're putting in a power transistor or mosfet, and the next time it's a little resistor lead or such. Just shoot me.


----------



## TomW2034 (Jun 2, 2015)

*I've already got that Tee-Shirt*

Thanks, Mike, but it's more like "welcome back" in my case.

I made my fair share of smoke back in high school before noticing I was infinitely better at rebuilding & repairing mechanical stuff than I was at assembling piece-part electronics to do what I wanted.

This new age of Chinese-stuff-on-a-board-just-add-power has re-kindled my interest.

Did you see the crossing bell ringing circuit I made of eBay parts GunRunnerJohn pointed me to? No smoke ON THE FIRST TRY! :appl:






It had a great sense of accomplishment... and it alerts the whole house of potential danger when activated...

Tom


----------



## gunrunnerjohn (Nov 10, 2010)

I have a similar bell, it's around 9" in diameter, the sucker is LOUD!


----------

