Project Files of TF-Luna LiDAR Distance Sensor Library for Proteus V1.0
tf-luna-tep-v1-0-1684646237214240b726042f747cba5b.zip

TF-Luna LiDAR Distance Sensor Library for Proteus V1.0
TF-Luna LiDAR Distance Sensor Library for Proteus V1.0 comes as a ZIP archive of 10 files (1.2 MB, 2.7 MB unpacked) holding Proteus library files, simulation model DLLs, a Proteus simulation, an Arduino sketch and compiled HEX firmware.
- LIBProteus library
- DLLProteus model
- DSNProteus simulation
- INOArduino sketch
- HEXHEX firmware
Description
TF-Luna LiDAR Distance Sensor Library for Proteus V1.0 is the download package that goes with our tutorial TF-Luna LiDAR Distance Sensor Library for Proteus V1.0. On this page you can download the ZIP file (1.2 MB) and see what is inside before you save it: 10 files in 5 folders, the Proteus library files (LIB and IDX), the simulation model (DLL), a ready Proteus simulation, an Arduino sketch and the compiled HEX firmware. The tutorial explains the design; this page gets the files onto your computer and into use.
What this library is
TF-Luna-LiDAR-Library-for-Proteus-v1.0.zip with the Benewake TF-Luna LiDAR (0.2 to 8 m, UART and I2C), Simple and Advance (TEPTFLUNA.LIB and TEPTFLUNA.DLL), our Arduino UNO V4.0 library with its built-in serial monitor (ArduinoV4TEP.LIB and TEPARDUINO.DLL), the two-UNO simulation with its HEX file, the demo sketch and a README.
This is version 1.0; older or newer releases, when they exist, are listed in the Development tab.
What is inside the ZIP file
- ArduinoV4TEP.LIB – Proteus library, 201.9 KB
- TEPTFLUNA.LIB – Proteus library, 50.3 KB
- TEPARDUINO.DLL – Simulation model, 883.5 KB
- TEPTFLUNA.DLL – Simulation model, 309.5 KB
- TF-Luna-LiDAR-ArduinoUnoV4.pdsprj – Proteus simulation, 23.7 KB
- TFLuna_LiDAR_Demo.ino – Arduino sketch, 7.7 KB
- and 4 more, all listed in the File Structure tab
The archive unpacks to 2.7 MB and carries its own README (README.txt), shown in the README tab above.
How to download
Use the download panel at the top of this page: after the counter (30 seconds for guests, 10 for members) the black button unlocks and the ZIP file comes straight from our content network. If the browser opens it instead of saving, use Save as; extract the whole archive before using anything inside it.
How to install
- Step 1: Extract the ZIP file with Windows (Extract All), 7-Zip or WinRAR, keeping its folders.
- Step 2: Close Proteus and copy ArduinoV4TEP.LIB and TEPTFLUNA.LIB into its LIBRARY folder (Proteus 8: C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY).
- Step 3: Copy TEPARDUINO.DLL and TEPTFLUNA.DLL into the MODELS folder next to it, so the part simulates.
- Step 4: Start Proteus, press P and search for "ArduinoV4TEP"; place and wire it as in the tutorial.
- Step 5: Open TFLuna_LiDAR_Demo.ino in the Arduino IDE, pick board and port and Verify (Export Compiled Binary gives the HEX).
- Step 6: In Proteus set the controller's Program File to TFLuna_LiDAR_Demo.hex; on hardware, flash the same file.
- Step 7: Open TF-Luna-LiDAR-ArduinoUnoV4.pdsprj in Proteus and press Play.
Read the detailed guide
This page is for the files. The tutorial above explains the circuit and the code step by step and shows the working results and the simulation; read it before you build. Questions about the download or the installation go in the comments below; more Proteus downloads are listed further down this page.
File Structure
7.7 KB201.9 KB50.3 KB883.5 KB309.5 KB883.5 KB309.5 KB23.7 KB34.1 KB24.3 KBGallery12 images from the tutorialOpen the tutorial
The circuit, the board and the results as they appear in TF-Luna LiDAR Distance Sensor Library for Proteus V1.0. Open an image for its full size.












README
TF-LUNA LIDAR DISTANCE SENSOR LIBRARY FOR PROTEUS - V1.0 (0.2 to 8 m, UART and I2C)
Designed by The Engineering Projects
www.TheEngineeringProjects.com
IMPORTANT LINKS
Article (read it first - pictures, step by step, every feature explained):
https://www.theengineeringprojects.com/2026/10/tf-luna-lidar-sensor-library-for-proteus-v1-0.html
Report a bug or suggest a feature (our forum):
https://www.theengineeringprojects.com/forum/category/tf-luna-lidar-proteus-library
The demo runs on our Arduino UNO V4.0 (included) - working LEDs, RESET and a
built-in serial monitor, no Virtual Terminal to wire - its own article:
https://www.theengineeringprojects.com/2026/10/arduino-uno-library-for-proteus-v40.html
The built-in monitor is our TEP Serial Monitor Advance - its own article:
https://www.theengineeringprojects.com/2026/10/serial-monitor-advance-proteus-library.html
Support us (the libraries are free):
https://www.theengineeringprojects.com/donate
FILE STRUCTURE
TF-Luna-TEP-v1.0/
|-- Proteus Library Files/
| |-- ArduinoV4TEP.LIB 201.9 KB TEP Arduino boards V4.0 (UNO), to LIBRARY
| |-- TEPTFLUNA.LIB 50.3 KB the TF-Luna, to LIBRARY
|-- Proteus Model Files/
| |-- TEPARDUINO.DLL 883.5 KB the Arduino board model, to MODELS
| |-- TEPTFLUNA.DLL 309.5 KB the TF-Luna model, to MODELS
|-- Proteus Simulation/
| |-- TEPARDUINO.DLL 883.5 KB copy of the board model
| |-- TEPTFLUNA.DLL 309.5 KB copy of the model
| |-- TFLuna_LiDAR_Demo.hex 34.1 KB both UNOs (demo sketch V1.0)
| |-- TF-Luna-LiDAR-ArduinoUnoV4.pdsprj 23.7 KB demo: 2 UNOs, 2 modules
|-- Arduino Code/
| |-- TFLuna_LiDAR_Demo/TFLuna_LiDAR_Demo.ino 7.7 KB the demo sketch (source of the .hex)
|-- README.txt ~25.2 KB this file
Total: 2.67 MB (unzipped). The C++ source code of the model is not included.
WHAT IS IT?
A simulation model of the Benewake TF-Luna, a small single-point LiDAR: it
sends modulated infrared light and measures the distance from the phase of
the reflection (time of flight), 0.2 to 8 m. Our own model, written from the
manual (SJ-PM-TF-Luna A03), not a part that shows a number:
* Two interfaces, chosen by pin 5 (CFG) at power-on: open (or 3.3 V) =
UART at 115200 baud 8N1; to GND = I2C at address 0x10. The module draws
the interface it chose on its body.
* UART: a 9-byte frame per measurement - 0x59 0x59, Dist, Amp, Temp (two
bytes each, low byte first) and the low byte of the sum of the first 8.
Dist in cm (or mm with the format command), Temp = raw / 8 - 256 C.
* The 0x5A commands of the manual: version (0x01), soft reset (0x02), frame
rate (0x03 - 0 = trigger mode), trigger (0x04), format (0x05), baud rate
(0x06 - it starts after the module's answer), output on / off (0x07),
checksum check (0x08), I2C address (0x0B), restore defaults (0x10), save
(0x11), amp threshold (0x22), distance limit (0x3A), read the settings
(0x3F). Each gets its answer, with the same ID. Nothing is kept at
power-off unless it was saved.
* I2C: the register file of the manual (0x00 - 0x31): DIST 0x00, AMP 0x02,
TEMP 0x04 (in 0.01 C), TICK, VERSION 0x0A, SAVE 0x20, SHUTDOWN / REBOOT
0x21, SLAVE_ADDR 0x22 (used after SAVE and REBOOT), MODE 0x23 (0 =
continuous, 1 = trigger), TRIG_ONE_SHOT 0x24, ENABLE 0x25, FPS 0x26,
AMP_THR, DUMMY_DIST, MIN_DIST and MAX_DIST. Pin 6 (MUX) is HIGH when a
new measurement is ready and LOW after the Arduino reads it.
* The frame rate: 500 measurements a second averaged into frames of 1 to
250 Hz (500 / n only - 100 Hz by default); a slower rate averages more
and is quieter.
* The signal: Amp (the strength) falls with the square of the distance -
the model gives Amp 100 at 8 m for a white target (90 %) and at 2.5 m
for a black one (10 %). Below the threshold (Amp 100) the module sends
Dist = 0, the dummy value. The noise follows the manual's table: about
3 cm at Amp 100, 1 cm at Amp 1000, 0.5 cm at Amp 2000 or more (100 Hz).
* Under 20 cm (the dead zone) the readings are unreliable: the model reads
a few cm too far with a jumpy noise. A spot on two surfaces (EDGE: half
on the target, half on a wall 1 m behind it) reads a value in between.
* The target in front: its distance (property DISTANCE; 0 = nothing), the
panel's - / + (10 cm a click) and presets (10, 50, 100, 200, 400, 800 cm
and NONE), and four actions: SWEEP 20-800 (20 to 800 cm and back in
16 s), APPROACH (from 300 cm to 5 cm in 10 s, slower as it comes close),
BLACK (a black target, on / off) and EDGE (on / off).
* The chip's temperature (property TEMP, 35 C) in every frame and register.
The module is drawn at about three times its real size (35 x 21 mm): the
black body with its two lenses - the transmitter, whose red light is on
while the module measures, and the receiver - and the 6-pin connector with
its cable (1 +5V, 2 RXD/SDA, 3 TXD/SCL, 4 GND, 5 CFG, 6 MUX). ON the body, as
TEP additions: the SIMPLE / ADVANCE badge, the interface label, the DATA LED
and the panel button. The LED, the badge, the label, the button and the
panels are TEP additions; the real module has none of them (its light is
infrared and invisible).
TWO DEVICES IN ONE LIBRARY (search "TFLUNA" or "LUNA" in Pick Devices):
Simple TFLUNATEP "TF-Luna LiDAR Distance Sensor V1.0 - Simple"
Advance TFLUNAADVTEP (the same, "- Advance")
(pins VCC, RXD, TXD, GND, CFG and MUX on the connector, on the
left; category Sensors > Distance)
Simple On-Sheet Panel: the STATUS panel under the module - the banner
(READS ... cm - THE TARGET AT ... cm, AMP ... - the interface; in
amber when the signal is too weak or nothing is there, red in the
dead zone), THE TARGET - / + with a ruler (0 to 800 cm, the range
shaded), seven presets, four actions, ten readouts (STATE,
INTERFACE, THE TARGET, DIST, AMP, TEMP, FRAME RATE, FRAMES, PIN 6,
THE BUS) and the last 4 events. The red X closes the panel,
PANEL: ON / OFF on the module opens it.
Advance Pop-Up Panel: only the module on the schematic; at Run a TEP
pop-up window opens - the look of the TEP Serial Monitor. Tabs
Sensor, Event log and Tests; gear and ? icons for Settings and
Help; the palette icon switches the theme:
Sensor the presets on the toolbar; THE TARGET IN FRONT
(-50 / -10 / +10 / +50 cm, SWEEP 20-800, APPROACH,
BLACK, EDGE, a side view with the beam and the
range); WHAT THE MODULE REPORTS (Dist, Amp, Temp,
the interface); the last frame byte by byte with the
last commands (UART) or the data registers and pin 6
(I2C); the last frames, newest first
Event log power, the data, the bus (commands, register
writes), the target, notes, warnings; filters All /
Data / The bus / Warnings, Pause, Clear
Tests Frames & commands, Registers, Range & signal (THE
TEST TOOLS)
Settings theme, text size, open at Run, window size
Help report a bug, suggest a feature, article, updates,
donate, forum; Copy diagnostics for a bug report
The OPEN PANEL button on the module opens the window again.
Both devices use one model, TEPTFLUNA.DLL.
TEST STATUS
V1.0: verified in Proteus 8.5 on 17 Oct 2026 (the demo project as shipped:
two Arduino UNO V4.0 boards with their built-in monitors; node 1 with the
Simple module in I2C (pin 5 to GND) and the target at 150 cm, node 2 with the
Advance module in UART (pin 5 open, D4 to GND) and the target at 300 cm).
What the runs showed:
* ARD1 reads the version over I2C - "I2C at 0x10: SDA / SCL, pin 6 on D2 -
version 1.0.0" - then "#1 150 cm amp 2826 34.8 C (102 frames/s)".
ARD2 sets its TF-Luna to 9600 baud and 10 Hz (at 115200) and prints each
frame: "#1 59 59 2C 01 B9 02 18 09 BB 300 cm amp 697 35.0 C (10
frames/s)".
* U2's pop-up and monitor: 100 cm - "59 59 64 00 AD 18 18 09 FC 100 cm
amp 6317"; RAW - "RAW: the last frame 59 59 64 00 C9 18 17 09 17"; BLACK
at 400 cm - "0 cm amp 40 ... - amp under 100: no reliable distance";
EDGE at 100 cm (a wall 1 m behind) - 120 cm; 10 cm - 15 to 24 cm, "under
20 cm: unreliable"; SWEEP 20-800 - up to 761 cm, with one "0 cm amp 99"
near 750 cm; TRIG - one frame for each TRIG; the three tools and the
Event log.
* U1 with the real mouse (3 wheel steps on U1): 800 cm - "797 cm amp 100"
and now and then "0 cm amp 99" (the end of the range); NONE - "0 cm amp
12"; APPROACH - down to 20 cm, then 15 to 21 cm; 50 cm and FPS 250 -
"(250 frames/s)"; RAW - "RAW: registers 0x00 - 0x0C 31 00 2E 65 9D 0D CD
1B 00 00 00 00 01"; TRIG; U1's red X and PANEL.
* 89.8 s of simulation took 202 s - about 0.44 x real time with the pop-up
and both monitors open.
Plus automatic checks on a PC, 0 failed: 47 on the model (both interfaces
bit by bit, the commands, the registers and pin 6, the signal and the dead
zone) and 7 on the pop-up; the demo project read back from disk (81
checks: devices, pins, wires, labels; no wire through a part, no wire
crossing).
INSTALLATION (about 2 minutes)
1. Close Proteus. Extract the WHOLE ZIP to a normal folder (e.g. Desktop).
2. Copy everything in "Proteus Library Files" (TEPTFLUNA.LIB with the two
parts, and our Arduino library V4.0, ArduinoV4TEP.LIB, with the ARDUINO
UNO V4.0 used by the demo) to the LIBRARY folder of Proteus, for example:
C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY
(on some PCs: C:\ProgramData\Labcenter Electronics\Proteus 8 Professional\
LIBRARY - use the folder that already holds Proteus's own .LIB files).
3. Copy TEPTFLUNA.DLL and TEPARDUINO.DLL from "Proteus Model Files" to the
MODELS folder (...\Proteus 8 Professional\MODELS).
ArduinoV4TEP.LIB and TEPARDUINO.DLL are the files of our Arduino Library
V4.0 - if you have it, they are the same.
4. Delete TEPTFLUNA.IDX from the LIBRARY folder if it is there (Proteus
makes a new index).
5. Start Proteus. In Pick Devices (P) search "TFLUNA" (or "LUNA").
RUN THE DEMO
"Proteus Simulation\TF-Luna-LiDAR-ArduinoUnoV4.pdsprj" - keep the .hex file
and the two DLLs beside the project.
ARD1: Arduino UNO V4.0 + U1 = a TF-Luna (Simple) in I2C (pin 5 to GND),
the target at 150 cm; pin 6 on D2; D4 open.
ARD2: Arduino UNO V4.0 + U2 = a TF-Luna (Advance) in UART (pin 5 open),
the target at 300 cm; D4 to GND.
Both UNOs run TFLuna_LiDAR_Demo.hex and each has its serial monitor built
in ("TEP Arduino UNO - ARD1" / "- ARD2").
1. Press Run. Both UNOs' monitor windows open (9600 baud) and so does the
pop-up of U2 (move it aside - it opens over the schematic).
2. ARD1 reads the version over I2C, then reads Dist, Amp and Temp each
time pin 6 says new data is ready; ARD2 tells its TF-Luna (at 115200
baud) to talk at 9600 baud and send 10 frames a second, then reads the
frames. Twice a second each prints the latest reading (ARD2 with the
frame's 9 bytes) and how many frames came.
3. Move the target on U1's STATUS panel or in U2's pop-up (- / +, the
presets): the next reading follows. SWEEP 20-800 and APPROACH move it.
4. 800 cm or NONE: Amp falls under 100 and Dist becomes 0. BLACK: a black
target - out of reach beyond about 2.5 m. 10 cm: the dead zone. EDGE:
a reading between the target and the wall behind it.
5. Type in a monitor: FPS 250 (a frame rate), TRIG (trigger mode - one
frame per TRIG), CONT (continuous again), RAW (the last frame, or the
registers 0x00 - 0x0C over I2C).
6. U1: close its panel with the red X, open it with PANEL on the module.
U2 (Advance): Sensor, Event log, and Tests - Frames & commands,
Registers, Range & signal.
Closed a monitor window? Click the UNO's USB port.
WIRING (the same in Proteus and on a real board)
TF-Luna I2C (pin 5 to GND) UART (pin 5 open)
1 +5V 5V 5V
2 RXD/SDA SDA (A4) D9 (AltSoftSerial TX)
3 TXD/SCL SCL (A5) D8 (AltSoftSerial RX)
4 GND GND GND
5 CFG GND open
6 MUX D2 (data ready) -
The demo reads D4: open = I2C, to GND = UART.
An UNO has one hardware serial port (D0 / D1 - the monitor), and
AltSoftSerial cannot receive 115200 baud, so the sketch first sends
5A 08 06 80 25 00 00 sum at 115200 (9600 baud, not saved) and listens at
9600. In I2C the sketch reads 6 bytes from register 0x00 when pin 6 is HIGH:
Wire.beginTransmission(0x10); Wire.write(0x00); Wire.endTransmission();
Wire.requestFrom(0x10, 6); // Dist, Amp, Temp - low byte first
The serial monitor needs no wires: it is built into the Arduino UNO V4.0.
The pins reach their UNO through net labels - SDA_1 / SCL_1 / MUX_1 (node
1), RXD_2 / TXD_2 (node 2): the same name = connected. 5V and GND are Proteus
power terminals; U1's CFG and ARD2's D4 go to GND terminals.
REAL HARDWARE:
* The supply is 3.7 to 5.2 V (about 70 mA, 150 mA peaks) and the module has
no polarity or over-voltage protection: check the wires before power-on.
* Its signals are 3.3 V (LVTTL). A 3.3 V HIGH from TXD is a valid HIGH for a
5 V UNO; for the UNO's 5 V into RXD and for the I2C lines use a level
shifter, or pull SDA / SCL up to 3.3 V only.
* Pin 5 is read at power-on: change it, then power the module again.
* The light spot must fit on the target: about 3.5 cm across at 1 m and
28 cm at 8 m (a 2 degree beam). Glass, water and mirrors confuse it; keep
the lenses clean and out of direct sunlight.
THE TEST TOOLS (Advance, Tests tab) - what they really measure
Every tool reads the model during the running simulation; each shows one
"Good for:" line and, where it judges, a verdict per row (green = fine, amber
= check, red = wrong).
Frames & commands
Good for: no data, garbage at the wrong baud rate, dropped
frames, a command that does nothing. The line (baud, format,
output), the frame rate or trigger mode, the frames sent and
dropped, the commands received and ignored, the bytes and
framing errors on RXD, what is saved; the last commands with
their bytes. In I2C: why there are no frames.
Registers Good for: no answer at 0x10, values that never change, a
setting that does nothing, a new address. The address that
answers, the mode, pin 6, the reads and writes, and the
registers as the Arduino sees them. In UART: why there is no
I2C.
Range & signal
Good for: readings of 0, a black target that vanishes,
jumping readings close up or at an edge. The target and its
zone, the threshold and the dummy value, the noise; a table
of distances from 10 to 900 cm with Amp for a white and a
black target.
THE DEMO SKETCH ON THE SERIAL MONITOR (TFLuna_LiDAR_Demo V1.0)
FPS <1-250> a frame rate (the TF-Luna uses 500 / n), e.g. FPS 250
TRIG trigger mode: one frame for each TRIG
CONT continuous again (10 Hz in UART, 100 Hz in I2C)
RAW UART: the last frame's 9 bytes; I2C: registers 0x00 - 0x0C
HELP the command list
Commands are not case-sensitive; type them in the UNO's built-in monitor and
press Enter. Twice a second the sketch prints the latest reading by itself.
EXPECTED MONITOR OUTPUT (the start)
ARD1 (I2C, the target at 150 cm):
TEP TF-Luna LiDAR - demo
I2C at 0x10: SDA / SCL, pin 6 on D2 - version 1.0.0
Commands: FPS <1-250> | TRIG | CONT | RAW | HELP
#1 150 cm amp 2826 34.8 C (102 frames/s)
#2 151 cm amp 2889 35.2 C (100 frames/s)
ARD2 (UART - D4 to GND - the target at 300 cm):
TEP TF-Luna LiDAR - demo
UART (D4 to GND): TXD on D8, RXD on D9 - set to 9600 baud, 10 Hz
Commands: FPS <1-250> | TRIG | CONT | RAW | HELP
#1 59 59 2C 01 B9 02 18 09 BB 300 cm amp 697 35.0 C (10 frames/s)
The last digits move a little: the noise of each measurement.
PROPERTIES (double-click the part > Edit Properties)
DISTANCE the target's distance at the start in cm (default 150; 0 =
nothing in front)
TARGET WHITE (90 %, up to 8 m) or BLACK (10 %, up to 2.5 m)
FPS the frame rate at power-on in Hz (default 100; 500 / n)
BAUD the UART baud rate at power-on (default 115200)
ADDR the I2C address at power-on (default 0x10)
TEMP the chip's temperature in C (default 35)
PANEL Simple only: the STATUS panel at the start, OPEN or CLOSED
FPS, BAUD and ADDR are what a real module has saved. Every run starts again
from the properties, and the module from power-on.
The demo's UNOs (ARDUINO UNO V4.0): PROGRAM TFLuna_LiDAR_Demo.hex, MONITOR
YES (the built-in monitor), BAUD 9600, AUTOOPEN YES, BOOTLOADER YES.
LINKS.INI (OPTIONAL)
The Help page cards of the Advance device open web pages. To point them
somewhere else without a new DLL, put a text file named links.ini next to
TEPTFLUNA.DLL with lines KEY=URL, for example:
ARTICLE=https://www.theengineeringprojects.com/...
Keys: WEBSITE, FORUM, BUG_REPORT, FEATURE_REQUEST, ARTICLE, USER_GUIDE,
UPDATE_CHECK, DONATE. Only http:// and https:// links are used; lines starting
with # are comments.
TROUBLESHOOTING
* I2C prints "no answer at 0x10" or "no data yet": pin 5 is not at GND at
power-on (the module talks UART - the label on its body says which), SDA /
SCL swapped, or no power (the red light is off). Without pin 6 on D2 the
sketch never reads.
* UART prints "no frame yet": TXD / RXD swapped (the module's TXD goes to
D8), pin 5 at GND (the module talks I2C), or the module is not at 9600 -
Tests > Frames & commands counts the framing errors on RXD.
* Dist 0: Amp under 100 - nothing there, too far, or a black target beyond
about 2.5 m.
* Readings jump under 20 cm: the dead zone. A value between two distances:
the spot is on an edge.
* Missing frames at a high rate: 9600 baud carries about 100 frames a second
at most - the model drops the frames the line has no time for.
* The parts are not simulated: TEPTFLUNA.DLL is missing from MODELS and from
the project folder. No UNO / no monitor window: TEPARDUINO.DLL is missing,
or click the UNO's USB port.
* Advance: the pop-up does not appear - click OPEN PANEL on the module, or
turn "Open the panel at Run" on its Settings page back on.
BUG REPORTS AND FEATURE REQUESTS
Please post them in our forum with a screenshot, the Serial Monitor text, the
simulation log and (Advance) the Copy diagnostics text:
https://www.theengineeringprojects.com/forum/category/tf-luna-lidar-proteus-library
SUPPORT US
This library is free. If it saves you time, please support our work:
https://www.theengineeringprojects.com/donate
WEBSITE
https://www.theengineeringprojects.com/
LICENCES AND THIRD-PARTY NOTES
* The TF-Luna model (TEPTFLUNA.DLL), the symbols and artwork and the Arduino
Library V4.0 (ArduinoV4TEP.LIB / TEPARDUINO.DLL, with its built-in TEP
Serial Monitor Advance) are made by The Engineering Projects. The model is
an independent implementation written from Benewake's product manual (the
pins, the frame, the commands, the registers, the range and noise tables).
The model uses only standard Windows libraries; no Visual C++
redistributable is needed.
The C++ source code is not included.
* Arduino UNO V4.0 (ArduinoV4TEP.LIB / TEPARDUINO.DLL, our Arduino Library
V4.0 - its microcontroller is Proteus's own AVR model): The Engineering
Projects, https://www.theengineeringprojects.com/2026/10/arduino-uno-library-for-proteus-v40.html
* The demo sketch uses Wire (part of the Arduino AVR core) and
AltSoftSerial 1.4 by Paul Stoffregen (PJRC), MIT License - it is
not included: install it from the Arduino Library Manager ("AltSoftSerial") or
https://github.com/PaulStoffregen/AltSoftSerial
The .hex file contains it; its licence:
Copyright (c) 2014 PJRC.COM, LLC, Paul Stoffregen, [email protected]
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* The .hex file is built from the demo sketch, AltSoftSerial and the Arduino
AVR core 1.8.6 (with Wire), which includes LGPL-licensed code; its source
code is available at
https://github.com/arduino/ArduinoCore-avr/tree/1.8.6
The demo sketch's source is in "Arduino Code", so the .hex can be rebuilt
with other versions of the core (REBUILDING THE FIRMWARE).
* TF-Luna and Benewake are names of Benewake (Beijing) Co. Ltd. Proteus is a
product of Labcenter Electronics and is not included. Arduino is a
trademark of Arduino SA. This library is not made or endorsed by Benewake
or by Labcenter.
REBUILDING THE FIRMWARE (OPTIONAL)
The HEX file is supplied; Arduino IDE is not needed to run the demo. To edit the
sketch, install AltSoftSerial (Library Manager), open
Arduino Code\TFLuna_LiDAR_Demo\TFLuna_LiDAR_Demo.ino in the Arduino IDE,
select Arduino Uno and use Sketch > Export Compiled Binary. Replace the
simulation's .hex with the exported HEX.
The sketch needs 12,418 bytes of flash and 724 bytes of RAM.
MODEL SCOPE AND LIMITS
Modelled: pin 5's choice of interface at power-on, the UART frames and the
0x5A commands with their answers, the I2C register file and pin 6, the frame
rate (500 / n) and trigger mode, the baud rate and the address with save /
restore, the signal strength against the distance and the target, the
threshold and the dummy value, the noise of the manual's table, the dead
zone, a spot on two surfaces, the chip's temperature, power on / off, the
target's distance and its motions.
How the part works with the circuit: VCC and GND power the module (on or
off); CFG is a digital input read at power-on; in UART mode RXD is a digital
input and TXD a digital output with every bit at its exact time; in I2C mode
SDA and SCL are open-drain (the module only pulls SDA LOW); MUX is a digital
output (I2C: data ready).
Not modelled: the infrared light itself, the target's size against the spot,
glass, water, mirrors, sunlight and overexposure (Amp 65535), the supply
voltage and current, the 3.3 V signal level, the low-power and ultra-low-power
modes, pin 6's on / off switching output in UART mode (it stays LOW), the
time the module needs to start up beyond its first frame after 100 ms. The
signal strength's curve, the dead-zone readings and the 1 ms answer time are
the model's values.
VERSION
TEP TF-L
…Development1 release
-
V1.0TF-Luna LiDAR Distance Sensor Library for Proteus V1.0this page
V1.0 is the only release in the Download Center so far. When a newer version is published, it appears above with its own download page.
Installation8 steps
From the download to a working project, in order. The steps follow what the package contains.
You will need
- Proteus Design SuiteProteus 8 or newer (Labcenter), on Windows
- Arduino IDE1.8 or 2.x, with the board of the tutorial chosen under Tools → Board
- Any archive toolWindows, macOS and Linux extract ZIP files on their own
Steps
- 1
Extract the archive
Right-click tf-luna-tep-v1-0-1684646237214240b726042f747cba5b.zip and choose Extract All (or open it with 7-Zip or WinRAR) into a folder you can find again. Keep its folder structure (TF-Luna-TEP-v1.0) as it is.
- 2
Copy the library files into Proteus
Move ArduinoV4TEP.LIB and TEPTFLUNA.LIB and the files into the LIBRARY folder of your Proteus installation: C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY for Proteus 8, or the matching Proteus 7 folder. Older versions keep it under ProgramData\Labcenter Electronics. If Proteus is open, close it first.
- 3
Add the simulation model
Copy TEPARDUINO.DLL and TEPTFLUNA.DLL into the MODELS folder next to LIBRARY, so the component can run, not only be drawn.
- 4
Restart Proteus and place the component
Start Proteus, open a schematic, press P (Pick Devices) and search for the component by the name used in the tutorial. It appears with its pins ready to wire.
- 5
Open the sketch in the Arduino IDE
Open TFLuna_LiDAR_Demo.ino, select your board and port under Tools, then Verify. Sketch → Export Compiled Binary writes the HEX file a simulation needs.
- 6
Load the HEX file
In Proteus double-click the microcontroller, set Program File to TFLuna_LiDAR_Demo.hex and run the simulation. For real hardware, flash the same file with your programmer.
- 7
Open the example simulation
Open TF-Luna-LiDAR-ArduinoUnoV4.pdsprj in Proteus to see the wiring exactly as in the tutorial. Check the controller's Program File path, then press Play.
- 8
Follow the tutorial
TF-Luna LiDAR Distance Sensor Library for Proteus V1.0 explains every connection and setting in order; keep it open beside the files while you build.
FAQs9 questionsContact TEP
How do I download TF-Luna LiDAR Distance Sensor Library for Proteus V1.0?
Wait for the 30-second guest countdown on this page, then press the download button; the file comes straight from our storage. Members who are logged in skip the wait. If the browser opens the file instead of saving it, use its Save as option. The download link is made for you when the countdown ends and works for 15 minutes; a saved or shared link stops working, so share this page instead.
What is inside the archive?
TF-Luna LiDAR Distance Sensor Library for Proteus V1.0 comes as a ZIP archive of 10 files (1.2 MB, 2.7 MB unpacked) holding Proteus library files, simulation model DLLs, a Proteus simulation, an Arduino sketch and compiled HEX firmware. Open the File Structure tab for the full list of 10 files.
What should I do if the download does not start?
Check the browser's download list first; an ad blocker or a company firewall can also hold it back, so try another browser or network. If the file arrives incomplete, download it again. For an installation problem, read the Install tab or tell us in the comments with your software version and the exact error message.
Is this file free?
Yes. Every file in the TEP Download Center is free for learning, personal and student projects. If you share it, link back to this page or the tutorial so others find the latest version.
How do I check that the file arrived complete?
Compare its SHA-256 with the one on this page, f0a12ba5c4a3ab833834d9e9663b020ab7f9078209dcce353b6df5bf24c0abd4. In PowerShell run Get-FileHash "tf-luna-tep-v1-0-1684646237214240b726042f747cba5b.zip"; on macOS or Linux run shasum -a 256 "tf-luna-tep-v1-0-1684646237214240b726042f747cba5b.zip". The same value means the file is exactly the one in our storage; a different one means the download broke off, so download it again.
Do I need WinRAR to open the ZIP file?
No. Windows, macOS and Linux open ZIP archives on their own (Extract All, or double-click). WinRAR and 7-Zip work too. Extract the whole archive before using the files.
Where do I put the LIB and IDX files?
Both files go into the LIBRARY folder of your Proteus installation (Proteus 8: C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY; Proteus 7 has the same folder under its own name). Restart Proteus afterwards and search for the component with P.
Which Proteus version does the library need?
The tutorial names the Proteus version the library was made and tested with. Most TEP libraries work in Proteus 7 and Proteus 8; if the component does not appear after a restart, check that both the LIB and the IDX file were copied and that Proteus was fully closed while copying.
How do I get the HEX file into the simulation?
Compile the sketch in the Arduino IDE (Sketch → Export Compiled Binary gives you the HEX next to the sketch), then in Proteus double-click the board, set Program File to that HEX and run.
Members skip the wait. Log in or join TEP.
- 8Total downloads
- 4%Popularity
- ProteusCategory
- 0Comments
- ssyedzainnasirUploaded by
- 16 Oct 2026Uploaded at
f0a12ba5c4a3ab833834d9e9663b020ab7f9078209dcce353b6df5bf24c0abd4
















Comments
0