CITY416.ruBlagoveshchensk city Arduino community    
news modules projects ideas technology links
 CITY416.RU / projects / village houses


Village houses


Task

Light control unit for village house models. Standalone power, wireless control. 5 models, independent control.

Technical solution

Arduino Duemilanove with Atmega168 microcontroller onboard is used as controlling device.

12 V yellow LED strip is used as light source. LEDs are controlled by PWM Arduino output via transistor key.

zoom
Schematic


NiCd or NiMH cells are used as power supply. Each model requires 8 cells. Sypplying LEDs from 10 V instead of 12 causes acceptable brightness degrade, still allowing normal operation. Further increasing of power supply voltage causes too heavy heating of 7805 on Arduino board.

Small strip length allows TIP122 usage (without heat sink). In case of LED strip length more than 50 cm, heat sink should be used.

Design

Cells and Arduino lives inside house model. There is a button on top side, which allows to turn light on/off. IR receiver is also mounted on top side. LED strip is mounted on plastic tube inside. Assembled without errors, the device should working without any tuning.

Algorithm and Arduino sketch

After power on, device polls IR receiver and on appropriate IR code does action: LEDs animation or LEDs blinking according to power source voltage. The voltage is put on Arduino ADC through resistive divider.

There are up to 10 on/off codes assigned to 1-10 TV remote keys, power check code and common on/off codes assigned to remote Up/Down keys. Common codes turns light on/off on all models.

Animation includes random -5..+5 brightness delta, and brightness is also stayimg in specified area of 32 minimum and 64 maximum. These brightness restrictions reminds real candle flame brightness.

Brightness to PWM level translation happens in logarithmic law, placed in array. This array was taken from Arduino - Physical Computing für Bustler, Designer & Geeks (Manuel Odendahl, Julian Finn, Alex Wengler).

Power check code is assigned to Power TV remote key. By this code, Arduino maps voltage on ADC to 1-10, according to difference between min and max voltage of power supply. Then this value is used as n, and central LEDs of eyes are blinking n times. This means n*10% battery charge.

The sketch requires IRRemote library.

Arduino sketch
Download Arduino sketch - house.ino

PostScriptum
To make light more real, three LED strips can be used (two yellow and one red). Each channel brightness delta is calculated separately in this case.

Links

 

проектирование, изготовление, монтаж

PCB