Reading multiple voltages (digital)

For me, ground is 0 V when the other wire has 24 V.

Yes it is for me too.

In my wiring the relays would usually only close the 0 V (for me GND... so far...) of one valve at a time,

Yes.

while GND is open for the others,

No. The ground is not open it simply is not connected to the other valves through the relay contacts. The ground is still a common ground with all the others, they are all at the same potential whether it is connected to a valve or not. There is nothing special about the other grounds. You could swap them around between your valves and nothing would change. Try it.

The ground simply completes the circuit for the valve and allows current to flow through it. With one end of the valve connected to +24V permanently, connection of the other end of the valve to ground will energise the valve. This is done through your relay switch.

You could, if you wanted, ignore all the grounds but one, and connect all the relay contacts to that one ground in a chain. The only danger would be that there would be too much current for one wire that is why you are given a ground for each valve. It is the relay that does the switching not anything magical that happens to the wire labeled ground.

So connect any ground to the Arduino and the Arduino will know what to measure the incoming voltage against. The grounds, all of them, are never nothing.

Grumpy_Mike:
Yes it is for me too.
Yes.
No. The ground is not open it simply is not connected to the other valves through the relay contacts. The ground is still a common ground with all the others, they are all at the same potential whether it is connected to a valve or not. There is nothing special about the other grounds. You could swap them around between your valves and nothing would change. Try it.

The ground simply completes the circuit for the valve and allows current to flow through it. With one end of the valve connected to +24V permanently, connection of the other end of the valve to ground will energise the valve. This is done through your relay switch.

You could, if you wanted, ignore all the grounds but one, and connect all the relay contacts to that one ground in a chain. The only danger would be that there would be too much current for one wire that is why you are given a ground for each valve. It is the relay that does the switching not anything magical that happens to the wire labeled ground.

So connect any ground to the Arduino and the Arduino will know what to measure the incoming voltage against. The grounds, all of them, are never nothing.

Seems I really lack some understanding here.
If one ground would be enough, and all valves have permanently the 24 V (since it is a common wire for all of them), the all should permanently active (i.e. open). But they are not...
Why?

the all should permanently active (i.e. open). But they are not...
Why?

Because the ground is switched to the valve through a relay contact. Reply #8 shows a diagram of your system it shows relay contacts connecting ground to your valves. The ground I am talking about is the ground on the other side of those relay contacts at the very top of your diagram.

Ok, many thanks, this now makes more sense to me, the ground on the other side of the relay. :slight_smile:

Today I managed to find a guy on campus who also knows a bit about these things, he had a suggestion which is a bit different and seems to work without any resistors and voltage dividers. We will try that these day.

Cheers,
Jan

Confusion because the parts in the diagram are drawn upside down.
Ground in the last diagram is ok now, but the rest is wrong.
While drawing this diagram you must have been thinking that you have to measure the voltage across the valve. Try thinking of measuring the voltage across the switch.

Use Grumpy-Mike's diagram from post#12.
Note the diode across the valve....

This is the correct way of doing it.
A more complicated way would be opto couplers (and kickback diodes) across the valves.
Leo..

he had a suggestion which is a bit different and seems to work without any resistors and voltage dividers.

Do say how please. You might fry your Arduino.

You can do it with opto-isolators but that is going to be more expensive.