Maker.io main logo

Police Lights Using ATOM Matrix ESP32

2026-05-25 | By Ron Cutts

License: GNU Lesser General Public License LED Strips Microcontrollers Wifi Arduino ESP32

In this tutorial, you will see how to make police lights using the ATOM Matrix ESP32.

Watch the video!

Learn more about Visuino: What is Visuino

What You Will Need

What You Will Need

What You Will Need photo 2

Start Visuino, and Select the Atom Matrix Board Type

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 "Atom Matrix" as shown in Picture 2

Start Visuino, and Select the Atom Matrix Board Type

Start Visuino, and Select the Atom Matrix Board Type photo 2

In Visuino, Add Components

  • Add "Toggle(T) Flip-Flop" component

  • Add "Delay" component

  • Add "Sequence" component

  • Add "Color Value" component

In Visuino Add Components

In Visuino Add Components photo 2

In Visuino Add Components photo 3

In Visuino Add Components photo 4

In Visuino Set Components

  • Select "M5 Stack ATOM Matrix" board, and in the properties window, expand "Modules">"RGB Matrix">"Elements" and click on the 3 dots button

  • In the "Elements" window, drag "Fill Screen" to the left side and in the properties window select "Color" and click on the Pin Icon and select "Alpha Color SinkPin"

  • Close the "Elements" window

Double-click on the "ColorValue1" and in the Elements window:

  • Drag "Set Value" to the left side and in the properties window, set "Color" to clRed

  • Drag another "Set Value" to the left side

  • Drag another "Set Value" to the left side and in the properties window, set "Color" to clBlue

  • Close the Elements window

Select "Sequence1" and in the properties window set "Enabled" to False, click on the Pin icon, and select "Boolean SinkPin"

Double-click on "Sequence1" and in the Elements window:

  • Drag "Repeat" to the left side, and in the Properties window, select "Elements" and click on the 3 dots button, and in the Elements window, drag 2X "Digital Period" to the left side, and in the Properties window for each, set "Delay" to 50. Close the Elements window

  • Drag another "Repeat" to the left side, and in the Properties window, select "Elements" and click on the 3 dots button, and in the Elements window, drag 2X "Digital Period" to the left side, and in the Properties window for each, set "Delay" to 50. Close the Elements window

  • Close the Elements window

In Visuino Set Components

In Visuino Set Components photo 2

In Visuino Set Components photo 3

In Visuino Set Components photo 4

In Visuino Set Components photo 5

In Visuino Set Components photo 6

In Visuino Set Components photo 7

In Visuino Set Components photo 8

In Visuino Set Components photo 9

In Visuino Set Components photo 10

In Visuino Set Components photo 11

In Visuino Set Components photo 12

In Visuino Set Components photo 13

In Visuino Set Components photo 14

In Visuino Set Components photo 15

In Visuino Connect Components

  • Connect "M5 Stack ATOM Matrix" > "Button" pin [Out] to "TFlipFlop1" pin [Clock]

  • Connect "TFlipFlop1" pin [Out] to "Sequence1" pin [Enabled]

  • Connect "TFlipFlop1" pin [Inverted] to "Delay1" pin [Start]

  • Connect "Sequence1" > "Repeat1" > "Digital Period1" pin [Out] to "ColorValue1" > "Set Value1" pin [In]

  • Connect "Sequence1" > "Repeat1" > "Digital Period1" pin [Out] to "ColorValue1" > "Set Value2" pin [In]

  • Connect "Sequence1" > "Repeat2" > "Digital Period1" pin [Out] to "ColorValue1" > "Set Value3" pin [In]

  • Connect "Sequence1" > "Repeat2" > "Digital Period1" pin [Out] to "ColorValue1" > "Set Value2" pin [In]

  • Connect "Delay1" pin [Out] "ColorValue1" pin [Clock]

  • Connect "ColorValue1" pin [Out] to "M5 Stack ATOM Matrix" > "Fill Screen1" Pin [Color]

  • Connect "ColorValue1" pin [Out] to "M5 Stack ATOM Matrix" > "Fill Screen1" Pin [Clock]

In Visuino Connect Components

In Visuino Connect Components photo 2

Generate, Compile, and Upload the Arduino Code

In Visuino, at the bottom, click on the "Build" tab, make sure the correct port is selected, and then click on the "Compile/Build and Upload" button.

Generate, Compile, and Upload the Arduino Code

Play

If you power the ATOM Matrix module and push the Matrix button, the display will start to flash the red and blue colors like police lights; if you press the Matrix button again, the display will turn off.

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

Downloads

Mfr Part # C008-B
ATOM MATRIX ESP32 EVAL BRD
M5Stack Technology Co., Ltd.
€ 13,17
View More Details
Add all DigiKey Parts to Cart
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.