Converting 24V to Digital I/O

Thread Starter


Joined Dec 9, 2020

Hope you're all well.

I'm currently investigating how to approach part of a project I'm dealing with. I want to take a pos/neg wire from various 24V appliances in a vehicle, and end up with a digital signal of what's being used. This will feed via datalink to a small computer, which will then create a software instance and deal with this information in real time.

I'm a beginner with electronics as such, but I've soldered kits in the past.

However, my biggest query is, how would I take an input of a pos/neg wire from a 24V input, say, an indicator stalk, and convert this into a binary I/O situation? What components should I be looking for to make my kit?

Many thanks,



Joined Aug 1, 2013
The most simple approach is to attenuate the 24 V down to whatever logic level is for your device (3.3 V, 5 V, 12 V) with two resistors. But we can't know if this will work without a lot of information.

What produces the 24 v signal?

When the signal is not present, is the line open or shorted to GND or something else?

What is the power source for the datalink?



Joined Aug 23, 2012
Usual way to do this is to use an opto-isolator.
Resistor R1 sets the LED current depending on the input voltage.
Resistor R2 is a pull-up for the logic (binary) output.
The opto-isolator isolates the vehicle electrics from the logic circuit.
Good job.
To me, I will plus one stage of pnp transistor, so the output logic polarity will be the same with input.