I am thinking if it's some easy way to measure current loop or Voltage in the same circuit, I mean a circuit able to capture 4-20mA OR Voltage.
How to unify those both circuits in a single one?
I am thinking if it's some easy way to measure current loop or Voltage in the same circuit, I mean a circuit able to capture 4-20mA OR Voltage.
How to unify those both circuits in a single one?
MultiPlexer? Analog Switch?
Isn't your question answered in the diagram you posted? It shows an analog-to-digital converter which is either sensing the current or a voltage. Can you explain your question better? What are you trying to achieve?
Current measurement requires a shunt resistor (R1) to convert the current into a voltage.
Voltage measurement may require a voltage divider (R2/3).
Both inputs can be combined with separate voltage and current PINs. In your Voltage Reading diagram connect a voltage source to PIN and a current source to Vin+.
A relay with gold plated contacts that switches the actively connected circuit is probably your best bet.
I know that using some analog switch or Multiplexer will be very easy but my question is about if it's possible to make circuit that can handle both type of input signal without switching.
Current measurement is in amperes. Voltage measurement is in volts. A circuit that measures both is in what units?
That's not 100% true because at the end what we are reading is always voltage at the ADC.
No switching is required. You only have to provide two different headers for the different signal sources. This will prevent connecting the voltage source for the current source signal and vice versa. If you only want to have a single connector then you can use a stereo phone jack and use one channel for current and the other one for voltage.
what I trying to achieve is to merge both circuits somehow into a single one (without multiplexers).
What did you not understand in post #4?
I think that I understand but you are saying me that I have to have two input pins one for 4-20mA and another one for the voltage input, right? maybe I missundertood
What I want to achieve is to have just one input pin that will be able to get both types of signal.
He wants to use only a single pin. It doesn't sound like your solution does that. Or am I reading it wrong?
just one input pin
A single pin is not sufficient for electric signal transmission. So instead of a single pin use a phone jack with at least 2 pins and be happy.
Do you seriously want to have the same connector or pin for mains (voltage) and battery (current) connection?
What I want to achieve is to have just one input pin that will be able to get both types of signal.
After inspecting the circuit diagram once more I found that the Voltage Reading diagram can be used for both purposes. Provided that the current source can provide at least 50V.
After thinking about it, unless you switch the incoming signal somehow, you won't be able to do this. You could control the switching motion with an output pin, have it toggle with a 555 or similar at a set rate, multiplex, etc. You could have one circuit deliver 0 - 2.5 volts, and the other 2.5 to 5 volts so you know which is which.
I am thinking if it's some easy way to measure current loop or Voltage in the same circuit
Why do you want to do this?
It is easy to use two pins and two circuits, that way there is no possible confusion about what is being measured by either pin.
I was thinking about how to make the switching without MCU control pins, what do you think about this:
I doubt that circuit would do anything useful.
Please explain what you think it would do, and how you would know what you are actually measuring.
Still wondering why you want to do this!
I want to do that in order to use the same input pin for that two sensor types (4-20mA & voltage), with that kind of solution I save MCU pins and makes me a lot easier to handle the SW.
When Voltage is present at the input PIN the Q2 remains open (2K is enabled as a voltage divider) otherwise Q2 is closed (2K is overriden to 0R).
At Least I think so..