Introduction: M5StickC-ESP32 Mini PIR Alarm System
In this project we will learn how to make a mini Alarm Warning using a mini PIR sensor and a M5StickC ESP32 board.
Watch the video!
Step 1: What You Will Need
- M5StickC ESP32
- Mini PIR Sensor
- Visuino software: Download Visuino here: https://www.visuino.eu
Step 2: 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
Step 3: 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 on Picture 2
- 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 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
Step 6: 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.
Step 7: Play
If you power the M5StickC module the PIR sensor will activate the movement by flashing 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 Instructable, you can download it and open it in Visuino: https://www.visuino.eu