
AZ87 (Customer) asked a question.
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.
How would 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
1) Don't use a RPI.
2) If you're looking for cheap, buy a Click PLC with an analog input.
3) If you don't buy a PLC, you'll need to create/buy some shield to interface to the RPI. The sensor does have some form of ASCII RS-232 comms, but it looks like it'll suck to try to implement that. Probably just easier to use the analog output functionality.
4) You'll have to get power for the sensor from a power supply.
5) Why a RPI?
hi thank a LOT FOR ANSWERING BACK!!!iì I was about to lose hope!! i am using the RPi because my boss is an AS****LE and he wants to control the whole project we ar working on with RPi.
Basically he ordered this sensor(The wenglor CP53MHT80) and the RPi and he asked me to figure out how to get those values from the sensor so he could then drive a couple of stepper motors based on the sensor readings. I have minimum ABSOLUTE MINIMUM EXPERIENCE WITH RPi meaning that I am taking a python course for the first time in my life and started so just a couple of week or so and now I am in the middle of this....if I cant get this done he will definitly find a way to fire without any questions...he is such an as****le!!! Anyway, i just would like to have the chance to be pointed into the right direction so i can figure out what i need to get the job done; from the datasheet i see the sensor needs 10-30 V to run; i ahve already ordered the rs232-to-usb adapter for raspberry py and also an RS232 cable for the sensor which it supports; now my only big question is this: the sensor has only 1 and 1 only outlet: if i connect the RS232 cable to the sensor and then this cable to the RPi(through the usb adapter), HOW IN THE WORLD DO I GET 10-30V to the sesor to power it up???HOW??
I am almost certain the RPi cannot provide tahta voltage through a usb port, so how do i get 10-30V to the sensore while the only 1 outlet available to the sensor is already used by the RS232 cable?? I CANNOT GET IT REALLY
PLEASE HELP ME
Not sure what the application is, but if someone is telling you to do this in a commercial environment, they don't know what they're doing and maybe you shouldn't be working there. Trying to implement a RPI solution like this as a first project is too much. It's not the right tool for a beginner. There's way too much to learn and is exponentially more difficult to implement than a basic PLC approach with ladder logic and will probably be less reliable. If your boss can't help you with this I suspect he can't do it himself. If you're being paid to do this, he'll pay you more in labor to figure this out than just buying the right components to start with. You'd probably be better off just getting something like this: C0-02DD2-D and using it as a Modbus slave to the RPI if he's dead set on using a RPI to start with. Better yet, just ditch the RPI. To power the sensor, you need a separate 24VDC power supply. You can't power it from the RPI.
that is exactly what we i have suggested to him!!and even though some of my peer also advised him to use PLCs, he insisted in doing things differently and now he stucked with RPi thing. My thinking is: if I aconnect the Wenglo CP53MHT80 sensor (https://www.wenglor.com/en/Photoelectronic-Sensors/Laser-Distance-Sensors-High-Precision/Laser-Distance-Sensor-High-Precision/p/CP35MHT80) to the RPi using the RS232 cable(https://www.wenglor.com/it/Componenti-del-sistema/Tecnica-di-collegamento-e-box-di-collegamento/Cavo-interfaccia/p/S232W3) (with a usb adapter) and I do provide 10-30V separetely to power the sensor, and i also connect a common ground from the sensor to RPi, what would be the voltage of the signal coming through the TxD and RxD ? I am asking this because the RPi can only handle 3.3V e no more than this, and Im reading from the datasheet of the sensor which output is either 0-10V or 4-20mA Any help on this?
>My boss asked me to control it with a Raspberry Pi.
Odd requirement. Do you know why RPi was the chosen as the platform?
> I have no clue wahtsoever where to start.
Do you have RPi experience?
hi thank a LOT FOR ANSWERING BACK!!!iì I was about to lose hope!! i am using the RPi because my boss is an AS****LE and he wants to control the whole project we ar working on with RPi.
Basically he ordered this sensor(The wenglor CP53MHT80) and the RPi and he asked me to figure out how to get those values from the sensor so he could then drive a couple of stepper motors based on the sensor readings. I have minimum ABSOLUTE MINIMUM EXPERIENCE WITH RPi meaning that I am taking a python course for the first time in my life and started so just a couple of week or so and now I am in the middle of this....if I cant get this done he will definitly find a way to fire without any questions...he is such an as****le!!! Anyway, i just would like to have the chance to be pointed into the right direction so i can figure out what i need to get the job done; from the datasheet i see the sensor needs 10-30 V to run; i ahve already ordered the rs232-to-usb adapter for raspberry py and also an RS232 cable for the sensor which it supports; now my only big question is this: the sensor has only 1 and 1 only outlet: if i connect the RS232 cable to the sensor and then this cable to the RPi(through the usb adapter), HOW IN THE WORLD DO I GET 10-30V to the sesor to power it up???HOW??
I am almost certain the RPi cannot provide tahta voltage through a usb port, so how do i get 10-30V to the sensore while the only 1 outlet available to the sensor is already used by the RS232 cable?? I CANNOT GET IT REALLY
PLEASE HELP ME
I don't know what cable you have, it might be easiest to have one with flying leads on the end opposite the sensor, in that case the one cable will have 8 wires, two will be for power (which as other have said will require 24V supply separate from the Pi) there are two for RS232 (plus the (-) power line for common) and some for other signals
It sounds like you might have ordered a wenglor® Plug Adapter S232W3? if so, it looks like one still needs a cable for power, which again an 8 pin M12 to flying leads might work well
It looks like RS232 will be complicated as one needs to generate checksums, the analog seems simpler to me. While the Pi doesn't have analog input natively, there are a number of ADC "Hats" available for the Raspberry Pi that will provide analog inputs.
I have project where I use a raspberry PI to do some data logging and create SPC charts. I use a labjack T7pro for my interface to the gauge and have a python script reading from the Labjack. It has been absolutely reliable even more reliable than our boughtem SPC systems. Depending on the accuracy you are looking for a T4 would probably be fine but i wanted the 24 Bit ADC of the T7
https://labjack.com/
that is exactly what we i have suggested to him!!and even though some of my peer also advised him to use PLCs, he insisted in doing things differently and now he stucked with RPi thing. My thinking is: if I aconnect the Wenglo CP53MHT80 sensor (https://www.wenglor.com/en/Photoelectronic-Sensors/Laser-Distance-Sensors-High-Precision/Laser-Distance-Sensor-High-Precision/p/CP35MHT80) to the RPi using the RS232 cable(https://www.wenglor.com/it/Componenti-del-sistema/Tecnica-di-collegamento-e-box-di-collegamento/Cavo-interfaccia/p/S232W3) (with a usb adapter) and I do provide 10-30V separetely to power the sensor, and i also connect a common ground from the sensor to RPi, what would be the voltage of the signal coming through the TxD and RxD ? I am asking this because the RPi can only handle 3.3V e no more than this, and Im reading from the datasheet of the sensor which output is either 0-10V or 4-20mA Any help on this?