M5StickC-ESP32 Mini PIR Alarm System

by RonFrtek in Circuits > Arduino

978 Views, 1 Favorites, 0 Comments

M5StickC-ESP32 Mini PIR Alarm System

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!

What You Will Need

FUPA768K36U3RSQ.LARGE.jpg
61-aFoSutTL._AC_SS350_.jpg
VisuinoAdvrtisementRaspberryPiRobot1.jpg

The Circuit

2020-10-27_18-47-50.jpg

  • 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

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

F5ZAEMUK36U3RS2.LARGE.jpg
FBZIDQ4K36U3RS3.LARGE.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 "M5 Stack Stick C" as shown on Picture 2

2020-10-27_20-48-24.jpg
2020-10-27_20-50-18.jpg
2020-10-27_20-49-36.jpg
2020-10-27_7-56-19.jpg
2020-10-27_7-55-59.jpg
  • 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

In Visuino Connect Components

2020-10-27_20-59-37.jpg
2020-10-27_20-59-53.jpg
stickc-pir.png

  • 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

Generate, Compile, and Upload the Code

2020-10-27_9-31-03.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 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