I am trying to make a simple IR detector

Thread Starter

AllisonAmg

Joined May 18, 2020
71
Hi,
I am new to the forum, could any one please help me.

I am trying to design a very simple Track Signaling module, which has the following functionality

1) Uses IR Sensors for the detection
2) As i need to make a few of these i would like the component list to be as small as possible
3) Below is the logic
1589800987209.png

I would like the module to detect a train passing over a IR sensor, and set a LED to Red, then to wait 2 Seconds and then reset the LED to Green, and then wait for the next train.

I dont know if this is possible but any help would be realy appreciated.

Thank you in advance
Allison
 

jpanhalt

Joined Jan 18, 2008
11,087
Hi Allison,

Welcome to AAC.

I would use any one of the many IR TX/RX pairs for detecting proximity. Use a pulsed signal to avoid interference from ambient IR. Vishay and others make them. Generally, the frequency you chose for the pulse is not important, but it is better to match the TX and RX frequencies approximately.
 

Thread Starter

AllisonAmg

Joined May 18, 2020
71
Yes.... i was considering using the Arduino Uno.... but there will be a lot of signals so if i could achieve it by using discreet components it would be better
 

Alec_t

Joined Sep 17, 2013
14,330
but there will be a lot of signals so if i could achieve it by using discreet components it would be better
A lot of signals would require a lot of discrete components. I don't see why that would be better? How many is 'a lot'?
If 3 pins of a Nano could handle one IR sensor and one red/green switch, then with 12 digital pins and 6 analogue pins a Nano could cope with 6 signals.
 

MrChips

Joined Oct 2, 2009
30,821
Depends on how much is a lot and how far apart the sensors are located.
One solution is to run wires back to a single microcontroller at do all the control from one central controller.
8-pin MCUs are so tiny and low priced that you can create multiple autonomous controllers very easily.
 

Thread Starter

AllisonAmg

Joined May 18, 2020
71
Depends on how much is a lot and how far apart the sensors are located.
One solution is to run wires back to a single microcontroller at do all the control from one central controller.
8-pin MCUs are so tiny and low priced that you can create multiple autonomous controllers very easily.
I wouldnt know where to start with a microcontroller, I have looked at using a Arduino

Here is the layout the > < or >< indicate directions of travel
Finalised Plan (PM - Mono).jpg
 

MrChips

Joined Oct 2, 2009
30,821
Nice.
Can you tell us the scale (dimensions) so that we have an idea of the size of the layout?
How many signals in total?
Are the signals independent?
How are the signals powered? What voltage?

You don't have to use MCU. A simple 555-timer circuit might be able to do the trick.
 

jpanhalt

Joined Jan 18, 2008
11,087
How many detectors do you need?
Do you need just to detect passage of a train or its direction too?

As for approaches, it seems you will need a lot of wires (at least one per sensor) or some sort of coding and a network. I am thinking of something like how a TV remote works (https://electronics.howstuffworks.com/remote-control2.htm ). The remote sends a coded signal and the detector decodes it and does what it is supposed to do. Of course, you will need a lot of detectors too.

Each detector could send a "train pass" code to the central MCU. I did a brief search for "programmable IR detectors." That is, one that can send a unique code the central control. I didn't find exactly what I was looking for in a brief search.

As an alternative, there are some very small microcontrollers (like Microchip's 10F322 series) that could be glued to an ordinary IR detector to make it "smart." It would hardly be noticed size wise.

As mentioned, it can be done with a lot of wires to a central control panel, but that would be a lot of work and wiring. If you only need, say 10, that is not such a big deal. But 30 would be a different story.
 

Thread Starter

AllisonAmg

Joined May 18, 2020
71
Nice.
Can you tell us the scale (dimensions) so that we have an idea of the size of the layout?
How many signals in total?
Are the signals independent?
How are the signals powered? What voltage?

You don't have to use MCU. A simple 555-timer circuit might be able to do the trick.
The is approx 4.8m(L) x 3.8m(W)
At present i am looking at simple independent siganls, but later i may want to link in to 'blocks'
The signals could be powered by either 12vDC or 5vDC (resistors in the actual signal LEDs)
There could be around 50 actual Signals with around 25 IR Sensors, although these arnt finalised as yet.

It is my husbands layout, i am just doing the 'Techie' bits as he isnt good with those.
 

AlbertHall

Joined Jun 4, 2014
12,347
Are the trains powered with simple DC or are they 'digital' (DCC)?
If using simple DC you could possibly send coded signals via the rails thus eliminating the wires.
 

Thread Starter

AllisonAmg

Joined May 18, 2020
71
How many detectors do you need?
Do you need just to detect passage of a train or its direction too?

As for approaches, it seems you will need a lot of wires (at least one per sensor) or some sort of coding and a network. I am thinking of something like how a TV remote works (https://electronics.howstuffworks.com/remote-control2.htm ). The remote sends a coded signal and the detector decodes it and does what it is supposed to do. Of course, you will need a lot of detectors too.

Each detector could send a "train pass" code to the central MCU. I did a brief search for "programmable IR detectors." That is, one that can send a unique code the central control. I didn't find exactly what I was looking for in a brief search.

As an alternative, there are some very small microcontrollers (like Microchip's 10F322 series) that could be glued to an ordinary IR detector to make it "smart." It would hardly be noticed size wise.

As mentioned, it can be done with a lot of wires to a central control panel, but that would be a lot of work and wiring. If you only need, say 10, that is not such a big deal. But 30 would be a different story.
Initially it will be just an idication that a train has passed a signal, but having directional indication would be great. Most of the layout is Uni-Directional, although there are some sections that are Bi-Directional.
There could be around 25 detectors but this number could change depening on the final solution used
 

MrChips

Joined Oct 2, 2009
30,821
At present i am looking at simple independent signals, but later i may want to link in to 'blocks'
You could start off with simple independent signals.
However, if you have bigger plans in future it would be a good idea to plan ahead.
Can you explain what you mean by 'blocks'?
 

Thread Starter

AllisonAmg

Joined May 18, 2020
71
You could start off with simple independent signals.
However, if you have bigger plans in future it would be a good idea to plan ahead.
Can you explain what you mean by 'blocks'?
A block is a section of track that is controlled by an entry and exit sensor.... when a train enters a block, the signal is set such that a following train should not enter that block until the 1st train has left the block.
 

MrChips

Joined Oct 2, 2009
30,821
I have to admit that I know nothing about model railways.
However, if at some point in the future you plan on having full computerized control then now is the time to plan for this.
 
Top