Tilt Orientation and Shock Sensor SW420 Blue

AED 1.05



Tilt sensors can detect orientation and inclination. They are compact, affordable, low-power, and simple to use. Because of their simplicity, they are popular for toys, gadgets, and appliances. They are also known as" "tilt switches," or "rolling ball sensors" for obvious reasons.

Package Includes:

  • 1 x Tilt Orientation and Shock Sensor SW-SW420


  • It has a supply voltage range from 3.3V to 5V.
  • The sensor draws a minimum current of 25mA.
  • The sensor is easy to interface with microcontrollers.
  • Cheap and reliable
  • It has a great durability rate.


Tilt sensors can detect orientation and inclination. They are compact, affordable, low-power, and simple to use. Because of their simplicity, Single-roller type full induction trigger switch. When no vibration or tilt, the product is ON conduction state, and in the steady state, when vibration or tilt, the switch will be rendered instantly disconnect the conductive resistance increases, generating a current pulse signal, thereby triggering the circuit. This product is a completely sealed package, waterproof, and dustproof. they are popular for toys, gadgets, and appliances. They are also known as" "tilt switches," or "rolling ball sensors" for obvious reasons.

Principle of Work:

The Tilt sensor, model SW-420, is a sensitive switch with two balls inside. It can be used both for the tilt function (horizontal position) and for the vibration function (vertical position).

The sensor operates as an on/off switch according to its position in relation to the horizontal design plane. To use it with the inclination function, just incline it more than 15º in relation to the horizontal condition. In case its inclination is towards the side of the conductor terminal (A), the circuit becomes open, that is, turned off. And in case it is facing the component level condition, it changes 15º from the opposite side, towards the terminal (C), it becomes closed, in the on condition.

Pinout of the Module:

you can work with the tilt sensor as a switch so you can connect its legs interchangeably 


  •  theft alarm
  • intelligent car
  • earthquake alarm
  • motorcycle alarm


Assemble the Tilt Sensor using the Arduino UNO by connecting an LED to pin 12 with a 220ohm resistor and connecting the sensor to pin 4. Now, copy and paste the code into your Arduino IDE. The code is then uploaded to Arduino. To see the glowing LED, tilt and move the sensor.


 No Library is needed for this module to function


The input sensor pin and output LED pin that are connected to the Arduino pins has been defined. Then, by declaring the variable LastTiltState, we have shown that the sensor's previous stage was high. Next, we must specify the variables debounceDelay and lastdebounce time.
We have specified the sensor pin as the Arduino's input in the void setup. Led is also an output. Additionally, we initialized the serial monitor there.
We have defined the function digitalRead() in the void loop to examine the sensor reading. The sensor will reset the debouncing time if it detects a value identical to the previous lastTiltState stated above, as long as the requirement is met.

additionally returns the milliseconds value. The condition has been created since then. The lastTiltState becomes the sensorValue if the condition is verified. The lastTiltState is also taken by the LED pin. To display the sensor value on the serial monitor, use the Serial. println command.

int ledPin = 12;
int sensorPin = 4;
int sensorValue;
int lastTiltState = HIGH; // the previous reading from the tilt sensor
// the following variables are long's because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long lastDebounceTime = 0; // the last time the output pin was toggled
long debounceDelay = 50; // the debounce time; increase if the output flickers
void setup(){
 pinMode(sensorPin, INPUT);
 digitalWrite(sensorPin, HIGH);
 pinMode(ledPin, OUTPUT);
void loop(){
 sensorValue = digitalRead(sensorPin);
 // If the switch changed, due to noise or pressing:
 if (sensorValue == lastTiltState) {
 // reset the debouncing timer
 lastDebounceTime = millis();
 if ((millis() - lastDebounceTime) > debounceDelay) {
 // whatever the reading is at, it's been there for longer
 // than the debounce delay, so take it as the actual current state:
 lastTiltState = sensorValue;
 digitalWrite(ledPin, lastTiltState);

Technical Details:

  • Voltage: <12V
  • Current: <20mA
  • Conductive time: About 1s
  • Closed resistance: 0-200 ohm
  • Open resistance: >10M ohm
  • Temperature range: -40 to 80℃
  • Pull force of terminal: 500gf for 1 minute
  • Humidity: 95% RH, 40℃ for 96 hours
  • Operating lifespan: above 1000000 circle



Switch-Based Tilt Sensors: These switch sensors determine if the system is slanted or not, as the name implies. Switch-based sensors are the most basic forms, having only two output states. The sensors can be divided into two more categories:
Switches with a metallic ball inside a cage are known as "ball in a cage structure switches" and they use a metal ball in place of mercury. The ball's design is extremely important since it must be resistant to stress and vibration. As a result, a solid, thick structure rather than a hollow one is employed.
Mercury Tilt Switch: When tilted, a mercury bead links the switch's terminals. These tilt switches are among the earliest varieties, and their response time is slow. Depending on how many contacts are utilized, mercury tilt switches come in SPST and SPDT varieties.
 Mercury, being a liquid metal can flow down and establish contact between the switch's leads. The blob of mercury is able to provide resistance to vibrations as mercury is a dense liquid metal. Using mercury is discouraged as it is a toxic metal and poses a potential hazard to the user when the glass casing breaks and metal spillage take place.