MECHATRONX

أهلاً بيك

سجّل دخولك تتابع أوردراتك وتحفظ مفضلتك.

الأقسام

كل الأقسام

اللغة والدولة

اللغة

العربية English

الدولة

مصر · ج.م السعودية · ر.س قريباً الإمارات · د.إ قريباً

الموقع بيفتح بالعربي دايماً، وتقدر تغيّرها من هنا.

ميكاترونكس - المنصورة، مصر
الأحد للخميس، 10ص - 8م

-23%

شارك المنتج

1 / 3
سنسورات تقارب وحركة (الترا سونيك / IR / PIR)

موديول سنسور اهتزاز SW-420

50 ج.م 65 وفر ⁦15⁩ ج.م
متوفر
الكمية:
اسألنا - نرد عليك على واتساب
يوصلك خلال 72 ساعة
دفع آمن. نقبل: بطاقة بنكية محفظة إلكترونية الدفع عند الاستلام إنستا باي

يُشترى معاً عادةً

عن هذا المنتج


There are several critical machines or expensive equipment which suffer damages due to vibrations. In such a case, a vibration sensor is required to find out whether the machine or equipment is producing vibrations or not. Identifying the object which is continuously vibrating is not a tricky job if the proper sensor is used to detect the vibration. There are several types of vibration sensors available in the market which can detect the vibration by sensing acceleration or velocity and could provide excellent result. However, such sensors are too expensive where the accelerometer is used. Accelerometer is very sensitive and can be used to make Earthquake detector circuit. But there are few dedicated and cheap sensors are also available to detect the vibrations only, one such vibration sensor is SW-420 which we are going to interface with Arduino Uno.


So, in this project, a basic vibration sensor module is interfaced with popular Arduino UNO and whenever the vibration sensor detects any vibration or jerk an LED will start blinking.



Vibration Sensor Module SW-420


Vibration Sensor Module SW-420


This is an SW-420 vibration module, which can work from 3.3V to the 5V. The sensor uses LM393 comparator to detect the vibration over a threshold point and provide digital data, Logic Low or Logic High, 0 or 1. During normal operation, the sensor provides Logic Low and when the vibration is detected, the sensor provides Logic High. There are three peripherals available in the module, two LEDs, one for the Power state and other for the sensor’s output. Additionally, a potentiometer is available which can be further used to control the threshold point of the vibration. In this project, we will use 5V to power the module.


We used the same sensor in Anti-Theft Alert System using ATmega8 Microcontroller. Also a tilt sensor can be used to detect sudden accident.



Components Required



  • Arduino UNO

  • SW-420 Vibration Sensor Module

  • 5mm LED (Any Color)

  • Jumper Wires(Hookup Wires)

  • USB Cable for Uploading Program


Arduino Vibration Sensor Circuit Diagram


The schematic for interfacing Vibration sensor with Arduino uno is given below.

Arduino Vibration Sensor Circuit Diagram


The LED is connected in the D13 pin. The module is powered using the available 5V pin in the Arduino. The Ground and the 5V pin are used to power up the Arduino whereas the A5 pin is used to get the data from the vibration sensor.


The circuit is constructed where the SW-420 module and LED are connected with Arduino Uno.


Arduino SW-420 Vibration Sensor Interfacing Circuit Diagram



Arduino Uno Vibration Sensor Programming


Programming the Arduino UNO to interface vibration sensor doesn’t require much effort as only the input pin should be monitored to make conclusion. The complete code and working video are attached at the end.


Initially the Header Files are included. The arduino header is included since this tutorial was written in Eclipse IDE with Arduino extension. This sketch will also work for Arduino IDE and while using this sketch in Arduino IDE, there is no need to include



#include

Here two macros are defined for ON and OFF.



#define ON 1
#define OFF 0

The below statement is used for integrating the LEDs and the Vibration Sensor. The vibration sensor is connected to pin A5. The inbuilt LED is also used which is directly connected in the board to pin 13. The 5mm LED is also connected to the pin 13.



/*
* Pin Description
*/
int vibration_Sensor = A5;
int LED = 13;

Two integers are declared where the sensors present output and previous output will be stored, which will further used to detect whether the vibration is happening or not.



/*
* Programme flow Description
*/
int present_condition = 0;
int previous_condition = 0;

The same pin which is declared as the peripheral connection, the direction of the pins are configured. The sensor pin as input and the LED pin as an output.



/*
* Pin mode setup
*/
void setup() {
pinMode(vibration_Sensor, INPUT);
pinMode(LED, OUTPUT);
}

One function is written to blink the led twice. The delay can be configured by chaging the delay value.



void led_blink(void) {
digitalWrite(LED, ON);
delay(250);
digitalWrite(LED, OFF);
delay(250);
digitalWrite(LED, ON);
delay(250);
digitalWrite(LED, OFF);
delay(250);
}

