Two-trains-interaction with photosensors

Now that we can control 1 train with arduino, it’s time to add a second one.
We made a track where the two trains share a part of the track, but also each have an individual part of the track. In this case we can let a train wait on his own track, while the other train uses the shared part of the track.
How do we know when the other train can start? We will be using photosensors for this.

Continue reading


First attempt at driving a train!

Our first try to start a train.

What you have to know about the Power Functions trains is that they are controlled with InfraRed signals. Each train is set to a specific channel. There areĀ 8 channels in total on LEGO Power Functions (RED 1 to 4 and BLUE 1 to 4), which would make it possible to individually control 8 trains in total.
Continue reading

Why this blog

A while ago, around christmas, we started collecting and playing with LEGO trains. We compared the new sets we bought with the old 9V ones we used to play with when we were younger and found that the options with todays Power Functions trains are more limited (aided by the fact that the LEGO Group discontinued some interesting track types) So when we started experimenting with arduino we asked ourselves: ‘What if there is a way to combine the powerful arduino controller with the LEGO Power Functions?’

Pretty soon we stumbled upon some basic things like the Arduino Power Functions library which contains the signals needed to control the train and we obtained some IR leds to send the signals with (but not the exact right ones, more about that in future posts).
This is how we started out, pretty soon our heads were full of great ideas and we were a bit low on information as to how we were going to implement these features. As we searched the web desperately to find out how and what other people have done we established that there was very little information to be found on this specific subject. Most people working with arduino’s didn’t supply much specific information and the other people who did supply information were usually sticking to the 9V engines which are easier to control and maintain.

So that’s why we decided to document in as much detail as possible the steps we have taken with our little project and we hope that we can help others who might be interested in automating their Power Functions trains.