Trains.com

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

A very simple IR Train Sensing Circuit.

39986 views
18 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    August 2006
  • From: Greendale, WI
  • 108 posts
A very simple IR Train Sensing Circuit.
Posted by Robert Frey on Wednesday, November 4, 2009 12:02 PM
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  A 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

 

 

 

Website: http://bobfrey.auclair.com

  • Member since
    November 2005
  • From: Teaneck, New Jersey
  • 136 posts
Posted by rxanand on Wednesday, November 4, 2009 1:01 PM
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

Slowly building a layout since 2007!

  • Member since
    August 2006
  • From: Greendale, WI
  • 108 posts
Posted by Robert Frey on Wednesday, November 4, 2009 5:27 PM

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. 

Robert Frey

---------------------------------------------------------------------------------- 

Article by Rangachari Anand  October 26 2007

Three albums of photos from the streets of Hyderabad in India.

http://www.coralfringe.com/IRDetection.html

 

His experiments in using IR to detect HO train occupancy.

IR Detector is S471FE  Sharp Microelectronics     Digi-Key Part is 425-2069-5-ND             

IR Emitter is QEC113 Fairchild Optoelectronics Group  Digi-Key Part is QEC113-ND

“A cost-effective way to utilize IR detection on a train.”

 

 

Website: http://bobfrey.auclair.com

  • Member since
    October 2005
  • From: Ulster Co. NY
  • 1,464 posts
Posted by larak on Wednesday, November 4, 2009 7:24 PM

rxanand

 

How's that?

The mind is like a parachute. It works better when it's open.  www.stremy.net

  • Member since
    August 2006
  • From: Greendale, WI
  • 108 posts
Posted by Robert Frey on Thursday, November 5, 2009 4:22 PM

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.”

Website: http://bobfrey.auclair.com

  • Member since
    January 2003
  • From: Ridgeville,South Carolina
  • 1,294 posts
Posted by willy6 on Thursday, November 5, 2009 11:12 PM

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

Being old is when you didn't loose it, it's that you just can't remember where you put it.
  • Member since
    August 2006
  • From: Greendale, WI
  • 108 posts
Posted by Robert Frey on Friday, November 20, 2009 10:11 PM
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 

 

Website: http://bobfrey.auclair.com

  • Member since
    February 2008
  • 8,878 posts
Posted by maxman on Saturday, November 21, 2009 1:59 PM

Robert Frey
Yes, Logic Rail Technologies does make easy to use Optical Detectors. 

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

  • Member since
    July 2003
  • From: Sierra Vista, Arizona
  • 13,757 posts
Posted by cacole on Saturday, November 21, 2009 4:37 PM

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.

  • Member since
    August 2006
  • From: Greendale, WI
  • 108 posts
Posted by Robert Frey on Sunday, November 22, 2009 6:29 PM
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.

 

Website: http://bobfrey.auclair.com

  • Member since
    August 2006
  • From: Greendale, WI
  • 108 posts
Posted by Robert Frey on Wednesday, November 25, 2009 8:15 PM
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 

Website: http://bobfrey.auclair.com

  • Member since
    August 2006
  • From: Greendale, WI
  • 108 posts
Posted by Robert Frey on Friday, February 12, 2010 11:09 AM
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, trackside installation, the IR sender and receiver are each on 1 foot cables attached to the circuit board and powered by 5 to 24 volts D.C.

 Regards,

Robert Frey

Website: http://bobfrey.auclair.com

  • Member since
    November 2005
  • From: Teaneck, New Jersey
  • 136 posts
Posted by rxanand on Friday, February 12, 2010 1:38 PM

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.

Slowly building a layout since 2007!

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Friday, February 12, 2010 7:08 PM

 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

 


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    August 2006
  • From: Greendale, WI
  • 108 posts
Posted by Robert Frey on Saturday, February 13, 2010 8:52 AM

 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

 

Website: http://bobfrey.auclair.com

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Saturday, February 13, 2010 8:01 PM

 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

 


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    August 2006
  • From: Greendale, WI
  • 108 posts
Posted by Robert Frey on Saturday, February 13, 2010 9:51 PM

 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.

Website: http://bobfrey.auclair.com

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Sunday, February 14, 2010 12:52 PM

 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

 


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    November 2005
  • From: Teaneck, New Jersey
  • 136 posts
Posted by rxanand on Monday, February 15, 2010 5:24 AM

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

Slowly building a layout since 2007!

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Users Online

There are no community member online

Search the Community

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
Model Railroader Newsletter See all
Sign up for our FREE e-newsletter and get model railroad news in your inbox!