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.

The hourglass is built by 30 leds, and the behaviour is showed here:
In this version, we paid attention at the orientation of the accelerometer: we worked on the x-axys of this device.
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:
This is the plastic box chosen for this project, clean and with the leds:

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!
| Attachment | Size |
|---|---|
| EAGLE archive, contains schematic and PCB layout | 298 KB |
| Program files for PIC, archive contains C and HEX files | 4.81 KB |
| 3GP video of the working hourglass | 254.85 KB |
Recent comments
1 year 20 weeks ago
1 year 35 weeks ago
1 year 48 weeks ago
1 year 48 weeks ago
1 year 51 weeks ago
1 year 51 weeks ago
2 years 18 weeks ago
2 years 26 weeks ago
2 years 28 weeks ago
2 years 28 weeks ago