LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

24V TO 5 V conversion

Hi.

My DAQ module 9401 has a digital counter input on it which it is a TTL 5V high/low signal. I am attempting to use it to count the pulses that an encoder puts out. The issue is that the encoder puts out 24 volt pulses, not the 5V that my DAQ can read. I was looking for some suggestions for solutions, whether it be through a few resistors or some more complicated circuitry.

0 Kudos
Message 1 of 10
(9,337 Views)

You can buy complete level shifting boards, no need to fiddle with resistors yourself. For instance this one: https://www.sparkfun.com/products/12009

 Or buy a chip: https://nl.farnell.com/c/semiconductors-ics/logic/level-shifters

0 Kudos
Message 2 of 10
(9,333 Views)

Hi sobansair,

 

the 9401 has a ±30V overvoltage protection built in, so you could (at own risk!) use it with 24V pulses too.

But I prefer some resistors and Z diodes for protection…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 10
(9,314 Views)

2 resistors that'll work as voltage divider should be easy enough. E.g. 1k + 4,2k, connect the DAQ over the 1k resistor.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 10
(9,304 Views)

@LennartM wrote:

For instance this one: https://www.sparkfun.com/products/12009


That one is not made for handling 24V.  And finding level shifting chips that can handle 24V is also really hard (I have yet to run into one).

 

The simple solution is a resistor and Zenor diode circuit.  For more isolation, a solid-state relay would be a good way to go.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 10
(9,286 Views)

@crossrulz wrote:

@LennartM wrote:

For instance this one: https://www.sparkfun.com/products/12009


That one is not made for handling 24V.  And finding level shifting chips that can handle 24V is also really hard (I have yet to run into one).

 

The simple solution is a resistor and Zenor diode circuit.  For more isolation, a solid-state relay would be a good way to go.


Ah, didn't look at the specs enough. But an optocoupler is also a good option. For instance this one: https://www.amazon.com/24V-Optocoupler-Voltage-Level-Converter/dp/B06XKSFGXX

You do have to check if the speed is fast enough. An encoder signal can be quite fast.  There is also a 80 kHz variant.

Message 6 of 10
(9,281 Views)

Well if a simple voltage divider will not work why not just use a transistor and a couple resistors like this?

You might have to change the resistor values in the voltage dividerYou might have to change the resistor values in the voltage divider

 

========================
=== Engineer Ambiguously ===
========================
Message 7 of 10
(9,254 Views)

I like the idea of optoisolators particularly if there is a concern of galvanic isolation.

 

If R1 is blown you will have 24V on the base of the resistor.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 10
(9,238 Views)

@Ben wrote:

I like the idea of optoisolators particularly if there is a concern of galvanic isolation.

 

If R1 is blown you will have 24V on the base of the resistor.

 

Ben


Why would R1 blow?

 

Even if if did all that would probably do is blow the transistor and put constant 5 volts on the output.

Nothing too tragic. Well except for shorting the 24V to ground through the shorted transistor...

========================
=== Engineer Ambiguously ===
========================
Message 9 of 10
(9,227 Views)

More likely, it would "short" 24 volts to the 5 volts supply and the 5 volts input of the following electronics, which is quite dangerous for those electronics. The ground line has still another resistor in it. So that optocoupler in not a bad idea at all. But I agree that there is normally little worry for a 10K resistor (in this configuration) to blow up. 

0 Kudos
Message 10 of 10
(8,325 Views)