Introduction: PCB DIYA Because Diwali Is Coming

About: Hello world;

Hey Guys what's up!

So here's something HOT, a PCB DIYA that is powered by an Attiny13 MCU, it has two different LED Driving Mosfets that turn ON and OFF LEDs in a sequence and that emulate a flame.

This Instructables is about the whole built process of this PCB so let's get started.

Supplies

Here are the components used in this built-

  • Custom PCB
  • Attiny13A
  • 8205 Mosfet IC
  • AO3401 Mosfet
  • 0603 LEDs White /Orange/RED
  • 10K 0603 Resistors
  • Type C Port
  • CR2032 Coin Cell THT Holder
  • CR2032 Coin cell
  • USB Type C Cable
  • 5V Power Source
  • Arduino Nano- for programming the Attiny13A

Step 1: About DIYA and DIWALI

A "DIYA" is an OIL LAMP that is usually made out of clay or metal, they are symbolically lit during prayers, rituals, and ceremonies.

Diyas represents the triumph of light over dark, good over evil with the most notable example of this being on the day of Diwali.

Diwali is Essentially a Hindu Halloween.

Step 2: ATTINY13A

As for the brain and the control unit of this project, ATTINY13A is being used here.

Here's why it's a small AVR RISC-based microcontroller with 1Kb of flash which is plenty for a Blink sketch instead of using a full fleshed MCU like an Atmega MCU or any other DEV Board.

Also, Attiny13A costs a lot less, less than 1$ which is crazy low, the cost is not an issue with this project but for some projects, the cost is a big factor to keep in mind.

Attiny13 is an 8 Pin AVR RISC-based microcontroller with five usable IO Ports with two PWM Pins that are enough for a small badge-like project or in this case a Bi-Flashing Light.

Checkout its datasheet from here- https://www.microchip.com/en-us/product/ATtiny13A#Features

Step 3: PCB DESIGN

I started the design process by first finding a nice black-and-white image of a DIYA which can be used as the base model for the whole board.

The Black and white image that was selected got converted into BMP Image as my cad software only imports BMP format for creating a new silkscreen layer.

Next, I prepared a simple Schematic with other Attiny13A MCU that had two Mosfet as Switch setup, One Mosfetr that only had 4 LEDs connected in series was the AO3401 N channel mosfet which can handle 4A of current at 30V max.

5V will be used here if powered by the USB port and 3V if powered by the Coin cell.

For 10 LEDs, the same mosfet as switch setup was utilized but with the 8205A Mosfet IC that has two mosfet on it, I connected both in parallel so it can handle a total of 12A, and 6A each at 20V which is too much for this system but keep this in mind, always choose components with at least double the current usage of your project requirement.

As for the design, I added LEDs in the Flame region, 10 LEDs were placed at the outline of the flame and four at the inside region, Flame also has a cutout between two LED regions.

As for the current limiting Resistor and Diode of the USB Type C Port, both are placed on the bottom side of the board because of space issues.

ISP Connector is an SMD Con6 Port that is made especially for using a POGO Pin setup for flashing this board.

Step 4: PCBWAY

After finalizing the board, I exported the Gerber Data and sent it to PCBWAY for samples.

A yellow solder mask and white silkscreen was used for this project.

I received PCBs in a week and the PCBs were nice as expected.

I really like the quality of the white solder mask, it was a tough sample to manufacture as the silkscreen that I laid out on this board was not completely symmetrical and I also added a few cuts in the flame region which was definitely not like normal PCB layout but PCBWAY did an excellent job of manufacturing this PCB with no error whatsoever.

check out PCBWay service for getting great PCB service at less cost.

Step 5: Solder Paste Dispensing Process

We apply solder paste with a solder paste dispenser syringe or the proper method is to use stencil here which I don't have. but anyway, after this, we can now move on to the next process, which is to add components to each pad.

Step 6: Pick and Process

