Example Code for Raspberry Pi-Wakeup Function

Last revision 2025/12/17

This article guides you through setting up a wakeup function using a Raspberry Pi and H3LIS200DL accelerometer, covering hardware and software preparations, wiring connections, and executing the sample code to achieve the desired functionality.

Hardware Preparation

Software Preparation

Wiring Diagram

  • Connect the module to the Raspberry Pi according to the connection diagram. The default I2C address is 0x19. Connect the interrupt pin (INT1) to a GPIO pin of the Raspberry Pi.

Other Preparation Work

  1. Complete the I2C setup and library installation as described in the "Read Acceleration" example.
  2. Navigate to the sample code directory:
    cd DFRobot_LIS/python/raspberrypi/examples/H3LIS200DL/wake_up
    

Sample Code

Run the sample code:

python wake_up.py

Result

When the acceleration exceeds the threshold, the module wakes up from low-power mode, and "wake up" is printed on the terminal.

Ensure the interrupt pin is correctly connected to the Raspberry Pi's GPIO pin.

Was this article helpful?

TOP