2
\$\begingroup\$

When I press an ON-OFF type switch (SPST), I would like to have a corresponding HIGH or LOW registered on the inputs of both a 5V-level microcontroller as well as a 10V-level device, without damaging either one obviously.

How would I go about achieving this -- should I use a resistive divider?

\$\endgroup\$
  • \$\begingroup\$ Do they have a common ground? \$\endgroup\$ – Trevor_G Oct 19 '17 at 2:32
  • \$\begingroup\$ @Trevor: Yes, common ground. \$\endgroup\$ – boardbite Oct 19 '17 at 2:48
  • 1
    \$\begingroup\$ Trevor's answer is good and is what I would choose, provided you're ok with either using a normally-closed pushbutton or accepting an active-low signal on the destination devices. That said, your idea of using a voltage divider would be fine too - but beware of "sneak-path" powering the 5V MCU through the divider and switch when it's 5V supply is unpowered but the 10V is hot. \$\endgroup\$ – pericynthion Oct 19 '17 at 6:10
  • \$\begingroup\$ Out of curiosity what is the 10V device? \$\endgroup\$ – pericynthion Oct 19 '17 at 6:11
  • \$\begingroup\$ @pericynthion: Thank you for the suggestions. And sorry about this really late (and possibly boring) reply: It was one of the control inputs of a VFD. \$\endgroup\$ – boardbite Dec 17 '17 at 16:18
3
\$\begingroup\$

Assuming you have common grounds you can use diodes like this.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • \$\begingroup\$ OK. I'm reading up now about diodes; I've only used them once before based on an example circuit. Would a diode like 1N4148 or 1N400x be appropriate here? Also, what values would you suggest for the resistors? \$\endgroup\$ – boardbite Oct 19 '17 at 2:52
  • 1
    \$\begingroup\$ This sort of low speed signal logic application is not very sensitive to the choice of diode or resistor. Either of those diodes would be fine. A 10k resistor is a safe bet. \$\endgroup\$ – pericynthion Oct 19 '17 at 6:06

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.