Next, we carefully pick all the components with an ESD tweezer and place them in their assigned place one by one.

  • We start first by placing Microcontroller, Mosfet IC, Mosfet, and resistors.
  • Next, we add LEDs in their place which was the flame region.

Step 7: Hotplate Reflow Process

Then after doing the pick and place process, we carefully lifted the whole PCB and place it on the hotplate. I’m using my good old DIY hotplate which I made a few months ago.

Basically, in this hotplate reflow process, the surface heats up to the solder paste melting temp and it slowly melts. after a few mins when the solder paste completely melts, we remove the PCB and let it cool down for a moment.

Step 8: Bottom Side Components Placement

This PCB contains components on both sides, we could put all the components on the top side but there is a custom design on the top layer that involves a top etch layer which makes putting stuff on the top layer nearly impossible so it was better to add current limiting Resistors and diode of charging input section to the bottom side.

As for soldering the components, Hotplate reflow can not be used on the bottom side so instead, both components will get soldered by a good old soldering iron.

Step 9: Main Code and Attiny13 Programming

I have used an Arduino as an ISP programmer which I made last year. it's basically an Arduino nano that has its SPI Pins breakout for connecting Attiny13A with it in order to flash the Attiny MCU.

As for connecting Attiny13A, it connected through six Pogo Pins that are connected with ISP Pins of ISP Programmer.

If you want to know how this setup works then definitely check out this post of mine. https://www.hackster.io/Arnov_Sharma_makes/multiple-attiny85-13a-programmer-84adf8

Here's the main code-

int pinsCount=2;                        // declaring the integer variable pinsCount
int pins[] = {0,1}; // declaring the array pins[]
void setup() {
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
}
void loop() {
for (int i=0; i<pinsCount; i=i+1){ // chasing right
digitalWrite(pins[i], HIGH); // switching the LED at index i on
delay(70); // stopping the program for 100 milliseconds
digitalWrite(pins[i], LOW); // switching the LED at index i off
}
for (int i=pinsCount-1; i>0; i=i-1){ // chasing left (except the outer leds)
digitalWrite(pins[i], HIGH); // switching the LED at index i on
delay(70); // stopping the program for 100 milliseconds
digitalWrite(pins[i], LOW); // switching the LED at index i off
}


To Flash Code to the Attiny13, we first need to wire the Arduino as ISP setup with the Custom PCB Badge in the above configuration.

  • We first select the right MCU which is attiny13 in our case and do not forget to choose the right com port.
  • then we select the right programmer which is in our case "Arduino as ISP"
  • then we hit on the Burn Bootloader option which will take a few seconds
  • Now we go to the sketch menu and select the "Upload using Programmer" Option and BANG.

Step 10: Power Source #1- 5V Supply Via Type C Port

After Programming, we connect a 5V Source to the USB Type C Port of the Circuit for powering the setup.

For this Test, I'm using one of my previously made PowerBank that can provide up to 3Amps at 5V but the device consumes a bit less, roughly 1 Watt.

Step 11: Power Source #2- CR2032 Cell

After testing the USB Section of the DIYA PCB, we move on to a much better and more portable solution which is to add a Coin cell Holder to this board and run it via a CR2032 Cell.

We add a CR2032 Coin Cell holder in its place from the bottom side and solder its pad with a soldering iron, the polarity of the Coin cell holder should be right so we should always double-check while putting the THT Coin cell holder in its place.

Step 12: Conclusion

This PCB DIYA works and is a perfect Desk Decorative prop, it even looks better than an actual clay DIYA.

As for LEDs, RED or Orange LEDs could be used instead of White or we can use two color tones of leds so it will look a lot more like a flame.

Leave a comment if you need any help regarding this project, this is it for today folks.

checkout a similar project I did, PCB Candle.

Special thanks to PCBWAY for supporting this project, do check them out for getting great PCB Service for less cost.

Peace out