ROSANNAPAPINI.IT ≡ Accessories Circuitoimpreso Kits Educativos Amplifier
  • Motion

  • KY-020 TILT SWITCH MODULE

KY-020 TILT SWITCH MODULE

$16.2 $31.43
The KY-020 Tilt Switch Sen­sor mod­ule is a switch that reacts to move­ment. It clos­es the cir­cuit when it’s tilt­ed to the side as long as it is moved with enough force and degree of incli­na­tion to acti­vate the ball switch inside.Com­pat­i­ble with Arduino, Rasp­ber­ry Pi, ESP32 and oth­er micro­con­trollers.KY-020 SPECIFICATIONSThis mod­ule con­sists of a 10kΩ resis­tor, a metal­lic ball switch with bidi­rec­tion­al con­duc­tion that will open/close the cir­cuit when tilt­ed, and 3 male head­er pins. This mod­ule does not mea­sure tilt angle.Oper­at­ing Volt­age3.3V ~ 5VOut­put TypeDig­i­talCONNECTION DIAGRAMCon­nect the module’s Pow­er line (mid­dle) and ground (-) to 5 and GND respec­tive­ly.Con­nect sig­nal (S) to pin 2 on the Arduino.KY-020ArduinoS2mid­dle 5V–GNDKY-020 ARDUINO CODEThe fol­low­ing sketch will turn on the LED on pin 13 of the Arduino when the mod­ule incli­na­tion degree changes. Tilt the mod­ule to turn the LED on/off.Arduino int tiltPin = 2; // pin number for tilt switch signal int ledPin = 13; // pin number of LED int tiltState = 0; // variable for reading the tilt switch status void setup() { pinMode(ledPin, OUTPUT); // set the LED pin as output pinMode(tiltPin, INPUT); // set the tilt switch pin as input } void loop(){ // get the tilt switch state tiltState = digitalRead(tiltPin); // check if tilt switch is tilted. if (tiltState == HIGH) { digitalWrite(ledPin, HIGH); } else { digitalWrite(ledPin, LOW); } }123456789101112131415161718192021int tilt­Pin = 2;      // pin num­ber for tilt switch sig­nal int led­Pin =  13;     // pin num­ber of LED int tilt­State = 0;    // vari­able for read­ing the tilt switch sta­tus void set­up() {    pin­Mode(led­Pin, OUTPUT);  // set the LED pin as out­put        pin­Mode(tilt­Pin, INPUT);  // set the tilt switch pin as input} void loop(){  // get the tilt switch state  tilt­State = dig­i­tal­Read(tilt­Pin);   // check if tilt switch is tilt­ed.  if (tilt­State == HIGH) {         dig­i­tal­Write(led­Pin, HIGH);    }   else {    dig­i­tal­Write(led­Pin, LOW);   }} DOWNLOADSFritz­ing Part: KY-020 Tilt Switch Mod­ule.Fritz­ing Offi­cial Site.
Motion

Motion

  • C1001 60GHz mmWave Indoor Fall Detection Sensor
    $62.03 $78.16
  • RCWL-0516 Microwave Radar Sensor Switch Module Body Induction Module 4–28V 100mA
    $22.5 $27.9
  • Crowtail- Microwave Sensor 2.0
    $76.5 $113.22
  • Hi-Link HLK-LD2410B, 24GHz Human Presence Radar Sensor
    $40.5 $61.16
  • Tilt Sensor Vibration Module
    $21.6 $32.83
  • Leap Motion Controller
    $58.4 $81.18
  • Vibration Sensor Module — SW-18010P
    $17.1 $20.69
  • PAJ7620 Sensor for Hand Gesture Recognition
    $40.5 $49.41
  • KY-020 TILT SWITCH MODULE
    $16.2 $31.43

© 2026 - ROSANNAPAPINI.IT