Introduction: Simple LiDAR Using the Laser Rangefinder Uni-T UT390b, Arduino and Turbo Pascal

Picture of Simple LiDAR Using the Laser Rangefinder Uni-T UT390b, Arduino and Turbo Pascal


Some days ago I bought a laser rangefinder (Uni-T UT390b, f.e. to realise a simple LiDAR. The rangefinder has an accuracy of +/- 2mm and is able to measure distances up to 45m. This will be enough for my living room ;-)

You'll also need:

* Arduino Mega (because of more than one Serial Outputs)

* 2 Servos

* Servo tilt (f.e.

* LM317 and some other parts for the 3V-power-supply

* 5V/3A power supply for the servos and the voltage Regulator

* cable, different connectors etc.

Step 1: The UT390b Laser Rangefinder and His Outputs

Picture of The UT390b Laser Rangefinder and His Outputs

In the web you can find some interesting articles about the UT390b and the serial read out of the data.




There's even a special UT390b-library for the arduino.

You just need 3 pins (GND, RX and TX), placed under the batteries on the back of the unit. Open the rangefinder (instruction: and solder 3 wires on the outputs.


* The Tx-signals coming from the arduino have a 5V-level. This is too high for the UT390b and may destroy the electronics. Therefore you'll need a voltage devider with two 10kOhm resistors! The 2.7V-output doesn't need to be connected.

* A further problem is, that the UT390b will sometimes turn automatically off during the measurement or will stop because of an error message (f.e. 190). To be able to continue the measurement without problems you should replace the batteries with an external power supply and a switch for the restart! I use a LM317 as a voltage regulator.

If the UT390b shows an error on its Display you'll just have to switch it off and on again followed by pressing the ON-button. If the UT390 turns off automatically you'll just have to push the ON-button.

Step 2: The Measurement

Picture of The Measurement

To start the measurement I have to push a button. Then the two servos move zigzag and for each direction the measured distance and alignment (horizontal angle phi, vertical angle Theta) are sent to the computer. To save the values I use the program teraterm.

Step 3: Visualization of the Data

Picture of Visualization of the Data

When you have the data (phi, theta, distance) you want to visualize them. I haven't found a suitable prgram in the Internet to do that. The problem is, that the values aren't regularly. Most of the Commercial programs need regular (x/y)-Points to draw a net.

Luckily I've written a program in Turbo Pascal 20 years ago to visualize 3D-data. The intention was to display topographic surfaces like my hometown. For this I had to read the altitudes of 1600 points in a map ;-)

For the LiDAR I use this program to visualize the detected surrounding. With keys I'm able to Change the Point of view, the magnification and the offset.

Step 4: The Results

Picture of The Results

Scanning my living room was the first test of my LiDAR. At this time I didn't have the option switching off the UT390b manually yet. Therefore some lines are a bit distorted and displaced, because I had to take the rangefinder out of the mount a few times during the measurement.

Equipped with the external switch and a more stable mounting I'll now produce better results ;-)

Thank's for spending your time. Maybe you're interested in my other projects:


landger (author)2016-07-22

For those interested in a laser distance meter with HID usb connection look at the sndway SW-S100. It comes with a CD with a basic application but also a list with command codes. It's a bit more expensive (about US$60 on AliExpress). The software does not seem to be very stable on my PC, but it does work - sending a command form the PC to measure and retrieve the distance on the PC. I'm now looking into implementing an application in C#, but I'm not very familiar with HID-USB, so any help is welcome

sydios (author)landger2017-09-25


did you have any luck with the SNDWAY?


landger (author)sydios2017-09-26

Yes, I managed to control it in C# and retrieve the measurements. It has been a while, but I'm planning to pick it up again soon.

oliverilmagnifico (author)2016-11-17

I also would be interested if someone could find out how to do this with a 390B+. I've had a play but i'm a total noob so didn't get anywhere. One thing I did notice is that my device does not have the tx and rx pads that were pictured elsewhere in the comments.

I also purchased one of these. So far the serial RX and TX pins on the back of the board are non responsive. I'd guess that a serial command may be able to unlock the serial mode but that may be wishful on my part.

I did hook a scope and observed the pins while powering on. They don't do anything. Essentially low the entire time. We need to figure out some command or possibly a jumper to enable the serial. Appears to be a knock off of the UNI-T or a no name version of the latest board. I know mine differs slightly in the upper left side of the board vs. pictures I have seen of the 390B+

jnissen (author)jnissen2017-01-30

I tried the various commands with an UNO in reset and using the hardware serial to USB of the board. The 390B+ is not responding or putting anything out on the TX or RX pins. I tied a number of commands and various baud rates but nothing. I'll have to spend some time later to see if there is some easy hack or enable of the serial involved.

The pins that are exposed from the battery compartment do look more like the ARM debug port more than anything else. Unfortunately I do not have access to an ARM debug interface.

Carlosrhs (author)2017-01-25

Any one with knowledge on the UT390+ ?

masc01 (author)2016-11-06

Would also be very interessted in the pins von 390B+! I hope that someone will have success and share the ideas!

lemorlenny (author)2016-11-01

Anybody discovered the right pins for 390B+?

landger (author)2016-06-11

I also got a UT390B+. I opened it and it actually indicates the TXD and RXD on the board. Interestingly, these are not directly connected to the connectors accessible under the battery cover (I measured resistance with any of the connectors and these were all high).

I connected the TDX to the RX and RDX to the TX on an Arduino Due, together with the negative battery lead to ground. Using the UT390B_Arduino_Library as linked to above, I was however not able to read any data.

Has anyone had more luck reading data from the 390+?

SimonM83 (author)landger2016-07-20

Hi, did you try sending the serial command which the qartis blog used? Nothing received from the Tx pin when executing commands?

landger (author)SimonM832016-07-22

No, I didn't. I think I actually blew up the Tx/Rx connections as I now measure zero resistance between the two...

SimonM83 (author)landger2016-07-22

I'll check the resistance between mine and put the results on my hackaday project. Link in my other comments here. I posted an update this morning you may find of interest (but I've not cracked it quite yet!)

SimonM83 (author)landger2016-07-21

Please join in this project to hack the UT390B+

SimonM83 (author)2016-07-20

I started a Hackaday project here to try and get the community to find a way to talk to the UT390B+ with microcontrollers. Please get involved and share what you know!

SimonM83 (author)SimonM832016-07-21

Seems like hyperlink doesn't appear in instructable app so here's the text:

aspic (author)2016-02-17

Hello All

Correction : I have an UT390B+ (not 380).

So I disassemble it.

GND, and power are identified.

It seams to have 1 output, and 2 inputs.

But even trying all RS232 speed, set one input to 1 or 0 during sending command, nothing never append :o(

So at this time, no success.

I order one UT390B (hop to receive it). I will try to compare with ...

So as soon as I found something I'll tell you !....

voxelcam (author)aspic2016-02-19

Do you have oscilloscope? Have you tried to measure the voltages on those pins? Please post a picture with discovered GND, pwr pinout and internal view.

aspic (author)voxelcam2016-02-20

Yes, I check with the scope.
To open is same as the 390B. Dont' forget to remove stickers to view all screews...
Wire directly sold and comes by the holes.
SO I think that :
- White is power (apply voltage (by a resistor) switch on the unit
- gray is ground (directly connect to battery)
- I think magenta is an output. stay to ON level ( 2.8V) even is pulldown resistor, and make "reset" display if connected to ground :o(
- blue and green are input. Blue is 0v and become 1 with pullup resistor. Green same but reverse (2.8V and become 0 with pulldown resistor)

I will compare with 390B when I will have it...

SimonM83 (author)aspic2016-07-20

aspic, I have just been sent a UT390B+ instead of the UT390B I ordered. I'm disappointed but decided to open it up like you. On your UT390B+ were there any other pads than the ones in line which can be accessed by the battery compartment? I seem to have a couple labelled Rx and Tx which aren't anything to do with the ones in a line as far as I can see. I'm going to start a hackaday project for anyone who wants to share their findings on the UT390B+

voxelcam (author)aspic2016-02-20

Thank you!

I will contact that seller to check if they really have "B" model. So many of them just pretend to.

I am thinking - is there the 'hard way' - to attach in place of LCD ? if it is non-graphical we could catch print-out version of readings?

voxelcam (author)aspic2016-02-19

What a pity! Please give us a link where you are about to order original UT-390B. I've contacted some sellers on aliexpress who listed 390b, but unfortunately all of them eventually said that they only have 390B+ but at 390B price (which is almost +80%!)

aspic (author)voxelcam2016-02-20

I found 390B ! (more expensive I confirm (double than 390B+), but finaly less than a 390b+ can not use ;-))
Have a look here,searchweb201644_4_505_506_503_504_301_502_10001_10002_10017_10010_10005_10011_10006_10003_10004_10009_401_10008,searchweb201560_2,searchweb1451318400_-1,searchweb1451318411_6452&btsid=261d0cd5-81ac-41f4-9d7d-8b31187e7903

fbujold (author)2016-05-18

if you can accomplish +-2 mm of 45 m is it thinklable of accomplising sub mm over 1 meter?

landger (author)fbujold2016-06-15

I'm not sure what the specified accuracy actually means, but from the raw measurements given in a comment in one of the links above, which seem to yield sub-mm measurement values, I estimated a standard deviation of about 1.1 mm, which is half the accuracy. This suggests that sufficient repeating and averageing could yield sub mm accuracies. For instance, repeating them 100x would yield an accuracy of 2/sqrt(100) = 0.2 mm.

I actually did this for an ultrasound distance sensor and it worked well, so I don't see why it wouldn't work for this device. Disadvantage is of course the vastly increasing measuring time.

fbujold (author)landger2016-06-15

What i would like to know is; Since LIDAR technologies are very accurate over long distances, what kind of accuracy can i be expecting for distances in the 1 meter range? Or is this technology not usable for short distances?

ie 3d scanner device. For 3d printing the normal resolution of a print is .1 to .2 mm.

landger (author)fbujold2016-06-15

The laser rangefinder technology is definitely suitable for distances in the 1m range, just not under about 20cm where it becomes inaccurate. The accuracy under 1 meter is not much better than at larger distances, although measuring time may be somewhat reduced.

For high resolution scanning purposes I think it would be far too slow; even if the averageing method would work it would take about 30 seconds per .2 mm accuracy single point measurement. If my calculation is right, that would be about 3 months for a scan of a 100cm2 surface. (At the standard 2mm accuracy this would be less than 1 hour)

Also, the laser spot is quite large, I estimate about 2 by 4 mm at 20-100cm for the UT390B+, reducing spatial resolution. Laser beams can be focussed to sub mm range, but I think this device is not suitable for that.

aspic (author)2016-02-08

Hello dir all.

I just buy an UT380B+ (because UT390B not available). So I try to identify the debug pin assignement but except GND and POWER (not the most difficult ;o)), I didn't identify the other... I check all pins at power on but nothing send at the startup. So not possible to simply identify the tx pin :o(

Some one try to use it or knows if it's possible to dial by rs232 (ttl) port ?

Thanks a lot if yes...

voxelcam (author)aspic2016-02-16

Do you have any progress with ut-390b+ ? Also, do you have disassembled photos?

RussellC19 (author)aspic2016-02-13

Did you manage to get this working? would be really great to know if it works with UT380B+

ChrisH234 (author)2015-12-18

Does anyone know the method the UT390b uses for its distance measurement?

“time of flight” , “phase shift” or interferometry”.

schalliol1 (author)2015-11-29

Has anyone had success hacking the UT390B+? I have opened the unit, but the port under the battery is oriented parallel to the batteries. I am trying to get the serial port pin out.

Alexander Dumbhead (author)2015-11-11

Approximately how much does it cost to build this project?

Should be possible for $100

tomas75a (author)2015-11-10

Awesome project! And to see someone use turbo pascal is just cool! I love it :)

magma1914 (author)2015-11-09

What is the final precision of the scans (for example the room scan - are the wall distances measured correctly?) What is the time of scanning the whole room?

magma1914 (author)magma19142015-11-09

I once considered building such a device using stepper motors and small line lasers with camera

sinzu (author)2015-11-04

very intereting. I didn't expect that this kind of telemeter had an easily accessible Rx/Tx pinning.

This brings me to think about an adaptation of your system: I need to measures the distance on teta angle on 360° (phi angle always at 0°). However, the teta angle will vary at high speed (>4Hz = 4RPM). Could you tell me what is the maximum time latency you observed to make a measure ?

As the measure is done with the light speed, the latency should be pretty low. But I guess the laser rangefinder itself made some calculation and averages measures before providing the final distance result. These operation should be a bit time consuming.

sinzu (author)sinzu2015-11-04

to be more understandable, my idea is to make this kind of detection lidar:

stoppi71 (author)sinzu2015-11-06

I'm pretty sure that you can forget that project. When you use the "fire-mode" the UT390b sends a lot of distances within a second but other instructions f.e. for the servos will disturb the data-flow.

And when you recieve f.e. 20 distances/second, how to you select? You just want 1 distance in one direction. So you'd have to find an algorithm to select...

Otherwise when you wait until a correct distance is measured (like I do) and then step foreward it will be definitely too slow. The measure-frequency will then be around 1 distance/second, so quite too slow for your purpose. For your purpose I'd try this laser rangefinder:

sinzu (author)stoppi712015-11-06

Yes I know these robotshop products. But the goal of my question was to know if it could be possible to build a cheaper system with this kind of rangefinder. But you answered my question.

Another solution to get a cheap LIDAR module is to find a broken vacum robot like Neato for few bucks and then dismount it. A lot of hack for these robot are available on the web.

Steve-Abx (author)2015-11-03

The measured results that you get are a "point cloud".

You can use just about any 3D design software to load and view a point cloud. Just google point cloud.

stoppi71 (author)Steve-Abx2015-11-03

Hi Steve!
Getting a point cloud wouldn't be the problem, even with freeware like gnuplot. The problem is how to get a grid with not-equidistant (x,y)-points like in my case. I'm sure Thatcher there are programs for that but i haven't found one. Luckily i could dig out my old Turbo-Pascal-Program ;-)

Steve-Abx (author)stoppi712015-11-03

I don't understand.

What do you want the grid for?

stoppi71 (author)Steve-Abx2015-11-04

to create, imitate surfaces like in real... Just points aren't able to do that, I've tried this with my old ultra-sonic-scanner.

Steve-Abx (author)stoppi712015-11-04

When we make 3D models for printing we turn a 3d model into an stl file (which is a point cloud). If you import that into a 3d software package it can be treated as having a skin or not, and the skin can be modified. Have a look at the 123D software. It has scanning to and modification functions.

stoppi71 (author)stoppi712015-11-03

Of course that and Not (margret Thatcher :-))

jeanniel1 (author)2015-11-04

I found this for sale - it ought to work, too, right? How would the resolution be improved and the scan area / size?

stoppi71 (author)jeanniel12015-11-04

I've found that models too. They look good and can also be read with an arduino. But I don't know, whether sometimes errors will occur in the same way as with the UT390b.

BrenBren (author)2015-11-04

You can also use the Teensy (LC or 3.1 or 3.2) for multiple hardware serial ports. They cost around $15-20 each.

About This Instructable




More by stoppi71:Multi Channel Analyzer for Gamma Spectroscopy With Arduino & Thereminoscanning laser microscope with ArduinoArduino Segway
Add instructable to: