Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use SW420: Examples, Pinouts, and Specs

Image of SW420
Cirkit Designer LogoDesign with SW420 in Cirkit Designer

Introduction

The SW420 is a tilt switch sensor module designed to detect changes in orientation or position. It activates when tilted beyond a certain angle, making it ideal for applications requiring motion or tilt detection. This component is widely used in alarm systems, robotics, and devices that need to monitor angular movement or orientation.

Manufactured by ARDUINO, the SW420 (Part ID: UNO) is a reliable and cost-effective solution for detecting tilt or vibration in electronic systems.

Explore Projects Built with SW420

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
STM32F103C8T6 and ESP8266-Based Real-Time Crop Health Monitoring System with Wi-Fi Connectivity
Image of crop: A project utilizing SW420 in a practical application
This circuit is a real-time crop health monitoring system that uses an STM32F103C8T6 microcontroller to read data from an NPK soil sensor, a soil moisture sensor, and a humidity and temperature sensor. The collected data is then transmitted wirelessly via an ESP8266 module to a dashboard or mobile app for farmers to monitor crop health.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based GPS Tracker with SD Card Logging and Barometric Sensor
Image of gps projekt circuit: A project utilizing SW420 in a practical application
This circuit features an ESP32 Wroom Dev Kit as the main microcontroller, interfaced with an MPL3115A2 sensor for pressure and temperature readings, and a Neo 6M GPS module for location tracking. The ESP32 is also connected to an SD card reader for data logging purposes. A voltage regulator is used to step down the USB power supply to 3.3V, which powers the ESP32, the sensor, and the SD card reader.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Raspberry Pi Pico GPS Tracker with Sensor Integration
Image of Copy of CanSet v1: A project utilizing SW420 in a practical application
This circuit is a data acquisition and communication system powered by a LiPoly battery and managed by a Raspberry Pi Pico. It includes sensors (BMP280, MPU9250) for environmental data, a GPS module for location tracking, an SD card for data storage, and a WLR089-CanSAT for wireless communication. The TP4056 module handles battery charging, and a toggle switch controls power distribution.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Smart Environmental Monitoring System with Battery Power
Image of BeeHive: A project utilizing SW420 in a practical application
This circuit is a multi-sensor monitoring system powered by an ESP32 microcontroller. It includes sensors for gas (MQ135), vibration (SW-420), weight (HX711 with a load cell), and temperature/humidity (DHT22), along with a buzzer for alerts. The system is powered by a 18650 Li-ion battery managed by a TP4056 charging module.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with SW420

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of crop: A project utilizing SW420 in a practical application
STM32F103C8T6 and ESP8266-Based Real-Time Crop Health Monitoring System with Wi-Fi Connectivity
This circuit is a real-time crop health monitoring system that uses an STM32F103C8T6 microcontroller to read data from an NPK soil sensor, a soil moisture sensor, and a humidity and temperature sensor. The collected data is then transmitted wirelessly via an ESP8266 module to a dashboard or mobile app for farmers to monitor crop health.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of gps projekt circuit: A project utilizing SW420 in a practical application
ESP32-Based GPS Tracker with SD Card Logging and Barometric Sensor
This circuit features an ESP32 Wroom Dev Kit as the main microcontroller, interfaced with an MPL3115A2 sensor for pressure and temperature readings, and a Neo 6M GPS module for location tracking. The ESP32 is also connected to an SD card reader for data logging purposes. A voltage regulator is used to step down the USB power supply to 3.3V, which powers the ESP32, the sensor, and the SD card reader.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Copy of CanSet v1: A project utilizing SW420 in a practical application
Battery-Powered Raspberry Pi Pico GPS Tracker with Sensor Integration
This circuit is a data acquisition and communication system powered by a LiPoly battery and managed by a Raspberry Pi Pico. It includes sensors (BMP280, MPU9250) for environmental data, a GPS module for location tracking, an SD card for data storage, and a WLR089-CanSAT for wireless communication. The TP4056 module handles battery charging, and a toggle switch controls power distribution.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of BeeHive: A project utilizing SW420 in a practical application
ESP32-Based Smart Environmental Monitoring System with Battery Power
This circuit is a multi-sensor monitoring system powered by an ESP32 microcontroller. It includes sensors for gas (MQ135), vibration (SW-420), weight (HX711 with a load cell), and temperature/humidity (DHT22), along with a buzzer for alerts. The system is powered by a 18650 Li-ion battery managed by a TP4056 charging module.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Anti-theft alarm systems
  • Robotics and automation
  • Motion detection in toys and gadgets
  • Orientation monitoring in industrial equipment
  • Earthquake detection systems

