A very simple IR Train Sensing Circuit.

On page 20 of the December 2009 issue of Model Railroader is a Correction to the IR Train Sensing Circuit published on page 64 in the October 2009. In general, the 470 Ohm and the 470K Ohm resistors got reversed. This circuit problem was as figured out in the DCC Forum http://cs.trains.com/trccs/forums/t/160848.aspx very simple IR Train Sensing Circuit is using just one IR Sensor, one Transistor and one LED is showned in the following picture. It can sense the tip of your finger more then 1/2 inches away.

Robert Frey

[IMG]http://i140.photobuck

Using IR to sense train movement is also an interest of mine. I have found an inexpensive two component solution to this problem. Please check out this article on my web site. Edit: Not sure why the link did not show up. Here is the link: http://www.coralfringe.com/IRDetection.html

My Digi-Key Part Search: http://www.digikey.com/

QRB1114 is $1.51 MPSA27 is $0.47 511-1250 is $0.27 The picture is of a Fairchild Optoelectronics Group QRB1114 IR Sensor that is mounted under my HO Track.

How’s that?

Three albums of photos from the streets of Hyderabad in India by Rangachari Anand

http://www.coralfringe.com/

He also made reference in his article to IRDOT detector from Micro Mark.“Standard IRDOT-1 mounts to underside of track base board.Emitter/detector pair installs through hole drilled between ties. Trains passing overhead reflect the beam and trip the circuit.”

http://www.micromark.com/SearchResult.aspx?deptIdFilter=0&searchPhrase=IRDOT

“IRDOT-1DEW with extended wire-leads has separate emitter and detector attached to 18 inch long leads for mounting in tight spaces or for use as a beam splitter (trains break the beam and trip the circuit). Features a 4 to 5 second delay on detection drop-out so that indicating lights don’t flicker as a train passes over the detector.”

www.logicrailtech.com I like the stuff they have and simple.

Yes, Logic Rail Technologies does make easy to use Optical Detectors. The Optical Detector OD-1-IR for example, utilizes an infrared emitter and detector between the rails. When the beam is not reflected the OD-1-IR will activate its green output. Use this version under any layout lighting condition.

http://www.logicrailtech.com/sigani.htm

Quite a difference in price between this commercial product and your two designs isn’t it? Will your design work just as well?

By substituting a 2N3904 transistor for the more expensive and hard to find MPSA27, I have gotten Robert’s circuit to detect up to 2 inches away.

Yes, a 2N3903 NPN General Purpose Transistor would be lower cost and the circuit would still work. Use two 2N3903 Transistors connected as a Darlington. This would be a better replacement for a MPSA27 NPN Darlington Transistor, and still have a lower part cost. The Darlington requires more sensor light to operate, but because of its high gain, the LED turns on and off quickly as you move your finger over the IR detector at 1/2 inch from its face.Parts to build (10) IR sensor circuits from http://www.digikey.com/

QRB1114-ND (SENSOR IR NPN) is $12.29, MPSA27GOS-ND (TRANS NPN DARL) is $3.18, P470KCACT-ND (RES 470K OHM) is $1.71, RNF1/4T1470FRCT-ND (RES 470 OHM) is $1.05 P680CACT-ND (RES 680 OHM) is $1.71, 511-1250-ND (LED 3.1MM RED) is $3.17, Shipping U.S. Postal is $4.80, Sale Tax is $1.16, Your ONLINE ORDER Total is $26.

Logic Rail Technologies Sensor can be use under any layout lighting condition. (It uses more electronics to eliminate the Indecent or sun light problems.). http://www.logicrailtech.com/sigani.htm

Other Infra-Red Train related products:

DALLEE ELECTRONICS Infra-Red Optical Detection #552/553 http://www.dallee.com/Optical_Detector.htm

Ram Track Electronic Devices http://www.ramrcandramtrack.com/ramtrkbro.pdf

See page 4 of 6 pages

RAM 102 INFRA RED SWITCH. This system uses infra red. For convenient,

I had posted some remarks earlier in this thread. I have several update on my experiments with IR sensors:

  • The Sharp IS471 sensors that I used work very well but, ultimately, I removed all of them and decided to go with reed switches instead. I found it very tedious to assemble and install the IR sensors on the layout. I need a large number of sensors and it would have taken me months to finish them. I found a new kind of reed switch that is much easier to install. Details can be found in my blog. I think IR is a great solution for modelers who need only a few sensors.
  • I recently found that Sharp has discontinued the IS471 chip (which I used) in any case so you will not be able to use it.
  • I found this great IR sensor on Rob Paisley’s web site which works in a manner very similar to the Sharp IS471 chip (except with discrete components). Obviously it will be much more expensive than Robert Frey’s design however, it will be more resistant to spurious triggering.

I was just looking at Rob’s octal circuit. I’d need to add a bit of additional logic on the output to do what I was planning. I have 2 staging tracks at each end of my layout, each track is more tahn double the length of a typical train, so I was plannign to allow doubling up. Since there is absolutely no way to actually see the staging tracks without removing the removable backdrops, I want to have indicators on the fascia. My idea was to have a green light for each half track that is on when NO train is there. At the clearance point would be a sensor to trigger a yellow light - so as the train starts to enter the track, the green light goes yellow. At the stopping point would be another sensor that turns on a red light so you know when to stop. So - track has a green light, line the switch for that one. As you enter the track, yellow light goes on. AFter you are clear the yellow goes out. When the red comes on, stop.

–Randy

Hi Randy,

Question is 2 staging tracks at each end of layout, each track is more double the length of a typical train.

Answer is Five IR sensor in each staging track. Example Train 1 enters staging track 1. Color is Red then Yellow then Red then Yellow then Red. STOP! (End of track is now Yellow off & Red on.)

Train 2 enter staging track 1. Color is Red then Yellow then Red. STOP! (Beginning of track is now Red off, Yellow on, and mid. Red on.)

The basic idea is Begining, 1/8, 1/2, 5/8 and full. STOP!. (If the Begining is on, then the turnout is not clear.)

Regards,

Robert Frey

See, I figure I can do this with just 4 sensors per track. Repeating the same example:

Track 1 is empty. 2 green lights. Train enters. Yellow A comes on…keep going. Red A comes on…Green B is on so keep going. Yellow B comes on. Red B comes on - STOP. Second train comes in. Green A is on, RED B is on because a train is in the back half. Yellow A comes on, kee going. Red A comes on - STOP.

–Y------------------------R-----Y-----------------R-| sort of like that. Green LED would be driven by a NOR gate from the yellow and red - when neither one of those is on, green is lit. Only downside is a short train will turn on the green after the yellow goes out but before the red lights. Easy to take care of by rule: always run your train into the siding until the red light comes on. Or since I plan to use track detection for signals on other partsof the layout, I could add in the signal from a detector in each half of the siding. Seems like overkill to keep a spurious green light off. Option 2, use some sort of IR sensors as shown to feed a PIC or Atmel chip with simple coded logic to activate the LEDs. Gives me an excuse to play with a PIC.

–Randy

OK Randy, just 4 sensors per track. But remember, when your two Red sensors are on, both Yellow sensors MUST BE OFF. Regards Robert Frey

PS: I am going on vacation for 2 weeks.

Yes - that’s the sanity check. If the red comes on before the yellow goes off, your train is too long.

Which means you probably picked up one too many cars, or forgot to set one out.

–Randy

Doing this with a PIC or Arduino is definitely one way to go about this. I just got an Arduino and am having fun exploring model railroad uses. However, I would suggest that you look into JMRI and investigate the possibility of doing this in software. You may already be using DecoderPro for programming your decoders.

Anand