You Are Here: Home » AVR ATmega Projects » Wireless Accelerometer Controlled rgb-LED’s using atmega168 microcontroller

Wireless Accelerometer Controlled rgb-LED’s using atmega168 microcontroller




MEMS (Micro-Electro-Mechanical Systems) Accelerometers are in widespread use as tilt-sensors in mobile phones and cameras. Simple accelerometers are available both as ic-chip’s and cheap development pcb-boards.
Wireless chips are also affordable and available in assembled circuits, with matched antenna-network and decoupling-caps onboard.

Hook both wireless board and accelerometer up to a microcontroller via serial interface and you have a wireless controller with nintendo-wii functions.

Then build a receiver with the same type of wireless chip and pwm-controlled rgb-LEDs, voila, you have wireless, tilt-controlled coloured room lightning.

Keep the transmitter-board level with breadboard facing up and the LED is cool blue, only blue led is active. Then tilt the transmitter in one direction and you mix in red or green depending on which direction you tilt it. Tilt all the way to 90 degrees, and you go trough all mixes of red and blue or green and blue until only red or green is active at 90 degrees tilt. Tilt a little in both x and y direction and you get a mix of all the colours. At 45degrees in all directions the light is an equal mix of red, green and blue, in other words, white light.

The parts used are available from internet hobby-electronic stores. Should be identifiable from some of the pictures.

Step: 1 Transmitter with accelerometer

The transmitter is based on the Atmel avr168 microcontroller. The convenient red board with the 168 is an arduino-board with voltage regulator and reset-circuit. The accelerometer is connected to the avr with bit-banged i2c bus, and the wireless board is connected with hardware SPI, (Serial Peripheral Interface).
The breadboard is completely wireless with the 4,8V batterypack strapped underneath.

The wireless board and the arduino wee accepts up to 9 V and have onboard linear voltage regulator, but the accelerometer needs 3,3V from the regulated rail on the wee.

Step: 2 Receiver with RGB-LED

The Receiver is based on the atmel avr169 demoboard named butterfly. The board have a lot of features not used in this project. The wireless tranceiver is connected to PortB and the pwm-controlled led is connected to PortD. Power is supplied at the ISP-header, 4.5V is enough. The wireless board can tolerate 5V on i/o pins, but need 3.3V supply which is supplied by the onboard regulator.

The modified header-cable for the rf tranceiver is really convenient, and connects wireless board with power and hardware spi controller on the butterfly.

The shiftbright is a rgb-led pulse width modulation controller which accepts a 4 byte command which is latched in and then latched out on the output pins. Really easy to connect in series. Just shift out many command words, and the first shifted out will end up in the last connected LED in the daisy-chain.

For more detail: Wireless Accelerometer Controlled rgb-LED’s using atmega168 microcontroller

About The Author

Number of Entries : 6710

Leave a Comment

You must be logged in to post a comment.

Read previous post:
Mini RGB Light Cube using AVR microcontroller

This is basically a knockoff of the Hypnocube, instead of being 64 LEDs, thus costing at least $150 to make,...

Close
Scroll to top