Arduino Reset | Arduino Serial | Laser Reset | Laser Serial |
Floating | Floating | Low | Low |
Low | Floating | Low | Low |
High | Floating | High | 11.24 ms pulse @ ~4.8 Hz |
Floating | Low | Low | Low |
Floating | High | Low | High (Blank Display Mode) |
Low | Floating | Low | Low |
Low | High | Low | High |
High | Floating | High | Low |
High | High | High | High (Blank Display Mode) |
Low | High-Z | Low | Low |
High | High-Z | High | 11.24 ms pulse @ ~4.8 Hz |
High-Z | Low | Low | Low |
High-Z | High | Low | High (Blank Display Mode) |
Sensor SPI-bus data is interesting.
Sensor(SPAD) size is 2x32x32 pixels.
I´m studying Laser sensors, and I Think they are Pixelized array detectors for calculating distance by Triangulation.I'm quite sure that's the way they do it but they are getting very good results for such a small 32x32 detector.
They *might* be using compressive sensing to increase the spatial resolution.Or maybe just averaging, I don't know but a dump of the image data would give some more insight.
Send: Start_measure_cmd
Parsed reply: Length=7509 ( =375.45mm )
Send: Get_info_from_last_measurement_cmd
reply: 49001e00030017fc4407c406b1054d078f00a608ef07000039ab2a473920564772b6fb46004d5c47d28ab848f6772543e48139437a470b43a0bc38435f8af043491d0000401d00005e1d0000721d00000000000000000000
parse reply:
parsed value 1=7497
parsed value 2=7488
parsed value 3=7518
parsed value 4=7538
they are Pixelized array detectors for calculating distance by TriangulationI think we can be reasonably certain they are not using triangulation in this unit. For one thing, the baseline (distance between emitter and detector) is far too small relative to the distances this unit is intended to measure. For another, 32 pixels don't yield the kind of resolution this unit supposedly delivers over its intended measurement range. I know it's a 2D array, but the second axis doesn't really yield any useful additional data for triangulation.
I noticed a post on another thread stating that the user found a 'Chinese laser sensor' online, so I searched and found the almost-perfect sensor. Accuracy of +/- 1mm, very simple TTL ASCII interface, under 40 bucks. Downside is slow delivery, sketchy docs and tracking. I would recommend looking on the Chinese market outlet site.Care to share a link to this "almost perfect" sensor for the rest of us? Thanks!
float inches=39.3701*atof(&rxbuf[3]);
The link to the 'almost perfect' sensor is: http://208.73.204.85/item/50m-164ft-Laser-Distance-Measuring-Sensor-Range-Finder-Module-Low-cost-Diastimeter-Single-Continuous-Measurement/32792768667.html (http://208.73.204.85/item/50m-164ft-Laser-Distance-Measuring-Sensor-Range-Finder-Module-Low-cost-Diastimeter-Single-Continuous-Measurement/32792768667.html).I feel this urge to buy one just to play with it. I'm sure I can come up with some application for it! "No, honey, of course Junior needs adaptive cruise control on his bicycle. How else will he maintain an accurate following distance proportional to his speed?"
/* BOSCH laser serial data crc value computing */
/* Program prints out crc value of byte array */
/* [0xC0][command][length][data][crc] */
//#include "stdafx.h"
#include "stdio.h"
#include "stdint.h"
#define POLYNOMIAL 166;
#define SEED 170;
//http://www.ti.com/lit/an/slua363/slua363.pdf
int calc_crc(int data_byte, int crc)
{
int bit_mask = 0, carry_check = 0, temp_data = 0;
temp_data = data_byte;
for (bit_mask = 0; bit_mask <= 7; bit_mask++)
{
data_byte = data_byte ^ crc;
crc = crc << 1;
temp_data = temp_data << 1;
carry_check = data_byte & 0x80;
if (carry_check)
{
crc = crc ^ POLYNOMIAL;
}
data_byte = temp_data;
}
return (crc);
}
int main()
{ //test arrays
//received data:
uint8_t data[] = { 0x00, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x08, 0xC1, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; //serial number received from device last byte 0xD4 removed(crc)
//commands:
//uint8_t data[] = { 0xC0, 0x55, 0x02, 0x01, 0x00 }; //crc should be 0x1A. PRL30C Set device as BT master
// these commands might work after device is set as BT master
//uint8_t data[] = { 0xC0, 0x51, 0x02, 0xFF, 0xFF }; //crc should be 0x9C. Get how many measurements in device memory
//uint8_t data[] = { 0xC0, 0x51, 0x02, 0x01, 0x01 }; //crc should be 0x18. Get measurement 1
//uint8_t data[] = { 0xC0, 0x51, 0x02, 0x01, 0x0A }; //crc should be 0x80. Get measurement 10
uint8_t crc = 0;
uint8_t newseed = SEED;
uint32_t bytearraysize = sizeof(data) ;
uint32_t bytepos = 0;
//calculate crc
do
{
newseed = calc_crc(data[bytepos++], newseed);
}while (bytepos < bytearraysize);
crc = newseed;
printf("crc: 0x%X ", crc);
getchar();
return 0;
}
Array size is quess based on image.
I was able to see external laser pointers dot in intensity part of dataflow, which matched array horizontal positions.
Laser pointer didn't interference with measurement.
I think distance is calculated from phase difference of transmitted and received modulated laser pulse.(+light intensity)
if i meassure 3729mm i get the result 0d1b hex
As the relevant files might not be shown in a PC's file browser in 'Internal Storage', copy the file to a PC by means of the Android Debug Bridge: adb pull /sdcard
The files of interest are btsnoop_hci.log and all files with the extension .cfa
Artag,
If your Android device doesn't have access to the file, try with an older device. In my case, I used a Tablet S2 Samsung Android 7.0. And it worked.
Searching for an answer in ChatGPT - artificial intelligence: https://chat.openai.com/
Links suggested by me in 2018:
Device and method for optical distance measurement
https://patents.google.com/patent/US6801305B2/en (https://patents.google.com/patent/US6801305B2/en)
Device and method for optical distance measurement
https://patents.google.com/patent/US7728957B2/en (https://patents.google.com/patent/US7728957B2/en)
I am using FTDI VNC2 debug module as usb to single wire serial adapter.Unfortunately, I can't receive any answer to my commands, sent using a Terminal emulator on my PC (9600 bauds, 1 Bit Stop, No Parity, no Handshake)
Serial commands are only tested with PLR15.
There are firmware update commands so be careful when using random commands they could erase flash.
GLM20 - Interface USB/Serial
Following the forum instructions, I've done several communication tests in the past with the GLM20. But my tests failed. I got frustrated and stopped.
Rereading all the threads, I realized that the PRL15 circuit board was identical to the GLM20. (Thanks RTV). I thought - it has to work!
If the RTV colleague did it, I think I can too.
Yesterday, doing more tests using an oscilloscope to monitor the waveform of the serial signal on pin P58/P59, I received a response to a command. But the received signal was truncated. I realized that the low level of the signal was at 1V, inadequate for reception.
After that, I built a circuit using resistors, schottky diode, a 74HC00 chip and managed to correctly read the received data.
Today thinking happily about being able to read the data, I built another simpler circuit, with a 74HC07 chip. Why HC chip? Because it works with 3.3V! Do not use an ordinary 7407.
This is the circuit built by me. It's the first one that worked with my tests. I checked with the oscilloscope and the signal is fine. We can then make other improvements if necessary.
Usage sequence:
1) press the power button on the GLM20
2) Press the reset button SW2 (display turns off)
3) Press the SW1 button to activate the communication (backlight on)
4) Run a terminal program connected to the USB of the CP2102 module - 9600 Bps 8N1.
5) Send the command and you will see the results.
To do later
- Connect with an Arduino, Raspberry PICO or ESP32
- Make a Golang program to run on a Windows/Linux/MAC
Thanks RTV - instructions to use Realterm:
https://www.eevblog.com/forum/projects/hacking-the-bosch-glm-20-laser-measuring-tape/msg1450020/#msg1450020 (https://www.eevblog.com/forum/projects/hacking-the-bosch-glm-20-laser-measuring-tape/msg1450020/#msg1450020)
Display as = HEX SPACE OR ANSI