Basic Tilt Sensor Tutorial

Project Info
Author: Chris
Difficulty: Easy
Time Invested: 2 Hours

Take a look at the above
articles before continuing
to read this article.
           After writing so, many, FPGA articles, I thought it would be fun to get back to the basics of micro- controllers and sensors. One of the easiest to use and dumbest sensors found is called the tilt sensor. The one used in this tutorial isn't special in anyway, it's a basic tilt sensor that acts like an on/off switch.
           In this article we will build an example system and use the basic tilt sensor as an input into a microcontroller. The microcontroller will read the data input from the tilt sensor and act accordingly to output the current state of the tilt sensor. Everything will be done on a breadboard to show how easy it is to assemble and use the system.

Basic Tilt Sensor Tutorial - Demonstration

Basic Tilt Sensor Tutorial - Setup

Purpose & Overview of this project
           The goal of this project is to create a system that senses when the tilt sensor is tilted and halts the currently running firmware program. This will be done by making the tilt sensor act like a standard push button switch. One side will be connected to +5v and the other side to ground. These two states will be detected by the firmware in the microcontroller and then the proper output will occur.
           To build this system we will use a PIC 18F452 microcontroller to take input from the basic tilt sensor and give output to 8 LEDs on an LED Bar. The firmware should run a simple knight-rider program on the LEDs and when a tilt is detected the program should halt until the system is no longer being tilted, then the program should resume as if nothing had occured.