Tilt Sensor: Cheap, Easy, Nontoxic




About: www.leevonk.com

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.



    • Growing Beyond Earth Maker Contest

      Growing Beyond Earth Maker Contest
    • Backyard Contest

      Backyard Contest
    • Sensors Contest

      Sensors Contest

    11 Discussions


    10 years ago on Introduction

    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?

    1 reply

    Reply 6 years ago on Introduction

    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


    10 years ago on Introduction

    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 (https://www.instructables.com/id/balancing_robot) and first I tried to use a sensor like this but because of its motion the sensor worked improperly.

    3 replies

    Reply 9 years ago on Introduction

    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.

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


    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.


    9 years ago on Introduction

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


    Reply 10 years ago on Introduction

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