How to detect actuator feedback voltage using Arduino/esp32?

Hello,
I am operating motorized ball valve using ESP32 and relay module, ball valve has two feedback voltage to detect close and open position of valve, there are two output wires one to detect close state and one to detect open state of valve. see below image.

**My question is how to collect feedback using Arduino/ESP32 to detect open/close state of valve ? **
Open state voltage between "R1(BLUE) and Negative(BLACK) will be 24v DC
Close state voltage between "R2(YELLOW) and Negative(BLACK) will be 24v DC

They look like just switches:
image

So you read them exactly as any other switch.

These switches i am operating from relay, I need to read feedback voltage,if blue wire ang black wire shows 24v then we can say valve is open.

I think you need to supply more details about this actuator.

I have no idea if what you say is true, but it wouldn't be my interpretation of that diagram.

I'd use a 24V optoisolator at R1 & R2 and read the output with arduino.

Based on my read and my interpretation of your post. I would just either divide down the Open/Close outputs or as suggested use an opto coupler as cedarlakeinstruments suggested and I would lean towards the latter. Actually since the valve only has two states you only need one digital I/O channel.

Ron

These things often (usually?) have three states:

  1. Open;
  2. Closed;
  3. Moving from one to the other.

It may or may not be useful or important to identify the transient 3rd state....

1 Like

I agree. No clue as to a transitional state. My read was a yes it's open or no it's closed.

Ron

This seems to be the complete description:

Thank you all for your responses

So to measure 24v DC in ESP32?

  1. using voltage sensor.

  2. Using Optocoupler Isolation

  1. Using voltage divider resisters

ca0433a6920db19d900cdbacc4a2123f5f6a939c

Which is most efficient to detect 24v dc?

The optoisolator is the best way to ensure you don't damage anything. There are a few other advantages.

Your number 2., however, is meant to go the other way, that is to say it is used to take a microprocessor output and use that to control a higher voltage.

It may well be that your number 1. is indeed implemented using an optoisolator.

Do you have a part number or where you saw that a link to the product?

The number 2. is also oddly labeling its output as low level, this is not how I understand the reg of what's going on with that module, so post a link to that part, also.

a7

second option of optoisolator i got from somewhere, its just to represent my thought, at actual i shall use in correct way

1 Like

PC817 2 CH Optocoupler Isolation Module is actual module i planned to use, but i feel that voltage sensor will be best choice, right?
Here i found PC817 use case
Vhp3A

I'm not sure what the difference is. I suspect the voltage sensor is doing that with the same kind of circuit.

But I'm still interested in your option 1. above, what is and where did you find that product?

Where did you get the circuit you posted? Share a link.

The resistor for the LED looks high for a 24 volt driving signal. Check the datasheet to make sure the current is correct.

On the output side, it is more common to see the resistor placed between Vcc and the collector of the phototransistor, with the emitter going to ground. In that configuration, the presence of the 24 volt signal woukd result in the input being pulled LOW. This is easily accounted for in the software.

a7

Don't use voltage dividers for this. Voltage dividers are for cases where you can guarantee that you won't overvolt whatever is at the load end. The safe and simple solution is an optocoupler or a transistor. Go with the optocoupler: this is not the kind of thing worth spending days thinking about.

Thanks, could you please share me how to use octocoupler, one I shared above is just to present my thought.
How to use octocoupler?

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