Lego train sets were introduced almost 50 years ago, and since then, one thing has been constant: the trains connected with magnets. While this is a supremely simple means of connecting locomotives to rolling stock, there is one big disadvantage. Building decouplers – devices that will separate one car from another – is difficult.
Now, with a clever combination of racks, gears, and wedges, trains can disassemble themselves. They can even do it with an Arduino.
This decoupler works by effectively wedging cars apart from each other. With a motor from an old Lego Technic set, a few gears, shafts, and a rack, a device can be constructed that fits between the rails of a track that raises into the undercarriage of rolling stock.
Because this rolling stock is moved around with a locomotive, all that’s needed to separate two halves of a train is to move the locomotive forward. Yes, it does mean that the connection with the weakest magnet is disengaged – not necessarily the connection you want to decouple. However, with only one car and a locomotive, there’s only one connection to break. Simple enough.
This Lego decoupler can be further improved with an Arduino, a few ultrasonic sensors, and an IR detector to make a fully automatic decoupling siding for a Lego train layout. You can see all this below operating with a full state machine that perpetually switches rolling stock behind a locomotive.
A great use for Legos.
Lego. It’s Lego. I don’t know if the author is stupid or is trolling, but it’s Lego, not Legos.
Whilst I agree with you, the whole Lego / Legos thing had been done to death here.
Really? That’s what you took from the article? Sad.
No matter how good an article might be bad grammar and spelling always undermine credibility.
+infinity
Grow up, the only people that give a crap about the Lego/Legos thing are the lawyers at Lego.
No the only people who don’t care are Americans who are the only country who get this so badly wrong.
I’m glad that this was the first comment.
Pasta, Sheep, Furniture, Thunder, Clothes, Soup, Lego. It’s not that hard.
So why is the plural of moose not “Meese”. The plural of goose is geese, yes?
Is your point is that you want the plural of Lego to be “Lege” instead of “Lego”?
“Moose” is an Eastern Algonquian word, most likely from the Narragansett language, which means it comes from a genetic group within the Algic language family. Due to this, the correct plural of “moose” should be “mosinee.”
“Lege”- No, of course not, that would be just as ridiculous as this conversation we are having. Leego would be better.
Yes! Leego. That is the perfect plural form of Lego. I will use it from now on. Thank you.
Because the correct plural of goose is actually goosen. That’s why the correct plural of moose is actually moosen.
And the correct plural for “spouse” is “spice.”
+1
Nice build! As for the code, I suggest reading up on enums: they’re perfect for keeping your state names legible while not wasting memory.
You were doing really well but then had to spoil it with the last line ‘A great use for Legos.’
Cool, though I wonder if is it possible to slow down the speed at which the train leaves the junction when decoupling, it almost jumps the tracks a couple times.
Depends on which version of train motor used in this project. Old 4.5v and 12v were fixed speed. 9v electric track (which cost a lot on used market) had variable speed control, and both the short lived RC and the current PF train system have 7 speed motor.
If you’re starting out, I’d go with the current set which are PF (power function). If you have lots of time and experience with remote controlled PWM technology, you could pick up cheap old 4.5v train stuff and add PWM to get variable speed. 12v stuff is rather expensive due to scarcity.
I noticed the top decoupler catches on the second axle, not the intended first one. At some point the concrete mixer almost tumbles. I think the train should back up a little bit more before activating the decoupler. Or maybe the position of the infrared detector (photoresistor vs. IR led position) could be adjusted. Great build!
As someone who did a lot with Lego trains in the glory days of the 12V railway, back in the early Eighties, I feel I have to point out that Lego did have an official solution for just this:
http://www.peeron.com/inv/sets/7862-1
The magnetic couplings used with those models had a vertical pin hanging down. When they passed over the uncoupler, its slanted blades forced one pin to the left and the other to the right, breaking the magnetic contact and uncoupling the rolling stock. I fantasised about building a hump-shunting system this way. Unfortunately the component can’t have been a success, as it was only sold for one or two years, and it wouldn’t work with the current system.
You forgot to add ‘Arduino’ tag… get ready for those guys…
is it not possible to replace the magnets with electromagnets?
Maybe but you’d need to go back about 10 years or more when LEGO still used separate magnet and parts. The train coupler in the last 10 years used sealed magnet and permanent connection which would make custom electromagnet a little hard. Unless you mean using EM to break the existing magnet field?
Lego trains didn’t always use magnetic coupling. Blue Era 4.5V trains used mechanical hook couplers.