Arduino NeoPixel LED Ring Fire Simulation

by RonFrtek in Circuits > Arduino

323 Views, 4 Favorites, 0 Comments

Arduino NeoPixel LED Ring Fire Simulation

Arduino NeoPixel LED Ring Fire Simulation

In this tutorial we will learn how to make a Fire simulation using the Neopixel Led Ring Ws2812 and Arduino.

Watch the video!

What You Will Need

Adafruit-1643-30091150-01.jpg
arduino.jpg
jumper-wires.jpg
VisuinoAdvrtisementPLCXPertTinyLab (1).jpg


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

2022-10-20_16-40-32.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

FRWQB80K1RVKKV9.LARGE.jpg
Visuino-Select-Board-UNO.jpg

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-10-20_16-52-03.jpg
2022-10-20_16-51-18.jpg
2022-10-20_16-50-33.jpg
2022-10-20_16-49-21.jpg
2022-10-20_16-48-31.jpg
  1. Add "Random Clock Generator" component
  2. Add "Clock Multi Source" component
  3. Add "Random Color" component
  4. Add "Random Integer Generator" component
  5. Add "NeoPixels" component


In Visuino Set Components

2022-10-20_16-54-24.jpg
2022-10-20_16-53-57.jpg
2022-10-20_16-53-19.jpg
2022-10-20_16-54-47.jpg
2022-10-20_16-55-11.jpg
  • Select "RandomClockGenerator1" and in the properties window set "Max Frequency" to 20 and "Min Frequency" to 10
  • Select "RandomColor1" and in the properties window set "Max" to clRed and "Min" to $000080FF <<Orange
  • Select "RandomIntegerGenerator1" and in the properties set "Max" to 16 and "Min" to 0

Note if you are using a LED Ring with more or less then 16 LEDs then replace the number 16 with your number of LEDs

  • 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)
  • Close the "PixelGroups" window




In Visuino Connect Components

2022-10-20_16-55-45.jpg
  1. Connect "RandomClockGenerator1" pin [Out] to "ClockMultiSource1" component pin [In]
  2. Connect "ClockMultiSource1" pin [0] to "RandomColor1" component pin [Clock]
  3. Connect "ClockMultiSource1" pin [1] to "RandomIntegerGenerator1" component pin [Clock]
  4. Connect "RandomColor1" component pin [Out] to "NeoPixels1" >Color Pixel1 component pin [Color]
  5. Connect "RandomIntegerGenerator1" component pin [Out] to "NeoPixels1" >Color Pixel1 component pin [Index]
  6. Connect "NeoPixels1" component pin [Out] to Arduino digital pin[6]


Generate, Compile, and Upload the Arduino Code

Visuino-Compile-UNO.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, athe LED ring will start to change its colors that will imitate the fire.

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