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:
The sensor and OLED display can easily connected with Sparkfun Thing Plus for Matter - MGM240 development kits via Qwiic connector.
Getting started with CircuitPython on EFR32 boards.
To run the example you need to install Thonny editor and then follow the steps below:
- 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.
-
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 -
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.
-
Run the scripts on the board.
-
- [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)
- [Char] Lower Threshold Value - threshold_value_lower
- [Service] Distance Monitor
Run the code.py file, monitor the OLED, and try to place your hand beyond the sensor you will see the result below.