Surilli
Published © LGPL

Detect Vibration and Tilt with Ball Sensor and Surilli Basic

It can only detect large changes when it's tilted. For example, opening or closing of a door, etc.

BeginnerFull instructions provided9 minutes561
Detect Vibration and Tilt with Ball Sensor and Surilli Basic

Things used in this project

Hardware components

Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×5
LED (generic)
LED (generic)
×1
Surilli Basic
Surilli Basic
×1
KY-020 Ball Switch Sensor
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Detect vibration and tilt with Ball sensor and Surilli Basic

Code

Ball_Sensor

C/C++
int Led = 6;// define LED Interface
int buttonpin = 5; // define Sensor Interface
int val = 0;// define numeric variables val
void setup ()
{
 pinMode (Led, OUTPUT) ;// define LED as output interface
 pinMode (buttonpin, INPUT) ;// output interface is defined of sensor
}
void loop ()
{
 val = digitalRead(buttonpin);// digital interface will be assigned a value of pin 5 to read val
 if (val == HIGH) // When the sound detection module detects a signal, LED flashes
 {
   digitalWrite (Led, HIGH);
 }
 else
 {
   digitalWrite (Led, LOW);
 }
}

Credits

Surilli

Surilli

196 projects • 62 followers
Surilli is a premiere Internet of Things centric Technology Company aimed at providing cutting edge innovative solutions.

Comments