Cube Project

Update 8-10-2015

Received a photo of the production line. Very nice panels šŸ™‚


For a client Verelec designed an embedded project where based on changes of gravitation electric devices can be switched on or off.

Proof of concept

The concept for these kind of projects is relatively straight forward. The device makes use of a gravitational device to determine along which axis (X,Y,Z) the device is oriented. Based on the outcome a signal (over 433Mhz) is transmitted to a remote device that will respond to an On or Off command.


The device would make use of an ATTiny processor, an acceleration chip, 3xAAA batteries, a ready made 433Mhz SAW transmitter. These requirements led to several challenges

  1. The device needed to be asleep when in rest
  2. Battery power should be consumable as long as possible
  3. Change needed to be detected on time to enable to determine a change of direction has taken place.

The first approach was to use simple mechanical devices to determine the X, Y, Z (positive and negative values) orientation. Experiments with these devices failed. Too many disturbances and they are quite expensive. A switch was made to the ADXL345 which is a 6 DOF chip operating at 3.3V. This chip works great.

As we are using 3 x AAA batteries, the initial voltage would be around 4.5Volts. For theĀ  ATTiny this is adequate. However the ADXL345 can handle only 3.3V to around 2.5V. By using a MicroChip low voltage regulator, the voltage would always be 3.3V or lower. Measuring the device proved that regulations stops when the voltage is lower than 3.3V. It just passes the voltage through which is fine.

The transmitter needs 5V to send out enough power. As the battery voltage is always below 5V, a small SMPS circuit was used. The chip has an enable pin so it can be switched on/off by the CPU.

The Attiny and ADXL345 and SMPS needed to be asleep (using microAmps of power) and only wake up when there was a change. The ADXL345 is the first to detect change. I tried using a very sensitive touch sensor to achieve this first. If a human hand came close enough, it would wake up. This option failed however and proved very unreliable. The ADXL345 however can be put to sleep and generate an interrupt when waking up (by an orientation change).

So now the process is:

Device sleeps->change generates interrupt->CPU wakes->CPU Reads ADXL345->CPU turns SMPS on->Transmit->everybody go to sleep again

Current consumption is 140uA in sleep mode and about 10mA during transmission (250 milliseconds).

The ADXL345 libary was modified so I could use Soft I2C as the ATTiny series does not support hardware I2C. The board uses an ISP for programming and when in debug mode, I can use some of the pins from the ISP for serial communication.

below is the working prototype with a funny looking antenna (due to some experimentation for best performance). The antenna is performing best as a solid core wire folded into a kind of square (like the PCB).




EĆ©n reactie op Cube Project

  1. meykerque schreef:

    Hi my friends
    Very interresting project
    could you send your adxl lib and the attiny program please ?


Geef een reactie