IR train detector

A

Alec K

Guest
I hesitate to post this as it's very much a work in progress, but as always I'd welcome comments along the way. I visited our local branch of Maplins recently to buy an IC LED flasher so that I can complete an automatic barrier level crossing module I'm putting together. While exploring the 'bargain bin' I came across a Maplins IR beam kit, which consists of the components for an IR transmitter and an IR receiver, the latter including a miniature relay. The LED flasher and the IR units are all driven from 9vDC batteries.

To cut a long story short, I incorporated the twin led flasher IC into a scratchbuilt level crossing warning sign - for North American colleagues, I believe I'm referring to a grade crossing, correct me if I'm wrong - and then I constructed and tested the IR component elements. I have (just) connected the road warning light assembly to the normally open contacts of the IR receiver relay, and, success! The brake van in the picture will break the IR beam across the track, trigger the relay on the receiver, and switch on the flashing lights. When it's passed through, the contacts on the realy open and the lights stop.

Pretty simple stuff for the experts out there - so apologies - but it's robust and it works at a very low cost. I guess I could have used a track mounted reed switch and permanent magnet on a loco to the same effect ( I have the LGB set ready to use elsewhere) but this seemed more elegant somehow!

As the pictures show, the testing's been done on our dining room table. The next stage will be to scratchbuild a couple of bridge piers and locate the IR circuitry in them.

b43b96644d0a42b1baafa73d3c0dc1a5.jpg


4e48f47d6d35427da348e347a4cef259.jpg


I've also bought an inexpensive servo and servo control board that I'm currently using to create the lifting arm barrier for the crossing. The servo control incorporates a manually operated potentiometer - is there any way at all of replacing this manual control electronically so the train triggers the lowering of the arm via the servo? Or is this way too complicated to achieve? All ideas gratefully received!

The Maplins kit I used, by the way, was created for them by Middlesex University, whose trading arm can be found at http://www.mutr.co.uk/ < Link To www.mutr.co.uk

Best wishes,

Alec K
 

Neil Robinson

Registered
24 Oct 2009
9,699
579
N W Leicestershire
Best answers
0
Country flag
Alec K said:
I've also bought an inexpensive servo and servo control board that I'm currently using to create the lifting arm barrier for the crossing. The servo control incorporates a manually operated potentiometer - is there any way at all of replacing this manual control electronically so the train triggers the lowering of the arm via the servo? Or is this way too complicated to achieve? All ideas gratefully received!

The Maplins kit I used, by the way, was created for them by Middlesex University, whose trading arm can be found at http://www.mutr.co.uk/ < Link To www.mutr.co.uk

Best wishes,

Alec K

Following your link I found the kit in the link below.
As stated, the pot. may be substituted by two fixed resistors once the appropriate resistance/degree of servo travel is determined.
http://www.mutr.co.uk/product_info.php?cPath=4_531&products_id=1009480 < Link To http://www.mutr.co.uk/pro...mp;products_id=1009480
I assume one value of resistance will trigger the gates to drop, the other to raise.
 

Neil Robinson

Registered
24 Oct 2009
9,699
579
N W Leicestershire
Best answers
0
Country flag
Do you intent to use this outdoors? If so daylight may interfere with the I.R. beam so I suggest it is sited with care and maybe shielded from direct sunlight.
 
A

Alec K

Guest
Many thanks for this, Neil. The issue is also addressed in the packing for the controller board, which I have in front of me. I think it's the calculations of the resistor values that have me temporarily stopped- this is after all the first electronic kit I've built! I'm after a 90 deg angle and a 180 deg angle so I suspect it's back to my 'electronics for real beginners' little book or trial and error based on the 22 deg and 56 deg example MUTC have given. We'll press on....

As ever

Alec
 
A

Alec K

Guest
Neil, thanks too for the caveat re other sources of IR. I use an energy-saving bulb in my desk lamp and there's enough IR generated by that to trigger the RX- I was getting all sorts of chatter on the relay until I worked that out.

Alec
 

Neil Robinson

