Introduction: ATtiny Powered Christmas Tree

About: Hey there. This is Amit. I love making electronics on the concept of LEDs, PCBs, Batteries, and IoT.

Ho! Ho! Ho! (Trying to be a Santa Laugh), So it's Holiday Season going on

and I am back with my second and unfortunately last project of the year 2021. Before getting into the detail of the project, a special thanks to @Arnov Sharma for his support in helping me build this project as I am a noobie to these ATtinies.

Well! This is my Merry tree aka ATtiny powered Christmas Tree and, as the name implies, this Tree uses a few of the components that make a connection between ATtiny and Mosfet as a switch with few LEDs and resistors.

This setup works on a 3V Coin Cell battery aka model CR2032. So, let's dive into this tree with a much wide guide.

Supplies

  1. Customized Printed Circuit Board x 1 -- Powered by the Finest PCB manufacturer from India - The Lion Circuits
  2. 3mm LEDs x 9
  3. MOSFET 8205 x 1
  4. 10k resistor x 2
  5. 1k resistor x 1
  6. SMD Switch x 1
  7. CR2032 Coin cell Holder (THT in my case)
  8. ATtiny85 or ATtiny13A x 1 (ATtiny85 in my case)
  9. 8 pin IC Base (if you have a limited number of microcontrollers, else you can directly solder the ATtiny on the PCB)
  10. Header pins to program the ATtiny via programmer (Arduino as ISP in my case)
  11. Soldering tools [ SMD paste is not recommended as the project uses only two SMD components (the MOSFET and the switch) ]

Step 1: Idea of Design

Designing the PCB is the core idea of the project. Mine design is mathematically symmetrical i.e. both the sides of the PCB either forward-backward or Right Edge-Left Edge overlap when folded in half or when the two boards are overlapped on each other.

Because it's a tree that will obviously work as the home decor or Christmas decor item, the base of the PCB or in lame, the trunk of the tree is tried to make in the best possible wide region with as much negligence to the texture of the PCB while getting milled.

Now, to make it cosmetically attractive, I masked an abstract design of the Christmas tree that I got from the web, I then added some snow flakes (of different sizes) on the PCB depicting the Snowy Tree, I then look forward of adding a Christmas champ on the PCB like the Santa Face or the Reindeer or the Snowman or the Gingerbread doll. But, from all of them, only the Snowman fit the best on my tree (HaHa), and lastly, to make it a Christmas Decor item, I added the "Merry Christmas" text on the tree.

Naming the project is simple but I call it "Merry Tree" - A happy & cheerful tree.

Step 2: Hardware Setup

So, as mentioned in the supplies, this project works on the "Mosfet as Switch setup". I took this idea from the Cute Pandacorn badge.

