Forum >Connecting Rangefinder SEN0366 to Raspberry Pi 4
General Raspberry Pi

Connecting Rangefinder SEN0366 to Raspberry Pi 4

userHead Rushabh.Jain 2024-02-23 08:37:40 1335 Views2 Replies

Hello,

 

I recently bought a SEN0366 sensor and would like to connect it to my robot with Open CR and Raspberry Pi 4. I have received a UART to USB converter with the sensor. 

 

I am quite new this stuff an would like to know how can I connect and receive range values for the raspberry pi 4. Can I directly connect the USB to one of the USB ports or should I use the GPIO pins on the Pi. How do I get the values after connecting the sensor to the Pi ?

 

Thanks in advance. 

2025-03-27 13:37:43

Hello!

You can connect the SEN0366 to your Raspberry Pi 4 using the UART to USB converter via one of the Pi's USB ports—it’s the easiest option. Once connected, use a library like pyserial to read data from the sensor.

(e.g., /dev/ttyUSB0)

Where in India If you need an official Raspberry Pi 4, you can get it from Robocraze, they are the authorized seller of official seller of authentic Raspberry Pi boards and accessories.

 

userHeadPic sanjaay.jayasankar
2024-02-24 01:22:02

If you have a board like the Pi, you can connect the sensor directly to the Pi. Instead of using the supplied USB-TTL module, this mod is just to be able to test it properly on a normal PC.

But DF doesn't have sample code for Pi, only Arduino sample code.
I'm afraid you'll have to develop your own according to the protocol in the wiki.

 

wiki:

https://wiki.dfrobot.com/Infrared_Laser_Distance_Sensor_50m_80m_SKU_SEN0366

userHeadPic Yeez_B