FREE SHIPPING OVER $89; 10% OFF FOR YOUR FIRST ORDER (CODE:NEW10); $20 OFF OVER $179 (CODE:BL20); $30 OFF OVER $259(CODE:BL30)



EASY PLUG Super Starter Kit For Arduino Project 13: Tilt Switch

Posted by Fiona Su on

Overview
This lesson we are going to test the tilt sensor. Simply connect to EASY Plug control board to make amazing interactive projects.
Component Required:
  • EASY plug control board*1
  • EASY plug Tilt Sensor Module *1
  • EASY plug LED Module *2
  • RJ11 cable*1
  • USB cable*1

Component Introduction:


Keyestudio EASY plug Tilt Sensor Module
The tilt-switch twig is the equivalent of a button, and is used as a digital input. Inside the tilt switch is a ball that make contact with the pins when the case is upright. Tilt the case over and the balls don't touch, thus not making a connection. When the switch is level it is open, and when tilted, the switch closes.
It can be used for orientation detection, alarm device or others.
Here is the principle of tilt sensor to illustrate how it works:

thumb

  • Interface: Easy plug
  • Supply Voltage: 3.3V to 5V
  • Sensor type: Digital

Connect It Up
Connect the EASY Plug Tilt sensor and LED module to control board using RJ11 cables.

thumb

Upload the Code
Below is an example code.

thumb

What You Should See
Done uploading the code, if tilt the sensor, you should see the led state ON or OFF.

thumb

thumb

thumb

Extension Experiment
Controlling Two Lights
Next, how to use tilt sensor to control two lights on and off. Let’s get started right now!
Hookup Guide
Connect the EASY Plug tilt sensor and two LED modules to control board using an RJ11 cable.

thumb

Upload the Code
Below is an example code.

thumb

What You Should See

thumb

Upload success, if tilt the sensor to one side, you should see one led is turned on; if tilt toward another side, another led is turn on.

thumb

thumb

All Tutorial

 Buy here>>EASY PLUG Super Starter Kit For Arduino STEM EDU

0 comments

Leave a comment

Please note, comments must be approved before they are published