QRD1113/1114 for model rail detection

I’m new here. Thinking of using QRD1113/1114 between the rails for detecting N-scale model trams with Arduino. Is that a good idea? If not, what should I use? Better than break-beam detectors because I can’t have anything protruding from the road surface alongside the tracks.
Thanks

Hi Ronald
Welcome
It would be pretty handy if we knew what a QRD1113/1114 is without having to search for it.
Cheers Bob

Sorry. It’s something that Core sells.
Optical Detector / Phototransistor - QRD1114
This sensor uses an infrared emitted diode combined with an infrared phototransistor to detect the reflected infrared signal. Ideal for sensing black-to-white transitions or can be used to detect nearby objects (.5-1cm).

Thanks
Cheers Bob

1 Like

Hey @Ronald193850

Have a look at this graph from the datasheet. Factoring in noise, you might find it’s reliable at 120mm max distance. 120mm is not much, can you work around this limitation?

Testing with your train, in your lighting, will be the deciding factor. For $2, i’d buy one and find out.
image

1 Like

Hi Ronald

I like many others are not Core staff so without searching Have not much idea of what is in their pretty comprehensive inventory.

But in fairness you would not be expected to know that. In fact Core staff can be identified by a little shield which appears next to their name in the Forum.

Back to your problem. Yes I reckon that would work(I actually did a google search on that part number). If you stuck a shiny reflective bit on the underside of the object you want to detect would help a lot I think. But you would have to have objects that are not to be detected painted a matt black so not to have false triggers or you will have the system going off all the time. You might be able to arrange some sort of sensitivity control to minimise false triggers.

I have worked with a similar device many years ago. This was a laser type sensor with a tiny transmitter in the end of the actual sensor and the receiver a ring of optical fibre ends arranged around the transmitter. this was a commercial device with built in sensitivity control. We used it to detect the TX reflected off the shiny wire on a coil winding machine where any sideways displacement is detected by a missing reflection and was seen as a misswind and the machine stopped before it went too far.
I am not too sure of how the sensitivity control was achieved and didn’t really have the time to find out. At the time it worked and that is all that mattered.
Cheers Bob

2 Likes

Hi @Ronald193850, Welcome to the Forums!!!

It looks like the chip part should do what you need, It Uses a similar detection method as this board which seems to work quite well across small distances (1-2cm)

Another couple of ways I can think of doing this would be using a TOF distance sensor through the tracks to detect a drastic change in distance or using a hall effect sensor to detect a magnet on the bottom of the train.

1 Like

I dabbled in Model Railway trains a while ago.
The small magnets I bought cost a lot, more than they were worth in my opinion. The grandkids managed to lose one, it must have detached when they were playing with the set. The Hall effect sensor had to be very close to the train, embedded in the top of the track. In the end I used an optical sensor beam which the train broke as it passed. I was not worried about realism; more the programming, electronics and automation of the trains.

I also tried light dependant resistors to detect a train over the track, unsuccessfully.

I didn’t try reflective IR as I lost interest eventually. (building a Model Train railway set is pretty expensive). This might actually work if you can get the software right.

IR sensing can be very dependant on ambient light, often giving false readings.

Cheers
Jim

2 Likes

Another couple of methods I can think of include embedding a micro switch in the track that the train can pass over to actuate. If this one is feasible depends on the size and weight of the train.

Another method could be to use inductive coils. I’ve seen this used on RC/model cars to turn on their headlights. This one is a more fun than practical approach, there are many ways this can be done you just need to find the one that works best for you!

1 Like

Thanks Jack. I’m going to experiment with two types of sensor from Core. I’m sure one of them will do the job.
Best wishes

1 Like

Thanks Robert. I’ve decided to try two of the detectors that Core sells.
Best wishes

1 Like

Tried that method for stopping the train at a buffer. The train was not strong enough to trigger the micro switch at slow speed. At a speed fast enough to trigger the switch, momentum would carry it into the buffer anyway.

The tiny reflective sensor might actually work if you can deal with the ambient light conditions. The data sheet for the IR sensor @Ronald193850 gives me some confidence in it. Love to hear how this goes @Ronald193850. Might get train set out again.

Regards
Jim

1 Like

Finally got around to testing Optical Detector / Phototransistor - QRD1114 I bought when this post first surfaced.

Used a short piece of N-gauge rail line and a locomotive I have. Best voltage change I could get was 0.5 to 0.9V at the collector. The 0.9 was my finger directly over the device, 0.5 was the locomotive.

A bit disappointing as it would need comparators on each sensor to give a larger swing or micro A/D pins to detect a change. The sensor is rather hard to fit nicely between the sleepers of the track as it is slightly too wide. Don’t think I will be changing the train set any time soon.

But an interesting exercise anyway. Thought I would post to close of this topic as original poster has not been back.

Cheers
Jim

1 Like

I am getting very good results with the IR LED/Photodiode Miniature Reflective Infrared Optical Sensors - 5 Pack - ITR20001/T. The LED is fed from 5V via a 470 ohm resistor and the photodiode is connected from an Arduino digital i/o in configured for PULL-UP. The models have white adhesive labels stuck to their undersides. The face of the detector is just below the N-gauge track sleepers.

(attachments)

1 Like

@Ronald193850 Good to hear you are having success.

Mine was mounted at the sleeper level, had to remove two to fit it in, careful cutting of plastic ballast. Should have bought track with just sleepers. Locomotive had red undercarriage. No reflective strip.

Both devices have very similar specs, most likely my way of measuring the state of the sensor is affecting the voltage I am reading. Attaching it to an Arduino Pullup input is probably better than trying to drive an LED. Arduino pullups have a high resistance, might experiment with that.

As my layout is already built with small IR beams which work nicely; I don’t think I will be retrofitting it any time soon. (wonder if the wife would agree to another layout with new track etc. HAHA)

Appreciate you letting me know how it has been going and giving me some ideas.

Cheers
Jim

EDIT: After brief test.
Sometimes think my electronics has gone to mush in my brain. Changed collector connection, 10K resistor to 5V. Now getting 4.7V non triggered and 0.3V triggered, perfect for input to a micro GPIO. Motivation has increased amazingly to use these rather than the IR beams. Cheers

1 Like

Thanks Jim

1 Like