Jump to content

Recommended Posts

Posted

Hi all, if I just thought I would share with you one of the baby steps of the train project I'm working on. I'm currently using a very crude Lego model, but I guess this will be improved once I get one of those new PF train sets.

This is a prototype Lego train built with a power functions XL engine, a RoboDuino arduino board with an IR receiver and a reflex detector. Through the IR receiver I can control the speed and direction of the train using the remote control for my DVD player. The reflex sensor is used to detect codes embedded in Lego along the track.

The code is billed as high and low spots, where the length of the low spots indicates whether a zero or a one is encoded. Two examples in the video are 01 and 10. The first code indicates that the engine should slow down, and the second code is a stop command.

Notice how the engine is commanded forward by the remote control. It quickly ramps up to full speed and continues like this until it reaches the first code block. Once the first code block is read, the engine slows down to a more moderate speed. This speed is maintained until the engine reaches the second code (a stop command). Once the code is detected, the engine quickly decelerates to a full stop.

This will be expanded in the future, hopefully with less noticeable codes, to support a wider range of different commands. If we combine this with timers, we could get a very dynamic languages able to speed up and slow down, for instance straight and curved tracks, and which also will stop at given points (stations) for some period of time, before it continues.

Further extensions of this idea are very welcome.

Thanks for watching.

Posted

This is very cool, will you ever cover up all the wires with an actual engine? Anyway, this is very cool! :thumbup:

As I mentioned in my first post, if I have to get either the passenger or cargo train set with the new power functions engine. I could then use a new engine with the accompanying battery box, so that I would only have to fit the microcontroller into the train.

Posted

I have done some more experimentation, and figured out how to place the code embedded within the track itself. The code will build one or two plates high between the two rails that make up the train track. This means that it is no longer necessary to have the detector poking out of the side of the train, rather it can be mounted within the engine with a view downwards.

The downside of this approach is that every code has different meanings depending on which way it is rate, so I would need a longer code (more bits) to come up with a decent system.

It is difficult not to run out and buy a new passenger train set straight away to put this into a nicer looking train set :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...