Train Detection

AlanL

AlanL

Registered
1 Mar 2016
33
0
Northampton
I've received a bundle of components including some miniature 24 volt relays and have been trying a test on the bench. However seeing John's post above using an optoisolator, the relays may not be required.
Yesterday I cut a gap in my test track and filled in the gap with a small piece of rail glued in position -
118869_cafc4e80ab9b6e7ff2821a8a9d263794.jpg


The length of wire was soldered before gluing and as I had glued it slightly higher than the track, I filed and smoothed it so that it was perfectly level with the rail top.

118867_a839792b30b6d3bd754dbe8018d9d5c2.jpg

I then soldered wires to the relay coil contacts and as it was on the bench, decided to try it with a single diode. The relay didn't work, just made a faint buzzing. Perhaps I should have used a lower voltage coil on half-wave? I then soldered a capacitor across the coil, 10uf and with that the relay operated and released instantly. I soldered an LED and battery on the relay contacts to confirm the operation. Earlier in this thread, relay chatter was mentioned so I wondered if a higher value capacitor might delay the relay operation. I tried a 100uf and a 470uf capacitor, they both operated instantly. What did alter was the holding time of the relay. 100uf was about 1/2 second and the 470uf was about 2 seconds.
118871_82034206c8b0aafe5c4d5b11c3945340.jpg


With the test circuit connected to the rail, I pushed the caboose along the test track and the relay operated each time the metal wheels crossed the insert.
I tried a loco afterwards and again the relay worked faultlessly.
The idea works but I would have connected the relay contacts to a 555 timer circuit. However, after John's post above maybe an optoisolator would be better?

Alan
 
AlanL

AlanL

Registered
1 Mar 2016
33
0
Northampton
Alan, can we assume DCC? Makes it simpler, but need to know.
Yes I forgot to mention that it is DCC but I thought that it could also be used with DC albeit with component variations or a bridge rectifier in reverse. Thanks for your input by the way.

Alan
 
John S

John S

Registered
5 Nov 2017
489
11
Exeter, Devon, UK
Hi Alan, good job for post #21 on making progress.
 
Last edited:
PhilP

PhilP

G Scale, 7/8th's, Electronics
5 Jun 2013
22,061
38
Tamworth, Staffs.
The timer unit will switch the relay (orange bit on the right) which has changeover contacts, so yes, this will switch from red to green after the timer period.

Why not use a 'buck' converter, in place of the resistor? - Set it for 5V (which you need for most of the circuitry) and then use a resistor to set the current through the LED's in the opto-isolator?
 
PhilP

PhilP

G Scale, 7/8th's, Electronics
5 Jun 2013
22,061
38
Tamworth, Staffs.
Having realised I commented before being right up to date on this..

Alan, put a diode across the coil of the relay, please. It will not matter with the circuit 'as is' at the moment, but any electronics will not like it.
 
John S

John S

Registered
5 Nov 2017
489
11
Exeter, Devon, UK
Refer to post #34
 
Last edited:
AlanL

AlanL

Registered
1 Mar 2016
33
0
Northampton
Phil, thanks for the tip to place a diode across the coil. I had forgotten about back emf from a de-energising coil.

