# How to convert a digital signal from 24V to 5V

I have an industrial automaton that gives me a digital signal (24V or 0V) on its outputs and I want this signal to control an integrated circuit, but the integrated circuit only takes a TTL signal in its input (0 to 5V).

I think it can be controlled if I convert the 24V/0V signal to 5V/0V. How can I convert this signal?

• Is it a TTL signal (current sink of about 1.4mA) or a simple voltage signal (0 - 5V) ? - if the latter a simple potential divider. – JIm Dearden Sep 6 '17 at 17:57
• google for "logic level converter", "shifter" or "translator" ..... – user3528438 Sep 6 '17 at 17:58
• What is rated R load to signal? 10k? then consider 4:1 R ratio to ground to get 1/5th output. – Tony Stewart Sunnyskyguy EE75 Sep 6 '17 at 18:14
• Sure with Pierre had written a lot more about the situation. Way too little information allows 100 different thoughts and no way to choose among them. Oh, well. – jonk Sep 6 '17 at 19:01
• @jonk agreed. The IF is answerable, the HOW needs more info. – Trevor_G Sep 6 '17 at 19:03

If this is for an industrial project you are probably better off using an opto-isolator to do your conversion. It provides several benefits.

1. Current loop on input side is impervious to common mode noise.
2. Isolated grounding gets rid of loops and different ground level issues.
3. Galvanic isolation provides protection to both sides.
4. And of course, the level shifting you asked for in the first place :)

simulate this circuit – Schematic created using CircuitLab

$R1$ should be chosen to establish the appropriate current in the LED at your 24V sensor level.

The size of $R2$ will depend on the logic family you are passing this signal to AND the frequency of the sense signal. For CMOS 10K will be sufficiently low, Standard TTL will need a much lower value.

• Oh and don't forget to use a properly rated resistor for R1, a 1/4W one probably won't do the business here – Julian F. Weinert Jun 6 at 1:07