Infrared sensor light switch

Status
Not open for further replies.

PomDave

New Member
Hi All,

I'm building a model railway and have an engine workshop/shed which I want to have pit lights turned on and stay on whilst an engine is there. Now I've seen infrared led's emitter/receiver which I think would do the job. I have around 15vDC going through my lighting circuit. I thought of placing the emitter/ receiver either side of the track so that the beam is broken by the engine, and remains so until it moves again, thus reversing the operation.

Is there an easy way of doing this without too much electronics involved as the workshop/shed is located about 4 metres from the main console.

I did try to post this earlier, but it doesn't seem to be there, so I apologize in advance if it's duplicated.

Best Rgds,
Dave R.
 
It is not well defined. Do you want auto-stop, auto-reverse, is it manual powered or RCC? Will that just control lights? WIll that confuse the operator if Fwd/Rev are swapped?

The simplest case is to have the last tracks isolated by a diode to only allow reverse voltage.

ANything more needs an IR detector with added small recess to an aperture to reduce the window to narrow hole to block stray reflections. Simple 3mm or 5 mm emitter and Daylight blocking PD for detection is one method to a comparator or any transmission or reflection kit.
 
Last edited:
It may work with just a suitable small power MOSFET and a few minimal components?

To switch on with the light blocked, connect eg. a small LDR between the FET source and gate, with (guesswork) a 1K resistor and 100K pot in series between gate and positive power.

The FET source connects to negative & the light connects between positive and drain.

The LDR holds the gate at a low voltage as long as there is enough light, then when light is interrupted, the LDR changes to a higher resistance, and with an appropriate adjustment of the pot, that (hopefully) will allow the gate voltage to increase significantly and the FET turn on.

If it's not a sharp enough transition to full ON or OFF with a change of light intensity, then another transistor could be added as an amplifier - but possibly try the simple approach first?

It could also be done eg. with an infra-red LED, and IR phototransistor instead of the LDR.
 
Yes, you can use an IR emitter / detector. I doubt your lighting in your in your engine workshop draws any current to speak of. Most IR detectors either have an output of Vcc (powered voltage) or 0.0 volts. If your IR system has for example o.0 volts (no engine blocking IR path and a voltage out when train is present I would keep it simple and just use a transistor or MOSFET to drive the lighting. Depends on how much current you need for your lights. Train engine present IR Detector outputs to a transistor which in turn will turn the lights On. Train leaves lights Off. This in the interest of keeping things simple.

You will likely find that most IR emitter / detector systems use 5.0 VDC, since you have 18 volt lighting you want an IR sensor system that runs on about what you have. Going with less like 5.0 volts involves adding components like a buck converter or voltage regulator. While hardly complex your parts count increased along with more wires.

Ron
 
Aside from contacting a local model RR club for help, have you considered installing a snap action switch - found in microwaves - beside or under the track rail to detect the locomotive's weight and keep the lights on as long as the locomotive is parked inside the model shop?
 
Hi All,

Yes , it probably was rather confusing. What I was trying to say was, if you have a beam from emitter to receiver that is interrupted some other action takes place, for me, to activate some kind of switching. Take those lights that come on in the dark when a sensor detects movement.
I like Shokjok's idea but not sure if enough weight could be applied on the switch, but worth a try.

Best Rgds,
Dave R.
 
I am having my front drive revamped, and would like to have a couple of brick lights incorporated into the wall, which is not a problem. But would also like some sort of infrared/magic beam/beam sensor attached to front wall so when car passes through beam the lights will come on, and then go off after a set time. Have thought of PIR, but their range is too great, lights coming on everytime someone passed the drive. Any ideas anyone??
 
Good point Beau, never thought of that. I've found one small circuit using a 2N2222 transistor and the IR TX & IR RX which I'm going to try.
Let you all know how it turns out.

Best Rgds,
Dave R.
 
I assume that the engine has a motor and it's sitting on an electrically isolated track when it's in the workshop.
If so, then I'd just do a continuity test across the track segment.
 
I assume that the engine has a motor and it's sitting on an electrically isolated track when it's in the workshop.
If so, then I'd just do a continuity test across the track segment.
That's a bit 1960's

Haven't model trains been DCC (or similar) for decades now, and don't use isolated tracks.
 
That's a bit 1960's

Haven't model trains been DCC (or similar) for decades now, and don't use isolated tracks.
Yes they have an that's why I steer clear of anything that may induce other signals into the track system.
Have you considered a reed switch and magnet arrangement?
No, didn't even think of that, but wouldn't that require a magnet attached to the train in order to activate the switch, and maybe more than one?
 
Found this one which I'm going to try out, looks as if it might be just what I'm after.
Unfortunately, it's REALLY poor, due to how crude it is, as it will be triggered by any random IR source, so any remote control anywhere near, or sunlight etc. IR systems, either broken beam, or reflected (like this one) modulate the IR LED and the receiver has to detect that modulation.

For a reflected type sensor, here's one that I copied from another site (referenced on the page) that uses a PIC, which does all the work.

 
Hi Nigel,

Yeah, I know it's pretty basic and the one that you are offering is much more, shall we say, robust design. I do like the use of veroboard, although it doesn't have the ultimate professional look about it, it does the job.
As for sunlight etc., effecting my original setup, it should be OK as it's situated inside the engine shed and away from any real light beams hitting it.

Thanks for your input.

Best Rgds,
Dave R.
 
Try it and see how it goes, but reliability could be an issue.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…