Skip to content

Latest commit

 

History

History

cp_bluetooth_distance_monitor

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

CircuitPython - Bluetooth - Distance Monitor (VL53L1X)

Type badge Technology badge License badge

Overview

This project shows a demonstration of a Bluetooth Low Energy distance monitor system using SparkFun Thing Plus Matter - MGM240P development kit and the integrated CircuitPython BLE Stack.

The block diagram of this application is shown in the image below:

overview

Hardware Required

Connections Required

The sensor and OLED display can easily connected with Sparkfun Thing Plus for Matter - MGM240 development kits via Qwiic connector.

Prerequisites

Getting started with CircuitPython on EFR32 boards.

Setup

To run the example you need to install Thonny editor and then follow the steps below:

  1. Flash the corresponding CircuitPython binary for your board. You can visit circuitpython.org/downloads to download the binary.

NOTE: The examples in this repository require CircuitPython v8.2.0 or higher.

  1. The lib folder on github contains the necessary library files. You can get updates from the bundle here. The libraries used in this project are listed below.

    Library Version
    adafruit_framebuf 1.6.1
    adafruit_ssd1306 2.12.2
    adafruit_vl53l1x 1.1.10
  2. Upload all the files and folders from the device_root folder to the CircuitPython device. The files and folders should be copied into the root of the file system on the target device.

  3. Run the scripts on the board.

How it Works

  • Initialization

    Initialization.

  • Runtime operation

    Runtime operation.

  • GATT database

    • [Service] Distance Monitor
      • [Char] Lower Threshold Value - threshold_value_lower
        • [R] Get lower threshold value (mm)
        • [W] Set lower threshold value (mm)
      • [Char] Upper Threshold Value - threshold_value_upper
        • [R] Get upper threshold value (mm)
        • [W] Set upper threshold value (mm)
      • [Char] Threshold Mode - threshold_mode
        • [R] Get threshold mode (0-2)
        • [W] Set threshold mode (0-2)
      • [Char] Range Mode - range_mode
        • [R] Get configured range mode (0-1)
        • [W] Set range mode (0-1)
      • [Char] Notification Status - notification_status
        • [R] Get configured notification status (0-2)
        • [W] Set notification status (0-2)

Output

Run the code.py file, monitor the OLED, and try to place your hand beyond the sensor you will see the result below.

result