Introduction: Tilt Sensor: Cheap, Easy, Nontoxic

Picture of Tilt Sensor: Cheap, Easy, Nontoxic

make a simple tilt sensor for your electronics project. this sensor will allow your robot or whatever to know when it has been inverted (or tilted to some angle such that the tilt sensor is inverted (i.e. needle side towards the center of the earth)

you'll need:
mechanical pencil
ball bearing with a smaller diameter than the pencil
two sewing needles
lighter or matches.


1) take apart the mechanical pencil so that you have a hollow shaft, you don't need the other parts of the pencil

2) solder lead wires to the dull ends of the sewing needles.

3) heat up the sharp end of the needles with a lighter.
while still hot stick the needles through one end of the pencil shaft as seen in the diagram. they should be side by side with ~2mm space between them. (i.e. wide enough apart so that the ball bearing can sit on them comfortably.

4) put the ball bearing into the shaft.
stick something (cotton ball, balled up rubber band, tape, whatever) into the open shaft end to keep the ball bearing in there.

you're done.


mathman47 (author)2009-05-29

I take it you have to operate this on its side? Isn't mounting, to have a level starting point, very critical? If starting from a non-level surface, it already triggers, but only in one direction. Perhaps a NAND gate for control - high or low. Or am I missing the point entirely?

diy_bloke (author)mathman472012-10-23

I know it is 3.5 years later but I think you were missing the point. You need to mount this tube on its side indeed at such an angle that it will start rolling at the desired tilt.

So suppose that you have a flat surface and you want the switch to close when the surface is 45 degrees tilted, you need to mount this tube at 45 degrees up, so it is level when the surface is at 45 and connects when it is tilted a bit more

vahidyou (author)2009-05-25

Very good idea.
But it has some dynamical problems when you use it on a moving object that the acceleration changes.
The ball is moving because of the the change of the acceleration of the object and causes error.
I made a balancing robot ( and first I tried to use a sensor like this but because of its motion the sensor worked improperly.

kcedgerton (author)vahidyou2009-08-27

If you use a piece of square keystock instead of a ball bearing it may help with the error, and also the shorter the tube the more sensitive it will be. So for your project you may want to use a short tube for fast response.

diy_bloke (author)kcedgerton2012-01-14

wouldn't that run the risc of getting stuck in the tube?

Procrastination (author)vahidyou2009-07-29

maybe add a capacitor to the leads to reduce noise and use tiny springs instead of needles to reduse the effects?

Firebreathing (author)2011-06-06

You could do this simpler with some copper wiring. Just take two pieces of it and put them in the tube you're using. Place some cotton in the end where the ball bearing will be, so that the tips of the wires are in it, and fill the rest of the tube with epoxy. Then use the remaining wire sticking out of the tube to connect to the rest of whatever you're attaching it to. Remove the cotton, add the bearing, cap the end, and it should work.

Cubie2 (author)2009-11-21

to make a 2 way switch do that on both sides. I like it though. A lot safer than a mercury switch. :P

krogie (author)2009-07-04

so if the bal gets off of the sewing needles wat happens???

leevonk (author)krogie2009-07-12

there is discontinuity and your microcontroller will read 0V at it's input pin

TXTCLA55 (author)2009-03-29

lol very cool, one step sensor.

About This Instructable




More by leevonk:WolfPack: Large-Dog CarrierVortex-Drive Micro ROV (ROVVor)Squintasaurus: cybernetic dynamically adjustable vision enhancement system
Add instructable to: