digitalRead of vibration sensors

Gentlemen, no code to show here, question general. Have many sensors on hand, consider the SW18010P or any other. Can't seem to figure out by experiment the actual conditions that make it go back to yielding a LOW once a digitalRead has yielded a HIGH.

Can you change the pin to OUTPUT and set it to LOW, then change back to INPUT?

"Can you change the pin to OUTPUT and set it to LOW, then change back to INPUT?"
Yes

.

thank you sir!

Hi,
How are you wiring your sensor to your Arduino?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

What are the part numbers of the sensors you are using?

Are you using sensors in this format?

or like this on a PCB?

Not all vibration sensors are created equal, we need to know part numbers and links to data/spec to give you an answer.

Thanks.... Tom... :slight_smile:

The SW18010P is just a switch.
A ballpoint spring as one contact, and a metal stick inside the spring as the second contact.
Not sure why you need a breakout board for that (second picture).

Just connect between an input pin and ground, with pull up enabled in pinMode.
Pin will be LOW (for a short time) when a shock is detected.
Make sure your loop is short, otherwise you will miss it.
Could use interrupts.
Leo..

chuck659:
Can't seem to figure out by experiment the actual conditions that make it go back to yielding a LOW once a digitalRead has yielded a HIGH.

You probably don't have it on a pin with an external pulldown resistor, which would take it low if it's not being made high by the sensor.

(But as Wawa points out, pullup is easier since they're built in. Need to reverse the logic though, since it will now be normally high, and active low.)