Volume Indicator Neopixel Ws2812 LED Ring & Arduino

by RonFrtek in Circuits > Arduino

1994 Views, 6 Favorites, 0 Comments

Volume Indicator Neopixel Ws2812 LED Ring & Arduino

Volume Indicator Neopixel Ws2812 LED Ring & Arduino

In this tutorial we will learn how to make a Volume Indicator using a Neopixel Ws2812 LED Ring and arduino.

Watch the Video!


Note: At the bottom you can find the step for the reversed direction of the LED ring.

What You Will Need

1586-01.jpg
pctdetail.775-114.1.jpg
FMT2X9VKEY93G5P.jpg
arduino.jpg
VisuinoAdvrtisementVersion8.jpg
  • Arduino Uno or any other Arduino board
  • NeoPixel - RGB LED Ring
  • Jumper wires
  • Potentiometer
  • Visuino software: Download here

The Circuit

324899_2312151212997_1057577010_o.jpg
  • Connect Arduino board pin 5V to LedRing pin VCC
  • Connect Arduino board pin GND to LedRing pin GND
  • Connect Arduino board Digital pin 2 to LedRing pin DI
  • Connect potentiometer pin OTB to Arduino Analog Pin A0
  • Connect potentiometer pin VCC to Arduino Analog Pin 5V
  • Connect potentiometer pin GND to Arduino Pin GND

Start Visuino, and Select the Arduino UNO Board Type

FRWQB80K1RVKKV9.LARGE.jpg
F311FBVK5AHN5HJ.LARGE.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 Components

2020-12-06_12-59-09.jpg
2020-12-06_12-58-28.jpg
2020-12-06_13-03-42.jpg
2020-12-06_13-03-07.jpg
2020-12-06_13-02-15.jpg
2020-12-06_13-00-55.jpg
2020-12-06_13-00-29.jpg
  • Add "Map Range Analog" component
  • Add "Ramp To Analog Value" component
  • Add "Analog To Unsigned" component
  • Add 2X "Compare Analog Value" component
  • Add 2X "Color Value" component
  • Add "RGBW Color Multi-Source Merger" component
  • Add "NeoPixels" component

In Visuino Set Components

2020-12-06_13-16-46.jpg
2020-12-06_13-15-04.jpg
2020-12-06_13-13-41.jpg
2020-12-06_13-12-49.jpg
2020-12-06_13-08-02.jpg
2020-12-06_13-05-03.jpg
  • Select "MapRange1" and in the properties set Input Range> Max to 1, and Input Range> Min to 0
  • Select "MapRange1" and in the properties set Output Range> Max to 12, and Output Range> Min to 0

Note: Output Range> Max to 12 is the number of LED on the LEDRing

  • Select "RampToValue1" and in the properties window set Slope (S) to 1000
  • Select "CompareValue1" and in the properties window set Compare Type to ctBigger and Value to 10
    also select Value field and click on the Pin Icon and select "Float Sink Pin"
  • Select "CompareValue2" and in the properties window set Compare Type to ctSmaller
    also select Value field and click on the Pin Icon and select "Float Sink Pin"
  • Select "ColorValue2" and in the properties window set Value to clNavy
  • Double click on the "NeoPixels1" and in the PixelGroups window drag ColorPixel to the left side, and in the properties window then set Count Pixels to 12

Note: Count Pixels 12 is the number of the LED on the LEDRing

In Visuino Connect Components

2020-12-06_13-19-41.jpg
ledvolume.png
  • Connect Arduino Analog pin [0] Out to MapRange1 pin In
  • Connect "MapRange1" pin Out to RampToValue1 pin In, and CompareValue1 pin Value and CompareValue2 pin Value
  • Connect "RampToValue1" pin Out to CompareValue1 pin In and CompareValue2 pin In and AnalogToUnsigned1 pin In
  • Connect AnalogToUnsigned1 pin Out to NeoPixels1 pin Index
  • Connect CompareValue1 pin Out to ColorValue1 pin Clock
  • Connect CompareValue2 pin Out to ColorValue2 pin Clock
  • Connect ColorValue1 pin Out to RGBWColorMultiMerger1 pin [0]
  • Connect ColorValue2 pin Out to RGBWColorMultiMerger1 pin [1]
  • Connect RGBWColorMultiMerger1 pin Out to NeoPixels1 pin Color
  • Connect NeoPixels1 pin Out to Arduino Digital Pin 2

Generate, Compile, and Upload the Arduino Code

2020-10-30_13-20-50.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 UNO module, and slide a potentiometer the LED Ring will indicate the Potentiometer position.
You can use this approach in Audio Applications where you need to indicate the Volume position or any other project where some kind of visual indicator is needed.

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

Set the Reversed Direction

2023-10-11_14-47-52.jpg
2023-10-11_14-48-49.jpg
2023-10-11_14-52-54.jpg
LEDRing-reversed.png
  • Add "Subtract Integer From Value" component and in the properties window set "Value" to 12 (The number of LEDs on your LED Ring)
  • Put the component between the "AnalogToUnsigned1" and "NeoPixels1"
  • Connect "AnalogToUnsigned1" pin [Out] to "SubtractFromValue1" and Connect "SubtractFromValue1" pin [Out] to "NeoPixels1" > "Color Pixel1" pin [Index]


Also attached is the Visuino project for the reversed LEDring, Make sure to change the number of LED pixels if you have a different LED ring

Reversed Volume Indicator Video

Volume Indicator Neopixel Ws2812 LED Ring using Visuino

Reversed Volume Indicator project made by Visuino user JP

Optional Improvements

2023-10-12_18-49-30.jpg
2023-10-12_18-56-01.jpg
2023-10-12_18-49-57.jpg
LEDRing-updated.png
LEDRing-reversed-updated.png

To overcome the LED blinking on the LED Ring, you can add "Analog Change Only" component and in the properties set the "Threshold" to 0.05 (or any other value that suits you).

  • Connect Arduino Analog pin [0] Out to "ChangeOnly1" pin [In]
  • Connect "ChangeOnly1" pin [Out] Out to MapRange1 pin [In]