Plachan1

Hello DCC train modelers

I'm looking for advice on using an Infrared obstacle avoidance module connected to a DCC Concepts IP Cobalt turnout. The purpose is to have the module detect an on coming train and when the switch/points are in the wrong position the sensor/module will signal the Cobalt switch to change the points.

Anybody out there who has done this or have any knowledge/experience on how to do this it would be great to here from you?

Best regards

Paul

Reply 0
Neil Erickson NeilEr

Here is a link to what might

Here is a link to what might work:  https://forum.mrhmag.com/post/sma23-%E2%80%93-a-new-dcc-dc-car-loco-detector-%E2%80%93-differential-absolute-position-detector-dapd-12203476

And this is an application in a staging yard:

https://forum.mrhmag.com/post/cornhill-and-atherton-lower-deck-part-1-staging-12204721

I bought a number of these detectors and am laying out my staging yard with them now  

 

Neil Erickson, Hawai’i 

My Blogs

Reply 0
Plachan1

NeilThanks for the link.

Neil

Thanks for the link. I've now read the article. My take away is that the only way to trigger the the switch control is if I connect the module to an Arduino Uno or Pro Mini? That becomes prohibitively expensive? 

My intention is to have several dozen of these detectors on my lay out.

Am I reading that correctly, is there no other way?

This is the IR module

img.jpeg 

Paul

Reply 0
Geoff Bunza geoffb

@Paul re: IR Module with DCC Concepts IP Cobalt turnout

Hi Paul,

There are two important points to note: The IR detector has a "sense output" that goes low (connects to ground) when it senses an object in front of it (a few inches or so), and the DCC Concepts IP Cobalt turnout control needs a 7-23V voltage applied to 2 terminals (1 &2 DC IN) to operate. To throw in the opposite direction the voltage needs to be reversed at the terminals.

You can direct the appropriate voltage to the IP Cobalt Analog device via a 5Volt relay (Double Pole Double Throw) that would be compatible with the IR sensor output. However, the sensor is "active/on" only when something is in front of it. Once the train passed (or sensed the space between cars) the IR sensor is off. So one sensor controlling one relay will not work. However you could try 2 IR sensors for each turnout route and a "latching" DPDT relay like: DigiKey.com PB1080CT-ND  RELAY GEN PURPOSE DPDT 2A 5VDC Dual Latching
You would wire the relay up as per the DCC Concepts IP Cobalt analog turnout DPDT instructions, and use one each of the IR sensors to trip one coil each of the latching relay. That should do it.
 
You must make sure that only one IR sensor could be active at a time.
 
'Hope this helps. Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Neil Erickson NeilEr

Cost

Paul;

Geoff always has some great info but relative to cost you might be surprised how inexpensive the Arduino and sensors actually might be. I buy off eBay, for the most part, and the Arduino is in the three dollar range. Ads ruin it Sparkfun have great products and customer support (as well as many others such as Mouser, All Electronic, Pololu Electronic s) but the processor and sensors are extremely common now and parts are literally pennies.  

We seem to be progressing on a similar party as my staging must be in place and sensors working to move forward. Once confident my mainline can move to the interchange and will make access to those tracks more difficult.

If I didn’t say before, you have a nice plan and I’m following along. 

Neil Erickson, Hawai’i 

My Blogs

Reply 0
Plachan1

@Geoff re: IR Module with DCC Concepts IP Cobalt turnout

Hello Geoff

First let me say thanks for replying, I did not expect the "Guru" to respond to me. so I'm very grateful.

Second as a matter of context I'm admittedly the most uneducated person when it comes to electronics and circuitry, but I try. LoL.

Third, I forgot to mention the Cobalt turnouts are Digital IP turnouts, powered by an NCE Radio Frequency Power Pro System. So my question now is; does that change anything in your response? That is in terms of the terminal connection etc.

Cheers

Paul 

Reply 0
Plachan1

@Neil re:Cost

Hi Neil

Thanks for the "nice plan" comment. It is rather sizeable and complicated but ultimately enjoyable.

I agree the sensors/modules are inexpensive but the Arduino Pro Mini's are certainly not.

I will check out your weblog / Garden Railroad and see waht you are up to on your layout. 

