ESP8266IOT Projects

Wireless vibration sensor, iot vibration sensor, Industrial vibration sensor “nodemcu esp8266”

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

  1. Complete Circuit Diagram Explanation
  2. Interfacing
  3. Programming and finally
  4. Testing

Amazon Links:

SW-420 Vibration Sensor

Nodemcu ESP8266 WiFi Module:

LM7805 Voltage Regulator:

470uf capacitor:

330-ohm resistor:

DC Female Power Jack:

Female Headers:

Male Headers:

Other Tools and Components:

Top Arduino Sensors:

Super Starter kit for Beginners

Digital Oscilloscopes

Variable Supply

Digital Multimeter

Soldering iron kits

PCB small portable drill machines


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:

wireless 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. I have also used the same Vibration sensor with the Arduino and I explained the most basic things.

This Vibration sensor can be used in places where you need to monitor the vibration.

Wireless Vibration Sensor Circuit Diagram:

wireless vibration sensor

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 the Nodemcu ground while the VCC of the vibration sensor is connected with the 3.3v pin of the Nodemcu esp8266 wifi module.

wireless vibration sensor

This is the final circuit, The pcb designing and online order placement is already explained in the video.

Download PCB Gerber Files:

wireless vibration sensor Interfacing:

wireless vibration sensor

  1. Insert the vibration sensor into the Vero board.
  2. now connect Vcc pin of the vibration sensor with 3.3v pin of the Nodemcu esp8266 wifi module…
  3. connect the ground pin of the vibration sensor with the ground pin of the Nodemcu module….
  4. connect D0 pin of the vibration sensor with the D0 pin of the Nodemcu module…

Note: this old version of the Blynk app is no more functional. For the blynk mobile App setup and dashboard setup ready my article on the New Blynk V2.0. In this article I have explained how to migrate your projects from Blynk 1.0 to the new Blynk V2.0. You can also watch the video.

wireless vibration sensor Blynk Application:

  1. First of all, open the blynk application…..
  2. set the project name as vibration monitoring…..
  3. Click on the choose device and select nodemcu….
  4. make sure you set the connection type to wifi….
  5. 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 …
  6. 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….
  7. now again click on the screen and this time add the gauge widget and follow the steps as explained in the video….
  8. 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

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.

#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
  pinMode(vs ,INPUT); 
  Blynk.begin(auth, ssid, pass);

  // Setup a function to be called every second
  timer.setInterval(10L,sensorvalue); // 1000L

void loop()
{;; // Initiates BlynkTimer


void sensorvalue()
  long measurement =vibration();
  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;

Watch Video Tutorial:

Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...


  1. 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.

  2. 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.

  3. hello there i hope you’re doing well

    i want to ask you about this project im not following exactly because im using serial usb not wifi but nontheless i was be able tocpnnect to the device. im using arduino nano and an SW420. for some reason when i run the program there are no data shown on my phone, do you know any possible reason why this happen?

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button