3

I am trying to configure a sensor with serial communication (raspberry-sensor). But i have connected my sensor to a oscilloscope see photo. I don't know if i can connect it directly to my rspberry pin 14 15, is the voltage not too high? And how could i connect it? enter image description here

Remi
  • 33
  • 3

4 Answers4

3

Judging by the oscilloscope readings, your sensor uses RS-232 levels. That's NOT compatible with the Pi, which uses 3.3V for input/output. If connected directly, your Pi may either fry instantly, or the UART pins may stop working.

What you need is an RS-232 driver compatible with the Pi. The most common chip for this task is MAX3232.

Dmitry Grigoryev
  • 27,928
  • 6
  • 53
  • 144
2

As @joan written, Raspberry is using 3.3V logic, therefore your sensor must be also with 3.3V logic. If your sensor is using 5V logic, you can use for example following bi-directional converter:

https://www.aliexpress.com/item/1005002907655206.html

If your sensor is working with external power, good think can be also optical separation of Raspberry IO pins, to make Raspberry safe in case of sensor error (when power voltage preset on IO pins), which can be integrated also in converter.

klaucode
  • 121
  • 2
1

You have not provided details of the sensor BUT if it uses RS232 you will require a RS232 converter.

RS232 is up to ±15V, although most devices which claim to be RS232 use much lower voltage unipolar signals. The unlabelled trace in your question appears to show bipolar levels.

Even if you adjust the voltage so as not to exceed Pi specifications it will NOT work as RS232 signal levels are inverted.

Milliways
  • 59,890
  • 31
  • 101
  • 209
0

The Pi UART (GPIO 14/15) requires 3V3 for high and 0V for low. If your sensor works at those voltages you will be fine.

If your sensor does not work at those voltages you will need to add circuitry to convert the voltages between Pi and sensor.

joan
  • 71,024
  • 5
  • 73
  • 106