Bird cage LED daylight simulation system

Sometimes you get a chance to combine helping out your family with a nice hobby project..

In this case my father in law was looking for a lighting system for his bird breeding cages. A daylight simulation system to be exact. He asked me to take a look at a website which sells such systems, since he wanted to know what he needed to order. After a quick look at those websites and seeing their pricing.. I convinced my father in-law I would develop and install the system myself.. He would get his lighting, I would have a new hobby project!

Daylight-simulation systems

The requirements for a daylight simulation system are simple: lights should gradually (say in 20 minutes) increase to a set high intensity in the morning, stay at that intensity during the day, gradually decrease to a set lower intensity in the evening, and stay at the low intensity during the night.

Other ‘non-functional’ requirements of such systems: the light should not flicker (this is stressful for the birds), the dimming should be smooth (again related to stress), the system should be reliable.. This instructable describes how I built this system based on an Arduino, some N-channel NPN transistors, a real time clock, a character LCD and some cheap LEDs from eBay.

A sidenote: The birds are only in the cages for breeding, the remainder of the year they are in an outside bird sanctuary. So no animals were harmed for making this instructable!

I’ve submitted this project to the 123D Circuits Contest and the 2014 makerlympics (both pending approval). So if you like this project: please vote for it! Thanks!

Step 1: Bill of materials

The base of the system is an Arduino Duemillenova. I think a Uno should work just fine. If you are considering to use a Leonardo or Mega: the code sets special registers in the Arduino.. these might be different for these boards!

All items were sourced online from dealextreme, eBay, Conrad etc.. but any electronics store would do.

A note on ‘daylight’ LEDs

According to bird breeder forums and stores: birds need special daylight LEDs. Maybe this is true (I do not want to start a religious discussion), but to me such definitions feel a bit like high-end audio discussions…

I’ve seen special birdkeeper websites showing off ‘home developed’ LED units for which the CE marking is of the ‘China Export’ type. A quick search on eBay revealed that the advertised LEDs (which are sold at special discount prices of 5 EUR per unit) very much resemble ‘Cool White store lighting’ LED chains sold for around 10USD / 20 units. Therefore I feel that at least some of the advise is a sneaky way to overprice the LEDs.

Step 2: Power the Arduino and LEDs

A schematic of supplying power to the arduino via a voltage regulator IC. Note that the same power supply can directly be used to power the LEDs without a voltage regulator.

Note that since the number of available components is still a bit limited, the 9v battery represents a power supply ( > 9v) and the PNP transistor represents a 7809 voltage regulator IC. The schematic view gives the clearest representation.

Be sure to use a power supply which can easily supply the the current you need to drive all your LEDs. I started out with a 12V / 2A power supply from some equipment that I no longer had. This seemed OK in the beginning, but resulted in a lower brightness and an unreadable LCD after about a day of testing!

Step 3: LED dimming

Dimming/fading of leds is the key part of the daylight simulation system. Leds can be faded by supplying a PWM signal instead of a DC signal. An example of this is known to most arduino owners: The ‘fade’ example. The only thing you need for this is a simple LED and a resistor to limit the current through the circuit.

The same code can be used for fading a LED strip instead of a single LED. When powering or fading a LED strip, the voltage or the current that can be supplied by an Arduino pin are no longer sufficient. Therefore an n-channel NPN transistor is introduced. A very common transistor for this is the BD135. The current that can be supplied by this LED is limited (the TO220 type I used for this can supply a maximum of 1A). If more power is needed, a Power MOSFET can be used.

An example circuit is shown below:

Here a 9V battery is used to power a led which is controlled by an Arduino. Here, the 9v battery represents any type of external power supply. Note that a 10k external puldown resistor is used to keep the signal low until the arduino supplies a signal on Pin 9. Also, in case you are powering a LED strip, the current limiting resistors are already integrated in the strip itself and can be left out.

The above example does not take into account two things:

The relation between the pulse width and the (perceived) LED brightness is not linear, but logarithmic (or at least: logarithmic is a good enough approximation)

The default PWM frequency is rather low, this might disturb the birds if they’re in this light all day

Step 4: Adding the display

I had a 20×4 HD44780 character display lying around which I bought for less than 1 Euro on a clearance. I wanted to use this in this project, but did not want to lose 10pins of my arduino just for driving the LCD.

To overcome this issue, I used an I2C backpack for the display. This is basically an adapter which drives all pins of the LCD but only costs you 2 pins + 5V & ground on your arduino. As stated in the Bill of Materials, these backpacks can be bought for less than 3 dollars on the internet.

The downside of using such a device is that the standard Arduino character LCD library doesn’t work, and you have to browse on the internet for a while until you find a suiting replacement. The replacement I used is:F Malpartida’s NewLiquidCrystal library. which works great, so many thanks to F Malpartida of electroFUN LTD!

Unfortunately it took me 2 evenings to get the display up & running with the backpack. So watch out for the following issues