# Detecting coupler activity in HO



## Shdwdrgn (Dec 23, 2014)

So here's a crazy thing... I've mentioned before that I want to be able to move cars around a yard completely under computer control. I've been thinking about the problem, and I believe the most critical part is being able to detect when the loco actually couples up with cars on a spur, and also when the loco successfully decouples. This of course is starting from the simplest condition where the loco is relatively in direct contact with the car or cars it is moving around.

I think this might be accomplished if I could modify a coupler to act as a switch when it is either pushed or pulled, and looking at the insides of a Kadee #5 I think with a little modification I might have almost everything needed to use the arm of the coupler as a 'switch' coming in contact with the center screw. This assumes I have some way of returning the coupler shank to the neutral centered position (relative to forward and backward movement).

My problem is I can't think of any way to keep the shank centered. The #5 has that copper plate to keep the coupler centered relative to the width of the car, but if I allow the coupler shank to also slide forwards and backwards then I need it to return to the centered position when there is no load (string of cars) on the coupler.

So, any thoughts? Obviously the best solution would be simple, yet fit inside the coupler box, but I'm drawing a blank.


----------



## gregc (Apr 25, 2015)

the no longer available kadee #4 can be pulled out of the pocket a bit and will center itself.

i assume there's a difference between making contact and actually coupling. If metal couplers were used, a current could detect when contact is made if couplers were connected to left/right rail.

you're considering adding two such mechanisms to every car? how is this information conveyed to some controller?


----------



## wvgca (Jan 21, 2013)

you -might- have more luck detecting the increase in mass of two couplers versus one coupler .. an added benefit - no moving parts .. but -probably- need kadee or metal couplers ..


----------



## Shdwdrgn (Dec 23, 2014)

@gregc -- oh nice, I've never seen the #4, I could have worked with that. It actually looks similar to their HOn3 couplers in the way it has the spring at the rear. And no, not in every car, I only wanted these added to the front and rear of the locos. Detection would be via an ESP32. That chip also has a capacitance touch sense feature and I've been thinking of trying to play with that to see if it might be useful for this application. I don't really want to try and connect the couplers of every car to a rail because of the extra rolling resistance that would add (not to mention the incredible amount of labor it would take!).

@wvgca -- not sure what you mean by detecting the increase in mass? Basically what I'm thinking is that when the loco is backing up and bumps into a car there could be a slight motion to trigger a switch. Similarly, when you're pulling a car there will be a bit of resistance pulling on the coupler, and that too could trigger a switch. I'm not looking for anything fancy, just a simple push-pull contact with a fairly lightweight operation.

So here's a bit more about what I'm thinking... The Kadee coupler has a round part in the center. The coupler fits around that, and the screw goes through it. If I cut out the front and back of that round portion it should allow the coupler to move forwards and backwards slightly, at least enough for it to come in contact with the screw. So if I connect a wire to the coupler (or to the copper plate in the #5), and another wire to the screw, I should have a simple contact switch? The trick is to put the coupler back in the centered position (no contact with the screw) when there is no pressure from contact with another car.

Hmmm... Thinking about that fine whisker on the #105's, I might have an idea. If I drill a hole through the shank, and a hole through the box on either side of the center screw, I might be able to take a V-shaped piece of piano wire and use that as a centering spring. The point of the V is bent down to fit in the hole in the shank, and the ends of the V go out through the box holes. That might just do the trick?


----------



## Severn (May 13, 2016)

maybe put something in the coupler "pocket" which when contacted, depressed (by another coupler) gives a signal. might be noisy though.


----------



## traction fan (Oct 5, 2014)

*Strange ideas and a question*



Shdwdrgn said:


> So here's a crazy thing... I've mentioned before that I want to be able to move cars around a yard completely under computer control. I've been thinking about the problem, and I believe the most critical part is being able to detect when the loco actually couples up with cars on a spur, and also when the loco successfully decouples. This of course is starting from the simplest condition where the loco is relatively in direct contact with the car or cars it is moving around.
> 
> I think this might be accomplished if I could modify a coupler to act as a switch when it is either pushed or pulled, and looking at the insides of a Kadee #5 I think with a little modification I might have almost everything needed to use the arm of the coupler as a 'switch' coming in contact with the center screw. This assumes I have some way of returning the coupler shank to the neutral centered position (relative to forward and backward movement).
> 
> ...


 Shdwdrgn;

First of you're nuts dude! :smilie_auslachen: But then aren't all of us model railroaders "more than a few spikes short of a full cask!"

Here's my contribution to the ongoing insanity. 

1) you could equip your locomotive with DCC-operated couplers using those tiny vibrating motors from pagers. www.allelectronics.com Not only would you be able to uncouple anywhere, but you would know when the locomotive's coupler was uncoupled (motor on) or "coupled" or at least ready to couple. (motor off) The simpleset system I've seen for connecting one of these motors to a coupler is to use the semi-circular weight that comes attached to the motor's shaft as a form of "reel" to wind in a bit of thread that's fastened to the magnetic trip pin of the coupler. Motor on, thread pulled, trip pin pulled sideways, coupler opens.

