4
\$\begingroup\$

The problem

Handle digital inputs on a MCU, the input could be 5V, 12V, 24V or an open collector.

My solution

My approach is based on jumpers, given the fact that the inputs dont change behavior in time (if the input is 0v or 5v it will be that always and never will change to 12v or 24v or open collector), so I set the jumpers one time in my circuit to work with the desired voltage. This is the most smart way i can think to solve this.

How it works

If the input is 0V and 12V, I set JP2 to 1-2, JP3 to 2-3, JP5 to 1-2 and JP7 to 1-2. If the signal is open collector; I set JP2 to 2-3, JP3 to 1-2, JP4, JP5 and JP6 dont care and JP7 to 2-3.

enter image description here

This seems to me the best way to go, but I don't like the amount of jumpers in my circuit, what do you think? what will be your approach?

\$\endgroup\$
6
  • \$\begingroup\$ What's the maximum frequency of your input signals? \$\endgroup\$
    – Oli Glaser
    Jan 2, 2013 at 22:23
  • \$\begingroup\$ very slow signal, below 10Hz \$\endgroup\$
    – DomingoSL
    Jan 2, 2013 at 22:24
  • \$\begingroup\$ What current can the sensors source / sink? \$\endgroup\$
    – jippie
    Jan 2, 2013 at 22:26
  • \$\begingroup\$ you mean the MCU inputs or the external signals? \$\endgroup\$
    – DomingoSL
    Jan 2, 2013 at 22:27
  • 1
    \$\begingroup\$ I would change the 3 resistors to 1. Then in series a zener and parallel to the zener the LED (with a current limiting resistor). Or use a JFET (eg. BF256C) to act like a (series) current source and forget about resistors (and zener) all together. \$\endgroup\$
    – jippie
    Jan 2, 2013 at 22:28

1 Answer 1

4
\$\begingroup\$

Replace the jumpers and resistors with a simple JFET current source. That alone saves you a lot of parts.

enter image description here

\$\endgroup\$
3
  • \$\begingroup\$ Not entirely sure if it works with 5V, the datasheets I've found so far aren't particularly clear. But I wouldn't expect much of a problem. \$\endgroup\$
    – jippie
    Jan 2, 2013 at 22:49
  • \$\begingroup\$ The Fairchild datasheet I found doesn't even explicitly say the part is a JFET. \$\endgroup\$
    – The Photon
    Jan 3, 2013 at 0:58
  • \$\begingroup\$ +1, and here's an App Note on JFET current sources. \$\endgroup\$ Jan 3, 2013 at 2:48

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