A ball tilt switch sensor, also known simply as a tilt switch or a rolling ball sensor, is a type of tilt sensor that uses a small ball inside a housing to detect changes in orientation or tilt. It is a simple and commonly used form of tilt sensor, especially in applications where basic tilt detection is sufficient.
How a ball tilt switch sensor typically works
The sensor consists of a small metal or plastic housing with electrical contacts inside. A small ball (often made of metal) is also present inside the housing.
When the sensor is at rest or in a neutral position (horizontal or vertical depending on the design), the ball rests against one set of contacts, maintaining electrical continuity between them. This position is often referred to as the “closed” state, where the switch is conducting electricity.
When the sensor is tilted beyond a certain angle or threshold, gravity causes the ball to roll and move away from its resting position. As a result, the ball no longer bridges the contacts, breaking the electrical connection between them. This position is often referred to as the “open” state, where the switch is not conducting electricity.
The change in the electrical state of the switch (from closed to open or vice versa) can be used to trigger actions or events in electronic circuits. For example, it can be used to activate an alarm, turn on a light, or control the operation of a device based on the tilt condition detected by the sensor.
How to use Ball Tilt Sensor Switch with Arduino
To use a ball tilt switch sensor with Arduino, you can employ the internal pull-up resistor and then read the state of the tilt switch.
This code reads the state of the ball tilt switch and prints a message based on whether it’s tilted or not. You can modify the code to perform specific actions based on the tilt state, such as controlling other components or triggering events.
Download Library
Simply click on the button to download the library. You can refer to this post for instructions on how to install the library in Proteus 8. How to Download and install Library in Proteus (electronicstree.com)
Please wait 120 seconds: after that, your download will begin ⏳
ZIP Password : electronicstree.com
If you have any requests for Arduino Module Libraries in Proteus, please leave a comment or message us using the contact form.