This still doesn't tell you if another car is even present, let alone that you have bumped into it. To do that, you would need some sort of accelerometer that would detect the collision. Better yet would be detecting the pushback of the coupler (Kadee #4, HOn3, N-scale type) But that would entail micro-surgery inside the coupler box. Mounting a tiny plate contact at the back and magically attaching a wire (and in the case of the plastic N-scale coupler a second tiny contact) to the coupler without messing up its operation, and good luck with that! :goofball:

Perhaps slightly more reasonable, would be using the metal trip pin as a contact. It moves sideways a bit when coupling takes place. A tiny wire contact that stuck out in the path of the trip pin could act as a second contact, but that would still mean attaching a wire to the trip pin. :dunno:
Alternatively you could have two tiny wire contacts in the path of the trip pin's sideways travel, and use the trip pin to bridge the two contact wires to each other. Keeping these two wires in perfect alignment after a few coupling cycles would be difficult, to say the least.

Here's the question.

Even if you overcome all the many difficulties and develop a reliable "coupling/uncoupling detector", how are you going to get that detector's signal from the locomotive, back to the computer?

Or, if all else fails, (and I really, really, think it will) we could take our cue from Tom Hanks as "Sully" the heroic pilot who safely landed his crippled airliner on the Hudson river, without losing a single life, and say "Could we be serious now?"
Doing that would involve a situation similar to that in the movie, get away from computer (simulations) and land the plane, or run the railroad, with a human's eyes and brain.

Good luck, I'm afraid you'll need a lot of it!

Traction Fan :smilie_daumenpos:

P.S. I hope you realize I'm joking. If you should succeed with your scheme, I will gladly admit being wrong, and congratulate you on your success. You will have advanced the frontiers of the hobby, and that would be praiseworthy.


----------



## Dennis461 (Jan 5, 2018)

I've had to install plastic couplers on my Athearn metal frame diesels and a metal frames coal tender to prevent shorts.

The metal couplers shorted out when trying to run SW7 back to back, and the steam coal tender coupled to SW7.

Why not run a small wire from the metal coupler shank to a voltage detector inside a boxcar?

For the engine, similar circuit (if you can squeeze it in), look for milliamps leaving the coupler.

p.s. You may have to switch to G scale


----------



## Shdwdrgn (Dec 23, 2014)

@traction_fan: The ESP32 I mentioned is an arduino type of mirocontroller, only a lot more powerful and has wifi built in. The board I'm currently working with in only 13x19mm! So basically I'm working on designing my own version of a mobile DCC decoder with a full-blown computer onboard my locos, with the goal being to have a larger computer hand out tasks to each loco, and then having the loco being able to complete that task on its own. What were you saying about ongoing insanity? 

@Dennis461: I'll keep that in mind but ideally I'm trying to prevent the need for special wiring in all of my rolling stock (beyond the wheel resistors for block detection).


----------



## gregc (Apr 25, 2015)

i see no need for a mechanical device to detect coupling. I think using a metallic coupler attached to a specific rail allows you to determine if there is contact. pulling away will confirm that coupling was complete (contact remains) or if coupling was unsuccessful. of course is may be intermittent, but software can handle that

an electrical method requires no extra components or micro surgery and is an easier interface, simply check for a voltage.


----------



## Shdwdrgn (Dec 23, 2014)

