SEN0524 cannot get data from UART on Raspberry Pi Zero W

userHead Dobromir.Semenliev 2023-08-08 06:20:28 245 Views1 Replies

Hello,

 

First I would like to start with that I'm very new to the world of microcontrollers. 

 

I am trying to use the SEN0524 distance sensor with Raspberry Pi Zero W but to no avail. The sensor is connected directly to the board's pins following the info from the WIKI - Vin to 5V (RPi pin4), ground to RPi pin6, RX (pin3) to GPIO15, TX (pin4) to GPIO14.

 

When trying to read data from /dev/serial0 (/dev/ttyAMA0) there's nothing. Using python's serial module serial.read(serial.isWaiting()) always returns an empty value, trying to read it from the terminal as well (cat /dev/serial0).

 

I have disabled the bluetooth of the RPi to make GPIO primary UART and if connect the GPIO14 and GPIO15 I can read and write data to/from /dev/serial0.

 

The wiki mentions two UART modes (active and query) what's the default state of the sensor and how should I trigger measurement in case of query mode? 

2023-08-08 18:38:03

Ok, I may have made a boo-boo with the connection - Tx to Tx and Rx to Rx. After swapping the jumpers I'm getting data on the /dev/serial0 and it seems Okay-ish - I can read the data correctly.

 

My concern is is it possible that I have caused any permanent damage to either of the devices? 

userHeadPic Dobromir.Semenliev