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

72,929

605

80

Hello!

Some days ago I bought a laser rangefinder (Uni-T UT390b, f.e.

http://www.dx.com/de/p/uni-t-ut390b-45m-laser-dist...) 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. http://physicalcomputing.at/epages/f46ab952-295a-4f65-8ffa-38a4b8eec267.sf/de_AT/?ObjectID=156007)

* 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

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

* https://github.com/erniejunior/UT390B_Arduino_Library

* http://blog.qartis.com/arduino-laser-distance-mete...

* http://blog.qartis.com/laser-distance-meter-update-serial-commands-timing-measurements/

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: http://blog.qartis.com/arduino-laser-distance-meter/) and solder 3 wires on the outputs.

Attention:

* 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

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

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

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:

https://www.youtube.com/user/stopperl16/videos

Share

    Recommendations

    • PCB Contest

      PCB Contest
    • First Time Author

      First Time Author
    • Big and Small Contest

      Big and Small Contest

    80 Discussions

    0
    None
    landger

    2 years ago

    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

    2 replies
    0
    None
    sydioslandger

    Reply 1 year ago

    Hi,

    did you have any luck with the SNDWAY?

    Thanks

    0
    None
    landgersydios

    Reply 1 year ago

    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.

    0
    None
    oliverilmagnifico

    2 years ago

    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.

    2 replies
    0
    None
    jnissenoliverilmagnifico

    Reply 1 year ago

    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+

    0
    None
    jnissenjnissen

    Reply 1 year ago

    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.

    0
    None
    Carlosrhs

    1 year ago

    Any one with knowledge on the UT390+ ?

    0
    None
    masc01

    2 years ago

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

    0
    None
    lemorlenny

    2 years ago

    Anybody discovered the right pins for 390B+?

    0
    None
    landger

    2 years ago

    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+?

    UT390B+.pngUT390B+.jpg
    4 replies
    0
    None
    SimonM83landger

    Reply 2 years ago

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

    0
    None
    landgerSimonM83

    Reply 2 years ago

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

    0
    None
    SimonM83landger

    Reply 2 years ago

    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!)

    0
    None
    SimonM83landger

    Reply 2 years ago

    Please join in this project to hack the UT390B+
    https://hackaday.io/project/12767-peek-inside-uni-t-ut390b

    0
    None
    SimonM83

    2 years ago

    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!

    1 reply
    0
    None
    SimonM83SimonM83

    Reply 2 years ago

    Seems like hyperlink doesn't appear in instructable app so here's the text:
    https://hackaday.io/project/12767-peek-inside-uni-t-ut390b

    0
    None
    aspic

    2 years ago

    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 !....

    3 replies
    0
    None
    voxelcamaspic

    Reply 2 years ago

    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.

    0
    None
    aspicvoxelcam

    Reply 2 years ago

    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...

    20160220_165025[1].jpg
    0
    None
    SimonM83aspic

    Reply 2 years ago

    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+