GERBER:

https://mega.nz/file/eARxDIQS#LV0VUp1NZolpf5ZUuxxO5FQ7PWzdgoqwKTef5yAonXs

DATASHEET ATMEGA328P:

https://mega.nz/file/nNBnzSgb#PcPsVQRChiZtZYC3e4W_GouRC5ByXcPjebM8TiqMqRU

In this project we will make a sequence of LEDs on a PCB of a very decorative tr:ee image for our projects and more we will use the atmega28p-pu from arduino uno.

For this project, it will help us to decorate Christmas by means of a PCB in the shape of a tree, for which we will design it and send it to our friends at JLCPCB to manufacture.

This project has the CH340C to load the program without removing the chip directly from the computer, we can load our program without problems.

We can control many sequence effects for this project, it will serve as a decoration in our homes and can be powered by a cell phone charger or 5V USB cable.

ELECTRONIC COMPONENTS :

  • ATMEGA328-P
  • CH340C
  • 2 CAP 104
  • 2 CAP 22PF
  • 1 CRYSTAL 16MHZ
  • 1 RES 10K 1/4W
  • 2 RES 1K 1/4W
  • 17 RES 220 OHM 1/4W
  • 17 LEDS 5MM different colors
  • 1 connector USB TIPO C
  • 1 electrolytic CAP 1000UF16V
  • 2 SMD pushbuttons

CHARACTERISTICS:

  • VIN 5VDC
  • I max 300 mA
  • load program directly

Next we can the Arduino code for the effects

TEST CODE:

# define led1 3 // ROJO
# define led2 4 // VERDE
# define led3 5 // AZUL
# define led4 6 // AMARILLO
# define led5 7 // ROJO
# define led6 8 // VERDE
# define led7 9 // AZUL
# define led8 10 // AMARILLO
# define led9 11 // ROJO
# define led10 12 // VERDE
# define led11 13 // AZUL
# define led12 14 // AMARILLO
# define led13 15 // AMARILLO
# define led14 16 // ROJO
# define led15 17 // VERDE
# define led16 18 // AZUL
# define led17 19 // AMARILLO

//jajaja
int leds [17] = {led1, led2, led3, led4, led5, led6, led7, led8, led9, led10, led11, led12, led13, led14, led15, led16, led17};
int leds1 [17] = {led17, led16, led15, led14, led13, led12, led11, led10, led9, led8, led7, led6, led5, led4, led3, led2, led1};
int leds2 [17] = {led1, led2, led3, led4, led5, led6, led7, led8, led9, led10, led11, led12, led13, led14, led15, led16, led17};
int ledRED [4] = {led1, led5, led9, led14};
int ledGREEN [4] = {led2, led6, led10, led15};
int ledBLUE [4] = {led3, led7, led11, led16};
int ledYELLOW [5] = {led4, led8, led12, led13, led17};
int valorleds1 [17] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
int valorleds0 [17] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int valorleds4 [17] = {1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1};
int valorleds5 [17] = {1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1};
int valorleds6 [17] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1};
int valorleds7 [17] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1};
int valorleds8 [17] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0};
int ledsRED [4] = {1, 1, 1, 1};
int ledsGREEN [4] = {1, 1, 1, 1};
int ledsBLUE [4] = {1, 1, 1, 1};
int ledsYELLOW [5] = {1, 1, 1, 1, 1};
configuración vacía () {

 para (int i = 0; i <= 17; i ++) {
  pinMode (leds [i], SALIDA);
 }

}
bucle vacío () {

 para (int i = 0; i <= 17; i ++) {
  escritura digital (leds [i], valorleds1 [i]);
  retraso (100);
 }
 para (int i = 0; i <= 17; i ++) {
  escritura digital (leds1 [i], valorleds0 [i]);
  retraso (100);
 }
 para (int i = 0; i <= 17; i ++) {
  escritura digital (leds2 [i], valorleds4 [i]);
  retraso (100);
 }
 para (int i = 0; i <= 17; i ++) {
  escritura digital (leds [i], valorleds1 [i]);
  retraso (100);
 }
 para (int i = 0; i <= 17; i ++) {
  escritura digital (leds1 [i], valorleds0 [i]);
  retraso (100);
 }
 para (int i = 0; i <= 17; i ++) {
  escritura digital (leds1 [i], valorleds5 [i]);
  retraso (100);
 }

 para (int i = 0; i <= 17; i ++) {
  escritura digital (leds1 [i], valorleds5 [i]);
  retraso (100);
 }
 para (int i = 0; i <= 17; i ++) {
  escritura...
Read more »