Tags: TFMini, Micro, LiDAR, Module, distance, ir, led, project, arduino,

TFMini - Micro LiDAR Module

  • 170.00 AED
    • Ex Tax:170.00 AED
    • Product Code: TFMini Micro LiDAR
    • Availability: In Stock
    The TFMini is a ToF (Time of Flight) LiDAR sensor capable of measuring the distance to an object as close as 30 centimeters and as far as 12 meters! As with all LiDAR sensors, your effective detection distance will vary depending on lighting conditions and the reflectivity of your target object, but..

    The TFMini is a ToF (Time of Flight) LiDAR sensor capable of measuring the distance to an object as close as 30 centimeters and as far as 12 meters! As with all LiDAR sensors, your effective detection distance will vary depending on lighting conditions and the reflectivity of your target object, but what makes this sensor special is its size. Measuring only 42x15x16mm, the TFMini allows you to integrate LiDAR into applications traditionally reserved for smaller sensors such as the SHARP GP-series infrared rangefinders. The TFMini is easy to power at only 5V and easy to talk to using a 3.3V UART at 115200 baud.

    Specs:

    • Input Voltage: 5V
    • Average Power: ≤120mW
    • LED Peak Current: 800mA
    • UART TTL Voltage: 3.3V
    • Baud Rate: 115200 8N1
    • Resolution: 5mm
    • Minimum Detected Object Size at 2m: 20mm
    • Operating Wavelength: 850nm
    • Signal Acceptance Angle: 2.3°

    Hardware Overview

    The sensor works by sending a modulated near-infrared light out. The light that is reflected from the object returns to the sensor's receiver. The distance between the two can be converted using the sensor by calculating the time and phase difference. The distance measured may vary depending on the environment and the reflectivity of object.

    Input Power

    According to the datasheet (pg 4) the input voltage is between 4.5V-6V. In this tutorial, we will be applying 5V to the sensor.

    Logic Levels

    While the sensor can be powered at 5V, the serial UART pins are only 3.3V logic. Make sure to use a logic level converter when reading the sensor with a 5V microcontroller.

    Pinout

    There is a marking next to the polarized connector to indicate the polarity as "J1" as indicated in the image below. This is useful when referencing sensor's pinout.

    TFMini  Pinout

    Pin NumberTFMini PinoutWire Color
    1UART_TX (3.3V TTL)Green
    2UART_RX (3.3V TTL)White
    35VRed
    4GNDBlack

    Hardware Hookup

    For the purpose of this tutorial, we will be using a 5V Arduino. A microcontroller and logic level converter is required in order to read the sensor values through the serial UART pins. Make sure to solder the male header pins to the converter before making the connections on a breadboard. Begin by making a connection from an Arduino's high side and following the connection to the TFMini. Then continue to make the rest of the connections by following the hookup table listed below.

    5V Arduino w/ Atmega328PLogic Level Converter (High Side)Logic Level Converter (Low Side)TFMini
    Software Serial RX 
    (Pin 10)
    HV1LV1UART_TX (3.3V TTL) 
    (Pin 1)
    Software Serial TX 
    (Pin 11)
    HV4LV4UART_RX (3.3V TTL) 
    (Pin 2)
    3.3VLV
    5VHVVin (4.5V-6V) 
    (Pin 3)
    GNDGNDGNDGND 
    (Pin 4)

    Once we are finished, it should look like the image below.

    Connecting the TFMini with Arduino

    Example Code

    Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE. If you have not previously installed an Arduino library.

    Download and install Peter Jansen's Arduino TFMini library using the library manager. You can also manually install it from the GitHub Repository by downloading the library from the button below.

    Arduino code :


    #include <SoftwareSerial.h>

    #include "TFMini.h"


    SoftwareSerial mySerial(10, 11);      // Uno RX (TFMINI TX), Uno TX (TFMINI RX)

    TFMini tfmini;

    void setup() {

     Serial.begin(115200);

     while (!Serial);

     Serial.println ("Initializing...");

     mySerial.begin(TFMINI_BAUDRATE);

     tfmini.begin(&mySerial); }

    void loop() {

     uint16_t dist = tfmini.getDistance();

     uint16_t strength = tfmini.getRecentSignalStrength();

     Serial.print(dist);

     Serial.print(" cm      sigstr: ");

     Serial.println(strength);

     delay(25);  

    }


    Once uploaded, try moving an object in front of the sensor to test. In the example below, a third hand was used to hold the TFMini when detecting an object at a certain distance away from the sensor. Since the sensor is not able to detect an object when less than 11.8 inches (or 30cm = 0.3m) away, the object under test was placed at 20 inches and 30 inches.

    TFMini Reading an Object at 20 InchesTFMini Reading an Object at 30 Inches

    Opening the serial monitor at 115200, you may see an output similar to the values printed below. Using a yard stick, the values responded as expected when moving an object between 20 inches and 30 inches.

    Initializing...
    54 cm      sigstr: 457
    54 cm      sigstr: 456
    54 cm      sigstr: 456
    54 cm      sigstr: 456
    55 cm      sigstr: 456
    54 cm      sigstr: 456
    54 cm      sigstr: 456
    54 cm      sigstr: 457
    67 cm      sigstr: 340
    70 cm      sigstr: 315
    71 cm      sigstr: 315
    77 cm      sigstr: 283
    77 cm      sigstr: 283
    77 cm      sigstr: 283
    77 cm      sigstr: 283
    77 cm      sigstr: 284
    78 cm      sigstr: 281
    78 cm      sigstr: 281
    78 cm      sigstr: 282
    78 cm      sigstr: 282
    78 cm      sigstr: 283
    

    Resources and Going Further

    Now that you've successfully got your TFMini up and running, it's time to incorporate it into your own project! For more on the TFMini, check out the links below: