Electronic hourglass: first version

Here we presents another application with the LIS2L02 accelerometer and a PIC16F877: an electron hourglass that changes its flow by turning the circuit upside down! The hourglass body is made up by 30 red leds, and the sand flow is represented by lighting leds. An accelerometer detect the direction of the gravity acceleration and set the direction the sand flow must be have. We also provide Eagle files and the C program.

electron hourglass with PIC microcontroller


The hourglass is built by 30 leds, and the behaviour is showed here:

Free Image Hosting at www.ImageShack.us

In this version, we paid attention at the orientation of the accelerometer: we worked on the x-axys of this device.

direction of the accelerations detectable by LIS2L02 accelerometer

The basic behaviour is this: when the circuit is turned off the "sand" is on the bottom of the hourglass. After a turning of the circuit, detected by reading the output of the accelerometer one time per second, the PIC sets this outputs to let the sand falling with the sequence described.

The connections required of the accelerometer LIS2L02 are explained in the datasheet, and the filter on its output is set for a cut-off frequency of about 1Hz.

In the "Attachments" box you can download the EAGLE files for making the PCB of the circuit. You can find the library of the component LIS2L02, the schematic and the board.

With the EAGLE files you can do a work alike this:

electron hourglass with PIC microcontroller

This is the plastic box chosen for this project, clean and with the leds:

plastic box for the electron hourglasselectron hourglass leds

Free Image Hosting at www.ImageShack.us This is the circuit during the assembly. The cover carry out the 30 leds; the box contains the PIC16F877A, the resistors, the crystal and the voltage regulator. In the bottom there's a space for the battery.

Also you can download here the PIC program. This program is written in C language with the CCS C compiler.

NOTE: THE OUTPUT RA4 IS NOT USED BECAUSE IT IS 'OPEN DRAIN'

Now you can download here the VIDEO!


AttachmentSize
EAGLE archive, contains schematic and PCB layout298 KB
Program files for PIC, archive contains C and HEX files4.81 KB
3GP video of the working hourglass254.85 KB