Internet of (Lego) Trains part 2

So a short update of my Lego and Raspberry project. Currently I can control multiple Lego trains at the same time through a Java and AngularJS application. Next to that I added some extra features like sound.

Two trains

 

Hardware

Two Lego trains which are both controlled through WIFI. Each train has a Raspberry Pi, USB WIFI dongle, battery pack and a infrared transmitter.

One of the trains has some more hardware on board:

  • Speaker for various sounds. Unfortunately the Raspberry Pi cam cannot record sound. But it plays songs like Steam locomotive.
  • Raspberry Pi camera to get streaming video from the train.
  • RFID this is still work in progress I can already read the tags but it needs to be integrated with the rest of the software.

Lego train with electronics

And a separate camera for the overview.

Overview cam

Control center

The control center is based on Java and AngularJS.

The first screen shows a list of all the trains with their functionality (infrared control, camera, speaker). The first (Cargo) train has all the features, the second (Passenger) train only has infrared for speed control. On the right the ‘overview’ camera’s are shown that are not attached to a train.

Control trains

The streaming video from the overview camera is shown below.Overview cam

The streaming video from the train is shown below.Train cam

Video

Video from the overview camera

Video from the train camera

Some extra pictures

Moving train 1 Moving train 2 P1120059 P1120067 P1120068

 

Next steps

  • Integrating RFID in the application
  • Using the Odroid C1 quadcore as a webserver/applicationserver/buildserver etc.
  • Add autopilot feature to enable users to predefine the actions of a specific train