We need read 24v inputs from sensors.
We have seen this board in youtube, but, we cant found it.
https://www.youtube.com/watch?v=i3DInBXiNNk
Did you know where can we found some similar??.
In the past we was using optocouplers, to have differents input voltages, but, for now with 24v is enough.
they do have stuff for sale. They just don’t have a web shopfront. And he’s pretty responsive, as you saw. And he’s an OK guy to boot, at least now he’s back in the UK and not sunning himself in NZ.
@ A_Dupont - Even that your solution should generally work, I would never ever expose the CPU pins directly to an industrial environment.
You never know what might happen out there.
Also for your solution you have to connect the CPU Gnd with 24V Gnd, which not an good idea, specially if you do some analog stuff too.
After the resistor divider put a buffer amp-op (voltage follower), this way you isolate high/low circuit impedances and protect your MCU input. Check LM358 or similar.
I won’t use a voltage follower in this kind of appplications, usually 24VDC is industrial equipment that already have a low output impedance and the resistor divider have a high impedance input if resistors have high values >10K. Instead I would use a TVS diode to eliminate transiant voltage.