Registered
24 Oct 2009
9,699
579
N W Leicestershire
Best answers
0
Country flag
Alec K said:
I think it's the calculations of the resistor values that have me temporarily stopped- this is after all the first electronic kit I've built! I'm after a 90 deg angle and a 180 deg angle so I suspect it's back to my 'electronics for real beginners' little book or trial and error based on the 22 deg and 56 deg example MUTC have given. We'll press on.

You could always use cermet or similar preset potentiometers in place of fixed resistors. You initially adjust them to suit by trial and error and then leave them alone unless something changes.
 

Tony

Model railways
28 Feb 2010
4,593
1
East coast Essex
www.facebook.com
Best answers
0
I love what you are doing and was thinking along the same lines
But dont you need some kind of delay fitted because if the front of a train triggers the crossing it will have to be some way down track to have time to activate the crossing before the train gets there but the last wagon passing will restore the beem long before it has reached the crossing or have you thought of that and im talking like a pratt

Tony
 
A

Alec K

Guest
Thanks for the encouragement, Tony!

You're completely right - there's a design flaw. I can locate the detectors well 'up the line' from the crossing but as you point out the train won't have cleared the crossing when the lights stop flashing. There's more.... on the dining room table, I had the detectors mounted too low and the gaps between the wheels kept sending IR pulses to the receiver. At the height shown in the photos, this doesn't occur fortunately, but at too slow a speed through the detectors, the IR beam is 'seen' through the end balconies of the van.

I've ordered the cermets suggested by Neil for the lifting barrier and I may use reed switches to trigger this given the issue you highlighted with the IR system. I'm a real beginner with DIY electronics so bear with me!

All the very best

Alec
 

Dtsteam

G Scale, Travel, Steam Boats, Mechanical Music
24 Oct 2009
5,401
15
Preston
Best answers
0
Country flag
You might consider two detectors - one either side of the crossing gates and no more than a trains length apart. That way it will work in each direction, and stay down until the last vehicle has cleared the second detector. You could try the detectors at an angle (say45 deg rather than 90 deg) across the track,which may stop it from seeing a gap between the vehicles.
 

Neil Robinson

Registered
24 Oct 2009
9,699
579
N W Leicestershire
Best answers
0
Country flag
Alec K said:
I can locate the detectors well 'up the line' from the crossing but as you point out the train won't have cleared the crossing when the lights stop flashing. There's more.... on the dining room table, I had the detectors mounted too low and the gaps between the wheels kept sending IR pulses to the receiver. At the height shown in the photos, this doesn't occur fortunately, but at too slow a speed through the detectors, the IR beam is 'seen' through the end balconies of the van.

I've ordered the cermets suggested by Neil for the lifting barrier and I may use reed switches to trigger this given the issue you highlighted with the IR system. I'm a real beginner with DIY electronics so bear with me!

If you intend bi-directional running I suggest two parallel reeds for raise and two for lower arranged as shown. Once one is triggered the barrier will respond and then stay in position regardless of how many times it is triggered and any intervals between triggers. Only triggering of an opposite function reed will change the barrier.
27583920eec241af9bc70aed9581e455.jpg
 
A

Alec K

Guest
Thanks to David and to Neil for their combined advice. I should be able to refine my first efforts into something protypically and electronically sound as a result. Furthermore, I won't create risks for my 1:20 (ish) road users either! I'll do some more work and component sourcing and report back in due course.

Best wishes

Alec
 

gregh

electronics, computers and scratchbuilding
1 Nov 2009
3,137
263
Sydney, Australia
www.members.optusnet.com.au
Best answers
0
Country flag
Alec K said:
I'm a real beginner with DIY electronics so bear with me!

Congratulations on your first go at electronics.
If you plan to use IR outside, you must make sure the sun or reflections don't hit the detector. That means facing the detector north (for you nthn hemisphere guys) and pointing it downwards - ie mounting it up at carriage wall heigth with the sender at ground level. Even then you'll probably find that light coloured wagons allow enough reflection to not trigger it when it should. I speak from experience!
If you can mount it in perpetual shade that's the best.
Now to get a time delay all you need is a big capacitor between the detector's output and the servo driver input. But it's hard for me to recommend what size without knowing the detector cct. Do you have one you could post here?
 
A

Alec K

Guest
Greg,

