24 v analog output position transmitter with arduino

Hello everyone,
I have a project with pneumatic piston which I almost finished, but I cannot find solution for this last problem. First time in my life I am posting on a forum, sorry for any clumsiness on my part.

Context : I am building a kind of press which works with a pneumatic piston. This piston is controlled by a 24 V pneumatic valve, itself controlled with an Arduino Uno via a relay. I use a small 0.5 A 24V power supply to power it. In order to get the deformation of the tested objects, I need to get the piston displacement. For that, I have a position transmitter that is made for the piston I am using.

The position transmitter which should be powered with the same supply than the valve has a 24 V analog output. You can find the datasheet of it here :

  1. I am not sure to well understand the schematic above. According to the datasheet, the analog output is on pin 2. Does the resistance RL represented is included on the sensor or is it the resistance that should be use to get the tension ?

Please, does someone understand this shematic better than I am ?

  1. I don't find a way to get the tension of the analog output. I have thought to a tension divider, but I don't know how to create a reference since the grounds are separated.

Please, do you have any sugestion to solve my problem ?
I really thank you in advance for any help.

Hi, @melar38
Welcome to the forum.

If the 24V analog output goes from 0 to 24V, you can use a potential divider made up of two resistors to scale the 0 to 24v to 0 to 5V for the UNO analog input.

Pin 2 is the analog output, RL represents the load of the device measuring the voltage, in your case the potential divider and UNO.

Tom.. :grinning: :+1: :coffee: :australia:
PS. Good to see you purchased a quality valve. :+1:

Hi,
I think you will find the output is 0 to 10V.

Tom... :grinning: :+1: :coffee: :australia:

Thank you @TomGeorge for you reply.
Yes it is 0 10V. I will have no difficulties to calculates the resistance of the tension divider.

What you suggest is what I had thought, and to me, it can be traduced with the schematic below.

Is it what you mean ?

To me, this lead to a problem because it would connect Arduino ground to the 24 v supply ground. Maybe I should not connect pin 4 to the 24 V ground ?

And what's the problem with that?

I don't have a lot a knowledge in electronics and Arduino but to me it was something to avoid because :

  • It mix up the power supply from my computer (in my case) and the extern 24V power supply.
  • The two system are no more isolated oneof the other, so I imagine some undesirable current from the extern supply could threaten my Arduino card and the other components of my system.

As you can see I am not very similar with this notion, so I'd be happy if you could tell me where am I wrong and why I can connect the two ground :slight_smile:

You can, as an option, power your arduino from the same 24v supply, using a voltage converter module

Connecting grounds means they will have the same amount of potential as their 0V line. let me elloborate:

As you know we don't have a certain reference point for Voltage thus we can only measure it relatively between 2 pins.

So if we create a theoratical ground thats exactly 0V we might measure 24V power supplys leads measure 3V and 27V. notice the difference is still 24 Volts.

Same thing goes with your PC's power supply its 3.3, 5 and 12 volt lines might give up valoes like 103.3, 105, 112 Volts but the ground pin will give 100 volts in this case to balance the difference.

You might think connecting 3V ground to 100V ground? that's deffinitely harmful. but hang on!

Basically when you connect them to each other they are forced to create a common ground voltage because there isn't any current flow from gnd to gnd of each respective psu. thus they will meet at a gnd voltage of X and each line will give their voltages accordingly. like: x+3.3V, x+5V, x+12V x+24V... Furthermore any current that flows from 24V circuit to 12V circuit will have a return path which is mandatory for creating a closed circuit :).

If you want proper isolation between the solenoid and ur pc you will need some kind of optocoupler circuit. It's too complex for my liking but you will have to somehow convert the analog output of the sensor to pwm signals send that to the optocoupler and read it from the other end digitally as pulse width and proccess accordingly.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.