In this Arduino Tutorial SW-420 vibration sensor was used. It can detect vibrations from various sources.
Download # Arduino Code (*.ino file)
or
Upload Arduino code directly to your Microcontroller from website
If you want to integrate Arduino IDE into your website (as above) sign up here: codebender
Caryn
Hi, thousand thanks for your code! i tried several not working but this works so perfectly!
Btw, I will need to interface with two sensor, I dont know how to change the code to measure for two, could you please help me please?
Thank you so much in advance..Have a great day!
Sincerely,
Caryn
admin
I’m glad it works. The code is not complicated at all in order to add additional sensor, try to sort it out by yourself.
Caryn
may I know what am I measuring in the code? is it vibration amplitude or vibration time ?
admin
Amplitude
Caryn
Thanks. can u tell me the amplitude SI unit?
admin
No, I can’t. This is raw data readings from the sensor.
Caryn
alright.thanks anyway
muna
tell me if measure 8 sensor output value ….???
Swetha
Can u send me the code for connecting the vibration sensor with nodemcu?
azriel
how to use this with arduino uno
admin
The same way as nano, just connect to a proper pins, which is also written in the code itself.
Nan
Is that the measurement is a frequency?
Souvik
HI, I had a quick question, according to my understanding, this is a digital sensor, in the sense that, the output from it is going to be only 0 or 1 based on the set threshold, (which you set by turning the potentiometer screw on board). How come your measurement output is showing values greater than 1?
admin
Correct. This is because pulseIn function was used.
pallavi
Because it is not the value of input pin. if we print the value at input pin then and only then it will be in 0 or 1.
nanik alviandari
thankyou so much. it works on my Arduino Uno with SW-18051P NO Vibration Sensor Module Arduino 🙂
gail
can you please suggest me which vibration sensor to use on car window to detect any vibration on window for my project vehicle antitheft system and which will be integrated to arduino uno
LJK
Hi, what if I want to put more than 1 vibration sensor, may I know how’s the coding may look like?
muna
i would like put 8 sensor and how can i control these through arduino and and every sensor output must be display at computer individually and separately.so plz tell me if it is possible .
Marc
Saved me some frustation… A million Thanks.
fahmi
What is unit for measurement ?
Art
What does 1000 mean? Is it 1000mm, 1000um or something else
Hanis
Nice example. Just want to know can i remove red LED on the pcb board? I need to reduce power consumption since I’m running on battery.
Mukesh
what is the maximum amplitude of vibration and it would be grateful if the unit of measurement is known.
lalit shendre
hey admin can you help me to construct a code for my project ?
sensing and supressing vibration of cantilever beam and displaying same on computer screen or DSO
it consist of a cantilever beam A Sensor actuator pair an arduino
bulut
What does 1000 mean?
amar
can i get ur contact num
Diego
Anyone knows the Units??? Like Nan and bulut said?
Simon
Hi guys. I’m trying to make an Arduino driven monitor that measures how much your hand is shaking/trembling for use by recovering alcahol dependency … Me!! I want to link it up with a data logger and graphic interface that can display day v day results to give the user feedback on their recovery programme. If anyone can point me in the right direction both hardware and code I would very much appreciate it. Many thanks
ihsan
please can someone suggest a sensor model to detect high vibration such as door break detection projects?your valuable advise would be appreciated
Anil
hi,please help me,how you have writen pulseIn() function.