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!
Step 1: What You Will Need
- NeoPixel Shield for Arduino – 40 RGB LED Pixel Matrix
- Arduino UNO
- Visuino software: Download here
Step 2: Brought by PCBWay
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 assembly, 3D printing, CNC machining and a lot more.
Step 3: The Circuit
- Attach the Shield to Arduino Uno
Step 4: Start Visuino, and Select the Arduino UNO Board Type
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
Step 5: In Visuino Add Components
- 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
Step 6: In Visuino Set Components
- 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
Step 7: In Visuino Connect Components
- 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]
Step 8: Generate, Compile, and Upload the Arduino Code
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.
Step 9: 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
Download neopixel-shield-police-lights.zip