0
\$\begingroup\$

I am currently working on a project where I have to use an industrial laser distance sensor. My boss asked me to control it with a Raspberry Pi. I have no clue wahtsoever where to start.

The sensor is an analog sensor. It is powered by V from 18-30V, and it outputs analog signals as voltage 0-10V or as current 4-20mA. I found that the Raspberry Pi has no analog to digital converter so I am almost certain that a circuit or something else is needed to interface this sensor directly to the Raspberry Pi (if it is even possible.) The sensor in question is a Wenglor CP35MHT80 laser distance sensor.

How can I make sure not to fry my Raspberry Pi since this guy needs more than 3.3V which is the limit for Raspberry Pi pins?

Could you please point me in the right direction and help me out on how to get this done? I only need to figure out how to read the sensor values with a Raspberry Pi, nothing else.

\$\endgroup\$
7
  • \$\begingroup\$ the sensor has a serial interface that can be used to obtain data ... the scan speed is limited by the baud rate when the serial interface is used \$\endgroup\$
    – jsotola
    Commented Mar 9, 2023 at 21:14
  • \$\begingroup\$ Thank you so much for answering! 🙏🏾So if I get this interface do i just need to plug to the sensor and raspberry pi and I will be able to read the values?....and what about the power to the sensor? I did know there is an interface RS232 to USB for RPi....do i need any additional circuitry or there things? \$\endgroup\$
    – AZ87
    Commented Mar 10, 2023 at 1:39
  • \$\begingroup\$ I saw this: wenglor.com/it/Componenti-del-sistema/… could it be useful? I will probably also need this (usb to RS232 converter cable) for the raspberry pi? My only question is how do I eventually power it up? How does it work? \$\endgroup\$
    – AZ87
    Commented Mar 10, 2023 at 2:55
  • \$\begingroup\$ usb to RS232 converter cable for the raspberry pi ... no, a usb to RS232 converter cable for a linux computer .... power the sensor with a separate power supply ... duckduckgo.com/… \$\endgroup\$
    – jsotola
    Commented Mar 10, 2023 at 3:04
  • \$\begingroup\$ how many readings per second do you require? \$\endgroup\$
    – jsotola
    Commented Mar 10, 2023 at 3:07

1 Answer 1

1
\$\begingroup\$

You will need to power this sensor from a separate power supply, you will not be able to run it from the Raspberry Pi. To read the output you will need a separate ADC chip, which will communicate with the Pi over some serial interface - SPI, I2C, etc. It is up to you which one, different ADCs use different interfaces. You can either choose the 0-10V option and make a circuit that converts that to a 0-3.3V range that the ADC reads, but I would recommend a 4-20mA circuit instead. Using just a couple of capacitors and resistors you can turn that output into a voltage that your ADC chip can read.

To summarize: 1) power the sensor off a separate power supply. 2) Use an ADC chip - powered from the Pi - that can communicate with the Pi over some serial interface. 3) Use a basic circuit to make either the 0-10V analog or the 4-20mA output readable for your ADC chip.

Make sure to tie grounds together and match your voltage level! The Pi works on 3.3V logic so your ADC must have digital power supply of 3.3V as well.

Edit: As pointed out in a comment this sensor does also have an RS-232 interface built-in. You could use a USB to RS-232 adapter to communicate with the sensor directly from your Pi as well.

\$\endgroup\$
3
  • \$\begingroup\$ Thank you so much for answering! 🙏🏾So if I get this interface do i just need to plug to the sensor and raspberry pi and I will be able to read the values?....and what about the power to the sensor? I did know there is an interface RS232 to USB for RPi....do i need any additional circuitry or other things? \$\endgroup\$
    – AZ87
    Commented Mar 10, 2023 at 1:42
  • \$\begingroup\$ Get a separate power supply for the sensor. One that plugs into an outlet. \$\endgroup\$
    – InBedded16
    Commented Mar 10, 2023 at 15:18
  • \$\begingroup\$ Thank you so much for answering! I am sorry if my questions sound silly to you, but how woul I plug the power if the sensor has only one M12 -8pins Male head? Since I'll be using it to attach the sensor to the RS232 cable(which then will go to the RPi through the RS232-to-USB cable), how do i get power to the sensor? Please guide me \$\endgroup\$
    – AZ87
    Commented Mar 10, 2023 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.