Homebrew lego sensors

The following is my first attempt at making some lego sensors for the Mindstorms Robotics Invention System.

Thanks to Michael Gasperi for the original instructions on making a temperature sensor: http://www.plazaearth.com/usr/gasperi/lego.htm

So far, I've made three sensors and one Frankenstein radio control module using a Rokenbok vehicle:

  • Temperature Sensor
  • Light Sensor
  • Bend Sensor
  • Rokenbok radio control module
  • Construction notes

    Tools you'll need: a drill, hacksaw, and soldering iron.
    Supplies: 3/16" brass tubing, some wire, and some sensors (obviously :-)

    Use a 3/16" bit and drill out two pegs in a lego block - it may be easier to start with a smaller bit to make a starter hole for the larger bit. Once the holes are drilled, insert the tubing in the drilled hole and mark the height for where to cut the tubing. Cut the tubing with the hacksaw.

    I used 3/16" brass tubing for two of the sensors (bend and temp), and 3/16" aluminum tubing for the light sensor. I liked the aluminum tubing better - it had a nice thickness to it so the end result had a better peg-like look to the connectors. Also, the tube was less likely to get mishapen in the vise, however in my inexperience I hadn't realized you can't reliably solder to aluminum using a simple soldering iron. Because of the soldering problems, I switched to the brass tubing. It works ok, however because of the thinner walls, you have to be a bit more careful to not crimp the ends.

    After cutting the tubing, I filed the ends to eliminate any sharp ends so legos attaching on top of the pegs wouldn't get scratched or gouged. I also made some tests with the tube pegs inserted in the holes to ensure the lego wire connector will fit properly on top while the tubes don't push out the bottom. If the pegs are too high, you'll have to file them down or cut them again. If the pegs don't seem to have the right angle, you may be able to fix it using a hot soldering iron. Line up the pegs with a real, unmodified lego block to determine which of the tubes is out of alignment. Then insert the soldering iron end into the tube and slowly force the tube into the proper position. As the iron heats the tube, the plastic surrounding the tube should begin to get pliable and you should be able to get a proper alignment. Double check your work by ensuring a wire connector will attach properly. Don't overdo it with the soldering iron or you'll end up with a Dali-esque lego block.

    Insert the cut tubing into the lego blocks and determine what part of the block needs to be cut to accomodate the sensor. Once the cuts are made, recheck whether the sensor will fit correctly. Remove the two pieces of tubing and the sensor and solder them together. Do NOT solder the tubing while it is in the lego block unless you are very fast and careful. The lego block will melt rather quickly. Instead, you should solder the whole thing outside, and then push it back into the block as one piece.

    Temperature Sensor

  • Sensor values: (643-RAW)/5.6 = temp in degrees C

  • The temp sensor is built from the Radio Shack Thermistor (part # 271-110A - cost $1.99).
    The thermistor leads are rather stiff, so I had a difficult time getting the leads attached to the tubing while maintaining the proper bend to have it stick out the front of the block. I ended up sawing notches on the inside ends of the tubing and put the thermistor leads in the slots. I then crimped the hidden ends of the tubing to clamp the thermistor leads in place. You can see that in the 3rd picture above.

    Light Sensor

  • Sensor values: 5 (bright light) thru 1000 (dark)

  • The light sensor is built from simple photo sensor. I had this part lying around, so I don't know the Radio Shack part number. When soldering this one, I had to pay attention to ensure the proper pin was attached to the proper aluminum peg. If the electrical circuit is reversed, the sensor doesn't work. I'm sure there is a simple way to add a few more electrical parts to make it not matter what way the wiring is done, but for now I kept it simple. I know to always put the lego wire connector on in the "right" direction.
    In the above pictures, note the use of aluminum tubing. It has a much nicer look than the brass stuff, but soldering it was a bear. Notice in the third picture above my fine example of how to not solder while the tubing is still in the block. I really scorched that block pretty badly.

    Bend Sensor

  • Sensor values: 945 (straight) thru 1010 (fully bent)

  • The bend sensor is my favorite and I hope to build a few more. I took an old Nintendo PowerGlove and cut it open to remove the bend sensors inside. These are the same bend sensors
    Images Company sells for $10 each. You can usually find PowerGloves for auction at eBay for around $20. You can get 4 sensors from a single glove. These sensors are great for making a robot follow the edge of a wall or stop before actually hitting an obstacle. The actual bend sensor is 4.5" long, although it's hard to tell from the above cropped pictures.
    In the above construction, I notched the lego block length-wise to ensure the bend sensor would have a good anchor point within the block. Notice in the third picture how one of the internal cylinders has been cut out.

    Check out my new Rokenbok/Mindstorm radio control project - AKA Rokenstorms. It's a way to make a Mindstorms radio control module out of the guts of an Rokenbok vehicle!

    Direct questions or comments to Brian Stormont.