General Criteria
For purposes of both signaling and animation, it is often desirable to know when a moving locomotive, car, or even vehicle has reached a particular point or location. For train/car detection this can take the form of a block detector, which will send a signal (usually electrical) when a loco or car has entered an electrically isolated block of track. This block length can vary to accommodate the largest anticipated train length on a layout. More accurate position detection is sometimes needed, where the absolute position is most important, rather than coarser block detection. This might occur when positioning a train at the end of a hidden staging track, or spotting a car on a loading track inside a building.
Absolute position detectors are often optical detectors, detecting the absence or presence of a light source. Mechanical and magnetic contacts have been used too. Mechanical contacts tend to become unreliable over time, and magnetic sensors require cars to be equipped with small magnets strategically places on the cars and/or locos. Thus, my preference has always leaned to optical detection.
Recently, I have been using IR proximity detectors (seen here in Scale Model Animation 14: Grade (or Level) Crossing Control https://forum.mrhmag.com/post/scale-model-animation-14-grade-or-level-crossing-control-12198577 )
IR Detector Module
While I’ve tried to be imaginative hiding these in scenery, buildings, behind rocks, dead trees, piles of rubbish, boulders, and “creative burms,” they are a general pain. The obvious solution is to remove the emitter and detector from the board and then rewire them so as to relocate them away from the detector board. This quickly becomes a strain on my already limited amount of patience.
The New Detector
The new Differential Absolute Position Detector (DAPD) uses 6 components, and is relatively easy to build. It can be used with both DCC and DC train control, and for any scale. There are 2 different versions of the DAPD. The first is designed for very small size, and uses surface mount devices (SMD’s). The board layout is such that it could substitute for a portion of an HO scale track tie, and be disguised (covered) in place. This design is for a single detector.
PD4L Schematic
PD4L Board
PD4L Board
The second version is designed for easier construction, and uses through-hole devices. The board layout is such that it is separate from the sensor that can be placed between the rails, and then wired to the detector board some inches away, nearby. This detector can support two independent sensors between the rails, to provide two independent detector circuits.
PD6L Board (PT19 Here and PT204 Are Interchangeable; Track PT204's Connect to SENxE &SENxC - Emitter and Collector Respectively)
PD6L Board
PD6L Board with Components
The PC Board can be ordered from this board fabricator: oshpark.com
The boards are 2 layer boards. OSHPark offers a public service fabricating very high quality, low cost PC boards in low quantities. Download the (Eagle PCB layout) board files (.brd) from here:
http://www.scalemodelanimation.com/Articles/DAPDetector/DAPDetector.zip
Set up an account at OSHPark (really easy) and upload the board file(s) you want to fabricate and specify the quantity (always in multiples of 3—their rules) either of these will cost $ 3.80 for 3 ($1.27 per board). They accept Paypal and will ship international. I have no vested interest in OSHPark – I’m just a satisfied customer. Please feel free to use whatever fabricator you know. I know of no source for fully built boards. That could change in the future.
The bare boards are shipped “panel-ized” so break or cut them apart. Follow the component diagrams and pictures, to solder the components to the board. Use a low temperature soldering iron or a low wattage soldering iron for these.
How it Works
The detector uses two small ambient light sensors based on a photo-transistor (a PT19 SMD device or a PT204 through-hole part). The ambient light hitting each sensor is compared. When the light level of the sensor between the rails falls below the light level of the nearby sensor, the output of the detector goes low (to ground). The detector can be powered over a wide range of voltage. I have tested mine successfully from about 4.6 to 14 volts. The output normally has a 10K pull up resistor on board, that can be omitted or adjusted to your needs. It is not critical. In fact, I have used 8 different phototransistors (including some surplus ones for which I have no specs) and they all work better than most other optical detectors I have used. Some adjustment may be needed for the two emitter resistors, depending on how different your choice might be. Note well that the emitter resistors are different, to force the sensor “off” under clear ambient conditions. The detector output can drive a LED directly for occupancy detection (the cathode- negative side – connects to the detector output; the anode – positive side – to the same positive voltage powering the detector through a current limiting resistor, which is chosen for LED brightness and supply voltage).
The light sensitivity of this detector is mostly in the same range visible to the human eye. This means the light in your layout room that the modeler sees is what is relevant. I have found that I can lower the light level to be darker than what I would consider to be a “normal” comfort level for operation, and still have the detector working. Likewise, very bright light internal lighting works well too. However, absolutely no light does mean no detection. If you want to place the detector in a lightless tunnel or building, simply add a lighted LED or incandescent lamp nearby and you should enable correct operation. Remember both sensors need to see about the same unobstructed “ambient” light levels. If the sensor not between the rails sees a much lower light level, the sensor may never turn on. If the sensor not between the rails sees a much higher light level, the sensor may always be on. I hope this point is obvious.
Bill of Materials (with digikey.com representative parts)
PD4L Board:
2 - PT19-21C/L41/TR8 Digikey #1080-1384-1-ND PHOTOTRANSIST FLAT CLR MINI SMD 0.47
1 - TL331IDBVR Digikey #296-10168-1-ND IC DIFFCOMPARATOR SINGLE SOT-23-5 0.59
2 - Digikey #P10KACT-ND RES SMD 10K OHM 5% 1/8W 0805 0.75 / 50
1 - Digikey #311-5.1KARCT-ND RES SMD 5.1K OHM 5% 1/8W 0805 0.32 / 25
PD6L Board:
4 - ALS-PT204-6C/L177 Digikey #1080-1019-ND LIGHT SENSOR AMBIENT 3MM ROUND 0.63
1 – LM2903N Digikey#LM2903NFS-ND COMPARATOR DL -40-85 C 8-DIP 10168-1-ND 0.39
4 - Digikey #CF14JT10K0CT-ND RES 10K OHM 1/4W 5% CARBON FILM 0.40 / 10
2 - Digikey #CF14JT5K60CT-ND RES 5.6K OHM 1/4W 5% CARBON FILM 0.40 / 10
The following are used for pull up resistors on the Sensor Outputs typically to +5 Volts or the sensor supply voltage:
2 - Digikey #CF14JT1K00CT-ND RES 1K OHM 1/4W 5% CARBON FILM 0.40 / 10
I have found this detector to be more useful and reliable than any other I have used. I hope you find it useful for your modeling too.
Have fun!
Best regards,
Geoff Bunza