SW 420- A Vibration Sensor Module Guide

Vibration detection is critical in many security applications, such as theft alarms. Also, it is important to identify natural phenomena such as earthquakes.  Hence, the SW 420 module for vibration/tilt sensor is an important electronic device for simple and sophisticated projects. Take a look at this simple tutorial on the vibration module. 

What is an SW 420?

Fig 1: A Normally closed vibration sensor module for Arduino and alarm systems. 

It is a digital vibration sensor module featuring an SW-420 Vibration Sensor and an LM393 Comparator IC. The cost-effective vibration sensor module also has a 10K potentiometer, essential in modifying the sensitivity.

Furthermore, the LM393 voltage comparator is useful in enabling a relatively smooth digital output. The comparator will detect an input vibration signal via a preset. Next, it gives an output indication of a high logic. However, the Builtin comparator circuit stays in its logic low state in the absence of vibration.  

Lastly, the module is simple to use, making it ideal for simple DIY projects in addition to sophisticated detection projects. 

SW 420 Pin Configuration

Pin NamePin Application
VccIt’s the module’s power supply pin that powers it with a 5V voltage. 
GNDThe module’s ground pin
DOIt is the module’s digital output pin useful 

SW 420 Features and Specs

Fig 2: The vibration sensor module is small in size

  1. First, It’s a readily available, cheap, and small-sized module. 
  2. Then, You require an operating voltage of between 3.3V and 5V DC to run it. 
  3. Thirdly, it needs a 15mA operating current and has LEDs for showing power and current.
  4. Also, it comes with bolt holes to facilitate easy installation. 
  5. Finally, you can easily interface it with microcontrollers or a typical Digital/Analog IC.

Also, while shopping for an SW 420 module, you might come across the Grove – Vibration Sensor model. In addition to the above-highlighted features and specs, it will further have the following properties: 

  1. The non-directional module has high sensitivity and thus can detect vibrations at a low level of detection. 
  2. Also, it is waterproof and has an efficient response to a tilt or vibration.
  3. The digital interface module additionally has a compression resistance feature.
  4. Finally, the 140mm by 85mm by10mm module weighs 10g (gross weight). 

SW 420 Working Principle

Fig 3: An illustration of a vibration pulse wave

The module operates as a switch that opens and closes an electrical contact. Also noteworthy, in its default state, it will remain closed. Therefore, the vibration switch is in a conduction state without vibration. 

However, when it detects a vibration, it opens the contacts, and consequently, there’s a rise in electrical resistance. It prompts the generation of a pulse which will, in turn, trigger the circuit. The pulse then passes to the LM393 comparator IC for digitization. Finally, the module outputs the pulse as a digital signal. 

SW 420 Vibration Sensor Interfacing with Arduino

Fig 4: You can interface the module with an Arduino UNO microcontroller

For this exercise, the aim is to create a circuit whereby the detection of vibrations switches on an LED. The connection procedure is, therefore, as follows. 

First, connect either a 3.3V or 5V power supply to the module’s Vcc pin. Next, connect the Arduino Uno’s GND pin with the module’s ground pin. Lastly, connect the module’s digital pin to any Arduino Uno’s digital pins. 

The table below will be handy in making the above connections. 

Vibration Sensor ModuleArduino Uno
Vcc Pin5V power supply
GND Pin Ground pin (often black)
Digital Output (DO) Pin A5 (It’ll be green in color)

Next, connect the Arduino Uno to the LED as follows: 

Arduino UnoLED
Ground Pin (GND)Cathode

Arduino Code

Use the Arduino Code we have provided below to control the module. 

Arduino Code

Fig 5: Arduino Code

How does the code work?

Note that you can effortlessly interface the SW 420 with Arduino UNO or, in other cases, the Eclipse IDE software. In the case of the code we’ve provided above, it is on Eclipse IDE software but features an Arduino extension. 

Therefore, the inclusion of the ‘Arduino. h’ header file, in this case, is inevitable for the code to work. But, if you can write this code on Arduino IDE, you don’t require an ‘Arduino. h’ header file. 

Applications of the SW 420 module

Fig 6: You can use the module in a burglar alarm system 

The module finds use in the following applications: 

  1. Alarm systems such as earthquake and motorcycle, and theft alarms 
  2. Smart car applications 
  3. Vibration detections
  4. Triggering shock and game control 
  5. Identifying objects. 


The SW 420 module is a critical component in vibration detection systems that is simple to use and interface with microcontrollers. For now, that’s all on this module, but you can still reach out to us for further elaboration. 

Avatar photo
Emma Lu
Our professional engineering support saves our customers a lot of trouble and loss. >>>>>> After you place the order, our engineer will conduct technical reviews to make sure the parts can be mounted well/correctly on the boards. We will check if the component packages match well with the Gerber footprints, if the part numbers you provided match well with the descriptions, and if the polarity is clearly marked. >>>>> When your design is ready, please send your Gerber and BOM so we can quote and start!