Infrared detector that switches a relay/operates push button

Discussion in 'The Projects Forum' started by Robbie58, Sep 8, 2010.

  1. Robbie58

    Thread Starter New Member

    Sep 8, 2010
    4
    0
    Hi everyone.

    First of all I am new here, but I know a good bit about basic electrics. I have a model railway with an automatic level crossing.
    The crossing is controlled by reed switches, the lights start flashing when the train is approaching, and when the train passes another reed switch turns the LC off. This can also be done using a push button from my control panel.

    HOWEVER, I want to replace the reed switches with Infrared detectors so the trains will not require magnets to be attached to them (I have quite a few).
    I think what is needed is a relay which uses IR, that acts as a push button starting the LC sequence (which was a pre-made circuit).
    I have acquired the following parts on eBay as I thought the circuit would be easy, but when wired in, the IR detector just lets the current flow so it is not a switch.

    L-34F3C IR LED Infra red infa Emitter diode
    L32PC3 LED Infra red infa Detector photo transistor

    These are the parts I have, they are 3mm diodes, but could anyone recommend a relay or other components that could possibly achieve what I need.
    Thank you so much, Bob.
     
  2. Dyslexicbloke

    Active Member

    Sep 4, 2010
    420
    19
    Recent posts on IR .... loads of others if you search
    http://forum.allaboutcircuits.com/showthread.php?t=42373
    http://forum.allaboutcircuits.com/showthread.php?t=42539
    I assume you want to reflect the IR from the underside of the train right?

    You will probably get away without modulating it if the source is bright tenough but
    you will need to detect a change not a level so an ac coupled amp will be required.

    You will have to exclude ambiant light with an IR filter and put a vertical barrier between the two so light must be reflected to be detected.

    The detector is a transistor and therfore you must measure the current through it with a resistor, it probably wont work simply connected to an opamp input.

    Al
     
  3. Dyslexicbloke

    Active Member

    Sep 4, 2010
    420
    19
  4. Robbie58

    Thread Starter New Member

    Sep 8, 2010
    4
    0
    Thanks for your replies Al, but am still wondering about a basic IR detector circuit using the two IR diodes incorporated into a relay. Would anyone know of a simple circuit to use with a relay with two outputs??
     
  5. Dyslexicbloke

    Active Member

    Sep 4, 2010
    420
    19
    If your IR Transistor isnt black looking you will need a filter, you cant get arround that unless you are working in the dark.

    It is unlikly that the detecttor, even if it were fully illuminated, will handle enough current to directly drive a relay. Its not likly you will manage to illuminate it that well anyway given your configuration. This means you only have a small signal and an even smaller differential to work with.

    You 'might' get away with an SSR (Solid State Relay) which will have an independant supply and only need a small current to subsiquently switch it on. However the most likly issue there will be getting a big enough difference between dark and light you are likly to find the relay sticks on or off in certain ambiant conditions.

    You could use a line driver chip which is just a darlington array as a relay driver, this would be the same as building a circuit with descrete rtransistors but all the work is done for you. all you would need to do is hook it between the relay coil and ground and give one of its inputs anything over 2 volts.
    Same potential sticky problem as above though, possibly a little easer to tweek though.

    I use these all the time with standard relays in-place of SSR's that would cost much more, but almost always from known, all be it small, inputs. (ULN2003A or ULN2803A)

    Find me the data sheet for your transistor and I will have a look and see if I think I can get it to work without resorting to anything more complex than a packaged transistor or two. Best get the Emitter as well whilst your at it.

    I still think its a long shot though AC coupled and generating a pulse is almost as simple, probably only 1 opamp IC an a few descretes but will be far more stable.

    I will also need the voltage and current you want to control, so I can ensure that a big enough relay is in play - I expect its realy small requirement you may well get away with driving it directly from the output buffer ... no relay needed.

    I could do you a block diagram showing potential circuit elliments but I don't see how that would help without values, because you would have no way of deciding what sort of elliment to use.

    The only other option is if you will accept a detector and illuminator I have specified from known data.


    Lastly ...
    do you trains always cross the crossing the same way? what I am getting at is can you define 1 input as activate and the other as de-activate or will you want to have some system to do it for you, automatic or switched manually.

    Al
     
  6. Robbie58

    Thread Starter New Member

    Sep 8, 2010
    4
    0
    I'm getting very bogged down in all this here lol.
    The parts I have are not filtered.
    I have e-mailed a company that specialize in IR train detection about a relay they sell that may work, however I got a reply saying they are on holidays for the next two weeks.
    The train would be crossing potentially in both directions, so the way I have the track laid out I would need 4 detector units, two to switch on (one on either side), and two to switch it off when it has passed.

    I believe that this is the information you were looking for:
    http://pdf1.alldatasheet.com/datasheet-pdf/view/97982/ETC/L34F3C.html

    I can't seem to find the detector: L32PC3 LED Infra red infa Detector photo transistor
    I got no information with the order, just 2 bags of diodes!

    The LC runs off 12-16 Volt AC or DC power, and I doubt that the power required for the switch is very much, I don't really know about that.

    Thanks a million Dyslexicbloke!!!
     
  7. windoze killa

    AAC Fanatic!

    Feb 23, 2006
    605
    24
    Firstly don't go racing off buying fancy relays.

    Secondly,.... How smart would you like this thing? I have been designing things for my ooopppssss My sons model railway for a while. This was going to be one of the next things on the list.

    I was planning to have an IR beam (invisible of course) shinning across the track either side of the crossing. When the train breaks the beam the crossing activates. I was going to put a time delay in so the gap between carriages didn't deactivate the crossing.

    Having a beam either side of the crossing allows activation from either side or both sides in the case of 2 trains. So long as one of the beams are broken then the crossing will remain active.

    The only downside so far is if you have a single engine it may not be long enough to have at least one beam broken. I may have to add a longer time delay. I didn't want to put the beams too close to the crossing as it would be unrealistic to have the crossing activate as the train is only 10' (scaled of course) from the crossing.

    I was planning on using (as DB suggested) ULN2003 darlington arrays to switch small relays.

    I will post a circuit in a few days I hope.
     
  8. Dyslexicbloke

    Active Member

    Sep 4, 2010
    420
    19
    Both directions ..... windoze killa.
    Have you thought of using d-Type and JK Flipflops, or just building bi-stables for that matter. You could activatre the crossing on a pulse, (min width rising edge), from either side detector and lock out that input at the same time. Then deactivate the crossing when you see falling edge (min width) because that must be the detector the other side now. This lastb event would also reset everything IE reenable the disabled detector.
    Coach spaces handled with nin width timer, which would be short. crossing would remain active untill activly cancled by train.
    Just a thought .... probably loads of other ways.

    Robbie58 .....
    I will see if I can find any info ... found them on ebay.
    Are you sure you dont want me to offer an alternative that will be easy to use.
    I have maplin parts here I could test for you?
    Do you want the logic function required to handle the two way stuff?
    Al
     
  9. Dyslexicbloke

    Active Member

    Sep 4, 2010
    420
    19
    Hi guys ....
    I found the data sheet for the detector. (Attached)

    As you can see it isnt going to run a relay directly, even if that were a practical proposal.

    Not witstanding ambiant light shading, a simple amp/buffer will be easy enough. and of course if you are going to do that you may as well decouple the thing and look for a delta (change) which will be a far better and easier aproach.
    look here .... http://www.allaboutcircuits.com/vol_3/chpt_8/11.html

    As you can see not dificalt to build and there are loads of opamps that will easily drive a small relay directly, although I would still recomend a little logic in the mix.
    Hope this halps .... let me know if you want anything spaciffic

    Al
     
  10. windoze killa

    AAC Fanatic!

    Feb 23, 2006
    605
    24
    If you happen to have a second train coming from the opposite direction this could deactivate the crossing while the first train is still in the area.

    I have been thinking of incorporating a block detect circuit so once activated the block detect circuit will keep it active for as long as a current load is detected. Downside to this idea is there maybe carriages still there once the engine has left the block. I will need to incorporate a few of these ideas.
     
  11. Robbie58

    Thread Starter New Member

    Sep 8, 2010
    4
    0
    My track configuration would mean that only one train would ever be crossing the crossing at a time, so a train coming from the other side would not happen.

    I am using DCC and won't be using current measurement for block detection. i won't even be able to afford block detection for a good while so this won't be coming just yet.

    There is lots of information here, thank you all very much, but I think that I want to keep this as simple as possible. It is just unfortunate that this isn't simpler haha!

    What did you have in mind Dyslexicbloke? After thinking about it now (I suppose I should have done that before!!) some locking function would be required to prevent the detector on the side after the crossing operating.

    This is all very interesting however quite confusing at the same time! :)

    Thank you everyone
     
  12. Dyslexicbloke

    Active Member

    Sep 4, 2010
    420
    19
    I have a couple of ideas, not sure right now which will be easest or cheapest but I have most of the stuff we are talking about so will have a bit of a play around for you and see what I can come up with.

    windoze killa has raised some interesting points and posibilities so I am sure there is a relativly simple solution in there somewhere.

    To be honest the detectoryou have is the biggest problem, its just going to need fiddling with too much. An ambiant shelded detector (black) would be so much easer.
    windoze killa What do you think on this sublect?
    I will find a few and let you know how much.

    Maplin do a modulated beam kit by the way ... probably overkil for your project but you could put the diode and detector, which contains logic, on longer leads.
    http://www.maplin.co.uk/Module.aspx?ModuleNo=220033 (£13)

    You could definatly build cheaper than that anyway!

    By the way why is block detect expensive, its easy?

    Al
     
  13. Dyslexicbloke

    Active Member

    Sep 4, 2010
    420
    19
    O now I am just being dense ....
    windoze killa has your answer ......
    Two small sections of block detect, one either side instead of IR.
    I asume you could place them at least 1 'maximum' train length beyond the crossing.
    youl still need the logic though, I say logic, its realy just a couple of latches.

    One last thing are all your wheels metal, coaches / wagons I mean.
    I know metal wheels have insulated axels so they dont short the power but if they are metal I think I have another idea a bit like block detect but only using a single rail. It would be more .... wheel passed this point than block.

    My dad has a moddle railway so I could try out stuf on him.

    Al
     
    Last edited: Sep 10, 2010
  14. windoze killa

    AAC Fanatic!

    Feb 23, 2006
    605
    24
    Ok, so you want to keep it simple and cheap. Easily done.

    Currently you have a magnet operating a reed switch. There is no reason why you couldn't replace the reed switch with the IR phototransistor (not underneath but to the side like I suggested to break the beam) and have it turn a more powerful transistor or darlington to operate the crossing. You could also have it switch a relay for some isolation.

    I will try and do a schematic today sometime.
     
    Last edited: Sep 11, 2010
Loading...