Maker.io main logo

M5StickC-ESP32 Mini PIR Alarm System

42

2026-09-30 | By Ron Cutts

Share

License: GNU Lesser General Public License Bluetooth / BLE Microcontrollers Wifi Arduino ESP32

We will learn how to make a mini alarm warning using a mini PIR sensor and an M5StickC ESP32 board.

Watch the video!

Learn more about Visuino: What is Visuino

What You Will Need

What You Will Need

What You Will Need photo 2

What You Will Need photo 3

The Circuit

  • Connect StickC pin 5V to PIR sensor pin VCC (+)

  • Connect StickC pin GND to PIR sensor pin GND (-)

  • Connect StickC pin G26 to PIR sensor pin Out

The Circuit

Start Visuino, and Select the M5 Stack Stick C 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 "M5 Stack Stick C" as shown in Picture 2

Start Visuino, and Select the M5 Stack Stick C Board Type

Start Visuino, and Select the M5 Stack Stick C Board Type photo 2

Step 4

  • Add "Digital (Boolean) Inverter (Not)" component

  • Select "M5 Stack Stick C" board and in the properties window expand Modules>Display ST7735 and:

    • set Orientation to goRight

    • Select Elements and click on the 3 dots button and in the elements window

      • drag "Draw Field" to the left and in the properties window set size to 3 and Text to "ALARM", Color to aclRed

      • drag "Fill Screen" to the left

  • Close the Elements window

Step 4

Step 4 photo 2

Step 4 photo 3

Step 4 photo 4

Step 4 photo 5

In Visuino Connect Components

  • Connect "M5 Stack Stick C" pin GPPIO26 Out to "M5 Stack Stick C" > LED pin In

  • Connect "M5 Stack Stick C" pin GPPIO26 Out to "M5 Stack Stick C" > "Draw Text1" pin Clock

  • Connect "Inverter1" pin Out to "M5 Stack Stick C" > "Fill Screen1" pin Clock

In Visuino Connect Components

In Visuino Connect Components photo 2

In Visuino Connect Components photo 3

Generate, Compile, and Upload the 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.

Generate, Compile, and Upload the Code

Play

If you power the M5StickC module, the PIR sensor will activate the movement by flashing the internal LED and displaying the text "ALARM" on the display.

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

Downloads

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.