Welcome to TinyF Laser Ranging Module repository
microbit
TinyF and microbit serial communication
TinyF and microbit serial communication0. Introduction to TinyF1. Experimental Preparation2. Experimental wiring3. Main code explanation4. Experimental Phenomena5.Some important parameters of TinyF
0. Introduction to TinyF
- The TinyF laser ranging module is based on a D-TOF single-point laser sensor, an onboard MCU, and a housing. It features built-in sunlight rejection and anti-cover contamination algorithms, enabling accurate and rapid distance measurement. Even in extremely bright ambient light (100-190K Lux), it can accurately measure even the smallest objects, unaffected by variations in reflectivity, achieving precise ranging of 2m to 4m.
1. Experimental Preparation
- TinyF laser ranging module
- This tutorial uses a micro:bit
- Superbit 2.0 multi-function expansion board + 18650 battery(optional)
2. Experimental wiring
| microbit | TinyF |
|---|---|
| P1 | TX |
| GND | GND |
| 5V | 5V |
Wiring diagram

3. Main code explanation
4. Experimental Phenomena
- Upload the hex program provided by the example to the microbit
- Connect the wires according to the wiring diagram, plug in the battery, and turn on the switch.
- Set the serial port assistant to the interface shown in the figure
- After power on, the serial port assistant will print the following information
5.Some important parameters of TinyF
Related parameter description
| name | value |
|---|---|
| Baud rate | 115200 |
| Effective minimum distance (theoretical value) | 20,unit:mm |
| Effective maximum distance (theoretical value) | 4000,unit:mm |
| Confidence | 0~62,The larger the value, the higher the distance reliability. |
Data format
Data frame structure: 
Example: 
| Field | Number of bytes | Example(Hex) | ASCII characters |
|---|---|---|---|
| Frame header (fixed value) | 1 | 20 | space |
| Distance value(distance) | 1~5 | 33 32 37 | 327 |
| Delimiter (fixed value) | 2 | 2C 20 | ,space |
| Confidence(confidence) | 1~2 | 36 31 | 61 |
| Frame tail (fixed value) | 1 | 0A | \n |