Skip to main content

@BOB WALKER posted:

Did you ever consider using the Sharp distance measuring sensor? I have used it with good results in several projects.

Bob, I did a search for Sharp distance measuring and got several hits. One is a flat module that appears to be IR based, so it would likely be no better than the 153IR or any ither IR device. Another offering was called Pololu and looks a lot like the HC-SR04, though it was not clear what the technology is. Both seem to be around 9 bucks, so they are way more costly than the HC-SR04. Sorry I am not seeing any advantage?

It would help if you could tell us which particular device you are referring to?

Rod

Last edited by Rod Stewart
@BOB WALKER posted:

The Sharp unit is a GP2YOA21YKOF proximity detector which outputs a voltage corresponding to the distance to an object. I used it in several projects described in train magazines. Here's one of them.

https://www.youtube.com/watch?v=P8NJNvCfCU

I'm at a loss as to how this is superior, and it's an optical sensor.

Sharp GP2YOA21YKOF Specification.pdf

So I have some real layout experience to relate with these sensors. Today I did my #2 build and mounted it on a scrap of 2 x 4 to do some layout testing. This puts the CL of the heads at about 2" above grade, which seems like a good height for use with O gauge tubular track on cork roadbed.

I set the range pot to max (about 7" with these components) and it worked really well. No false triggering or spurious responses. and there is a "rock" wall about 13" away which had me worried, but no issues. And it nicely covers the two tracks at this location. Set the delay to about 12 seconds which looks about right to me. It is very repeatable. The train I was running has a consist of about 6 tank cars plus a few box cars etc. It triggered when it should have, and not anytime else. My conclusion (based on an example of one!) is that as long as the range setting is reasonable, which it will be with the specified components, there should be no problem with reflections, false triggering, etc. Works great.

When you stop a train in front of it with the gap between cars lined up with the detector heads, it times out as expected. But stopping with any part of any car in the beam of the signal kept it triggered nicely. No dropouts at all. I may try lining the head height up with the couplers and see if that keeps it triggered between cars. But overall I am very happy with how they work just as is.

Attached is a short video clip of the test setup. This is hooked up where a 153IR controller normally sits; one I had some troubles with as reported recently in a separate topic.

In summary I think these guys work better at detecting trains than anything else I have tried on my layout. The next step is to whip up some sort of small trackside building or similar to mount it in. How about it you 3D print design guys??

Of course another option is remote mounting the board under the layout as discussed earlier in this thread, but I have not tried that yet. Anyone else who had tried grj's kits got any experiences to report?? I think he has some kits left, for anyone else who wants to get their feet wet. its pretty neat technology. And thanks again Stan 2004 for doing the circuit design, it works really well!!

Rod

Attachments

Videos (1)
Train Detector Test

Try them at an angle to the track and they may catch the train and ignore the gaps.

In the datasheet for the HC-SR04 they say that the "Measuring Angle" is 15 degrees. Not sure but I think that may mean you have to be within 15 degrees of perpendicular to the reflecting surface for it to read the reflection. If true, that might limit how far off these can be mounted, but a little more experimenting  will tell I guess.

Rod

They might be erring on the conservative side.  I got reliable readings at over 40 degrees when I rolled a tiny car in at that angle.  I think coming in at 20-25 degrees would solve the problem of the gaps between cars and still provide reliable triggering.



Good to know John. Overall I am quite happy with the way these things work. Just need to come up with a convincing small structure to put on the layout that will hide the sensor heads now.

I have been playing with some housing ideas for the sensor head that might work on the layout without looking too "clunky". Here are some pix of one idea. This is actually the large relay cabinet in the Lionel trackside accessory collection. I placed it on a convenient chunk of 1 x 2 just to get to the height needed for the sensor ports. To the right is a pic of the sensor head mounted in the cabinet with holes drilled in the back which would be aimed across the tracks. So the whole thing is pretty unobtrusive.

Housing 3Housing 5

Here is the finished cabinet with the sensor installed, ready for layout trials. Only trouble is I need to build up another train detector board first because the two I built so far have the sensor soldered into the board! Oh well.

Housing 6

Note that going this route would be a bit pricy as the Lionel trackside kit seems to sell for up to about $30. Kind of crazy for 4 or 5 simple little plastic doodads that don't do anything except sit on the layout, but hey. One idea I am exploring is getting a 3D printer file together for something similar to this. I have a sketch made up that will fit these sensor heads really well, and it is higher so you don't need the wooden block under it. That would allow one to print up half a dozen or however many you need pretty inexpensively.

Research continues.

Rod

Attachments

Images (3)
  • Housing 3
  • Housing 5
  • Housing 6
Last edited by Rod Stewart

So I tried the sensor on the layout today with great results. I put it in place of a 153IR which had been giving some problems. And it works great. It is 100% compatible with the other 153IR at the other end of two road crossings. Its range is good; it easily covers two adjacent tracks. No false triggering during my testing. And best of all it triggers reliably with tanks cars; something that most IR sensors have trouble with. I parked a couple of them in front of the sensor just to make sure it was solid. Worked really well. Here is a pic:

HC-SR04 In Housing on Layout.

Note this is just a test setup so the control board is plopped on the table right in front of the sensor cabinet, in the foreground. A permanent installation would have the control board sitting below the table with the sensor tethered to it. All good. Now I have to figure out something to use to house a few more of these guys.

Rod

Attachments

Images (1)
  • HC-SR04 In Housing on Layout.

I got a question I got a couple kits from John and finally got around to putting one together. And it didn’t seam to work very well then I noticed I had 7VDC coming out of the voltage regulator 😳

I need To go back through it and make sure I didn’t screw something else up but I’d bet that the sensor is dead now.

so to the point what voltage are you guy feeding these things? 14VAC? 8VAC? I wouldn’t had thought it to make much difference but just wanted to check

It appears there are 2 versions of the PCB out there.  I know there was some discussion about modifications to the initial PCB design IF another batch was ordered.   I guess they were ordered?

hc-sr04 versions

I see the 7805 voltage regulator (circled red) faces oppositely.  The left photo looks to be PCB Rev 1.0 (circled yellow); the right photo Rev 1.1?

If you're having a problem with the voltage regulator, can you confirm the 7805 orientation matches the version.

Attachments

Images (1)
  • hc-sr04 versions
@zhubl posted:

I got a question I got a couple kits from John and finally got around to putting one together. And it didn’t seam to work very well then I noticed I had 7VDC coming out of the voltage regulator 😳

I need To go back through it and make sure I didn’t screw something else up but I’d bet that the sensor is dead now.

so to the point what voltage are you guy feeding these things? 14VAC? 8VAC? I wouldn’t had thought it to make much difference but just wanted to check

Zachariah, the voltage on pin 3 of the 7805 should be pretty much 5 vdc, spot on. Your board should have the 7805 oriented as shown in Stan's pic above of 3/11, with the tab facing inwards and the inscription outwards. Grj revised this orientation on later boards to that shown in the 4/27 view. But I believe all original kits of grj's are as per 3/11. Grj will maybe confirm this.

Rod

@Rod Stewart posted:

Zachariah, the voltage on pin 3 of the 7805 should be pretty much 5 vdc, spot on. Your board should have the 7805 oriented as shown in Stan's pic above of 3/11, with the tab facing inwards and the inscription outwards. Grj revised this orientation on later boards to that shown in the 4/27 view. But I believe all original kits of grj's are as per 3/11. Grj will maybe confirm this.

Rod

Correct, the first spin of the boards were the top picture.  I did a second one that I didn't buy any boards from.

@zhubl posted:

I did confirm I have V1.0 and put the voltage regulator in backwards (that’ll show me to just slap a board together without tripping checking) anywho I still think I fried the HC-SR04 so I need to swap that out with the other one I got.

Sorry about that Zachariah, I really should have made that clearer, I was trying to accommodate both the switching power supply module and the regulator, and I did a poor job of documenting it.

Sorry about that Zachariah, I really should have made that clearer, I was trying to accommodate both the switching power supply module and the regulator, and I did a poor job of documenting it.

And to think you were a "professional"

No worries John I'm thinking that only the sensor module it's self was damaged but I'll find out soon enough



@Rod Stewart posted:

Ouch! Do you plan to flip the Vreg and see if bychance it works ok? You may have cooked the 5555 and the 74HC123 in the process, hard to say. But you have nothing to lose in trying it out.

Rod

I did do that but no cigar yet like I said above I'm betting then senor module is the only thing damaged as it's probably the only thing with a strict 5V rating. Not too worried about the 555 it should be fine the 74HC123 could be but we'll see I would imagine it should be fine but I'll double check the data sheet for the ratings.

Add Reply

Post
OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
330-757-3020

www.ogaugerr.com
×
×
×
×
Link copied to your clipboard.
×
×