Arduino Nano and Visuino: Animate the Colors of RGB LED

8.1K384

Intro: Arduino Nano and Visuino: Animate the Colors of RGB LED

Programming RGB LED Modules to show changing colors is an easy way to improve your mood, and lighten your evenings. Programming Arduino to do the animations however can be challenging. With Visuino however you can create great effects in matter of couple of minutes or less.

In this tutorial I will show you how easy it is to connect RGB LED Module to Arduino Nano and program it with Visuino to animate the colors.

I have also made Video Tutorial of this project.

STEP 1: Components

  1. One Arduino compatible board (I use Arduino Nano, because I have one, but any other will be just fine)
  2. One RGB LED module ( I got my one from Makerfabs ).
  3. 4 Female-Female jumper wires

STEP 2: Connect the RGB LED to Arduino

  1. Connect Power(Orange wire) to the Power Pin (V) of the RGB LED Module (Picture 1)
  2. Connect Red(Red wire) to the Red Pin (R) of the RGB LED Module (Picture 1)
  3. Connect Blue(Blue wire) to the Blue Pin (B) of the RGB LED Module (Picture 1)
  4. Connect Green(Green wire) to the Green Pin (G) of the RGB LED Module (Picture 1)
  5. Connect the other end of the Power wire(Orange wire) to the 5V power pin of the Arduino Nano board (Picture 2)
  6. Connect the other end of the Red wire to the Digital pin 3 of the Arduino Nano board (Picture 3)
  7. Connect the other end of the Blue wire to the Digital pin 5 of the Arduino Nano board (Picture 3)
  8. Connect the other end of the Green wire to the Digital pin 6 of the Arduino Nano board (Picture 3)
  9. Picture 4 shows where are the 5V Power, Digital 3, Digital 5, and Digital 6 pins of the Arduino Nano

STEP 3: Start Visuino, and Select the Arduino Board Type

To start programming the Arduino, you will need to have the Arduino IDE installed from here: http://www.arduino.cc/.

Make sure that you install 1.6.7 or higher, otherwise this Instructable will not work!

The Visuino: https://www.visuino.com also needs to be installed.

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

STEP 4: In Visuino: Add and And Configure 3 Sine Analog Generator Components

To control the Red, Green, and Blue values of the of the LED, we can use Sine Analog Generators with different frequencies connected to the pins:

  1. Type "sine" in the Filter box of the Component Toolbox then select the "Sine Analog Generator" component (Picture 1), and drop 3 of them it in the design area
  2. Select the SineAnalogGenerator2 component (Picture 2)
  3. In the Properties set the value of the "Frequency" property to "0.3" (Picture 2)
  4. Select the SineAnalogGenerator3 component (Picture 3)
  5. In the Properties set the value of the "Frequency" property to "0.1" (Picture 3)

STEP 5: In Visuino: Connect the 3 Sine Analog Generator Components

  1. Connect the "Out" pin of the SineAnalogGenerator1 component to the "Analog" input pin of the "Digital[ 3 ]" channel of the Arduino component (Picture 1)
  2. Connect the "Out" pin of the SineAnalogGenerator2 component to the "Analog" input pin of the "Digital[ 5 ]" channel of the Arduino component (Picture 2)
  3. Connect the "Out" pin of the SineAnalogGenerator3 component to the "Analog" input pin of the "Digital[ 6 ]" channel of the Arduino component (Picture 3)

STEP 6: Generate, Compile, and Upload the Arduino Code

  1. In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE
  2. In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)

STEP 7: And Play...


Congratulations! You have completed the project.

On Picture 1 you can see the complete Visuino diagram.

If you power the Arduino, the RGB LED Module will start gradually changing colors as seen on Pictures 2, 3, and 4 and in the Video.

On Picture 1 you can see the complete Visuino diagram.

Also attached is the Visuino project, that I created for this Instructable. You can download and open it in Visuino: https://www.visuino.com

3 Comments

what about an arduino IDE v?

I did like Visuino, I tried it for a few days before it asked for money, and only via Paypal, I don't like Paypal for a lot of obvious and well known reasons. But , honnestly, I would have pay (I'm a big crowdfounder) if it was complete but a lot of simple devices aren't implemented. I tried to make a design including a standard ultrasonic sensor HC-SR04, with trigger and echo pins, but this at least 2 years old component is not in the Visuino libraries. No more in the Autodesk designer as well, but at least this one is free.

Hi rafununu,

Thank you!
This is not true! HC-SR04 is included in Visuino and was one of the first components to be added, already 2 years ago. Here is example project with it:
https://www.instructables.com/id/Arduino-Nano-Ultrasonic-RangerPing-Distance-I2C-2-/
The reason I am using PayPal only at the moment is that I try to keep the price of Visuino as low as possible. Other payment processors charge too much and I would have had to increase the price. You can keep using the Visuino for free. It will run for 5 min every time you run, which is enough for most projects, and then you can run again.
If you want to try some alternative payment, please let me know, and I can see what i can do.