Jump to content

Train position detection in tunnel


morairamike

Recommended Posts

On my layout, I have a tunnel that occupies fairly large area (see photo). Two tracks enter the tunnel and two track exit the tunnel. Inside the tunnel are 4 points that split each of the two tracks into 2 passing sections, so there are are 4 tracks in the tunnel. This was envisaged as a hidden fiddle yard. Problem they are hidden by the quarry and the village of Barton Rise.

I was advised to buy TKDA14A61 Smart Car Robot Avoidance Sensors IR Infrared Barrier Arduino Modules. These arrived (see photo) and contain a TX and a RX, the LED type devices on the PCB. If power, 5V is applied to the PCB, the power LED illuminates on PCB and if a reflective surface is put near them, the detection LED on PCB illuminated. Any suitable device connected to the output pin also operates.

However the PCB is quite large and mounting near the end of the passing loops was the next hurdle.

I decided to remove the TX and RX units from a PCB and attach them to fly-leads. When they were pointed at each other and moved towards each other, when in range the detection LED illuminated. The detection range is adjusts using the PCB mounted potentiometer. So they didn't need to be on the PCB.

A gantry was constructed to span the 4 tracks. Four 5mm holes were drilled in the gantry directly above the track centres, but located far enough down stream of the point so a parked train on one track would not interfere with a train running on the twinned passing section.

Then a sleeper was removed from between the rails directly below the four hole and four more 5mm holes drilled through the base board.

The TX's were pressed into the gantry from the top and the RX's were pressed into the baseboard from below. The TX's were rewired to the PCBs and the RX's were rewired to the PCBs via an 8 way cable which runs through the base board and up the gantry.

The control panel was modified by the addition of four yellow LEDs, one in each of the four tracks.

DCC for the four PCBs and the four control panel LEDs was derived from the voltage regulator unit inside the control panel. This already supplies the other front panel lights and is set at 2.7V. I was concerned that 2.7V might be too low for the detector PCBs, but they work as required on that voltage.

Testing.

With power applied the four PCBs illuminated the power LEDs and the detection LEDs and the four yellow LEDs on the control panel illuminated. When a train was passed under the gantry the associated front panel and detector PCB LEDs was extinguished.

The scenery was refitted and the system tested. Now trains can enter the tunnel and stop on one track and another train can pass through or leave the tunnel from the associated passing section.

My layout is DCC but this will work with non DCC layouts.

forum_image_6234c687a336c.thumb.png.ab95891e68b1f510d591c58c542626a3.png

forum_image_6234c68c38386.png.902c1206e21f88fef8b9a2472ee7e7aa.png

forum_image_6234c68d3480b.thumb.png.6f41b5a41cb4da009d718bc328ab03fe.png

forum_image_6234c6911b53e.thumb.png.70868eb26897de52cf8c30c9d6cad29e.png

forum_image_6234c69595930.thumb.png.8c2990bcc815519fe05215faf2112de2.png

forum_image_6234c6992afda.thumb.png.c0a1092bb62240c56a5e11d518d17f18.png

forum_image_6234c69ccf710.thumb.png.daa5380717317ac4ffa811cffb80a052.pngforum_image_6234c6a17c01f.thumb.png.f9242769d0fb31743da3e7b310a9ac7f.png


 


Link to comment
Share on other sites

Nicely done Mike. Being in the ‘shade’ should preclude any false tripping.

I have a bag full of 4-pin IR devices (digital or analogue output) and many spare Tx-Rx led pairs intended for use in loco detection for automatic train control, but the collector device used as the interface twixt track sensors and PC didn’t work well with IR, so my track sensors are now simple reed switches.

Link to comment
Share on other sites

Mike,

I am also using those "detectors" in a four lane Siding I am building on to my layout. The sidings are fed from a cluster of points and I have a turntable at the far end. I have cut slots in the baseboard near each end and will fix the detectors under the baseboard and hopefully they will register when a "train" is over the slot. I will have to remove the sleepers that would otherwise cover the slots. I have connected the unit output to led's on a mimic panel. I should perhaps add that the sidings are in an adjacent room out of sight! I probably will be buying a cheap video camera to help me see what's happening. I am presently fabricating wiring looms but getting close to assembling and will post some photos once the track is laid.

Link to comment
Share on other sites

An interesting circuit Rob, I have been using micro switches placed under the sleepers, and ir detectors but placed as a break beam horizontal system. Never thought of putting the LED IR emitter and receiver photodiode on the same pcb vertically.


Is the output sufficient to drive an LED as I don't have the specs for the LM358N op amp to hand. Is the circuit public domain or copyright?

Link to comment
Share on other sites

SoT,

With my basic understanding of electronics I think the answer is no. The wiring diagram I have, and what I have built, needs a positive feed to the Sensor Unit and the same feed is split to the mimic led. The negative pin of the led connects back to the output of the sensor. My circuit works without any additional resistors but the schematic I received showed a nominal resistor between the mimic led and the sensor. Stating the obvious but a negative connection for the power source also needs to go to the Sensor unit. I bought a dedicated 5V power unit.

Link to comment
Share on other sites

@SoT

Mine are 4-pin TCRT5000 devices hence either a digital (on/off) output or analogue (gradient output which could measure range or intensity, etc). The IC is an LM393, rated at 15mA.

As 37 says the output is the switch and needs a common positive rail connection to work.

The output can be made low or high depending on if you set it up as reflective or break beam i.e. switched on or switched off upon detection.

The circuit is a generic opto-coupler used in umpteen applications, so I doubt there is copyright for the concept design, maybe only for the specific valued circuit as shown assembled.

forum_image_6235aa790f8ec.thumb.png.db8e5f75057f029ddf0fa62039370d26.png

Link to comment
Share on other sites

On the 3 pin ones I used the PCBs are fed with 2.7V from the control panel.

The new LEDs on my control panel are connected to the same 2.7V. They are seeking a return to illuminate. That is provided by the output pin on the detector PCB.

If you which to use a relay then supply the Detector PCB with 5v and use a 5v relay.

Link to comment
Share on other sites

This circuit was used by a guy in Malta to detect traffic in and out of his sidings using a pair of relays. I must admit to not having tried it as I didn’t fully comprehend the logic behind it.

forum_image_6235d9c3b6976.png.620c3bcf34e290cc28f7a055bab9f468.png

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
  • Create New...