Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to detect actuator feedback voltage using Arduino/esp32?

Status
Not open for further replies.

mrnams

Junior Member level 1
Junior Member level 1
Joined
Jan 3, 2021
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
96
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
Sa502-24vdc-5-wire-with-feedback.png ‎- Photos.png
 

Hi,

on first glance without any further information I would say a voltage divider should do the job, connected to a GPIO pin (input). You have to keep the scaled down voltage below te maximum allowed input voltage, which should be 3.3 V. The voltage has to be above the 3.3 V * 0.7 (double check ESP32 datasheet) to detect a valid high level.

BR
 
Agree with Stenzer, it apears the internal switches are connected to +24V with R1 and R2 in their ground side as "pull-down" resistors. The ESP32 cannot tolerate more than 3.3V on it's GPIO pins so you need to connect to the BLUE and YELLOW wires, each with a resistor divider to drop 24V down to 3.3V then to a GPIO pin.

I would suggest a 100K resistor to the wires joined to 15K to ground, connecting the GPIO pin to their junction. That will give you about 3.1V on the GPIO which is more than adequate to be read as 'high'.

A word of caution, the actuator almost certainly has a motor or solenoid inside it, these are inductive and as the power to them is removed, they can produce a brief but substantial voltage higher than that being applied. The collapsing magnetic energy in the inductance can release hundreds of volts. It is worthwhile adding some extra protection to the GPIO pin as it could easily exceed 3.3V even with the potential divider in line. I would add a 3.3V Zener diode across the 15K (ground side) resistor, cathode to the GPIO pin, anode to ground. This will clamp excessive voltage and prevent any negative voltages reaching the pin.

Brian.
 
Hi,

I guess your valve has
* a vendor
* a type number
* a datasheet

Klaus
 

How to measure 24v DC in ESP32?
1) using voltage sensor.
Interfacing-diagram-of-the-voltage-sensor-with-ESP32.jpg

2) Using Optocoupler Isolation
PC817-Optocoupler-Isolation-3.jpg

3) Using voltage divider resisters
ca0433a6920db19d900cdbacc4a2123f5f6a939c.gif

Which is most efficient to detect 24v dc?
 

The most efficient by means of low cost is the last one. BUT with those resistor values you are violating the ESP32 maximum voltage input range. Further, as recommended by Brian, if hooked up in this way a protection circuitry is required.

An optocoupler gives only indirect feedback in a digital manner.

BR
 

Keeping budget aside, I should go with first one i.e. using voltage sensor is best and most accurate, right?
--- Updated ---

@stenzer I shall modify resisters in last option i mentioned, that i got from some where, at actual i shall use R1-14000 ohm and R2-2000
 
Last edited:

No one can give a feedback with respecta to the voltage sensor as no one knows how it is implementated, nor a product number.
 

That still gives no clues about the actual sensor and how it operates. From the pictures it looks as though it is just two resistors so the output is analog, a proportion of the input voltage. A simple resistive divider is fine if you are trying to measure an analog quantity but expecting one to detect 24V is present will not give precise results. Whether it shows digital high or low depends upon the accuracy of the resistors and the voltage threshold at which the digital input changes state. For example, if it did work to confirm 24V was present, it might also say it was present when only 23V or 22V, maybe less, was actually there.

Brian.
 

That still gives no clues about the actual sensor and how it operates. From the pictures it looks as though it is just two resistors so the output is analog, a proportion of the input voltage. A simple resistive divider is fine if you are trying to measure an analog quantity but expecting one to detect 24V is present will not give precise results. Whether it shows digital high or low depends upon the accuracy of the resistors and the voltage threshold at which the digital input changes state. For example, if it did work to confirm 24V was present, it might also say it was present when only 23V or 22V, maybe less, was actually there.

Brian.
Thanks, it's ok if it detect 22v.
We are just collecting feedback, and most of time it should give 24v ,as input is 24v
--- Updated ---

Please share connection how to use octocoupler? The one i shared is just to put my thought.
 
Last edited:

This should give you the basic idea how to use an optocoupler. Depending on the specific part you have to select the diode current limiting resistor accordingly.

 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top