Introduction
Tilt Sensor is a digital tilt switch. It can be used as a simple tilt sensor. Simply plug it to our IO/Sensor shield; you can make amazing interactive projects. With dedicated sensor shield and Arduino board, you can achieve interesting and interactive work.
Specification
- Supply Voltage: 3.3V to 5V
- Interface: Digital
Sample Code:
int ledPin = 13; // Connect LED to pin 13
int switcher = 3; // Connect Tilt sensor to Pin3
void setup()
{
pinMode(ledPin, OUTPUT); // Set digital pin 13 to output mode
pinMode(switcher, INPUT); // Set digital pin 3 to input mode
}
void loop()
{
if(digitalRead(switcher)==HIGH) //Read sensor value
{
digitalWrite(ledPin, HIGH); // Turn on LED when the sensor is tilted
}
else
{
digitalWrite(ledPin, LOW); // Turn off LED when the sensor is not triggered
}
}
- Supply Voltage: 3.3V to 5V
- Interface: Digital
- N/A
More from this Category
LM393 Light Detection Sensor Module (4-pin LM393 LDR Digital & Analog)
R 28.35
View
TCRT5000 Infrared Line Tracking & Tracing Sensor Module
R 22.40
View
ADXL345 3-Axis Accelerometer Module
R 84.00
View
Speed Sensor/Tacho Sensor (Slot-Type Optocoupler)
R 16.80
View
IR Infrared Obstacle Avoidance Sensor Module
R 16.80
View
Snow & Rain Detection Sensor Module
R 28.00
View
Temperature Sensor Module (KY-001 3pin DS18B20)
R 44.80
View
Reed Sensor Module (MagSwitch)
R 10.71
View
Soil Moisture (Humidity) Sensor Module
R 28.00
View