Detecting 110V DC

This question has been on my mind from the beginning. On the one hand I kind of imagine a half-wave rectifier in the Neutral side of a 30A mains AC circuit, making optical isolation pretty well essential. OTOH, if we are wanting to sense the voltage out of an EL power supply, it's not obvious that there is enough current to drive an optical isolator.

1 Like

The topic starter says LAST WEEK he installed a PCB with 100K. It was done before I opened this thread. Please read carefully. Don't use sarcasm when there is no place for any.

It is hard to read a text wall, just to get this sentence. I am appreciated for your time, but, you get the point.

Today, I checked, it was up to 200V DC. I don't think this approach is a good idea after all. Maybe to low down voltage with something, or to use some relay, or I don't know...

In the beginning it was an easy task. But it turns up into a nightmare. :slight_smile:

But you wrote post # 33 a week after the start of the topic. You have received enough information to find the cause of the erratic circuit performance. Just take a multimeter and check the state of your optocoupler's phototransistor. It will immediately become clear to you whether a 100k ohm resistor is suitable for this optocoupler or not.

If the voltage rises to 200V (that's another task), put a zener diode, like in post # 25. There is no nightmare. Any problem is solved.

Why a zener. Don't overthink this.

As said, make it easier on the opto transistor by only using the internal pull up,
use a 100n cap to bridge brownouts, and start with a ~100k resistor.
That will keep dissipation in the resistor down to 0.4W@200V.
Don't worry about protecting the opto LED. The resistor will burn long before max LED current is reached.
Leo..

3 Likes

Post #25
200k and 1k resistors = 1mA and 200Vx1mA = 200mW. On 1k resistor you have 1V, at 70V you wil have 0.35V, setup arduino threshold point 0.2V. Zener is for protection.

Protection of what...

If you're thinking of using a 5volt zener in a voltage divider, then think again.
Leo..

1 Like

that voltage on arduino input pin never be higher than 5V

What makes you think that max pin voltage is 5volt...

It could be max ±0.5volt (when the Arduino is off), making the zener useless.

Google "clamping diodes" if you feel the need for pin protection.
Leo..

1 Like

minimum is not dangerous .

$0.5 protection is better than be sorry.

I'll try again...

If the Arduino happens to be off, then there can't be more than plus or minus half a volt on the pin.

That makes zener protection useless in all situations.

Two Schottky diodes is a much better solution if... there is a need for protection.

Opto isolation of course doesn't need any pin protection.
Leo..

2 Likes

I feel for you, however @Wawa knows what he is talking about. If I were doing this for myself it would take no longer that 10 minutes.

I currently have an AC version of this. 120Vac using 120k in series with an opto. Note 120Vac reaches a peak around 170 Volts Peak (yes its not steady state). However I am using a simple leaded metal film resistor (which may not matter).

Voltage on 1k resistor has nothing to do with arduino power ON/OF.

In case 1k resistor is open.

Limit voltage to 1V , arduino can handle 5V.

Most of optocouplers requirted 5 time more current = 1W on resistor.

0V or 1V (0.35V), from where you get 0.5V and negative voltage ?

= 1mA,
Which part number is that ?

Maybe one day you will understand that pin voltage limits depends on VCC of the MCU.
Leo..

again
Voltage on 1k resistor has nothing to do with arduino power ON/OF.

and for Arduino is ?

Leo (Wawa) is absolutely correct.

The zener provides no protection for the processor when the processor is not powered up.

In fact from the original post it seems that processor supply is 3.3V so the zener also provides no protection when the processor is powered up (no protection from positive or negative input voltages).

In any case, whether valid or not, the use of a potential divider instead of an opto-coupler has been ruled out.

Because consume 5 time more current, good advantage

It is from some system that opens the doors. There is a wire that runs to five doors and checks are some of them open. If so, it returns. Doesn't matter which one. That is the place I am connected to. I have no idea what is happening there and why DC is not stable. My guess is the cable length and I am not sure what length it is, neither the AWG. There is a difference in which door is open in DC. And I can't go there anytime I want, neither stay as I want. Only when that guy is available.

Ok, if I get you correctly, this is the solution I should try:

oc2

Some 1/2 watt 68K resistor will do?