Fast Vibration Sensor Switch (Easy to trigger) PRODUCT ID: 1
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- marck1
- Posts: 66
- Joined: Fri Mar 14, 2014 12:47 pm
Fast Vibration Sensor Switch (Easy to trigger) PRODUCT ID: 1
How do I permanently mount this sensor to an Arduino Uno
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I
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
- marck1
- Posts: 66
- Joined: Fri Mar 14, 2014 12:47 pm
Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I
Does this shield come pre-assembled or I have to do all the soldering. Also, is there any other options?
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I
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?
- marck1
- Posts: 66
- Joined: Fri Mar 14, 2014 12:47 pm
Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I
Not that rugged, I just dont want wires falling out.
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I
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.
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
}
}
-
- Posts: 11
- Joined: Wed Mar 20, 2013 9:32 pm
Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I
Is there documentation available on how to use this sensor?
- Franklin97355
- Posts: 23910
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I
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.Is there documentation available on how to use this sensor?
-
- Posts: 11
- Joined: Wed Mar 20, 2013 9:32 pm
Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I
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.
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Fast Vibration Sensor Switch (Easy to trigger) PRODUCT I
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.
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.
Please be positive and constructive with your questions and comments.