Any advice you can give with respect to your sensors and track switching would be most welcome.

Cheers.

Paul

Reply 0
Plachan1

Infrared Obstacle avoidance

I'm really happy to report that I have successfully set up on my layout two IR sensors at one turnout. Therefore completly avoiding de-railments and short circuiting. YaY!!!!

The trick I'm sure is using a Cobalt Digital IP switch machine with 2 sensor modules powered by a 5vdc adapter. Set up as if they were a 1p1t push button switch.

These turnout machines are quite remarkable.

Anyways, I though I would share this.

One down another 48 to go.

Cheers

Paul

Reply 0
kenheywood
Anybody out there who has done this or have any knowledge/experience on how to do this it would be great to here from you?
I bought a package of 10 HiLetgo detectors for about $9.
I put one under my grade crossing.
I adjusted it just below the trigger point.
Then I ran a train over it.
It detects the axles and some underbody parts.
The underbodies are black by design.
I figure the shaky detection is because of the black.
It detects light colored under bodies like my white tank car.
Is there a solution other than painting a white stripe on the bottom of each rolling stock?
Reply 1
Chuck Stuettgen

Infrared Obstacle avoidance

I'm really happy to report that I have successfully set up on my layout two IR sensors at one turnout. Therefore completly avoiding de-railments and short circuiting. YaY!!!!

The trick I'm sure is using a Cobalt Digital IP switch machine with 2 sensor modules powered by a 5vdc adapter. Set up as if they were a 1p1t push button switch.

These turnout machines are quite remarkable.

Anyways, I though I would share this.

One down another 48 to go.

Cheers

Paul

 
 
Interesting application.
 
I wonder if it could be expanded to allow the switch machine to control the power feed for a section of track leading to a sight restricted turn out.  In other words kill the power to the leading section when the points are set against the route?
 
Hmm.  Something for me to experiment with my MP5 switch machines.
 
Chuck S.
"It's a hobby not a race."  What I tell people when I'm asked when my layout will be finished.
[GFRR_Logo_small]
Reply 1
kenheywood
Well, a couple more hours messing around and rethink is in order.
 I think using this as an interference detector.
I’ll hide the IR emitter and detector in cabinets or bushes.
 I’ll aim them diagonally across the crossing.
Reply 1
Bernd
I bought a bunch of them also a while back. I removed both LEDS and wired them up so they would face each other thus breaking the beam when something passes through them. They way they are purchased is for reflective mode. 
 
Bernd 

New York, Vermont & Northern Rwy. - Route of the Black Diamonds - NCSWIC

