Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help hacking a laser tape measure?

274 views
Skip to first unread message

N_Cook

unread,
Aug 5, 2019, 11:55:48 AM8/5/19
to
Firstly for anyone else playing with these neat cheap laser diode
measuring devices.
I'm initially playing with a (Lidl) Parkside PLEM 50 (50m range), to
eventually use a Lomvum LV 120 (120m range) coupled to a pc via
Pi/Arduino. Both have 4 line 7segment LCD plus annunciators display with
a "chip on glass" look-up page chip for decoding and driving the LCD.
Made by SZYCLCD.COM and ident YGFB178004-A1 on the .5mm spacing ribbon
and I know by swapping between each, they are compatible between both
devices , completely different external and internal appearance, but
same STM micro. 14 way ribbon to LCD , 2 w for backlight, 2w for power
to chip on glass and a number of apparently inactive lines in
measurement mode anyway . So d0 clock , d3 and d4 used for SPI update
principal lastline of LCD and d2 +d3 active during power-up/first page
but not in measure mode.
Breaking-out at the ZIF ribbon socket and using Hobbycomponents
"matchbox" pulse analyser and Sigrok/Pulseview and pairs of readings on
the lower line of the LCD, ie switch unit on, then just pressing
"measure" once initiates the SPI clock pulses. The LCD is updated from
switch-on display in 0.5 to 1 seconds , so the data must be contained
within the first 2 or 3 frames of data. Short duration bursts of clock
then various amounts of dead space , as much as 400mS between frames,
highly variable duration.
I was hoping the same as

https://www.mictronics.de/2018/02/laser-distance-meter-hack/4/
LookupTableLcdLastLine.pdf , on link
https://www.mictronics.de/?wpfb_dl=156
on seeing 17 4 bit words per frame (mainly, sometimes 13, sometimes 16)
The first frame seems to have only 4 variants and is re-used for totally
different last-line readings. Whatever I set sampling speed, clock
polarity or phase etc I cannot avoid the "smearing" between frames ,eg
348-384 : 05
378-403 : 00
403-428 : 04

429-1961499 : 0C

980976-981002 : 0D
981001-981026 : 00
981026-981051 : 04

how to tidy up word apportionment ?.

And then for pairs of metre/mm distance readings I cannot get any sense
of pertinent words to decode/look-up (redundant 0's removed here for
linwrap)
and only frames 2 and 3 including the "smears"
B1820 sequence looked promising as an ident but non appearance in one
dataset.


00012080049008B180208010400A200 =6.345a
8B18020400108A000001208004900 =6.345b

8B180200010400A4000044041002101 =5.085a
000120A000504CD0401048082004202 =5.085b
(B18020 sequence not appearing in any succeeding frame, well beyond 1
second)

00012080049088B180208010400A404 =1.564a
B180200010400A400008010400A404 =1.564b





--
Monthly public talks on science topics, Hampshire , England
<http://diverse.4mg.com/scicaf.htm>

amdx

unread,
Aug 5, 2019, 10:24:21 PM8/5/19
to
What did he say?
Mikek

N_Cook

unread,
Aug 6, 2019, 3:40:21 AM8/6/19
to
On 05/08/2019 16:56, N_Cook wrote:
> d2 +d3 active

d2 +d3 active should have read as d1 + d2 active

Phil Allison

unread,
Aug 6, 2019, 5:00:41 AM8/6/19
to
amdx wrote:

>
>> Nutcase_Kook wrote:
>

