Christmas Tree PCB Gift




It was in the middle of september where i wanted to do a fun little project. Because christmas was approaching and I wanted to give some homemade gifts to my family I choosed to do a christmas tree.

The christmas tree should:

- must be power efficient

- not be larger than 10*10cm

- programmable

- must have a base, where the battery is placed

- must have more than 1 mode of operation

I designed the PCB in Altium Designer, printed the PCBs on JLC, programmed the atmel microcontroller in Atmel Studio 7.0 and designed the 3d model in SolidWorks.

Step 1: The Plan

My plan is to design 2 christmas tree shaped pcbs.

Before I started to work on the schematics I choosed the microcontroller, power supply, led drivers...

For the microcontroller i used the ATTINY85-20SU because of its simplicity (8pins).

For powering the microcontrollers and leds i choosed 3 AA batterys.

For switching the leds i choosed mosfets SI1012CR-T1-GE3.

Step 2: Designing the PCB

First i made the schematic then the PCB layout.

After i choosed the microcontroller i looked at the datasheet of the controller and the pinout. The microcontroller needed to have a sleep mode and atleast 4 I/O pins for 3 mosfets, one for each color(red,yellow,green) and a push button. The attiny85 was perfect.

Pin1(RESET) - is reset pin, where I connected an 10 kOhmPULL UP resistor (package 1206)

Pin2 - i used this pin for the push button, everytime i pressed the pushbutton the pin got pulled down to ground(so I programmed this pin as input and used an internal PULL UP)

Pin3 - in the SCH1 I did connect this pin on the male header but i didnt used it.

Pin4 - Ground

Pin5(MOSI) - goes to the gate of the mosfet Q3 for yellow leds

Pin6(MISO) - is connected to the gate of the mosfet Q2 for green leds

Pin7(CLK) - connected to the gate of the mosfet Q1 for red leds

Pin8 - Vcc

Datasheet of the mosfet:

On one mosfet there are 12 leds ( total power consumption for 1 mosfet: P=I*U, P=20mA*4.5V=90mW)

I also added 6 vias(2.54 mm from each other for programming (header 4 and header 2 on the SCH)).

After the SCH i went on arranging the board. I cut out the christmas tree shape, and then I layed out the components.

I added two decoupling capacitors 100pF and 10uF to stabilize the input voltage.

The 100 kOhm resistor that is in SCH i didnt use.

I added the gerber files for both PCBs.

Step 3: Soldering

I used an old soldering iron I had laying around.

First i soldered all the smd components, then all the through hole components.

After soldering it was time for fun programming :D

Step 4: Programming

For programming I used the AVRISP mk2 .

Because you need an external power supply to power the microcontroller and programator I connected 5v and gnd from Arduino Mega just for power. Then i connected the programator on my programmable pcb where i connected:

1 pin(RESET) to RESET

4 pin(GND) to GND

5 pin(MOSI) to MOSI

6 pin(MISO) to MISO

7 pin(CLK) to CLK

8 pin(Vcc) to Vcc

I attached the program code.

I the code i implemented pwm control, sleep mode, interupts...

The firs mode is just blinking all the leds, in the second mode i used the pwm to change the brightness(i just need to tweak a little to make it more fluently, the third mode is just turning the led on and off in steps, the fourth mode is just crazy blinking( i used the pwm function like in the second mode) i call it "funky" mode :D

After you press the push button an timer ist started that counts 5 minutes an then goes back to sleep mode( in sleep mode the power consumption is like 2-6 uA)


Before you programm your attiny85 with this programm, you need to disable8 Mhz fuse. because if not your attiny85 will work at only 1 Mhz

Step 5: Component List

I ordered components for 12 christmas tree i added an file of components that i ordered from Farnell and Mouser, other components i ordered from aliexpress:


- Protoype PCB

- Female headers

- Male right angle headers

- Push buttons

- ON/OFF switch

- battery

Step 6: 3d Modeling

I wont describe how i designed the 3d model for the base, but if you want you can PM me and i send you the files.

I made some opening for the on/off switch and the Push button.

First i soldered some wires on the push button and switch, then i positioned them and hot glued them from the inside of the base, then i cut out the perf boards, and soldered the female connectros and wires together and hot glued everything inside the base.

Step 7: Summary

Main purpose of this project was that i wanted to suprise my family with something homemade, that was the motivation that helped me to complete it.

Special thanks to my friends that helped me with this project.

I added an excel file, where i calculated how long would the battery last(in ideal conditions).

If you have any questions leave a comment.



    • Trash to Treasure

      Trash to Treasure
    • Tape Contest

      Tape Contest
    • Arduino Contest 2019

      Arduino Contest 2019

    2 Discussions