Home  /  Lego Projects  /  Tilt Sensor

  • This page is not connected with or endorsed by The LEGO Group. LEGO, LEGO SYSTEM, LEGO TECHNIC, LEGO DACTA, LEGO MINDSTORMS are trademarks of The LEGO Group. Please read the Legal Notice from The Lego Group.

  • The following information is free and may be used as such. Please do not receive direct monetary profit from this information.

  • The information provided on this page has been well tested, but is provided "as is." The authors may not be held responsible for any loss or damage sustained by the use of this information. Anything you do with your equipment is your responsibility. Your mileage may vary.

Robots that use this sensor:

 

I want to keep the instructions to build this switch as easy to follow as I can. You'll soon see that for any text directly relating to the construction of the switch is in plain text. Italic text signifies commentary, my thoughts, or just random babble. Although not required reading for the construction of the sensor, the random babble might be helpful.

First, the background info. (As you can see, mostly just babble.)

I set a couple of simple goals while designing the tilt sensor.

  1. The tilt switch should be adjustable. That way, the construction of the sensor can be a little less accurate.

  2. Materials used in the switch should be widely available. This allows friends in the Lego community to create the switch too.

  3. Keep the switch as small as possible. The goal is 2 x 4 with the thickness of one brick and one plate.

  4. Keep It Simple, Stupid (KISS). The simplest designs for this sort of project will almost always work the best and last the longest.

Ok, so I only failed to meet a couple of the goals...

  1. Most of the materials can be tracked down at the local hardware store. The hardware is in English units, so people outside of the U.S. might have a problem finding compatible parts. But look around, I'm sure you'll locate something that'll work.

  2. The switch is 2 x 4 with the height of one brick and two plates. (I can live with this. That's less than the height of the Lego rotation sensor, right??)

  3. I originally thought of using a mercury tilt switch, but in the end I chose one with a copper ball. It's probably for the best anyhow, especially with the possibility of heavy metal poisoning.

  4. I'm walking a fine line with the KISS principle. While the design of the switch is straightforward, the construction takes a few bizarre twists. The construction is also time consuming. I promise, that at least once, you'll say, "You want me to do WHAT???"

With all the background material out of the way, let's light this candle and get started.....

Materials you will need:

  • (1) 2 x 4 Lego Brick

  • (2) 2 x 4 Lego Plates

  • (1) Lego Electric Connector (I sacrificed half of a long one for this. It's a real quality piece and I know it will work every time. I'll have to give Dacta a call for a replacement. Since the making of this sensor, I purchased a whole bundle of these contacts from BrickLink.)

  • (1) Tilt Switch (I located mine at All Electronics. Their inventory is constantly changing, so the likelihood of them having it in stock is slim.)

  • (1) Resistor (This is optional. It's in the design so the sensor will look more like the touch sensor.)

  • (1) 1/8" x 2" Toggle Bolt (Supposed to be used for hanging light objects on hollow walls.)

  • (2) 6-32 x 1" Flat Head Machine Screws

  • (1) 6-32 Nut

  • (1) 6-32 x 1/4" x 1/2" Tee Nut

 

Tools you will need:

  • Soldering iron

  • Needle nose pliers (A small one is necessary, a larger one may also come in handy.)

  • Dremel (If you don't have one, buy one. You'll thank yourself later)

  • X-Acto Knife (For cleaning up all of those plastic pieces you hacked off with the Dremel.)

  • Drill (A drill press would be my first choice, but you can do most, if not all, of the holes without it.)

  • Center Punch (Not required, but real handy for drilling holes in the right place.)

  • Drill Bits 11/64", 13/64"

  • ABS Glue

  • Two part epoxy

 

Step 1: Flat Head Screw (2):

  1. Grind down the diameter of the head of the screw. It should be a little smaller than the diameter of a peg, and be able to spin in the bottom posts of the plate.

  2. Grind off the sloped portion of the underside of the head of the bolt. The head should look like a cylinder now, instead of a cone like it began as. Ok, now's it's time for you to say, "You want me to do what???" Yeah, I know, I said the same thing when I thought of it. It is possible. Use the Dremel and grind off a little at a time, being sure to keep it round. Using a cutting blade on the Dremel and holding it at 45 degrees to the screw does a nice job for removing the sloped portion of the screw head.

  3. The one machine screw will be about at long as the height of a brick. The other machine screw, we'll just be using the head.

Before After

 

All this is so the angle of tilt of the switch can be adjusted a little by rotating the screw. While trying to fall asleep one night, I came to a realization. How many times will the bottom of the tilt sensor be accessible from the bottom? Probably very few. So, we'll also add a bolt head to the top too.

 

Step 2: Tee Nut

  1. For the tee nut, decrease the diameter of the top plate and remove the tabs as well. Try to keep this as round as possible.

  2. Remove approximately half of the threaded portion off of the tee nut. This is done to allow for more travel of the tilt switch inside of the brick.

Before After

 

Step 3: Toggle Bolt

  1. Decide which side of the toggle bolt to use and then split the toggle bolt into it's separate pieces. This decision was easy for the ones that I purchased. The half I didn't use had an elongated pivot hole.

  2. Square-up the half as best as possible using pliers. Cut off a good portion of the center plate close to the pivot holes. The more space you can give the toggle bolt to move freely in the brick, the more adjustable the sensor will be.

  3. Reassemble the half your going to use and pivot nut. I had to do some creative shaping of the sides on the half for it to fit well against the pivot nut.

  4. Epoxy the tilt switch to the toggle half.

Before After

 

Step 4: 2 x 4 Brick:

  1. Drill an 11/64" hole through the top. The size of this hole is determined by the outside diameter of the threaded portion of the tee nut.

  2. Carve out a 3/8" diameter area in the pegs around the hole. This allows the tee nut to sit flat on the top of the brick. (not shown in left picture)

  3. From the bottom of brick, remove the center post and the post with the hole.

  4. Remove all but about 1/8" of the third remaining post. We'll have to come back to finish up the fitting process after the switch is attached to the toggle bolt. The idea is to leave enough so that the switch assembly can have a full range of motion.

  5. Cut the square slot for the Lego connector wire in the side opposite to the hole.

  6. Glue in two scrap sides of a Lego brick. The scrap sides are to keep the toggle bolt from moving side to side inside of the sensor.

 

Step 5: 2 x 4 Plate (Top):

  1. Drill a 13/64" hole through the top.

  2. Remove the remaining bits of post on the bottom from around this hole.

 

Step 6: 2 x 4 Plate (Bottom)

  1. Drill a 9/64" hole through the top.

  2. One of the modified machine screws should be able to fit flush with the bottom of the plate.

  3. Remove any parts of the pegs that will interfere with movement of the tilt switch assembly. It will be about a 3/8" wide area. Be sure to leave enough of the pegs to allow for easy placement of the plate into the brick. Again, the more space you can give the toggle bolt to move freely in the brick, the more adjustable the sensor will be.

 

Step 7: Putting everything together. Be sure to dry-fit everything first.

  1. Sit the tee nut into the top of the brick.

  2. Insert the long screw into the bottom plate and then thread the toggle bolt and switch onto the bolt.

  3. At the same time, snap/glue the bottom plate assembly onto the brick and thread the screw into the tee nut.

  4. Put a drop of epoxy into the top of the tee nut to bond the screw with the nut. While the epoxy is still wet, sit the head of the other screw onto the top of the nut.

  5. Snap/glue the top plate onto the brick.

 


Copyright 2001
Troy McLucas Designs
Last Updated - October 10, 2003