The energizer of the project is the CR2032 3V Coin Cell (I know it's too weak), simply putting the cell and tapping the switch, makes different modes for the LEDs i.e. Off, Fading Blinky Flash, Delay blink, and Flash Blinking. This goes in a Loop with each press on the switch.

The R1 resistance made an extra task for me as I neither had the required resistor nor the nearest resistor, So I had to utilize the stripped lead of the LEDs as the conductor between the two pads of the resistor.

Choosing the LEDs for this tree was the most time-consuming task as we cannot use the Blue and white LEDs in the tree due to their low behaviour on voltage below 3V i.e. we need to give them a constant 3V which is possible by other means but not with the Coin cell (If yes! let me know in the comment). So, I had to go with the Red, Yellow, and Green LEDs. But for Christmas decor, green and red LEDs are recommended.

You can find the Schematic of the project attached here.

Step 3: PCB Review

So, after designing the schematic and the cosmetic Gerber base, it was time to import the electronics to make a complete PCB.

After, importing the schematic on the board base and connecting the pads, I then moved with the Gerber DFM check to ensure that the fabrication of my PCBs is under the capability of the PCB manufacturer (In my case Lion Circuits).

PCBs from Lion Circuits cost me only $15 for 10pcs i.e. less than $2 per piece. Amazing right! with a fabrication + delivery time of only 5 Days.

I Received Matte green finish PCBs which costs more than $25 from other .cn manufacturers.

Some salient features of Lion Circuits are:

  1. IPC Class 2 PCBs for only $15 with a promised delivery time of only 4 days to EU and 3 Days to the US.
  2. Multiple service options where the user gets the best experience of ordering the PCBs with advanced and fully automated fabrication.
  3. Fabrication, Component Procurement, and PCB Assembly under one roof with IPC class 2 quality, supporting your complete hardware needs.
  4. No additional marking (Like Product no., Batch No., or the company brand) is put up on the PCB while fabrication, which means your design is solely respected and is secured with a legally binding NDA. see their design confidentiality page.
  5. Quality Assurance and 95% Green Packaging for the boards thereby reducing the Use of Plastic packing.

It's highly recommended by me to check @LionCircuits for your complete hardware & PCB needs.

Thanks to the whole team of Lion Circuits for their services and best after-sales!!!

Step 4: Software Setup & Programming

The software setup in this project is simple and minimal only for the ATtiny85.

For flashing the code, I utilized my old friend in the family of microcontrollers - The Arduino UNO (HaHa) as ISP.

So, I interfaced the ATtiny85 and Arduino as :

  1. Reset to Pin 10
  2. VCC to 5V
  3. GND to GND
  4. IO 0 to Pin 11
  5. IO 1 to Pin 12
  6. IO 2 to Pin 13

And a 10uF capacitor between the Reset and GND Pin of Arduino UNO.

Now,

  1. open the Arduino IDE and using the (ctrl + comma) function open the Preferences menu.
  2. Add the URL: https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json. and ENTER.
  3. Save the preferences and Open the BOARD MANAGER from Tools>Boards>Board manager
  4. Search for ATtiny by David A. Mellis, INSTALL the latest version, and CLOSE.
  5. Open, ARDUINO as ISP, and hit UPLOAD to the correct COM and Board.
  6. Now, select the board as ATtiny85 and Burn Bootloader. You will get the success option if wired as instructed above.
  7. Open your ATtiny code and hit UPLOAD to the microcontroller.

You are done with coding the ATtiny85 for the Merry Tree.

Step 5: Assembly Guide

Now as we are familiar with the PCB design, Schematic, getting PCBs, and Programmed ATtiny, it's time to assemble the Merry tree.

Soldering the PCB starts from the SMD Components at first.

  1. Using a Pointed Tip soldering Iron, we can solder the MOSFET 8205 and the Push Button with a good solder.
  2. Then, Solder the Coin Cell Holder, Resistors, and the ATtiny85 or the 8pin IC Socket.
  3. Now, Lastly, solder the LEDs with the correct orientation as shown in the images.
  4. Put the programmed ATtiny in the socket and the CR2032 3V Coin cell in the cell holder.
  5. Tap the button, and you will see the LEDs Flashing in the Loop sequence with respect to the Loop of Tapping the switch.

Hurrah! You completed the build of your Merry Tree and is good to place it in your Decor areas or hang it on the Christmas Tree with the Thread.

Step 6: The END

So, it was fun making this project by soldering the SMD and THT components both with a little programming experience and Enjoying Christmas 2021 with your own made Decor item.

You can get this Merry Tree in a KIT or in a Fully Assembled item from my Tindie Store.

All the products on my store are eligible for Free Delivery Worldwide! :)

Thank you for your reading time on this Instructables. I hope you learned something new, If yes! comment below your doubts, ideas, or upgrades in this project because I mind it positively.

Stay Safe, Stay Blessed, and Get vaccinated if you aren't yet!

Merry Christmas 2021!

Anything Goes Contest 2021

Participated in the
Anything Goes Contest 2021