Police Lights Using NeoPixel Shield for Arduino RGB LED

by RonFrtek in Circuits > Arduino

205 Views, 2 Favorites, 0 Comments

Police Lights Using NeoPixel Shield for Arduino RGB LED

Police Lights using NeoPixel Shield for Arduino RGB LED

In this tutorial you will see how to make a Police Lights using the NeoPixel Shield for Arduino - 40 RGB LED Pixel Matrix.

Watch the Video!

What You Will Need

8e0732970d282cde55616075a620930c615a0953_original.jpeg
FZEK4WBK3XGYAP0.LARGE.jpg
VisuinoAdvrtisemenESPNowESP32C3-1.jpg
  • NeoPixel Shield for Arduino - 40 RGB LED Pixel Matrix
  • Arduino UNO
  • Visuino software: Download here


Brought by PCBWay

2022-08-26_13-41-18.jpg

Thank you PCBWay for supporting this tutorial and helping users learn more about electronics.

What I like about the PCBWay is that you can get 10 boards for approximately $5 which is really cost effective for professional made boards, not to mention how much time you save!

Go check them out here. They also offer a lot of other stuff in case you might need it like assembly3D printingCNC machining and a lot more.

The Circuit

8e0732970d282cde55616075a620930c615a0953_original.jpeg

Attach the Shield to Arduino Uno

Start Visuino, and Select the Arduino UNO Board Type

select-board-uno.jpg
Visuino-Select-Board-UNO.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

2022-12-06_0-47-28.jpg
2022-12-06_0-48-33.jpg
2022-12-06_0-49-51.jpg
2022-12-06_1-00-12.jpg
2022-12-06_1-00-46.jpg
2022-12-06_1-01-35.jpg
2022-12-06_1-02-41.jpg
2022-12-06_0-05-21.jpg
  • Add "Pulse Generator" component
  • Add "Digital Multi Source" component
  • Add "Counter" component
  • Add "Compare Integer Range" component
  • Add 3X "Color Value" component
  • Add "Detect Edge" component
  • Add "Color Toggle Switch" component
  • Add "NeoPixels" component

In Visuino Set Components

2022-12-06_0-56-19.jpg
2022-12-06_0-56-36.jpg
2022-12-06_0-56-51.jpg
2022-12-06_0-57-09.jpg
2022-12-06_0-57-42.jpg
2022-12-06_0-58-04.jpg
2022-12-06_0-58-19.jpg
2022-12-06_0-58-38.jpg
2022-12-06_0-58-57.jpg
2022-12-06_0-59-22.jpg
2022-12-06_0-59-37.jpg
  • Select "PulseGenerator1" and in the properties window set "Frequency (Hz)" to 10
  • Select "Digital Multi Source" and in the properties window set "Output Pins" to 3
  • Select "DetectEdge1" and in the properties window set "Rising" to False
  • Select "Counter" and in the properties window set "Max">"Value" to 20
  • Select "Counter" and in the properties window set "Min">"Value" to 0
  • Select "CompareRange1" and in the properties window set "Include Limits" to True and
  • Select "CompareRange1" and in the properties window set "Range">"Max" to 10
  • Select "CompareRange1" and in the properties window set "Range">"Min" to 0
  • Select "ColorValue2" and in the properties window set "Value" to clRed
  • Select "ColorValue3" and in the properties window set "Value" to clBlue
  • Double click on "ColorValue1" component and in the "Elements" Drag "Set Value" to the Left and in the properties window select "Value" and click on the Pin icon and select "Color SinkPin"
  • Close the "Elements" window
  • Double click on "NeoPixels1" component and in the "PixelGroups" Drag "Single Color" drag to the Left and in the properties window set "Count Pixels" to 40
  • Close the "PixelGroups" window

In Visuino Connect Components

2022-12-06_1-22-52.jpg
hgh.png
  • Connect "PulseGenerator1" pin[Out] to "DigitalMultiSource1" pin[In]
  • Connect "DigitalMultiSource1" pin[0] to "ColorValue1"> "Set Value1" pin[In]
  • Connect "DigitalMultiSource1" pin[1] to "DetectEdge1" pin[In]
  • Connect "DigitalMultiSource1" pin[2] to "Counter1" pin[In]
  • Connect "DetectEdge1" pin[Out] to "ColorValue1"> "Set Value2" pin[In]
  • Connect "Counter1" pin[Out] to "CompareRange1" pin[In]
  • Connect "CompareRange1" pin[Out] to "ColorToggleSwitch1" pin[Select]
  • Connect "ColorValue2" pin[Out] to "ColorToggleSwitch1" pin[False]
  • Connect "ColorValue3" pin[Out] to "ColorToggleSwitch1" pin[True]
  • Connect "ColorToggleSwitch1" pin[Out] to "ColorValue1"> "Set Value1" pin[Value]
  • Connect "ColorValue1" pin[Out] "NeoPixels1" > "Color1" pin[Sensor]
  • Connect "NeoPixels1" pin[Sensor] to Arduino digital pin[6]


Generate, Compile, and Upload the Code

FBR42I2KXBU01YW.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 module the LED Pixel Matrix Pixels will start to Flas a Blue and a Red color.

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