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

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

FOYOWJKK437EP3J.LARGE.jpg
Adafruit-1643-30091150-01.jpg
FQ68OGUK437EP5E.LARGE.jpg
FELM42NK437EP3K.LARGE.jpg

The Circuit

Neo_Arduino1.jpg

  1. Connect LED Ring pin [VCC] to Arduino pin [+5V]
  2. Connect LED Ring pin [GND] to Arduino pin [GND]
  3. Connect LED Ring pin [IN] or (DI) to Arduino digital pin [6]

Start Visuino, and Select the Arduino UNO Board Type

FFR2XFGK1UXJLG8.LARGE.jpg
F8LR4HQK1UXJLG7.LARGE.jpg

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

2019-12-26_17-21-19.jpg
2019-12-26_17-20-31.jpg
2019-12-26_17-23-46.jpg

  1. Add "Clock Generator" component
  2. Add "Counter" component
  3. Add "Compare Integer Value" component
  4. Add "Random RGBW Color" component
  5. Add "NeoPixels" component

In Visuino Set Components

2019-12-26_17-19-15.jpg
2019-12-26_17-17-04.jpg
2019-12-26_17-17-26.jpg
2019-12-26_17-17-49.jpg
2019-12-26_17-18-32.jpg
2019-12-26_17-18-20.jpg
2019-12-26_17-18-59.jpg

  1. Select "ClockGenerator1" component and in the properties window set "Frequency" to 10
  2. Select "Counter1" component and in the properties window set "Max" to 12 or 16 (Depends on how many LED your LED ring is having)
  3. Select "Counter1" component and in the properties window set "Min" to 0
  4. Select "CompareValue1" component and set "Value" to 12 or 16 (Depends on how many LED your LED ring is having)
  5. Select "CompareValue1" component and set "Compare Type" to ctNotEqual
  6. Double click on the "NeoPixels1" and in the "PixelGroups" window drag "Color Pixel" to the left
  7. 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

2019-12-26_17-16-39.jpg

  1. Connect "ClockGenerator1" component pin [Out] to "Counter1" component pin [In]
  2. Connect "Counter1" component pin [Out] to "CompareValue1" component pin [In]
  3. Connect "Counter1" component pin [Out] to "NeoPixels1" >Color Pixel1 component pin [Index]
  4. Connect "CompareValue1" component pin [Out] to "Counter1" component pin "Reset"
  5. Connect "CompareValue1" component pin [Out] to "RandomRGBWColor1" component pin "Clock"
  6. Connect "RandomRGBWColor1" component pin [Out] to "NeoPixels1" >Color Pixel1 component pin [Color]
  7. Connect "NeoPixels1" component pin [Out] to Arduino digital pin[6]

Generate, Compile, and Upload the Arduino Code

F0P14MMK1UXJMQ8.LARGE.jpg
FCG1WWZK1UXJMQ7.LARGE.jpg

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