3-30V (Sinking/Sourcing) to Arduino Input

I've been working on a circuit that would take a field digital input ranging from 3-30 to feed the input of an arduino. I'd also like an LED to go on when the field voltage is above 3 volts without taking up and arduino output.
The field input can either be sinking or sourcing so I needed to use a bi-directional opto-coupler to make this work. Here is the circuit so far. I'm definitely no expert so I could use a little help to design this one.

That will work, but you probably don't need the transistor. The optocoupler output can handle up to 50 mA, and light up an LED with a suitable current limiting resistor.

@jremington
With 30volt input, yes. But with 3volt input there won't be enough opto LED current to directly/fully drive a LED with the opto transistor (CurrentTransferRatio).

Why the pair of schottky diodes. You seem to use an opto with bipolar opto LED.

Using an Arduino pin for the indicator LED would be much easier
(remember that the analogue pins of an Arduino (Uno) are also common digital pins).
Then you only need two parts (apart from the indicator LED).
The resistor, and the opto from a digital pin to ground (with internal pull up enabled).
On/off point could then also be 'sharper'.
Leo..

OP's image:

That should be an NPN transistor, won't work like that with a PNP. Otherwise the circuit looks OK to me.

The BAT54C doesn't make sense indeed.

With 30volt input, yes. But with 3volt input there won't be enough opto LED current to directly/fully drive a LED with the opto transistor (CurrentTransferRatio).

No, it will work.

The current transfer ratio of that optocoupler is high (greater than one for most versions) and sufficient to light an efficient LED on the output, even with 3V input.

wvmarle:
The BAT54C doesn't make sense indeed.

that's a double zener clamping/clipping for AC... are you using an AC input?

The BAT54C is a double Schottky diode. With an absolute maximum reverse rating of 30V it's likely one of them will fail quite quickly, causing a short and burning the other.

wvmarle:
The BAT54C is a double Schottky diode. With an absolute maximum reverse rating of 30V it's likely one of them will fail quite quickly, causing a short and burning the other.

You're right... my vision is getting worse... thought they were zener.

After a few modifications, I've come up with this circuit.

The input will be DC however, it can be either sinking our sourcing so I need to be able to have a negative and positive signal on either field input. That's why I'm using a bi directional opto-coupler. The dual zeners on the input will only conduct once over ~3.3v

I used a transistor on the output because I wasn't able to drive the LED just through the opto-coupler.

How is this design?

No need for the zeners, and the part number you used does not seem to exist.

Use a 1k or 2k2 resistor (or some value in between) and you get 3-30 or 1.4-14 mA of current through the optocoupler. That's enough to switch the LED at the low end, within spec of the optocoupler on the high end.

1 Like