0
\$\begingroup\$

I have an old device that contains multiple buttons that are all tied to some connectors in the back. The connectors are hooked up to a computer that interprets each button press and sends out a command depending on what button was pressed. When the buttons are depressed, there is a constant 24V DC voltage coming out of the corresponding pin from the connector. When the button is pressed, the voltage on that same pin quickly changes to -24V DC. I am in the process of upgrading the hardware in the computer and the IO modules can only accept a range of 0 to +5V. I am trying to figure out a way that I can step down the +24V down to about +5V and convert the -24V to something close to 0 so that the computer modules can interpret that as a low. Because of the positive and negative voltage toggling through a single wire, I am assuming that I just require a single converter. I am so confused as to how I can even work this out or if it is even possible. Any help would be greatly appreciated.

\$\endgroup\$
1
\$\begingroup\$

It's called a "DC clamp" circuit:

schematic

simulate this circuit – Schematic created using CircuitLab

The Schottky diodes prevent the right-hand side from dropping below 0V or rising above 5V. If the left-hand side exceeds this range, the diodes conduct, and the excess voltage is dissipated in the resistor.

The forward voltage drop of the diodes is about 0.3V, so the final voltage range you get is -0.3V to +5.3V, which is usually acceptable to equipment that nominally requires a "0 to +5V" range.

|improve this answer|||||
\$\endgroup\$
0
\$\begingroup\$

You could also employ a Zener if that's your cup of tea.

schematic

simulate this circuit – Schematic created using CircuitLab

This will be slightly more conservative than Dave's -- the output will be 0V to just under 5V (the 1N4732A is 4.7V) -- if you're worried about the extra 0.3V. But you'll pay: this design uses two different devices plus and an extra resistor.

|improve this answer|||||
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.