Lego Rail Crossing Arm and Counter

by david.mccormack

Published on December 14, 2014

Keep the lego mini figures safe at rail crossings with this lego rail crossing.  It will also keep track of the number of trains which have passed over it as well.

How To Make It


Connect usb power to pressure sensor.


Connect pressure sensor to wire.


Connect wire to Arduino port a1.


Connect Arduino port d1 to wire, then wire to the servo.


Connect the Arduino port d5 to the branch.  Then connect the branch outputs to number and cloudbit. 
NOTE:  It is important to use the USB power instead of the 9V battery power.  The battery doesn't have enough power to keep the CloudBit powered, and it won't work most of the time.


Connect Arduino port d9 to all of the leds.


Implement the code for the Arduino.


Place the pressure sensor underneath the train track.


Attach the servo to a lego arm.  We just used a paper clip to put it on.  Enclose the servo in a lego housing to keep it upright.


Place pressure sensor underneath the track.

Related Projects

Sleep Machine 2.0

My Sleep Machine 2.0 is meant to hack my habits. My habit is being scared of the dark and getting really hot. I also can´t stay aw...

littleBits Ice Cream Truck

In this project, we developed and constructed an ice cream truck with lights and bells (buzzer) that notifies children (minifigure...

Olympic torch #bitOlympics

A beautiful Olympic torch to be passed to participants #bitOlympics