MOC: Robot controlled Lego engine

Recommended Posts


Hi all,

It has been awhile since last time, but I have now completed my first prototype experimental Lego train engine (which is evidenced by its design). I have filmed it going one round on my kitchen tables and uploaded to YouTube. Below I have pasted in the text from the video description on youtube which describes what you see.

I apologise for the bumpy filming, but I had to fight my three-year-old for control of the tables and train :)

Begin pasted text:

This is a prototype research Lego engine. It's powered by a Lego power functions XL motor which again is powered by six rechargeable AA batteries (divided into two battery holders for maximum flexibility). The control is provided by an Arduino board (Roboduino), with input from an IR receiver and a distance sensor. Interface between the board and the engine is a regular electronic speed controler.

Using the Harmony one remote control I can control the target speed, and the train will smoothly accelerate up to the target speed in either direction (the acceleration is perhaps a bit slow for now). When encountering an obstacle on the track (like an illegally parked police car in this demo) the engine will emergency brake, and standstill until the obstacle has been removed. Once the track is again clear it will automatically accelerate up to the previously set target speed.

Once the train approaches the railway station I can command the engine to stop using the remote control, and it will smoothly decelerate to a standing position.

This is the first step towards automating the Lego train. Eventually it should be able to detect train stations and curves to automatically adjust its speed/stop for a period of time.

Hope you like it.

Edited by TheBrickster

Share this post

Link to post
Share on other sites

That's pretty neat Kolaf. Is the distance sensor part of the Roboduino system, or are you using something like a Mindstorms sensor?


Share this post

Link to post
Share on other sites

Ditto ditto - fantastic train concept - love the crash prevention system - very clever - Mindstorms ?

Excellent design job 'Kolaf' and I'm a conformist! ! :sweet:

Share this post

Link to post
Share on other sites

Thank you both for your enthusiasm. There is nothing mindstorm in it, the distance sensor is something I got from the same store where I bought the Arduino board. Similarly, the IR receiver and everything else is standard electronics, the only Lego thing in the drive system is the motor.

Since the video I have tweaked the acceleration and braking functions to look more "real". Even when approaching an obstacle it will emergency brake (which takes 5 to 10 cm), instead of stopping instantly as it does in the video.

I need to work some on the design, though. Does anyone have a better idea for the drive train from a power functions motor? It looks quite big at the front there. Also, the design of the boogie is a bit flimsy to be small enough to fit into the body.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.