• 1
    Hardware requirements

    For this tutorial, we have decided to use the M5Stack Ecosystem because it enables building such a system without prototyping specific tools, such as a soldering iron or prototyping cables. The brain of this project is the M5Core2, an IoT development kit based on the ESP32 microcontroller. This ecosystem allows you to connect the provided modules through a GROVE port to the M5Core2, allowing fast deployment of hardware.


    The modules we’ve picked for this tutorial are M5Stack’s Ultrasonic Distance Unit and PIR Motion Sensor.

    M5Stack’s Ultrasonic Distance Unit and PIR Motion Sensor
  • 2
    Wire Connections
    • Connect the Ultrasonic Distance Unit to PORT A of the M5Core2 (the red port near the USB-C connector) using the Grove cable. This unit uses the I2C protocol to send data to the M5Core2.
    • Take out the CORE2 plate on the back to expose the pins.
    • Connect the PIR Motion Sensor using the Grove cable, the Grove to 4 Pin connector and the male to male Dupont wires to the following pins:
    BLACK  - GND
    RED    - 5V
    YELLOW - G36
    WHITE  - G26
  • 3


    • Install Thonny following the steps on the official website.
    Thonny Python IDE