herwin

Arduino powered Lego Trains

Recommended Posts

Hi,

I'm new to this forum and what to share my project of the last months: Arduino Powered LEGO train!

Check this video to get the first look:

What i can do right now:

  • Arduino MEGA powered trains
  • Up to 3 trains (can be more, not tested yet)
  • Self written C++ code for controlling the trains. Trains chooses random his path, no predefined paths yet.
  • HTML5 Web Interface
    • Canvas dynamic train layout
    • Control trains and Points
    • Check status of tracks and Points
    • reset MEGA
    • MEGA connected to Raspberry Pi with send/receive commands via SocketIO (temp solution, waiting for the Ethernet Shield!)
  • Working crossover
  • Working red/green signals (not on video)
  • Magnets in Trains to let reed sensors detect the trains
  • Differente speeds per tracks
  • Multiple station segment (wait a couple of seconds on that segment)
  • Cargo segment (wait couple of seconds and reverse)
  • Track in video has 18 track segments, 4 normal points, 1 double point, 1 crossover, 1 red/green signal, 2 station segments, 1 cargo segment.

Some issues left:

  • Speed of the MEGA, not always fast enough to check reed sensors.
  • USB connection to Raspberry Pi not as stable
  • Lots of crashed :)
  • longest stable run with 3 trains: 4 minutes... with 2 trains: 10 minutes

Components used (most bought at BangGood)

  • Arduino Mega with shield for connections
  • modified points
  • 3 HW-95 Motor drivers
  • 1 powerfull IR led
  • lots of wires (used old CAT5 wires!)
  • LOTS of time...

So far for today! post pictures of details later.

 

Herwin

 

 

Edited by herwin

Share this post


Link to post
Share on other sites

Hi,

Thanx! Yes I must use a lot of cables. There are 18 reed sensors with use 2 wires per sensor. The Points use also 2 wires and the signals 3....

I don't have a table and build on the floor, so the cables are next to the tracks. As we are in experimental fase i did not tight them up yet.

 

 

Share this post


Link to post
Share on other sites

Hi,

Hereby a big update. I have completely rewritten the application in QT with the Arduino only as collecting device and for process the lights, IR e.d. on the track.

Hope soon to implant my PFx Bricks with Bleutooth (delivery beginning 2018?).

Here a little video of my test track: 

 

 

I motorize my switches with modified switches (open up the switches to remove the click). and they are powered by a 5V battery pack.

 

Herwin

 

 

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.