( snip pile of Kook's incomprehensible gibberish )


>>
> >
> >
> What did he say?
>


** ROTFLMAO !!



.... Phil

tabb...@gmail.com

unread,
Aug 6, 2019, 7:38:04 AM8/6/19
to
I'm not 'getting any sense of pertinent words' from this either.
Nor the reason for any of this.

peterw...@gmail.com

unread,
Aug 6, 2019, 8:36:38 AM8/6/19
to
Some of us have time on our hands.
Some of us have a perverse level of curiosity.
Which leads some of us to do strange things for no apparent reason.

Peter Wieck
Melrose Park, PA

Fox's Mercantile

unread,
Aug 6, 2019, 9:20:27 AM8/6/19
to
On 8/6/19 7:36 AM, pf...@aol.com wrote:
> Some of us have time on our hands.

And there are those of us that know how to use a text editor.

--
"I am a river to my people."
Jeff-1.0
WA6FWi
http:foxsmercantile.com

tabb...@gmail.com

unread,
Aug 6, 2019, 11:18:58 AM8/6/19
to
There is always a reason. The OP has not stated his.

Fox's Mercantile

unread,
Aug 6, 2019, 11:44:44 AM8/6/19
to
Nigel doesn't need a reason.
He's constantly falling into these rabbit holes of no return.

peterw...@gmail.com

unread,
Aug 6, 2019, 11:50:13 AM8/6/19
to
I find simple curiosity to be both sufficient and necessary for this sort of quest. Nor do I see utility as having any particular value. But all-and-at the same time, I have many things that I am curious about that would come in way ahead of hacking a laser measure.

N_Cook

unread,
Aug 6, 2019, 12:26:54 PM8/6/19
to
A side-scan tide gauge (Google for one of those) Where no resident's
land is anywhere near the river water at low tide, just the top of the
tide. But 100m off land is about 98% of all the tide range , with large
collector lens (with bored=thru central hole for the outgoing laser )
works in lash-up so far. And unusually for tide gauges any wave action
increases the valid responses to the receiver at the required acute
angle. In line bright sunlight at 100m will probably be out though. Tide
height is then inversely proportional to the measured distance, as long
as the waves are not too high but that would just give a spread of
heights, averaging to about true presumably oe t least offsettable. A
"proper" geodometer with interface topc is far too expensive for this
sort of project.

John Robertson

unread,
Aug 6, 2019, 12:57:24 PM8/6/19
to
That would have been useful in the OP. Makes the project much more
interesting!

You could make (then secure and float) an IR reflector, much like a
radar reflector, for calibration.

https://www.instructables.com/id/Lightweight-Radar-Reflector/

John :-#)#

Lucifer

unread,
Aug 7, 2019, 2:24:29 AM8/7/19
to
On Tue, 6 Aug 2019 02:00:38 -0700 (PDT), Phil Allison
<palli...@gmail.com> wrote:

>amdx wrote:
>
>>
>>> Nutcase_Kook wrote:
>>
>
> ( snip pile of Kook's incomprehensible gibberish )
>
>
>>>
>> >
>> >
>> What did he say?

I can't get mine into games mode either.

N_Cook

unread,
Aug 24, 2019, 11:18:40 AM8/24/19
to
Decoding so far, for anyone else doing similar (J makes an ideal search
engine term along with SZYCLCD.COM and ident YGFB178004-A1). 12MHz
sampling and 20 M samples per run on the analyser with d0 line for
trigger. SPI protocol with d3 as clock,d0 as MISO, d4 as MOSI, 4 bit
word length so superfluous analyser 8bit zeros removed in the following.
d1 and d2 only active during power-up page , not in measure mode.
For clarity and reduction, repeats in the coding via the following
look-up table.

J=
4,F,D,8,8,D,D,4,1,E,8,C,6,0,C,2,A,0,2,0,5,0,9,2,C,B,1,1,1,1,1,1,1,1,6,0,7,C,8,0,0,0,
K= 3,0,0,0,0,0,0,0,0,0,0,0,0,0,
L= 2,0,0,0,4,0,7,0,8,0,0,8,
N=2,0,A,0,0,8,4,0,8,0,0,4,
P=0,0,0,0,0,0,0,0,8,0,0,0,
Q=8,A,0,0,0,8,F,0,8,0,0,C,
R=0,0,4,0,5,0,8,0,0,8,
S=1,0,0,8,4,0,8,0,0,4,
T=1,0,0,8,F,0,8,0,0,C,
U=0,0,0,0,0,0,

Assuming J is invariant for this make and model in question, about 20
readings so far in the 1.000 to 2.000 display range ,it is invariant,
L to U would contain variation for units ,hundreds and thousands, DPs
and nulls and probably annunciators and other display rows data for the
other 3 lines in the display.

Single example of coding for the reading 1.264 in the bottom line for
the frames sent on pressing "measure" , running the analyser after
power-up each time and d0 line trigger occuring after pressing "measure"
, second frame is repeat of the first, powering down the measurer after
each reading.
1.264
J,K
L,K
N,K
Q,K
P,K
2,D,R,K
6,B,S,K
C,E,T,K
8,7,U,
J,K
2,D,R,K
6,B,S,K
C,E,T,K
8,7,U,

Preliminary decoding for readings in the range 1.0.. to 1.7..
for tenths in the rank P,K,*,x,R,K,*.y,S,K after the primary ident J,
where * is don't care/ignored and x,y is the coding
2 on the LCD codes to (x,y) D,B in the SPI
3 ~ D,7
5 ~ D,5
6 ~ D,D
7~ 9,7

for hundredths,
only *.*5* and *.*6* measures in the display so far
in the rank T,K,*,x,U
5 ~ SPI F
6 ~ 7
will probably require 1 or 2 other elements for the full set 0 to 9

for thousandths (for eventual use thousandths [mm] would be redundent)
R,K,x,*,S,K,y,*,T,K,z,*U
x, y, z SPI
1~ 6, 4, 0
2~ A, C, 4
3~ 6, C, 4
4~ 6, C, 8
6~ E, 8, C
7~ 6, 4, 4
8~ E, C, C


I might hookup an Arduino or a Pi , as in the intended usage , rather
than analyser ,for easier taking of pairs of readings/ LCD display
decoding look-up table determination , for the full set. There may be
transcription errors in the above of course.

N_Cook

unread,
Aug 25, 2019, 9:17:19 AM8/25/19
to
For units decodng

From the previous, for unit=1 eg 1.264
R=0,0,4,0,5,0,8,0,0,8,
S=1,0,0,8,4,0,8,0,0,4,
T=1,0,0,8,F,0,8,0,0,C,

unit is more simply represented by the first term of each of R,S and T
string and so preliminary look-up table
unit ~ SPI R(1) , S (1) , T(1)
1~ 0,1,1
2~ 3,2,1
5~ 1,3,2
6~ 3,3,2
8~ 3,3,3
9~ 1,3,3
10~ 3,5,7 (or maybe 0) , (plus 3,4 and 7 also unknown so far)
and the remaining 9 terms of R,S and T are invariant for the readings
taken so far.

When the sun goes down a bit, I'll try some pairings in the range 10 to
50 metres, for 10s decoding

N_Cook

unread,
Aug 26, 2019, 5:47:48 AM8/26/19
to
Looks like tenths *.1** is 9,5 for the previous determinations.
Looks like processing for longer distances takes longer and timed-out
for 20M samples so will have to select more when I rerpeat.
Got display readings for 16.388, 26.766, 44.244 and 51.971m but full SPI
only for the shorter pair . I've had a display reading of >70m on this
when playing with the measurer on its own, so there is not an internal
timing/bounding limit to 50m. Resolution to 1mm in 70m but its absolute
accuracy , fixed positions and multiple readings, seems to be about
+/-1cm over 50m for outdoor nighttime atmosphere.
For the moment , as going above 10 involves coding changes in the Q and
T sections and only 2 valid SPI readings so far, staying with the units
decoding table of the previous and extending, maybe
unit/tens ~ SPI R(1) , S (1) , T(1)
1~ 0,1,1
2~ 3,2,1
5~ 1,3,2
6~ 3,3,2
8~ 3,3,3
9~ 1,3,3
10~ 3,5,7
16~ 3,7,6
26~ F,B,6

The tenths decoding of the 16... and 26.... agrees with the previous.
For eventual use, I'm only interested in the tens,units,tenths of metres
and then 100/110/120m for the 120m version.

N_Cook

unread,
Aug 30, 2019, 12:21:26 PM8/30/19
to
A collection of LCD display readings and their SPI codings with the
repeated sections removed, leaving just 4 "rows" of 3 hex characters
(intervening repeated strings removed for clarity, described earlier in
this thread, would come into play for hundreds /thousands/other rows in
the diplay perhaps).
The first rank all even(eg 2,6,C,8 in the 1.014m reading is the mm
(thousandths) ,0 to 9
The second rank (eg C,D,5,C in the 1.014) is the cm (combined tenths and
hundredths) , 00 to 99
The third rank (eg 0,1,1,0 in the 1.014 or 7,D,7,5 in the 30.190 ) is
the combined units and tens
so 0, 1,2,3 ... 99
going by the pairings of "19" in 30.190 and 2.197, both coded to 9,5,7,3
and "20" in 8.206 and 9.206 , both coded to D,B,D,7
Perhaps someone can see octal coding or something , to avoid determining
two sets of 100 pairings, but so far I've not managed to reduce the
required look-up conversions required.

1.014
2,C,0,
6,D,1,
C,5,1,
8,C,0,

1.036
6,D,0,
E,D,1,
8,7,1,
C,D,0,

2.197
2,9,3,
6,5,2,
4,7,1
4,3,1,


4.235
6,D,0
6,9,3,
8,F,3,
C,5,0

5.265
6,D,1,
6,B,3,
8,E,2,
C,7,1,

6.243
6,C,3,
6,9,3,
C,F,2,
4,6,1,

7.112
6,8,0
A,5,1
C,5,1
4,0,1,


8.206
6,D,3,
E,B,3,
8,D,3,
C,7,1,

9.206
6,D,1,
E,B,3,
8,D,3,
C,7,1


10.217
2,C,3,
6,9,5,
4,D,7,
4,4,1,

16.388
6,D,3,
E,7,7,
C,F,6,
C,7,1,

22.136
6,9,F,
E,5,A,
8,7,5,
C,1,5,

26.766
6,9,F,
E,7,B,
8,6,6,
C,7,5,


30.190
6,9,7,
E,5,D,
4,7,7,
C,3,5,

30.191
2,9,7,
6,5,D,
4,7,7,
0,3,5,

30.192
6,9,7,
A,5,D,
C,7,7,
4,3,5,

30.195
6,9,7,
6,5,D,
8,7,7,
C,3,5,

30.196
6,9,7,
E,5,D,
8,7,7,
C,3,5,

The 30.19 set was setting up on a tripod and repeated grabbing codings
until I got a repeat reading. This was at dusk, after a sunny day, but
even so over 30m , for 6 readings involving switching off and on again ,
just a spread of 6mm and no guarantee my touching the buttons did not
upset the tripod a bit.
Message has been deleted

Branislav Drengubiak

unread,
Feb 4, 2021, 8:42:12 AM2/4/21
to
Display datasheet is available www.amega.sk/brano/Displej.pdf
driver ST7567A

code (STM32 spi client ) is www.amega.sk/brano/main.c

Thang tran dang

unread,
Feb 5, 2021, 5:14:38 AM2/5/21
to
Do you have code for arduino? Thanks

N_Cook

unread,
Jul 19, 2021, 11:55:08 AM7/19/21
to
Interesting info , I've downloaded for later .
Just got back to this tide-gauge project, the optics part of it anyway.
The bored hole through the lens has to be offset from centre by the
half-inch of the separation of the laser output port and the centre of
the large lens. Also covering over the small inset lens, so as not to
confuse the range setting procedure.
Some stainless steel "reusable drinks straws" I found for guiding the
laser thru the lens without side-scatter being returned to the receiving
lens. Just trying out a pan of water , shrouded against false returns,
to check out over 20 metres initially. For real over tidal water comes
later.

--
Global sea level rise to 2100 from curve-fitted existing altimetry data
<http://diverse.4mg.com/slr.htm>

N_Cook

unread,
Jul 22, 2021, 3:10:01 AM7/22/21
to
On 19/07/2021 16:54, N_Cook wrote:
> On 04/02/2021 13:42, Branislav Drengubiak wrote:
>> Display datasheet is available www.amega.sk/brano/Displej.pdf
>> driver ST7567A
>>
>> code (STM32 spi client ) is www.amega.sk/brano/main.c
>>
>
> Interesting info , I've downloaded for later .
> Just got back to this tide-gauge project, the optics part of it anyway.
> The bored hole through the lens has to be offset from centre by the
> half-inch of the separation of the laser output port and the centre of
> the large lens. Also covering over the small inset lens, so as not to
> confuse the range setting procedure.
> Some stainless steel "reusable drinks straws" I found for guiding the
> laser thru the lens without side-scatter being returned to the receiving
> lens. Just trying out a pan of water , shrouded against false returns,
> to check out over 20 metres initially. For real over tidal water comes
> later.
>

I'm way off trying to use this SPI coding , and I'm no codesmith , but
for anyone else landing here, there may be an error in the
7segment/decimal conversion block

else if(c == 0x3F) decimal[i] = '0';
else if (c == 0x06) decimal[i] = '1';
else if (c == 0x6D) decimal[i] = '2';
else if (c == 0x4F) decimal[i] = '3';
else if (c == 0x56) decimal[i] = '4';
else if (c == 0x5B) decimal[i] = '5';
else if (c == 0x7B) decimal[i] = '6';
else if (c == 0x0E) decimal[i] = '7';
else if (c == 0x7F) decimal[i] = '8';
else if (c == 0x5F) decimal[i] = '9';

The hex 6D and 5B may need swapping around for the '2' and '5'

bronek

unread,
Nov 15, 2021, 11:37:06 PM11/15/21
to
responding to
http://www.electrondepot.com/repair/help-hacking-a-laser-tape-measure-182152-.htm
, bronek wrote:
int get_segment(int SegmentNo) // return 1if LCD segment SegmentNo is ON
{
int group,byte,bit;
group = SegmentNo / 80;
byte = (SegmentNo / 8) % 10;
bit = SegmentNo % 8;
uint8_t Bit = (1 << bit);
uint8_t c = raw_segment_data[group * 10 + byte];
if(c & Bit)
return 1;
return 0;

}
uint8_t raw_segment_data[40];
void analyze_data(void) // analyze 71bytes laser_buffer[71]
{
uint8_t data[6];
uint8_t decimal[8];
uint8_t buffer[32];
float distance = 0;
long int distance_mm = 0;
static long int last_distance_mm = 0;
uint8_t c;
int i;
// remove LCD_commands, only use LCD data
for(i = 0; i < 10;i++)
raw_segment_data[i + 0] = laser_buffer[22+i];
for(i = 0; i < 10;i++)
raw_segment_data[i + 10] = laser_buffer[35+i];
for(i = 0; i < 10;i++)
raw_segment_data[i + 20] = laser_buffer[48+i];
for(i = 0; i < 10;i++)
raw_segment_data[i + 30] = laser_buffer[61+i];
memset(data,0,6);
// sign minus have SegmenNo 59, I do not use it
if(get_segment(300)) data[0] |= 0x02 | 0x04;
if(get_segment(61)) data[1] |= 0x01;
if(get_segment(141)) data[1] |= 0x02;
if(get_segment(221)) data[1] |= 0x04;
if(get_segment(301)) data[1] |= 0x08;
if(get_segment(220)) data[1] |= 0x10;
if(get_segment(60)) data[1] |= 0x20;
if(get_segment(140)) data[1] |= 0x40;

if(get_segment(63)) data[2] |= 0x01;
if(get_segment(143)) data[2] |= 0x02;
if(get_segment(223)) data[2] |= 0x04;
if(get_segment(303)) data[2] |= 0x08;
if(get_segment(222)) data[2] |= 0x10;
if(get_segment(62)) data[2] |= 0x20;
if(get_segment(142)) data[2] |= 0x40;

if(get_segment(49)) data[3] |= 0x01;
if(get_segment(129)) data[3] |= 0x02;
if(get_segment(209)) data[3] |= 0x04;
if(get_segment(289)) data[3] |= 0x08;
if(get_segment(288)) data[3] |= 0x10;
if(get_segment(128)) data[3] |= 0x20;
if(get_segment(208)) data[3] |= 0x40;

if(get_segment(51)) data[4] |= 0x01;
if(get_segment(131)) data[4] |= 0x02;
if(get_segment(211)) data[4] |= 0x04;
if(get_segment(291)) data[4] |= 0x08;
if(get_segment(290)) data[4] |= 0x10;
if(get_segment(130)) data[4] |= 0x20;
if(get_segment(210)) data[4] |= 0x40;

if(get_segment(53)) data[5] |= 0x01;
if(get_segment(133)) data[5] |= 0x02;
if(get_segment(213)) data[5] |= 0x04;
if(get_segment(293)) data[5] |= 0x08;
if(get_segment(292)) data[5] |= 0x10;
if(get_segment(132)) data[5] |= 0x20;
if(get_segment(212)) data[5] |= 0x40;

for(i = 0; i < 6; i++)
{
c = data[i];
if(c == 0x00) decimal[i] = '0'; // Prazdne uvodne miesta
else if(c == 0x3F) decimal[i] = '0';
else if (c == 0x06) decimal[i] = '1';
else if (c == 0x6D) decimal[i] = '2';
else if (c == 0x4F) decimal[i] = '3';
else if (c == 0x56) decimal[i] = '4';
else if (c == 0x5B) decimal[i] = '5';
else if (c == 0x7B) decimal[i] = '6';
else if (c == 0x0E) decimal[i] = '7';
else if (c == 0x7F) decimal[i] = '8';
else if (c == 0x5F) decimal[i] = '9';
else decimal[i] = 'X';
}
decimal[6] = 0;
distance_mm = atol((char*)decimal);
if(distance_mm == last_distance_mm) return;
last_distance_mm = distance_mm;
if(!distance_mm) return;
distance = (float)(distance_mm) / 1000;
if(get_segment(54) && get_segment(134))// metre
i = sprintf((char*)buffer, "%.3f[m]\n\r",distance);
if(get_segment(294)) // ft
i = sprintf((char*)buffer, "%.3f[m]\n\r",distance * 0.3048);
// if(get_segment(214) && get_segment(134)) // inch
//i = sprintf((char*)buffer, "Zmen inch na m\n\r");
usart_print(buffer,i);
}


--


0 new messages