Fast Vibration Sensor Switch (Easy to trigger) PRODUCT ID: 1

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
marck1
 
Posts: 66
Joined: Fri Mar 14, 2014 12:47 pm

Fast Vibration Sensor Switch (Easy to trigger) PRODUCT ID: 1

Post by marck1 »

How do I permanently mount this sensor to an Arduino Uno

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I

Post by adafruit_support_bill »

Not sure how permanent you need. Probably the most robust solution would be to solder it to a proto-shield. https://www.adafruit.com/product/2077

User avatar
marck1
 
Posts: 66
Joined: Fri Mar 14, 2014 12:47 pm

Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I

Post by marck1 »

Does this shield come pre-assembled or I have to do all the soldering. Also, is there any other options?

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I

Post by adafruit_support_bill »

The shield does require some soldering. Soldering is generally the best way to make permanent electrical connections. What are you trying build? How rugged does it need to be?

User avatar
marck1
 
Posts: 66
Joined: Fri Mar 14, 2014 12:47 pm

Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I

Post by marck1 »

Not that rugged, I just dont want wires falling out.

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I

Post by adafruit_support_bill »

If you trim the wire leads until they are both the same length, you can plug one into pin 13 and the other into the GND connection right next to it. then you can fold it down over the top of the Arduino and secure it with tape. Not exactly bulletproof, but it should hold up pretty well.

To read the switch, enable the internal pullup resistor in the Arduino. When the sensor triggers, pin 13 will go low.

Code: Select all

const int sensorPin =  13;      // the number of the sensor pin

void setup() 
{
  // initialize the sensor pin as an input & enable the pullups
  pinMode(sensorPin, INPUT_PULLUP);     
}

void loop()
{
  // read the state of the sensor:
  if (digitalRead(sensorPin) == LOW)
  {
    // vibration detected.  Add your code here
  }
}

wespor
 
Posts: 11
Joined: Wed Mar 20, 2013 9:32 pm

Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I

Post by wespor »

Is there documentation available on how to use this sensor?

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I

Post by Franklin97355 »

Is there documentation available on how to use this sensor?
What is it you need to know? The sensor colses a switch when it is vibrated and you read the switch with a digital pin on the Arduino.

wespor
 
Posts: 11
Joined: Wed Mar 20, 2013 9:32 pm

Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I

Post by wespor »

Well a couple things have me stumped. I'm assuming the really thin, delicate copper wire is the ground? I'm using a bread board and I can't even tell if it's making contact. Beyond that, do I need a resistor in place? I guess what I was hoping for was a sample script such as you provide with most of the other sensors.

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I

Post by adafruit_support_bill »

You wire it just like a switch. It has no polarity. This post gives you wiring instructions and sample code:
http://forums.adafruit.com/posting.php? ... 3#pr305043
If the thinner wire is too thin to make contact, solder it to a spare header pin, or a piece of solid-core hookup wire.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”