Sensor in 24v out 5v

Hi all. I have a problem as below

  1. Sensor use 24v input but output <5v so can i connect gnd of sensor with arduino together ?
  2. Can i connect gnd power 24v and 5v ?

Post a link to the sensor data sheet or product page.

  1. Many sensors have open collector or open drain outputs, so any output voltage is possible.

  2. Always connect the grounds.

thanks for your answer , please help me check again . if i connect as attachfile ,can it have any issue ? thanks you so much

That circuit should work with the 1-5V analog output sensor.

For best accuracy you will need to calibrate the Arduino response, because the Arduino analog input is ratiometric, not absolute, and depends on the Arduino 5V supply as a voltage reference.

OP's photo, posted properly (see image guide).

Or add a voltage divider, but have to keep the 1k output impedance in mind when picking resistor values, to bring down the voltage to 0.2-1V signal and read with the internal fixed reference.

Still needs calibration (the 1.1V reference has a 10% tolerance) but should be more stable in the long run. 5V from a 5V supply into the 5V pin gives a Vcc of 5V; 5V from a USB connection through the USB connector gives a Vcc of about 4.5V (a diode drop less). That means switching between the two will make the sensor readings jump by 10% if reading with Vcc as reference (the default).

Check the data sheet, https://www.smcpneumatics.com/pdfs_smc_instructional/PS-OMG0004-B.pdf, It outputs 1 to 5 volts, so you have a 1 volt offset. The schematic page 10 shows how to hook it to the analog pin, it is labeled load, and note the grounds are connected, remember the ground is the reference for all voltage measurements. If you look at the equivalent schematic the output is protected with a avalanche diode. You can add additional resistance in series with the output to the Arduino analog input pin. Start reading and follow the recommendations starting on page 5 if you expect it to work properly. This if from the instruction section:
∗Adjustment and Operation
•Do not short-circuit the load.
•If using the product to detect very small pressure rates, warm up the product for 20 to 30 minutes first.
There will be a drift on the analog output of approximate ±1% immediately after the power supply is turned on,
within 10 minutes.
∗Maintenance
•Turn off the power supply, stop the supplied air, exhaust the residual pressure and verify the release of
air before performing maintenance.
There is a risk of unexpected malfunction.
•Perform regular maintenance and inspections.
There is a risk of unexpected malfunction.
•Perform drainage regularly.
If condensate enters the secondary side, it can cause operating failure of pneumatic equipment.
•Do not use solvents such as benzene, thinner etc. to clean the Pressure Sensor.
They could damage the surface of the body and erase the markings on the body.
Use a soft cloth to remove stains. For heavy stains, use a cloth soaked with diluted neutral detergent and fully
squeezed, then wipe up the stains again with a dry cloth. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

You realize that sensor will run from 12V?