Using a 4N35 for 10v - 36V sensing?

Hi,

Can someone please give me some advice on this?

I need to sense a voltage source, ranging from say 10V to 36V. I understand that it has an LED built-in, which has a limit of 6v /60mah so I would need to use a resistor of say 720ohm, or possibly a 1K resistor. I need to know when a vehicle's ignition is turned on, but want to use the application in 12v and 24v vehicles. I have seen, in some cases that the 24V regulator can jump to 30V, although normal charging is about 27v on the 24v vehicles.

The questions(s) I have are:

  • Would a 1K be enough? Or should I got a bit higher?

  • If the volts, on the LED drop to say 2V, would the opto isolator still function properly?

  • Do I need a CAP, and transistor to protect the opto isolator, from possible backfeed from the vehicle's alternator.

  • would I be able to use the same circuit to measure the input volts? Or should I rather measure it through a voltage divider?

The Opto Isolator would be connected to a Analog PIN on a GBoard Pro, which is basically a MEGA2560 with a lot of breakout pins, but the digital PINS are being used already.

If you simply want to tap off the led current... all you need to is make sure arduino does not see > 5v

So a resistor divider will do it, no opto required, a 1k resistor and a 4v zener 5v may be on the boundry due to voltage spikes a 4v zener will ensure it does not go past 5v..

If you're really serious use a 5v TVS diode to clamp down the voltage from the resistor divider, slap in a cap to help give a nice dc 4-5v cleanish signal ..

I had to use ac input to simulate voltage spikes.. you'll notice how the resistor divider works providing you don't go over your expected voltage, while the zener diode will happy take 120+v and you need not worry

cjdelphi:
If you simply want to tap off the led current... all you need to is make sure arduino does not see > 5v

So a resistor divider will do it, no opto required, a 1k resistor and a 4v zener 5v may be on the boundry due to voltage spikes a 4v zener will ensure it does not go past 5v..

If you're really serious use a 5v TVS diode to clamp down the voltage from the resistor divider, slap in a cap to help give a nice dc 4-5v cleanish signal ..

I prefer to use the Opt Isolator, since the voltages can sometimes jump very high, and I'd rather have a burn-out iso optocoupler than a burn out Arduino :wink:

But at the same time, I'd like to protect the iso optocoupler as much as I can.

Then use TVS diodes.

I think that you'd do better with an LED shining on a photoresistor (inside heatshrink or similar.)
It probably won't be any good with an input < 3V, "YMMV", but neither likely will the 4N35.
However, the photoresistor will have an analog output.
I, for one, wouldn't worry a lot about protecting an LED from spikes.

It is more difficult to protect an optocoupler than an input to the uC.
The input circuit to the LED have to bee low ohmic and the LED are sensitive for overcurrent.
With high resistance and capacitors and TVS it's possible to protect the input.

Pelle

I thought the goal was sense if voltage is on or off ?

100 volt transistor, resistor from the incoming power to the base. zenier to the base and to ground. the base will be held at 5 volts ? run the opto from that. the incoming voltage will not matter as the zenier will hold a voltage on the base.

the load will be the LED so overheating because it is in the linear range should no be a problem. probably not the smallest parts count, but all parts one should have on-hand.

if the goal is voltage detection, then I think a simple voltage divider to an analog pin would be the simplest.

The goal isn't firmly fixed.
10-36V, but possible as low as 2V; using an analog pin so maybe analogRead desired.
(And, yes, I'm aware that an "analog in" pin can be dR'ed.)

Hi,

The goal is simple:

I need to know when a diesel engine is turned on. In some cases it could be a 12V environment, running at about 13.8 - 14.5V (alternator charging), or 24V (27 - 29V, alternator charging). The problem is, sometimes the alternator can cause a large feedback and could blow my arduino, even with a voltage divider.

So, to protect the Arduino, i decided to use an opto coupler (which is the same as running a LDR and LED in piece of heat shrink tube), but now I need to protect the opto coupler from the high feedback voltages.

I'll look into the TVS diodes suggested, but does anyone have, or know off a sample circuit I could use in this case?

How high, how great a "feedback voltage"?
What is a "feedback voltage"? Is it short-lived, like a pulse?

Let's say you biased the LED such that with 24V there'd be 10mA.
If there was a 75V feedback voltage, I suppose that for that brief period (big assumption, as I am not versed in the high feedback phenomena) the LED current would be around 30mA.

I don't own an oscilloscope, so I honestly don't know how high voltages these feedbacks can have or for how long. I haven't been able to pickup a high feedback on my 12v based diesel pickup yet, but I know some of the diesel water pumps and generators (which is what I want to tie an Arduino to, for remote monitoring and on/off control) sometimes cause high voltage spikes. It's probably safe to say that it's only momentarily, otherwise the other electronic equipment would be fried - or they already have some protection built-in?