wireless vibration sensor Project Description:
In this tutorial, you will learn how to monitor the Vibration wirelessly using Nodemcu esp8266 wifi module, Vibration sensor SW- 420, and Blynk application. As the wireless vibration sensor is an IOT based project the vibration sensor can be monitored from anywhere around the world. You can monitor the vibration values in real-time, whenever the vibration exceeds a pre-defined value a notification message is sent even if the application is running in the background. This tutorial covers
- Complete Circuit Diagram Explanation
- Interfacing
- Programming and finally
- Testing
The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:
Vibration Sensor SW-420:
Nodemcu esp8266 wifi module: Best price
330-ohm resistors pack:
lm7805 Voltage Regulator:
female DC power jack socket:
470uf capacitors:
DISCLAIMER:
Please Note: these are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!
SW-420 Vibration Sensor:
This is the SW-420 vibration sensor. As you can see it has three male headers which are clearly labeled with D0, ground, and VCC.
This Vibration sensor can be used in places where you need to monitor the vibration.
Wireless Vibration Sensor Circuit Diagram:
This is the complete circuit diagram of the Nodemcu esp8266 power supply. This Power Supply is based on the famous LM7805 voltage regulator. J1 is the female power jack and this is where we connect a 12v adaptor, battery or a solar panel. Two 470uf capacitors are connected at the input and output sides of the voltage regulator. A 330-ohm resistor is connected in series with a 2.5v led. This is a current limiting resistor. The output of the voltage regulator is connected with the Vin pin of the Nodemcu esp8266 wifi module and the ground is connected with the ground. SV1 and SV2 are the female headers… D0 pin of the Vibration sensor is connected with D0 pin of the Nodemcu module, the ground pin of the vibration sensor is connected with Nodemcu ground while the VCC of the vibration sensor is connected with the 3.3v pin of the Nodemcu esp8266 wifi module.
This is the final circuit, The pcb designing and online order placement is already explained in the video below.
Download PCB Gerber Files:
wireless vibration sensor Interfacing:
- Insert the vibration sensor into the Vero board.
- now connect Vcc pin of the vibration sensor with 3.3v pin of the Nodemcu esp8266 wifi module…
- connect the ground pin of the vibration sensor with the ground pin of the Nodemcu module….
- connect D0 pin of the vibration sensor with the D0 pin of the Nodemcu module…
wireless vibration sensor Blynk Application:
- First of all, open the blynk application…..
- set the project name as vibration monitoring…..
- Click on the choose device and select nodemcu….
- make sure you set the connection type to wifi….
- then click on the create button an authentication token will be send on your email id, which will be then used in the programming, simply copy and paste it in programming …
- Click anywhere on the screen and search for the terminal and add it and then follow the same exact steps as explained in the video given at the end of this Article….
- now again click on the screen and this time add the gauge widget and follow the steps as explained in the video….
- Now again click on the screen and search for the notification and add it… and follow the steps as explained in the video.
wireless vibration sensor Nodemcu ESP8266 Programming:
Before you start the Nodemcu programming first of all make sure that you download all the necessary libraries and you install the Nodemcu board, for the getting started tutorials check my playlists available on my YouTube channel electronic clinic. These are the same libraries I have been using in all of my iot based projects and maximum instructions are already explained in my previous projects. For the step by step program explanation watch video given at the end of this program.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
#define BLYNK_PRINT Serial #include <ESP8266WiFi.h> #include <BlynkSimpleEsp8266.h> #include <SimpleTimer.h> // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "be87fc5249a94f38a39941b3e01c4cd6"; // Your WiFi credentials. // Set password to "" for open networks. char ssid[] = "ZONG MBB-E8231-6E63"; char pass[] = "electroniclinic"; SimpleTimer timer; // sensors int vs = D0; // vibration sensor int sdata = 0; // sensor data will be stored in this variable. String vdata = ""; // This function sends Arduino's up time every second to Virtual Pin (1). // In the app, Widget's reading frequency should be set to PUSH. This means // that you define how often to send data to Blynk App. void myTimerEvent() { // You can send any value at any time. // Please don't send more that 10 values per second. Blynk.virtualWrite(V1, millis() / 1000); } void setup() { // Debug console Serial.begin(9600); pinMode(vs ,INPUT); Blynk.begin(auth, ssid, pass); // Setup a function to be called every second timer.setInterval(10L,sensorvalue); // 1000L } void loop() { Blynk.run(); timer.run(); // Initiates BlynkTimer } void sensorvalue() { long measurement =vibration(); //delay(50); Serial.println(measurement); Blynk.virtualWrite(V3, measurement); if( measurement > 1000 ) { Blynk.notify("Vibration detected!!"); } vdata = vdata + "Vibration: " + measurement; // You can send any value at any time. // Please don't send more that 10 values per second. Blynk.virtualWrite(V2, vdata); vdata = ""; } long vibration(){ long measurement=pulseIn (vs, HIGH); //wait for the pin to get HIGH and returns measurement return measurement; } |
Well done Engr Fahad, you are delivering the effective and interesting content to read about wireless sensors. We also have the large listing of industrial wireless sensors. You can get the best experience with our WS1 and WS1 Pro wireless sensors.
I have worked with ubidots its an amazing iot platform. You can check out videos on my YouTube channel.
If you can send me these sensors, I can use them in some amazing projects.
hi, i have try your coding and there is some error on arduino software. The error show exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module). How can i fix the error. Thank you in advance.