So in John's circuit, the orange box is a relay, I can now see the outputs labelled and understand it better. However, I only want to switch an LED with the 555 chip. It is capable of 200ma more than enough for an LED so I'm not sure that I need a separate relay when the 555 chip will work.
(Searching for timers lead me to the 555 chip and their explanation of use gave switching LED's as an example.)

I am now getting a picture of how to achieve my working signals. I want them to be powered and controlled locally.
Basic idea is as follows plus the diodes, resistors and capacitors. And wiring connections.

Power supply is track through bridge rectifier and voltage regulator.
Trigger is the sensor track through a diode to a miniature relay or optoisolator. The relay applies 0 volt to the 555 timer.
Timer is the 555 chip, input as above. Circuitry for adjustable delay.
Output is directly to the signal LED's, normally low (green) when triggered output high (red).
Hope that makes sense.

Alan
 
AlanL

AlanL

Registered
1 Mar 2016
33
0
Northampton
John thanks for stirring the grey cells and explaining your circuit, I was puzzled about the use of the 555. I'm trying to keep it simple and compact so that the circuit could be hidden near to or under a signal. Still it will be interesting to see your circuit.

Alan
 
John S

John S

Registered
5 Nov 2017
489
11
Exeter, Devon, UK
Anyways, if it ever stops raining, will be heading out to the workshop to make a start on putting it all together, you never know, may even get it to work!
 
Last edited:
GAP

GAP

G Scale trains, Lawn Bowls.
14 Jun 2011
2,431
7
64
Bomaderry, New South Wales, Australia
I have been looking at this site a lot ( a very knowledgeable and approachable person) and plan to give the detectors in the "sensors" section a go.


Bit of tinkering with electronics is on my horizon in retirement.
Road crossing flashing lights and boom gates signals and train detection displayed on an old tablet screen all part of the pipe dream.
I have a raspberry pi and a selection of PICAXE microcontrollers to play with at the moment.
I find tinkering a great way to learn or relearn stuff.
 
PhilP

PhilP

G Scale, 7/8th's, Electronics
5 Jun 2013
22,061
38
Tamworth, Staffs.
The beauty of Dave Bodnar's site, is there are video's of his presentations.. These give another insight into some of the projects and concepts..
 
John S

John S

Registered
5 Nov 2017
489
11
Exeter, Devon, UK
Video of detector in use, LED on when detect section occupied.


Whilst looking back through my notes, all the way back to 1968, re discovered some interesting ideas using this method and a collection of scratchy sketches for this.

Going to take the opportunity to update, rewrite and redraw the circuits for both track detection and coach lighting, and put it together in a document for easier reading, Forum Post's tend not to be the most suitable place for technical and educational information.


119045_47e1767d180e6b5dbbdf10e412c79ca7.png
 
Last edited:
AlanL

AlanL

Registered
1 Mar 2016
33
0
Northampton
John that circuit looks nice and simple. Correct me if I am wrong but is it track power on the left to a bridge rectifier. Then the DC goes to the optoisolator and then to the output on the right? Resistor selects voltage/current to the optoisolator? Would this work the 555 trigger pin 2 to 0 volt?
In your video, you seem to have a foot of track that detects the loco. So does the circuit detect the current drawn by the loco? For my idea the loco would stop on that section because I'm not powering it, the voltage in the loco passes voltage to the dead section.

Alan
 
AlanL

AlanL

Registered
1 Mar 2016
33
0
Northampton
I have been looking at this site a lot ( a very knowledgeable and approachable person) and plan to give the detectors in the "sensors" section a go.
 
Last edited:
AlanL

AlanL

Registered
1 Mar 2016
33
0
Northampton
Lots of info and ideas on that site, I've spent a lot of time reading all of his articles. With the sensors, there are mechanical switches, reed switches, hall effect sensors, and iR sensors. For me, they all had disadvantages and that is why started looking at an alternative method and asked if anyone has tried the 'dead rail' method.

Alan
 
PhilP

PhilP

G Scale, 7/8th's, Electronics
5 Jun 2013
22,061
38
Tamworth, Staffs.
Greg,
'Sloppy' use of language..

'Dead rail' is used when discussing motive-power, here in the UK, but can be used when discussing running live-steam as well:
"You need 'dead-rail' as many live-steam loco'c do not have insulated (isolated) wheels.."

But yes, dead rail is also used when referring to battery power. - But still the inference of 'no power on the rails' Which is what our OP is referring to. ie. a short section of isolated rail, used to detect the passage of stock' in some way.
 
AlanL

AlanL

Registered
1 Mar 2016
33
0
Northampton
Sorry if I've used a misleading term but the insert into the rail is not powered so I described it as dead. When the loco passes over the 'dead' insert the loco applies track voltage through it's chassis to the 'dead' insert momentarily as each wheel and pick-ups pass over. The 'dead' insert then makes a circuit through a relay coil and returns to the opposite track voltage. I'm using a miniature relay and it works every time but I am looking at using an opto-isolator instead of the relay. The relay/opto-isolator then triggers a 555 timer circuit to control signals. The 555 timer circuit ignores any further triggers in a train until it times up and resets to normal low output.

Alan