Introduction
The Rainbow Ring board has been upgraded to version 3! This is probably the most beautiful LED ring ever. Each led on the ring can be controlled seperatly on its brightness and colors (RGB). It comes with pre-burned bootloader which has several built in led scripts.It allows I2C/Serial communication from any MCU and can be serially linked to make a beautiful Art piece via I2C.
Specificiation
- CPU: Atmega 168P (Optiboot Lilypad Board in Arduino IDE)
- Bootloader: Optiboot diecimila
- Supply voltage:5V
- Output voltage:5V
- Interface: Serial/I2C/Digital pins
- Push button x2
- 12 SMD RGB LED
- Firmware upgradable
- Stand-alone operation: No microcontroller needed for light script playback
- Diameter: 61 mm
- Space between two holes: 29 mm
Hardware Requierments
Preparatory Work
- The Rainbow Ring ships with no pin headers. This gives you the option to solder the pins according to your project needs. Before starting to program the LED Ring you should solder the pin headers on to the board.
- CAUTION: Only supply power to 1 of the 3 power pins provided at any one time.
- Download the library Rar file (New RAR file with additional sample code)
- NOTE: This library has yet to be upgraded to be compatible with IDE V1.0 Please use Arduino 0023
- How to change board
-
-
step1: Once it's downloaded, unzip the files as normal.You will see the following list.
-
-
step2: Open ***boards and programmers-arduino / boards***.
-
-
step3: Meanwhile,open Arduino 0023 ***Arduino 0023 / hardware / arduino***.
-
-
step4: Put the file ***boards*** of step2 instead of the one ***boards*** of step3. Then re-open Arduino 0023 and select: ***\[Optiboot\] Lilypad Arduino w/Atmega 168***
Method of Use
1.FTDI Connection Instructions
The following picture is the connection diagram.Now,you can use code RGB_Ring_V3 in the zip to test it, directly upload code to Lilypad by FIDI and control it.Take note that the library for RGB_Ring_V3 is a bit different from other Arduino library. There are only an h file and an example pde file under the library folder. Just make sure the RGB_Ring_V3 folder is copied to the libraries folder for your Arduino 0023.
NOTICE: Because of the libary, setting the baud rate is need for double in the serial monitor than in the code.
2.I2C Connection Instructions
NOTICE: Do not connect 5V if already connected from the FTDI board.Connect your Arduino to the Rainbow Ring. Since we are providing power from the FTDI board do not plug in the 5V Vcc to the I2C side of the Rainbow Ring. The only 3 wires you need to connect are the SDA to pin 4, SCL to pin 5, and GND.
The connection is completed. Then, the UNO as the sender, the SenderV3.pde sketch in the folder needs to be uploaded to the UNO, and, the Rainbow Ring as the receiver, the ReceiverV3.pde sketch in the folder needs to be uploaded to the Rainbow Ring. Now, you can use UNO's serial to controll the Rainbow Ring by different commands.
Or, you can consult the code below, which is provided by a client. He changed the command mode by 16 binary. You can also have a try!
UNO as the Sender
Rainbow Ring as the receiver
PS: Some Details in the Code
1.Some Function Explanation
SET_LED_RGB(LED, RED, GREEN, BLUE) This function sets the RGB color for 1 specific LED. The value for the led should be between 0-11, indicating the 12 leds in the ring (in clock wise, the one on top of DFROBOT logo is LED 0). The red, green, and blue variable is the RGB value for that specific led. These values are intensity for each color from 0 – 64. For example:
set_led_rgb(2, 10, 15, 60);
Will set led 2 on the Rainbow LED Ring to the RGB value R=10 : G=15 : B=60.
SET_LED_UNICOLOR(LED, RGB, VAR) This function changes 1 specific color for 1 specific LED. The rgb value should be 0 – 2, which represent the color RED, GREEN and BLUE. You can also use the "RED", "GREEN", or "BLUE" color enumerator. The var represent the intensity for the specific color. Take note that this function will not affect the intensity of other color on the same LED. For example:
set_led_unicolor(0, RED, 50);
This function change the red color intensity on LED 0 to 50.
SET_ALL_RGB(RED, GREEN, BLUE) This function changes the RGB value for all LEDs. The red, green and blue variable is color intensity for RGB value for all LED.
SET_ALL_UNICOLOR(RGB, VAR) This function changes 1 specific color for all LED. The rgb value should be 0 – 2 represent the color RED, GREEN and BLUE. The var is the intensity for the specific color.
ROTATE(COLOR, DIR) This function will rotate 1 specific color for the LED ring to CW or CCW direction. The color variable is set from 0 – 7 (or you can use color enumerator, RED, GREED, BLUE, YELLOW, TURQUOISE, FUCHSIA, WHITE and BLACK. The dir variable is set from 0 – 2 (or the direction enumerator CW and CCW).
RANDOM_LEDS() This function is to set a random LED(s) and random color on the LED ring. Each time this function is called, some LED will change color or lighten up randomly.
FADER() This function is to perform a fader on all LED on the ring. After this function is called, all the LEDs will fade from zero intensity to full intensity and back to zero intensity (for all color).
FADER_HUE() This function is to perform a color fader on all LED on the ring. After this function is called, the color on all LED will fade from Red to Green, Green to Blue and Blue to Red. The color for all LED remain RED after the function had ended.
2.Rainbow Ring Interaction -- I2C Connection
The following are the commands used to control your Rainbow ring. Included are the parameters needed and the terminal command to execute each command.
NOTE: This sample code has been adapted from earlier Version 2 it has not been fully tested and may have some non-functioning commands, please let us know in the forum if you find problems with this sample code. //Term command`
Each terminal command should be preceeded by a "c" and ended with an "s". These commands are case sensitve.
This will send the command (c) rotate(o) the color Blue (02) times (99) clockwise (01) send (s)
Please study the sketch, it has been commented to give you a better idea of the functionality.
3.Color Enumeration:
- RED
- GREEN
- Bgdgr
- YELLOW
- TURQUOISE
- FUCHSIA
- WHITE
- BLACK = OFF
rotate CW = 1, CCW= 2