Arduino Christmas Tree Lights

by RonFrtek in Circuits > Arduino

169 Views, 1 Favorites, 0 Comments

Arduino Christmas Tree Lights

Arduino Christmas Tree Lights

Make a Christmass Tree Lights using Arduino. Lights will randomly change the color and change its brightness.

Watch the Video!

Project file can be downloaded below.

What You Will Need

XC4428-arduino-compatible-rgb-led-moduleImageMain-515.jpg
336-3361370_arduino-uno-r3-png-png-download-arduino-uno.png
VisuinoAdvrtisementElegooV4.jpg
FEGPLRJKK5FQW91.jpg

  • Arduino UNO (or any other Arduino)
  • 2X RGB LED or more
  • Jumper wires
  • Visuino program: Download Visuino

The Circuit

2021-12-25_21-19-27.jpg

  • Connect RGB-LED1 pin [+] to Arduino pin [5V]
  • Connect RGB-LED1 pin [R] to Arduino digital pin [3]
  • Connect RGB-LED1 pin [G] to Arduino digital pin [5]
  • Connect RGB-LED1 pin [B] to Arduino digital pin [6]
  • Connect RGB-LED2 pin [+] to Arduino pin [5V]
  • Connect RGB-LED2 pin [R] to Arduino digital pin [9]
  • Connect RGB-LED2 pin [G] to Arduino digital pin [10]
  • Connect RGB-LED2 pin [B] to Arduino digital pin [11]

Note: if you want to connect more LED, just connect them to the same pins

Start Visuino, and Select the Arduino UNO Board Type

FVM9U8IKT5SOQAJ.jpg
FPPYYQBKT5SOQAK.jpg

The Visuino: https://www.visuino.eu also needs to be installed. Download Free version or register for a Free Trial.

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

In Visuino Add, Set & Connect Components

2021-12-25_21-27-20.jpg
2021-12-25_21-26-41.jpg
2021-12-25_21-26-21.jpg
2021-12-25_21-24-57.jpg
2021-12-25_21-25-12.jpg
2021-12-25_21-25-48.jpg
2021-12-25_21-24-28.jpg
2021-12-25_21-27-01.jpg

  • Add "Clock Generator" component
  • Add 2X "Random Color" component
  • Add 2X "RGB LED" component
  • Add 6X "Ramp To Analog Value" component

  • Select "ClockGenerator1" and in the properties window set Frequency to 0.5
  • Select "RandomColor1" and in the properties window set Max to clFuchsia and Min to clMaroon
  • Select "RandomColor2" and in the properties window set Max to clWhite and Min to clMaroon

Note: You can choose diferent colors to test


  • Connect "ClockGenerator1" pin [Out] to "RandomColor1" & "RandomColor2" pin [In]
  • Connect "RandomColor1" pin [Out] to "LED1" pin [In]
  • Connect "RandomColor2" pin [Out] to "LED2" pin [In]

  • Connect "LED1" pin[R] to "RampToValue1" pin [In]
  • Connect "LED1" pin[G] to "RampToValue2" pin [In]
  • Connect "LED1" pin[B] to "RampToValue3" pin [In]
  • Connect "LED2" pin[R] to "RampToValue4" pin [In]
  • Connect "LED2" pin[G] to "RampToValue5" pin [In]
  • Connect "LED2" pin[B] to "RampToValue6" pin [In]
  • Connect "RampToValue1" pin [Out] to Arduino Analog PWM pin [3]
  • Connect "RampToValue2" pin [Out] to Arduino Analog PWM pin [5]
  • Connect "RampToValue3" pin [Out] to Arduino Analog PWM pin [6]
  • Connect "RampToValue4" pin [Out] to Arduino Analog PWM pin [9]
  • Connect "RampToValue5" pin [Out] to Arduino Analog PWM pin [10]
  • Connect "RampToValue6" pin [Out] to Arduino Analog PWM pin [11]

Note: If the LED1 is not shining then Select "LED1" and in the properties window set "Inverted" to True.

Note: If the LED2 is not shining then Select "LED2" and in the properties window set "Inverted" to True

Generate, Compile, and Upload the Arduino Code

F9CBHCTKTFSTNH3.jpg

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Play

If you power the Arduino module the LEDs color will start to change on the LEDs.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Tutorial, you can download it and open it in Visuino: https://www.visuino.eu