Introduction: Simple LiDAR Using the Laser Rangefinder Uni-T UT390b, Arduino and Turbo Pascal
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
more physics projects: https://stoppi-homemade-physics.de/
81 Comments
6 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
Reply 5 years ago
Hi,
did you have any luck with the SNDWAY?
Thanks
Reply 5 years 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.
Reply 4 years ago
Hello, share some knowledge.
A wiring sketch would be nice.
greetings
Reply 4 years ago
Hi, the wiring is extremely simple - just connect it with a USB cable to the PC/laptop. I now also ordered the sndway SW-S50 from Aliexpress, which is cheaper than the S100, and it works fine too. I am not an excellent programmer, but I wrote some C# code that works. I'm happy to share it, but I don't see how I can upload it here...
6 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.
Reply 6 years 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+
Reply 6 years 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.
6 years ago
Any one with knowledge on the UT390+ ?
6 years ago
Would also be very interessted in the pins von 390B+! I hope that someone will have success and share the ideas!
6 years ago
Anybody discovered the right pins for 390B+?
6 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+?
Reply 6 years ago
Hi, did you try sending the serial command which the qartis blog used? Nothing received from the Tx pin when executing commands?
Reply 6 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...
Reply 6 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!)
Reply 6 years ago
Please join in this project to hack the UT390B+
https://hackaday.io/project/12767-peek-inside-uni-t-ut390b
6 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!
Reply 6 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
7 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 !....
Reply 7 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.