I'm not sure how you figure there's no extra components with that method? It means that you have to add a wheel wiper to both truck of every single car, and then connect that wiper to the nearest coupler. The only advantage I see with that method (assuming the position of the wheel resistors is taken into account) is that you could get a fixed voltage change for each additional car which could give a count of the number of cars being towed. It would be a cool way to detect if part of the train breaks loose or if you didn't pick up as many cars from a siding as was expected, but I think block occupancy would be just as easy to detect lost cars, and an IR pair on the sidings could count passing cars. I'd really rather not have to perform a special wiring job on every single car.


----------



## gregc (Apr 25, 2015)

Shdwdrgn said:


> not in every car, I only wanted these added to the front and rear of the locos.


right not every car


----------



## Shdwdrgn (Dec 23, 2014)

But I need to be able to detect connection to literally every individual car on the layout. The way I plan to shuffle cars around, and because of the multiple reverse-loops, a switcher could encounter either end of every single car over a period of time.

I did some modifications on a coupler last night so the coupler can shift back and forth a bit. Interestingly the copper spring in the #5 actually seems to want to push the coupler back to the centered position by itself, at least to some small degree. I still don't have enough movement for the coupler to contact the center screw though, but after taking some emery paper to the shank it does make good electrical contact with the copper.

I also picked up some piano wire from the hobby shop. The smallest they had was 0.015" and it still looks too large. I may have to order something smaller online. I do have some 0.0125 phosphor bronze wire though, I wonder how good of a spring that would make? Anyway, still working on this idea...


----------



## wvgca (Jan 21, 2013)

well, ten days .. any updates ??


----------



## Shdwdrgn (Dec 23, 2014)

Heh, sorry, been a bit busy with other things. I'm actually hoping to get up to Home Depot this afternoon to pick up some plywood and foam so I can start setting up the shelf layout where I would be testing the automated switching on.

I'm not too happy with my precision with the xacto blade to make adjustments to the coupler pocket, but I got close enough to see that I *can* get enough room to allow the coupler to move back and forth by a couple mm. My concern is that it leaves the center support for the coupler so small that one good hit might break it off. The centering spring is another trick here. I may have to look around to see if anyone sells a flat springy material that's about 1mm or 1/32" wide that I could use instead of the piano wire.


----------



## gregc (Apr 25, 2015)

what if the whole coupler box were allowed to move?


----------



## Shdwdrgn (Dec 23, 2014)

Hmm that's an interesting idea I hadn't thought of. And my 0-6-0t does have pockets for the couplers where this may be possible... Thanks, I'll look into that as well.


----------



## gregc (Apr 25, 2015)

what about optical instead of mechanical detection?


----------



## Shdwdrgn (Dec 23, 2014)

I'm not sure about optical... I mean, it would take more space than a couple pieces of copper acting as contact switches. Unless you mean using IR LEDs to try an sense when there is something (hopefully a car) in close proximity to the loco?

Wow, what a day. Got my plywood and 1" pink foam. I knew Home Depot wasn't going to rip the plywood with any amount of accuracy, but it gave me a good excuse to do some quick cleaning in the garage so I could get to the table saw. Surprisingly they also are not allowed to cut the foam on their panel saw because of the "danger of cutting their fingers"??? Well whatever, the foam was light enough for me and my wife to handle. I set the saw to the width of the narrower piece of plywood, then ripped the other board to match and cut two piece of foam as well. Since this is going to be an L-shaped shelf, the 45 cuts were a lot more work since my miter saw only handles 12" across and not the full length of the 45 cut. I've had practice making the double-cuts though, so I got everything finished up nice and clean. Each leg of the shelf will be 6' in length so I lopped off the last 24" from everything.

Too worn out to even get the shelf brackets up on the wall tonight, but the sawing is finished and that was the important part. Got a big snow storm rolling in tonight but it was 75 degrees this afternoon -- great day for working on this!

Now I just need to find some 1/4" foam to top it off. The 1" thickness of the main piece gives enough space to embed the electronics and servos. I have an idea that I can cut slots for the servers along the front edge of the foam and use a piece of trim wood to hide them. The 1/4" layer would cover everything from the top, and hopefully the electronics will be hidden but easily accessible.

Yeah I should probably start a new thread for this project.  Once I have the shelf up and can grab some pics, I'll do that.


----------



## gregc (Apr 25, 2015)

Shdwdrgn said:


> I'm not sure about optical...


to detect coupler box movement which presumably has some light spring resistance. breaking an optical beam requires no force and it's not all or nothing (on/off). breaking part of the beam will reduce it's intensity.


----------

