Read Data from Distance Sensor UART Communication

Distance Sensor Setting:
UART Settings:
Baudrate: 460800bps
Data bits: 8 bits
Parity: no parity
Stop bits: 1 bit.
I have a Distance Sensor V-LD1 and try to read 31-byte Sensor data in Arduino UNO. But we cannot have the option to select Baudrate 460800bps in Arduino.

The chip's UART can do it: Correction: no, it can't - see Post #56.

So, if the Arduino Framework doesn't support it, you'd have to do it by direct register access...

How much data are we talking here?
It might be a challenge for the processor to keep up...

Can you not change the sensor's baud rate?
A link to a datasheet for the sensor would help...

Maybe use a different Arduino?

6.4.1 Data output
The client can request application messages from the server
in a handshake mode. The client must request each message
with the GNFD command.
The sensor goes into a sleep mode between requests as long
as the client reads the messages at the default baud rate of
115200. RFbeam recommends using this mode for the most
power efficient operation.
Higher baud rates are only recommended if the client wants to
read data intensive messages like RADC or RFFT in combination
with fast readout requests.

Did you mean V-LD1 ?

So Datasheet: https://rfbeam.ch/wp-content/uploads/dlm_uploads/2023/05/V-LD1_Datasheet.pdf

Which is, indeed, from that datasheet:

Distance_Sensor_Command_List.pdf (78.9 KB)
V-LD1_preliminary_datasheet.pdf (1.2 MB)

Are you saying that
Serial.begin(460800);
does not work?

Please find Attach Image_1. You can see the 31bytes data and Distance value also in the given Distance Sensor Viewer V-LD1 Software. But I want to read Distance Value in Arduino UNO.

Please find Attach Image_2 & Image_3. I just want to read value Distance Value (7-13 bytes) from incoming 31 bytes data in my arduino. 1st byte coming fine but 2nd incoming byte give garbage values



So it is V-LD1 - not VDL-1.

This shows the importance of giving actual links to the things you're talking about!

That datasheet also says that the baud rate is just 115200:

.........

How to capture screenshots:

Yes. I know that but the Sensor cannot work on 115200. Please find this Command list for your information
Distance_Sensor_Command_List.pdf (78.9 KB)

Looking more closely at the code image(PLEASE, USE CODE TAGS to post your code, no more images!!!), I see you're attempting to use the native hardware serial for Serial Monitor and some form of software serial at your very high baud rate. On an UNO, your desired rate is only achieveable reliably on the only hardware port. Choose another processor, or abandon using Serial Monitor.

1 Like

Why not?

The datasheet says it does!

Have you tested this with just a serial terminal - ie, take the Arduino & your code entirely out of the equation.

@awneil Yes, this is a concern, but it's moot, because he's not going to do 115200 on software serial anyway.

Brother thanks for share. I just need to read 31 bytes data from Sensor in Arduino UNO. Incoming data (7-13 bytes) is actual distance value. So, I want to this bytes(7-13) to read distance value in Arduino UNO Serial Terminal. I already share some code if you any information please share.
UART Settings:
Baudrate: 460800bps
Data bits: 8 bits
Parity: no parity
Stop bits: 1 bit

Why ?

1 Like

@Alee7 Once more. Post your complete code, in code tags.

@Alee7

Are you saying that
Serial.begin(460800);
does not work?

1 Like

:+1: fair point!

Yes, but it does not work on 115200 its only work 460800