Infrared Laser Distance Sensor SEN0366 issue
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: https://wiki.dfrobot.com/Infrared_Laser_Distance_Sensor_50m_80m_SKU_SEN0366
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.
Regards
av
The error code "ERR--16" that you are receiving from the SEN0366 infrared laser distance sensor indicates an out-of-range measurement. This means that the sensor is not able to detect a valid distance within the specified range.
The SEN0366 sensor has a range of 300mm to 50000mm (50m). Make sure that the object you are trying to measure falls within this range. If the distance is outside this range, you will receive an out-of-range error.
bidrohini.bidrohiniCan you guys give a sample code of what you have done? I'm trying to replicate this and I've just gotten
rst:0x8 (TG1WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13924
ho 0 tail 12 room 4
load:0x40080400,len:3600
entry 0x400805f0
Rhythm8503The wiki uses an Arduino Uno. What controller are you using?
Hi
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,
NeloKin