Lesson 10 Tilt Ball Switch
Lesson 10 Tilt Ball Switch
Introduction
In this lesson, you will learn how to use a tilt ball switch in order to detect small
angle of inclination.
Hardware Required
1 * RexQualis UNO R3
1 * Breadboard
2 * 220ohm Resistors
1 * 5MM LED
Principle
Tilt Switch with internal ball that will switch to ON state of approx. 15 degrees
tilt. Also great for sensing excessive vibration
Shape: Round
Color: Black
Contact Rating:12V
Contact Resistance: <10 ohm
Capacitance:5PF
Code interpretation
void setup()
void loop()
int i;
while(1)
digitalWrite(LedPin,HIGH);//turn led on
else
Experimental Procedures
Then, You can control the LED by controlling the balance of the
Tilt Ball Switch.
If it isn’t working, make sure you have assembled the circuit
correctly, verified and uploaded the code to your board. For
how to upload the code and install the library, check Lesson 0
Preface.