Technical Specifications

Key Technical Details

Parameter Value
Operating Voltage 3.3V to 5V
Output Type Digital (High/Low)
Sensitivity Adjustment Via onboard potentiometer
Dimensions 32mm x 14mm x 8mm
Operating Temperature -40°C to +85°C
Detection Angle Typically ±15°

Pin Configuration and Descriptions

Pin Name Pin Number Description
VCC 1 Power supply pin (3.3V to 5V)
GND 2 Ground pin
DO 3 Digital output pin (High when tilted, Low otherwise)

Usage Instructions

How to Use the SW420 in a Circuit

  1. Power the Module: Connect the VCC pin to a 3.3V or 5V power source and the GND pin to the ground of your circuit.
  2. Connect the Output: Attach the DO pin to a digital input pin of your microcontroller (e.g., Arduino UNO).
  3. Adjust Sensitivity: Use the onboard potentiometer to fine-tune the sensitivity of the tilt detection.
  4. Monitor Output: The DO pin outputs a HIGH signal when the module is tilted and a LOW signal when it is stable.

Important Considerations and Best Practices

  • Ensure the module is mounted securely to avoid false triggers due to vibrations.
  • Avoid exposing the module to extreme temperatures or moisture, as this may affect its performance.
  • Use pull-up or pull-down resistors if necessary to stabilize the digital output signal.
  • When connecting to an Arduino UNO, ensure the power supply voltage matches the module's requirements.

Example Code for Arduino UNO

Below is an example code snippet to interface the SW420 with an Arduino UNO:

// SW420 Tilt Switch Example Code
// This code reads the digital output of the SW420 and prints the status to the Serial Monitor.

const int tiltPin = 2; // Connect the DO pin of SW420 to digital pin 2
int tiltState = 0;     // Variable to store the tilt state

void setup() {
  pinMode(tiltPin, INPUT); // Set the tilt pin as input
  Serial.begin(9600);      // Initialize serial communication at 9600 baud
}

void loop() {
  tiltState = digitalRead(tiltPin); // Read the state of the tilt switch

  if (tiltState == HIGH) {
    // If the tilt switch is activated
    Serial.println("Tilt detected!");
  } else {
    // If the tilt switch is stable
    Serial.println("No tilt detected.");
  }

  delay(500); // Wait for 500ms before reading again
}

Notes:

  • Connect the DO pin of the SW420 to pin 2 of the Arduino UNO.
  • Open the Serial Monitor (set to 9600 baud) to view the tilt detection status.

Troubleshooting and FAQs

Common Issues and Solutions

Issue Possible Cause Solution
No output from the module Incorrect wiring or loose connections Verify all connections and ensure proper wiring.
False triggers or unstable output Sensitivity set too high Adjust the potentiometer to reduce sensitivity.
Module not responding Power supply issue Ensure the module is powered with 3.3V to 5V.
Output always HIGH or LOW Faulty module or improper grounding Check the module and ensure proper grounding.

FAQs

  1. Can the SW420 detect vibration as well as tilt?

    • Yes, the SW420 can detect both tilt and vibration, depending on its orientation and sensitivity settings.
  2. What is the maximum tilt angle it can detect?

    • The SW420 typically detects tilt angles of ±15° from its stable position.
  3. Can I use the SW420 with a 3.3V microcontroller?

    • Yes, the SW420 operates within a voltage range of 3.3V to 5V, making it compatible with 3.3V systems.
  4. How do I adjust the sensitivity?

    • Use the onboard potentiometer to increase or decrease the sensitivity. Turn it clockwise to increase sensitivity and counterclockwise to decrease it.

By following this documentation, you can effectively integrate the SW420 tilt switch into your projects and troubleshoot any issues that arise.