VMA502
V. 02 – 05/04/2019
15
©Velleman nv
7.8
The Tilt Sensor Switch
A tilt sensor will detect orientation and inclination. They are small, low power and easy-to-use. If used properly,
they will not wear out. Their simplicity makes them popular for toys, gadgets and other appliances. They are
referred to as
mercury
,
tilt
or
rolling ball
switches.
The Simple Tilt-Activated LED
This is the most basic connection of a tilt switch, but can be a handy while one is learning about them. Simply
connect in series with an LED, resistor and battery.
Reading the Switch State with a Microcontroller
The layout below shows a 10K pull-up resistor. The code states the built-in pull-up resistor that you can turn on
by setting an input pin to the high output. If you use the internal pull-up you can skip the external one.