Things used in this project

Hardware components:
Ardgen 101
Arduino 101 & Genuino 101
×1
SeeedStudio grove starter kit Arduino 101
×1
Software apps and online services:
Ide web
Arduino IDE

Schematics

Vibration sensor setup
connect the vibration sensor to A0
Dscn4049 wr3cqpyksk

Code

Code for piezo vibration sensorArduino
Touch the piezo sensor to make it vibrate, of course, any way to make it vibrate would be OK too. The LED would be on when vibration detected. You can also Open the serial monitor to see the sensor outputs.
const int ledPin=12;
void setup() {
  Serial.begin(9600);
pinMode(ledPin,OUTPUT);
} 
 
void loop() {
int sensorValue = analogRead(A0);//read the vibration
 Serial.println(sensorValue);//print it
 delay(1000);
 if(sensorValue==1023)//if you have an led it will turn on or off based on the vibration
  {
    digitalWrite(ledPin,HIGH);
  }
 else
 {
  digitalWrite(ledPin,LOW);
  }
}
Code 2 for piezo vibration sensorArduino
You can directly use a digital pin, take D5 of base shield as an example, and connect LED to Pin 12.
const int ledPin=12;
void setup() {
  Serial.begin(9600);
  pinMode(ledPin,OUTPUT);
} 
 
void loop() {
int sensorState = digitalRead(5);
 Serial.println(sensorState);
 delay(1000);
 if(sensorState == HIGH)
  {
    digitalWrite(ledPin,HIGH);
  }
 else
 {
  digitalWrite(ledPin,LOW);
  }
}

Credits

Download  2
Grant

DIY technology hobbyist

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Voltmeter using Arduino
Easy
  • 148
  • 9

Protip

If you can't find voltmeter at home or at any other place, then this Hack is for you, Go ahead.

Voltmeter using Arduino

Team Next Tech Lab

USBphpTunnel
Easy
  • 188
  • 4

Protip

USBphpTunnel - Android app for MXQ TV box to control an Arduino board via USB from PHP.

Arduino Morse Code Machine
Easy
  • 568
  • 9

Full instructions

A simple arduino Morse code machine with a button,led and a buzzer that takes your input and translates it into English while you are typing

Arduino 101 - Intel Curie Pattern Matching Dress
Easy
  • 1,897
  • 18

Full instructions

A dress with Curie's pattern matching engine on Arduino101 to control the embedded LEDs, which makes constellations show up on the dress.

Arduino Laser Tripwire
Easy
  • 2,435
  • 18

Full instructions

An Arduino Uno project that utilizes a laser to detect when the laser beam has been interrupted.

DIY RC Car
Easy
  • 48
  • 1

Full instructions

Web-based Car Control with PHPoC Shield for Arduino

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback