Amazing tool control making the slot through the track one-handed so that your support hand didn't block the shot. I just purchased a later version of that IR detector that should mount perpendicular to the rails on N gauge track.
Jimmy, I use this same sensor but I installed 3 mm led bulbs with long leads standing up off the pc board at right angles. I then drill 2 side by side holes between a pair of ties. The bulbs are passed up from under the deck, thru the foam base, and to a height where they just show above the subroadbed between the ties. Once this adjustment has been determined, I solder and clip the bulb leads in place to the pc board. The board has a hole, so I lay it flat under the deck and put in one small screw to hold it. I use a 12 inich or so - -dupont connector cable with female on one end for the sensor. I then daisey chain power and ground from my arduino mega sensor shield to all the sensors and run only the signal line back to the shield. This saves a ton of wire. Think of it like running a sensor buss line of power to all sensors much like your DCC buss. If you have a 8 position terminal block close to a grouping of sensors, run all signal lines into this block. Then take a 8 pin cat5 cable and run the one cable back to the arduino shield. Nice and neat - -walla!! Bob S
IR is good but it is easy to make it trigger with other objects, you can try Hall effects sensor they only trigger when they detect magnetic field, you can use tiny neodymium magnet on the loco or rolling stock to detect the train.
I use the same sensors, however I clip off the 5mm IR LEDs and attach 28 gauge wires to run to 3mm IR LEDs. This way I can have the sensor board on the control panel to monitor &/or adjust it if needed. I have run the IR LEDs 20 feet away from the board with no problems. I can put two between two ties on HO scale using two 3/16 holes. Good video if you don't want to modify the sensor board!!
I agree. I can't see carving that canyon between the rails, then having to mount the sensor board there. My installation is as you describe, very clean, unnoticeable once it's ballasted, and I can easily adjust the sensor any time I want.
Hi Jimmy, for some reason this video came up again and I'd share where I am now. I originally installed the IR detectors but I found that they were not totally reliable. In particular, they reacted to some LED lights I installed. So, I pulled those out and tried photoresistors and that's what I use now (I have 5 speedometers installed). Anyway, as part of my Arduino Sketch I sample my PhotoResistors to see what light they are getting and then set the trip value to something like 75% of that value. This way, if it is really bright it works fine and, if it is somewhat dim (not totally black) it still works. So while this doesn't work at night it does work in a dimly lit area. For my last install, it is on our club layout which runs in various places as it is transportable so I'm looking forward to see if there are any issues with the speedometer being installed in these different locations all with different lighting.
Thanks Jimmy...Love your videos. They gave some great ideas. I mounted the IRs above the tracks, some 15" or more about. Here are my thoughts, the same ones I expressed on one of your other videos. There are glaring deficiencies, in my opinion, with the Osoyoo IR Infrared Obstacle Avoidance Sensor modules including but not limited to: • their size makes them difficult to hide, therefore removal of the emitter detector pair is required as these are easier to hide without their printed circuit board; • IR emitter detector pairs proximity to the tracks must be close enough in order for the IR beam to reflect off engines and cars; • reflectivity varies being reduced due to car color, e.g. white versus black; • car configurations vary hampering detection, e.g. flat cars, round tank cars, etc. • burying IR pairs between tracks and pointing up are a pain to install, are subject to sunlight and room lights interfering with the detection sensitivity; • there is no applicability were a road crosses multiple tracks. To solve these issues, I decided to mount the IR pairs in a through beam configuration, similar to what you may have on your garage doors. In this configuration, when the beam is blocked, a train is present. This allows: • Mounting the IR pairs facing each other creating a strong signal; • it allows them to be up to 15” or more apart increasing the ability to hide the IR pairs; • Makes alignment easy, that is, as long as the green LED on the module is lit, the detector is “seeing” the emitter; • The IR pairs are less likely to be affect by ambient light; • Instead of aligning the IR pair perpendicular to the tracks, they can be mounted diagonally to look up or down a track thus preventing the beam from “seeing” between cars should the train stop; • The IR pairs can see across multiple tracks, 3 in my application making the signal system work not matter which track the train is on. Solution So, the question arises as to what to do now that the signal going to the Arduino A0 & A1 is reversed. In the normal configuration, the green LED off means; • no train or car present; • the “Out” pin on the IR module going to either A0 or A1 is high (~4.8vdc) When the green LED is lit; • a car is present; • the “Out” pin on the IR module going to either A0 or A1 is low (~120mVdc). In the new configuration, just the reverse output happens, e.g. no train present, LED on, “Out” is low, and so on. Since I am not a programmer, I had no idea how to modify the Sketch to address this voltage reversal. Since I am proficient in using printed circuit boards (PCBs) and mounting components on them, my solution was to make voltage inverter PCBs made up of 2 resistors, an NPN transistor and an indicator LED for each IR emitter detector pair. This inverts the signals (voltage) going to A0 & A1 in the new configuration to the old configuration so the Sketch works perfectly without modification.
If you use a small piece of scrap wood underneath where you are drilling the home it will prevent tear out when the bit cones through. Excellent video!!!!
I used a method similar to a later post. I removed the IR led and Sensor and replaced with 3mm longer lead sensor and led from the reverse side of the sensor unit. Then drilled 5/32 holes for the led and sensor. This works well if you drill the holes parallel to the track separated by a single tie
Wow Jimmy. You made it look so easy. That’s so cool. I think I’m understanding now why you named your railroad “digital “. 😁. Thanks for sharing. - Drew
If you had changed out the leds for ones with longer leads, you then could have made 2 small holes, pushed the bulbs up thru, and laid the sensor flat to the baseboard and been able to adjust it as required. Of course the bulbs would have been bent 90 degrees to the pc board so it could lay flat. Bob.
Ran across a strange problem after installing the 3mm IR detectors. While running a Athearn Trainmaster the IR would not respond until I placed a piece of masking tape under the fuel tank.
Thanks Jimmy. I've been waiting for this as I want to do the same thing (to create an Arduino based N Scale speedometer). I'm thinking I'll use Hot Glue so that the sensor is "somewhat" removable and I'm using regular flex track and have ONLY foam as a base - no plywood. I like the idea of using a terminal strip though. I'm also thinking of using Servo Wires as connectors to the sensor as these come as 3-wire sets - I'll need to test fit to make sure. Thanks for the Video, gave me some good ideas. Oh and I LOVE my Forstner bit set!
I use a Woodland Scenics, just happens to be brand name but it is a low temp "foam safe" hot glue gun. A high temp one would melt into the foam I have all over the pace. You don't have a lot of working time but if you've test fit what you want to glue AND the way you'll get the surfaces together and "practised" inserting (or whatever) the piece you'll have enough time. Plus, you can use it to fill gaps (not too large) and you can cut it to remove "overglue". You can paint it although it isn't the best surface for that. It works REALLY well when you want to take some light foam board and do some mockups.
@@DIYDigitalRailroad Bought one for $4.47 with 10 sticks at Walmart.... not quite a Dollar store, but will check on my next visit.... great videos, just found your site.
hi Jimmy ...if The sensor is 3 to 5 v output the signal lights are 12volts well the ones I have are anyway ..how did you get the signal led lights to work I haven't seen any premade in 2 or 3 way n scale signal lights in 3volt to 5volt...
This is really helpful and well presented. Because the sensor is light activated, do you encounter problems when you fill in the hole around the detection bulbs?
So I have not attempted to fill in around just yet and I am trying to figure out the best plan of attack for that. I want a method that isn't permanent so that I can work on the sensors if need be.
Would it be possible to mount the sensor portion (the two bulbs) remotely from the circuit board? That way, you could make adjustments to the pot on the board without having to either have a big hole in your fascia or removing the entire thing.
Great video thanks for sharing. I'm curious, with this method can you only run 2 block signals per 1 Arduino or do you have a way to run more off of a single Arduino?
My system uses one arduino per block, but you could certainly do more than one. You could connect 5 sensors to the analog inputs, and with some recoding, you could do 3 blocks with that. You would need 12 digital outputs for that to work with the signaling, so you may want to consider an Arduino Mega for that.
Some comments... The IR sensor you used between the rails is too large. The result is ugly and not realistic. You'd been better off leaving the photo resistor in place. A question...? Why did you choose to use Kato track? If you are modeling North American railroading, the tie spacing used on Kato track is too large. Secondly, Kato track is non-flex which which makes a layout look too rigidly formal and contrived.