Arduino Neopixel LED Ring Ws2812 - Visuino Tutorial
by RonFrtek in Circuits > Arduino
4420 Views, 12 Favorites, 0 Comments
Arduino Neopixel LED Ring Ws2812 - Visuino Tutorial
In this tutorial we will learn how to control the Neopixel Led Ring Ws2812 using Arduino and Visuino to run the LED pixel around.
Watch a demonstration video.
What You Will Need
- Arduino UNO (or any other Arduino)
- Neopixel LED ring
- Jumper wires
- Visuino program: Download Visuino
The Circuit
- Connect LED Ring pin [VCC] to Arduino pin [+5V]
- Connect LED Ring pin [GND] to Arduino pin [GND]
- Connect LED Ring pin [IN] or (DI) to Arduino digital pin [6]
Start Visuino, and Select the Arduino UNO Board Type
To start programming the Arduino, you will need to have the Arduino IDE installed from here: https://www.arduino.cc/.
Please be aware that there are some critical bugs in Arduino IDE 1.6.6. Make sure that you install 1.6.7 or higher, otherwise this Instructable will not work! If you have not done follow the steps in this Instructable to setup the Arduino IDE to program Arduino UNO! The Visuino: https://www.visuino.eu also needs to be installed. 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 Components
- Add "Clock Generator" component
- Add "Counter" component
- Add "Compare Integer Value" component
- Add "Random RGBW Color" component
- Add "NeoPixels" component
In Visuino Set Components
- Select "ClockGenerator1" component and in the properties window set "Frequency" to 10
- Select "Counter1" component and in the properties window set "Max" to 12 or 16 (Depends on how many LED your LED ring is having)
- Select "Counter1" component and in the properties window set "Min" to 0
- Select "CompareValue1" component and set "Value" to 12 or 16 (Depends on how many LED your LED ring is having)
- Select "CompareValue1" component and set "Compare Type" to ctNotEqual
- Double click on the "NeoPixels1" and in the "PixelGroups" window drag "Color Pixel" to the left
- On the left side of the "PixelGroups" window then select "Color Pixel1" and in the properties window set "Count Pixels" to 12 or 16 (Depends on how many LED your LED ring is having)
In Visuino Connect Components
- Connect "ClockGenerator1" component pin [Out] to "Counter1" component pin [In]
- Connect "Counter1" component pin [Out] to "CompareValue1" component pin [In]
- Connect "Counter1" component pin [Out] to "NeoPixels1" >Color Pixel1 component pin [Index]
- Connect "CompareValue1" component pin [Out] to "Counter1" component pin "Reset"
- Connect "CompareValue1" component pin [Out] to "RandomRGBWColor1" component pin "Clock"
- Connect "RandomRGBWColor1" component pin [Out] to "NeoPixels1" >Color Pixel1 component pin [Color]
- Connect "NeoPixels1" component pin [Out] to Arduino digital pin[6]
Generate, Compile, and Upload the Arduino Code
In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE
In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)
Play
If you power the Arduino UNO module, the LED ring will start to change its colors.
Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it here and open it in Visuino: https://www.visuino.eu