In the loop function, present and previous condition is compared. If these two are not same, the leds start to blink until the both are same. In starting, the two variables hold 0 and the led remains off during the start of program. When there is some virbraion, present_condition variable becomes 1 and led start to blink. And again when vibrations stops both the vaiables becomes 0 and LED stops blinking.



void loop() {
previous_condition = present_condition;
present_condition = digitalRead(A5); // Reading digital data from the A5 Pin of the Arduino.
if (previous_condition != present_condition) {
led_blink();

} else {
digitalWrite(LED, OFF);
}
}

This finishes the programming the arduino UNO with Vibration sensor. The final step will be testing the whole setup.



Testing the Arduino Vibration Sensor Circuit


The circuit doesn’t require additional breadboard. It can be simply tested using the Arduino UNO Board. The LED is monitored when the vibration sensor is hit or if it changes its state. The led will blink connected to Pin 13 of Arduino UNO when there is some vibrations. If the vibration sensor doesn’t work, then please check the connection and power. Avoid any loose connection between sensor and microcontroller.


Interfacing Vibration Sensor Module with Arduino


So this is how a Vibration sensor can be interfaced with Arduino UNO. If you have any doubt or suggestion, then you can reach us through forum or you can also comment below.





Code


/*//==============================================================================//

 * Vibration Sensor interfacing with Arduino

 * Date: - 15-04-2019

 * Author:- Sourav Gupta

 * For:- circuitdigest.com

 */ //=============================================================================//

#include

#include


#define ON 1

#define OFF 0


/*

 * Pin Description

 */

int vibration_Sensor = A5;

int LED = 13;


/*

 * Programme flow Description

 */

int present_condition = 0;

int previous_condition = 0;


/*

 * Pin mode setup

 */

void setup() {

pinMode(vibration_Sensor, INPUT);

pinMode(LED, OUTPUT);

}


/*

 * Led blink

 */

void led_blink(void);


/*

 * main_loop

 */


void loop() {

previous_condition = present_condition;

present_condition = digitalRead(A5); // Reading digital data from the A5 Pin of the Arduino.


if (previous_condition != present_condition) {

led_blink();


} else {

digitalWrite(LED, OFF);

}

}


void led_blink(void) {

digitalWrite(LED, ON);

delay(250);

digitalWrite(LED, OFF);

delay(250);

digitalWrite(LED, ON);

delay(250);

digitalWrite(LED, OFF);

delay(250);

}





Video


المواصفات التقنية

لسه مفيش مواصفات مسجلة

بنسجل المواصفات التقنية للمنتج ده وهتظهر هنا أول ما تخلص.

التقييمات

0.0 ☆☆☆☆☆ لسه مفيش تقييمات
5★ 0
4★ 0
3★ 0
2★ 0
1★ 0
لسه مفيش تقييمات للمنتج ده

كن أول واحد يقيّمه وتساعد اللي بعدك يقرر.

الأسئلة الشائعة

لسه مفيش أسئلة على المنتج ده

أول ما توصلنا أسئلة متكررة على المنتج ده هنجاوب عليها هنا.

منتجات مرتبطة

قد يعجبك أيضاً

متوفر

سنسورات تقارب وحركة (الترا سونيك / IR / PIR)

سنسور إنكودر ضوئي بالأشعة تحت الحمراء 4 طرف

★★★★★ (0)
45 ج.م
متوفر

قطع إلكترونية

موديول سنسور حركة PIR صغير HC-SR505

★★★★★ (0)
65 ج.م
متوفر

سنسورات تقارب وحركة (الترا سونيك / IR / PIR)

موديول سنسور ألتراسونيك لقياس المسافات ضد المياه

★★★★★ (0)
395 ج.م
متاح للطلب

قطع إلكترونية

مستقبل أشعة تحت الحمراء عام

★★★★★ (0)
6 ج.م
متوفر

قطع إلكترونية

مستقبل أشعة تحت الحمراء عام موديل: TL 1838

★★★★★ (0)
8 ج.م
-11% متوفر

سنسورات تقارب وحركة (الترا سونيك / IR / PIR)

موديول سنسور اهتزاز 801S

★★★★★ (0)
170 ج.م 190
متوفر

سنسورات تقارب وحركة (الترا سونيك / IR / PIR)

موديول سنسور لمس ديجيتال TTP223B

★★★★★ (0)
20 ج.م
متاح للطلب

قطع إلكترونية

حامل سنسور ألتراسونيك شفاف

★★★★★ (0)
12 ج.م
50 ج.م 65
متوفر - يوصلك خلال 72 ساعة
شوف السلة
تحب تحفظه في أنهي قائمة؟

لسه مفيش عندك أي قائمة. اعمل واحدة وهنحفظ المنتج فيها على طول.

اختار ألوانك

مفيش لون بالاسم ده

مسح الفلاتر اطلب المنتج ونوفره لك

مش لاقي اللي بتدور عليه؟ اطلبه وهنرد عليك بسعره ومدة توفيره.

— ج.م

الكمية 0 · الألوان 0