Reply 3
kenheywood
Bernd wrote:
I removed both LEDS and wired them up so they would face each other thus breaking the beam when something passes through them.
Depends upon the spread of the beam.
Testing tomorrow.
Reply 1
dark2star
Hi,
I've not been lucky with setting up the LEDs on either side of the track. Had to remove them and will replace them with reflective sensors.
In my case the main problem was pointing them correctly at each other. I tried pieces of drinking straw and moving them until they align, but the moment I hot-glued them in place and removed the straws, they were not aligned anymore :-(
Cost wasn't an issue, as the components were in the cents-range. IR-LED, IR-phototransistor, 3 resistors, small cap. When I built them, there was a store for electronic components in town. Nowadays everything costs 10 Gold pieces and you'll only get it it a box with 500 other parts you don't need...
Have fun.
Reply 1
Miktrain
Making them into a break beam detector should work, but now they will operate in reverse. The output will be low when the gap is empty, this can be fixed by inverting it with an opto-isolator. If the beam spread is too wide then slip a short length of shrink tube over the sensor LED (the dark one)
 
Tony
“The vision must be followed by the venture. It is not enough to stare up the steps - we must step up the stairs.” Vance Havner
 
Webmaster
Reply 1
Jim at BSME
I have in the past successfully made these into beam break sensors across HOn3 track, and since I was reading the sensor with an Arduino just changed the code to look for a HIGH when the beam is broken and therefore a car is present.
- Jim B.
Baltimore Society of Model Engineers, Estd. 1932
O & HO Scale model railroading
Check out BSME on: FacebookInstagram
Reply 1
kenheywood
Developing Grade Crossings
Part 3 – Detection
 
My original track design only accounted for block detection and signals.
Grade crossing placement was never in the plan to include gaps and detection.
My grade crossing was very near one of those detection gaps.
Originally, I just used the detection for both blocks to run the crossing signals.
That worked, but reset only occurred once both blocks cleared.
I needed to detect the crossing itself.

Others have used infra-red Arduino obstacle avoidance modules to determine crossing occupancy.
Following that lead, I drilled the holes and placed one module in the crossing.
Some of the rolling stock detected sporadically.
I tried a second module figuring together they would be more reliable.
Still the detection popped in and out as the train passed.
Jim at BSME wrote:
I have in the past successfully made these into beam break sensors across HOn3 track, and since I was reading the sensor with an Arduino just changed the code to look for a HIGH when the beam is broken and therefore a car is present.
I ran multiple tests trying to get the detector to sense grade crossing occupancy.
The avoidance detectors failed to be reliable.
I attributed that failure to the black undersides of locomotives and rolling stock.
A black underbody does not reflect IR effectively.
Perhaps these detectors I used were not as sensitive as others.
 
I decided to reapply the detector and the sensors as interference detectors.
I planned upon placing the sensors on either side of the track.
I planned to hide the sensors in trackside cabinets.
I started with replacing the detector board sensors with 0.1 PCB headers.
The sensors got twisted pair wires so they could remote from the detector board.
Then where to place the sensors?
 
I noticed the freight house next to the crossing had a long window.
What a perfect place to hide the dark IR sensor.
In a dark window with line of sight diagonally across the grade crossing.
 
IMG_6363.jpeg
[Mounted at the proper angle on the freight house floor]
 
IMG_6364.jpeg
[IR source mounted on a tongue depressor end]
 
IMG_6367.jpeg
[Aligning sensor and source]
 
IMG_6368.jpeg
[Overhead view of alignment]
 
IMG_6370.jpeg
[Track level view with 'bush' installed]
 
The IR source has a wide beam which made it easy to line up.
I added a furnace filter bush over the IR source and the beam made it through.
Testing proved out the setup and the operation to my satisfaction.
 
There are a few positives to this arrangement:
1) The sensors are not visible as they were previously mounted in the grade crossing.
2) Placed on a diagonal, there  is no dead spot between cars as it would be when mounted below the track.
3) The inverse action (interference vs reflective) is fail-safe. Loss of a sensor reads as occupied.
 
Now I just need to replace the crossing boards with ones with no holes.
 
I detect the train approach with the current block detection.
The crossing gates and warning signals activate immediately.
Logic in my JMRI software system determines the approach direction and controls the crossing operation.
Once the train clears the IR sensor, the crossing gates and warning signals deactivate.
 
The software logic accounts for backing movements.
The software also accounts for the special track arrangement at the depot to the east.
At the depot, trains can meet and pass.
The software logic also accounts for that special case where one train leaves and other proceeds through the crossing.
The crossing system resets once both detection blocks clear.
 
------------------------
Chapter 3 – Gaps and Blocks
 
 
Reply 6
Miktrain
I used one under the track very successfully on our club layout.
It works by using the block detection to start the sound. When anything is over the crossing the under track detector takes over and holds the crossing as occupied and throws a relay that disconnects the block detection signal. As soon as the last waggon leaves the crossing, the detector turns off but the relay is held on by a timer so that the train can leave the block without the warnings restarting.
 
Here are some photos of construction and videos of it in action.
 
Tony
“The vision must be followed by the venture. It is not enough to stare up the steps - we must step up the stairs.” Vance Havner
 
Webmaster
Reply 1
York1

@Neil re:Cost

Hi Neil

Thanks for the "nice plan" comment. It is rather sizeable and complicated but ultimately enjoyable.

I agree the sensors/modules are inexpensive but the Arduino Pro Mini's are certainly not.

I will check out your weblog / Garden Railroad and see waht you are up to on your layout. 

Any advice you can give with respect to your sensors and track switching would be most welcome.

Cheers.

Paul

 
 
 
Instead of the Arduino Pro Mini, try one of the generic pro minis.  There are pro minis that work just as well as the Arduino.  I've seen them on Ebay for three dollars.
York1 John
In Flyover Country
Reply 1
Reply