Apologies for the delay in responding to you. First and foremost, many thanks for the vote of confidence and for the advice on location of the IR transmitter and receiver. I will bear this in mind, for sure. Last night was spent in housing the receiver in a watertight project box, with a 'window' for the detector - a lot of effort went into this. Just after I'd tested it and boxed it up I realised I could have used the spare NC contacts on the relay for a bit of added value.

The Pway folk at a station near me maintain a foot crossing at the station throat, across at least four running lines. Use of the crossing is only permitted when a bright white light shows on a warning board. No light = no crossing, 'fail safe' I think. I could have done something very similar in G scale, but I'm loath to unpack all last night's efforts!

Unfortunately Maplins/Middlesex Uni provide only a component map for the PCB and a component list for the IR detector and transmitter- makes it easier for folk at my stage of learning - and I've attached a scan of the component list in the vain hope that it might assist you to recommend a capacitor for me.

8e52934397b0482192caa5b0e2d3502b.jpg


I didn't think the PCB map would be of much use to you. I've greatly enjoyed looking at the account of your own railway and now have a few targets to reach I think!

Regards

Alec
 

eye-kay

Trams, narrow gauge, and anything else on rails
26 Oct 2009
326
0
Warwickshire
Best answers
0
Country flag
Hi Alec

I'm just in the process of building an IR train detector as well. I would recommend you have a look at http://www.trainelectronics.com/ < Link To www.trainelectronics.com. There are several articles on IR train detection.

What are you using to house the electonics - you mention your project box, is that one of the Maplin weatherproof boxes? I was thinking of using a small plastic air-tight transparent food container for mine.

Ian
 
A

Alec K

Guest
Hello, Ian

I did indeed use the Maplin weatherproof project box - it's a good fit for the PCB and wire anchors I've used, and, as I guess you know, I thought it was very well made. I'll need to seal the cable entry I drilled and cover the small window I cut for the detector with thin polycarbonate to make that weatherproof as well. I've made my own housing for the separate road warning circuitry - I've tried to make it look like a railway relay cabinet.

Food boxes are a good tip - I may well borrow your idea if I may for the lifting barrier servo housing.

I'm learning a lot from all the help I'm getting and many thanks for the link to the site - will visit it with interest in a moment or two!

Kind regards

Alec
 

gregh

electronics, computers and scratchbuilding
1 Nov 2009
3,137
263
Sydney, Australia
www.members.optusnet.com.au
Best answers
0
Country flag
That list wasn't much good to me Alec.

I've drawn a little circuit here. If you can find a resistor, diode and capacitor, you can do some experiments. Resistor and capacitor values aren't critical at this stage. As shown they connect between the output of your IR detector and the input to the servo driver. When the beam breaks, the IR output goes high and instantly charges the capacitor and sets off the servo to lower the gates. When the beam is no longer interrupted, the IR output goes low. The capacitor discharges slowly through the resistor and maintains a voltage input to the servo cct. At some unknown voltage the servo driver 'decides' it no longer has an input and raises the boom gates.
8e9505e69b5b407f93d425b61c915c5e.gif
 
A

Alec K

Guest
Hello Greg,

I've printed off your detailed response and will make a trip to Maplins within a day or two to purchase an assortment of components for this experimental barrier control. Weatherproof housing of the detector and transmitter has now been completed so time for the soldering iron again....

I'm fortunate to have access to your expertise and that of others on the forum and I appreciate it all. I'll report back on what I hope will be a fully automated system!

Kind regards

Alec
 

gregh

electronics, computers and scratchbuilding
1 Nov 2009
3,137
263
Sydney, Australia
www.members.optusnet.com.au
Best answers
0
Country flag
Alec K said:
Hello Greg,
I've printed off your detailed response and will make a trip to Maplins within a day or two to purchase an assortment of components for this experimental barrier control. Weatherproof housing of the detector and transmitter has now been completed so time for the soldering iron again....
Alec

I just had a further thought. I forgot to put in a resistor as shown red in this new cct. Without it you may overload the output of the IR detector and damage it.
1db69236997e4f39b0d89aabe53766da.gif
 
A

Alec K

Guest
Thank you, Greg, for amending this. At this stage of my learning, I would not have spotted it!

All the very best

Alec