Lego train with Arduino

I am a starter with Arduino. I want to build a 2 train Lego model with Arduino, where I can control both trains and switch tracks. I wanted to ask which Lego trains (most basic ones) are appropriate for me to buy? Thanks

Any experience sharing would be helpful. Thanks

Make it from scratch

I did it and I worked you just have to put your brains in to it

You can modify posts when you just need to add another sentence.

@m_vikas, why do you think it matters which train you buy?

This is a real question - it's so long since my kids had Lego trains that I don't know the differences between the available models. Back in the day IIRC there was only one.

...R

@Seanny - many thanks.
@Robin2 - the question was emanating from the different trains I saw on youtube - 9V train and the normal train where the tracks are non conducting. I am not starting from scratch without conducting tracks. Hopefully will be successful. thanks

Lego trains use the IR protocol and I believe it is the same for all trains. It is also the same as the IR protocol used in the EV3 system.

I've tried and succeeded: http://forum.arduino.cc/index.php?topic=303110.0

I'm controlling 4 trains with a IR-beam.
On going project with servos for switches, trainpositioning etc.

Here you see my try-out and succes: http://forum.arduino.cc/index.php?topic=303110.0

I’m controlling 4 trains with an IR-beam.
On going project with servos for switches, trainpositioning etc.
More info to come otherwise a PM.

Roel

latest version attached

PFcentral-4trains-v2.ino (13.5 KB)

What kind of IR Led should I use with Lego trains?

A Lego LED? :roll_eyes:

Ken76:
What kind of IR Led should I use with Lego trains?

IE-0320HBJ

Where can I find more information about this led? I didn'nt find anything with Google Search.

You should maybe give a bit more info: not everyone knows about Lego trains. I gather from previous posts they are controlled by IR remotes?

So sounds as if you plan to control one from an IR led on an Arduino?

I suspect the tricky part will not be to find a suitable IR led, but rather to get that led to blink the right way to be a good signal for the receiver on the train.

I think it said somewhere in another recent Lego train thread, that it requires a 38kHz modulated signal (which is pretty common). But if I'm right with your intentions so far, you will need to find out what signals to send to cause what action.

Ken76:
Where can I find more information about this led? I didn'nt find anything with Google Search.

That is the part number used on the Lego schematics, it might be an internal part number. I used a pair of standard 940nm IR LED rather like this one:-
IR LED

This is a video of the Lego EV3 following this beacon. It is the same protocol for EV3 and the train.