Another illustration how to control and wire the Rolling Ball Tilt Switch or Ball Sensor along with Raspberry Pi. Ball tilt switch allows you to detect an location or inclination they are small and easy to wired-up it use low power if used it properly see below the diagram. They are usually made of cylindrical or square type surface mounting and it has a conductive balls inside. One end has two conductive elements pole when the sensor is oriented so that that the other end is downwards the ball rolls onto the pole and shorts them or switching the both pole.
Required Components
- Raspberry Pi / Banana Pi / Orange Pi (If your using Banana Pi or Orange Pi See first the GPIO Pins)
- Rolling Ball Tilt Switch
- Solder Less Bread Board
- Jumper Wire / DuPont Wire
- LED (Any Color)
- Resistor 220 Ohms
Wiring Diagram
For C Code/WiringPi
[crayon-6729b9c6370be402305591/]
For Python Code
[crayon-6729b9c6370c9770557830/]
Wiring The Vibration Tilt Switch / Ball Tilt Switch with RPI