(SKU:RB-02S029)Digital Virbration Sensor(Black)

From ALSRobot-Wki
Jump to: navigation, search
Heizhen.jpg

Contents

Product overview

Vibration switch digital input module, combined with special sensor Arduino extension plate, can perceive weak vibration signals, which can realize interact with vibration related works.

specification

  1. Working voltage:3.5V—5.5V
  2. Packing: electrostatic bag sealing
  3. weight:3g

Method of use

Pin definition

  • S:Signal input
  • +:(VCC)
  • -:(GND)

Connection here

By 3 p sensor cable plug received Carduino UNO R3 controller board using special sensor extension

Application of routine

Will black vibration sensor and LED the small lights in accordance with the procedure to access the Arduino UNO controller, observe when black vibration transducer vibration LED small light condition.

sample code

int hzPin = 2;
int ledPin =  13;     
int hzState = 0;        
void setup() {
  pinMode(ledPin, OUTPUT);      
  pinMode(hzPin, INPUT);     
}

void loop(){
  hzState = digitalRead(hzPin);
  if (hzState == LOW) {       
    digitalWrite(ledPin, HIGH);  
  } 
  else {
    digitalWrite(ledPin, LOW); 
  }
}

Application effect

Shaking black vibration sensor, the controller on the LED light up, stop shaking, LED lights.

Products related to recommend

Buy address:[1]

Personal tools
Namespaces

Variants
Actions
Navigation
Tools