# Digital Input Voltages

I have a very limited knowledge however just need to read one 24V Digital signal from a controller board so was going to use a voltage divider shown below.
I have now been told however that:

“24VDC, normally we have negative output, not trigger output +24VDC, trigger 0V”

From what I understand that means that 24V is being used as Gnd and Gnd so to speak is then -24V i.e. wires reversed or am I way off?

So can I still use the voltage divider and reverse the wires from the controller to sense +5V on the Arduino Digital pins.

Also just to confirm that a voltage divider will act as a pull down on the Arduino to get 0V.
The more I read this the more my logic sounds wrong.

Use an opto coupler, lots of circuits on the internet.

"24VDC, normally we have negative output, not trigger output +24VDC, trigger 0V"

This could mean only positive voltages, but reversed logic (active = 0volt, not active is 24volt).

Just try the voltage divider, and use a value for R1 that won't damage the pin with +24 or -24volt.

Try 39k for R1 and 10k for R2. Leo..

Edit: An opto could indeed be safer. Then there is also no groundloop problem between the two devices. Opto transistor between Arduino pin and ground, with pull up enabled in pinMode. 1mA is more than enough opto LED current, so a 22k current limiting resistor for the opto LED.

antc: I have now been told however that:

"24VDC, normally we have negative output, not trigger output +24VDC, trigger 0V"

From what I understand that means that 24V is being used as Gnd and Gnd so to speak is then -24V i.e. wires reversed or am I way off?

Who knows, its not really an intelligible sentence is it?

Perhaps ask some direct questions like "what is the output voltage range?" "What does each output voltage mean exactly ?"

Hi,

Thanks for the advice.

I will clarify the statement however if it is 0V and -24V is the attached opto coupler sketch ok?

And the logic that 0V would be connected to anode and -24V to cathode.

“Opto transistor between Arduino pin and ground, with pull up enabled in pinMode.”

Which part of that didn’t you understand.
Remove R2, and enable pull up in code.
Much easier.

Why 1k for the opto LED.
That’s ~22mA LED current.
You only need 1mA LED current to switch the <0.5mA pull up of a pin.
22k (10k if you must) is more than enough LED current.
If a LED CAN take 20mA, that doesn’t mean it MUST take 20mA.
Read up about CTR (current transfert ratio).

It’s rude to ask for help, and then just ignore the advice.
You could at least have asked why.
Leo…

Sorry Leo if I upset you I'm a real beginner here. I really appreciate people who give advice on forums.

I tried to do some of my own research as not doing this normally gets a negative response on forums.

Many of the forum posts seemed to use 20mA in the calculation of the resistor for R1 so that is what I used in my calculation.

The reason I used a resistor R2 on the input side is I am using a Siemens IOT2020 with Node-Red rather than running an Arduino script on it and had trouble finding information on it but could easily get desired result using an external resistor in a pull up / down configuration.

Ok so I see if take (24V -1.2V) / 1mA I get 2280 hence the 22k that you advised.