Infrared Laser Distance Sensor SEN0366 issue

userHead av_ 2022-11-12 16:35:48 628 Views1 Replies

Hi, I have a SEN0366 and I would like measure distances between 300mm and 3000mm with a adafruit esp32 feather board. Unfortunately, I unable to do so independent what method I use (single measurement, continuous measurement or read cache with broadcast measurement). All the other things work as expected e.g. set frequency, set resolution, switch on/off laser.


Continuous measurement:

I use following code:

I extend the code with some Serial.println to get more details e.g. exact result in case of “Out of range”. Additional I use the HardwareSerial of my Board with following code:


Top: HardwareSerial mySerial = Serial1;

Setup: mySerial.begin(9600, SERIAL_8N1);


Result is every 30s:

Out of range

8006834552522d2d31364d (ADDR 0x06 0x83 ‘E’ ‘R’ ‘R’ ‘-‘ ‘-‘ ‘1’ ‘6’ CS)


Independent from what I do with the sensor (distance, light, reflecting level)



Single measurement:

For my real use case I wrote a class for the sensor that contains all operations that give following response:



----- setFrequency

send request: fa 04 0a 0a ee

request written len: 5

counter: 3

available data: 4

received response: fa 04 8a 78

Frequency updated successful


----- setResolution

send request: fa 04 0c 01 f5

request written len: 5

counter: 3

available data: 4

received response: fa 04 8c 76

Resolution updated successful


----- singleMeasurement

send request: 80 06 02 78

request written len: 4

counter: 1171 (means ca. 15s waiting for respose)

available data: 11

received response: 80 06 82 45 52 52 2d 2d 31 36 4e

Error data: 80 06 82 45 52 52 2d 2d 31 36 4e

distance: 0.00


This is the same error as in the continuous measurement


Is ERR--16 something like an error code? What does it mean?

It would be great if someone could help me.




2023-02-24 09:51:41


Thank you for asking the issue with Infrared Laser Distance Sensor (SKU:SEN0366)

We have run the code and adjusted the parameter the same as you.

However, we get the proper reading, without error. See the picture below.

Could you please use the serial port, directly input the command(80 06 02 78) and see whether it comes out ERR again?

Hope it can help,

userHeadPic NeloKin