Author Topic: Sensing (interfacing) high voltage with arduino or any Microcontroller  (Read 5491 times)

0 Members and 1 Guest are viewing this topic.

Offline fourfathom

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: Sensing (interfacing) high voltage with arduino or any Microcontroller
« Reply #25 on: September 10, 2019, 03:10:58 pm »
I know that a single voltage divider would work in this case, but I would like to minimize the stresses on components, so I think multiple levels of attenuation with two voltage dividers+2 zeners will be something I will implement.

I don't think that multiple stages really buy you anything.  The stress on the components can be calculated quite easily as long as your assumptions are correct.  The first step is to check the power dissipation.  In the simple divider the 150K resistor (or whatever value you select) will see the bulk of the power.  With 150V input, the voltage across this resistor will be about 148V.  That's essentially 150V, so the dissipation will be 1502 / 150,000 = 0.15W (simple Ohms Law stuff).  A quarter-watt resistor will comfortably dissipate this amount of power, but you could use 1/2W part if you want even more margin or if you think the input voltage will greatly exceed 150V.  The power dissipation in the rest of the components is trivial in comparison.

You then look at the current in the optodiode.  This is being fed by the resistive voltage divider plus the series resistor, which has an equivalent output impedance of 1K + (150K || 2.7K) =  3.65K.  At 150V input, the effective voltage driving this impedance will be 2.65V.  Assuming the Optodiode forward voltage is 0.9V, the input current will be (2.65 - 0.9) / 3.65K = 0.48 mA.  You could double the input voltage and still be nowhere near stressing the optodiode.

If you were to reverse the 150V polarity the reverse voltage at the optodiode would be -2.65V.  Again, no stress on the opto.  In fact, that zener or the 1K series resistor really don't add much in the way of protection -- this circuit is already pretty bulletproof.

You do want to consider the high-voltage input, and make sure that the 150K resistor and connections aren't going to leak or flash-over.  A common 1/4W 5% resistor will have a voltage rating of around 350V (this is not related to power dissipation).  Should be OK.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 
The following users thanked this post: Laszlo

Online ledtester

  • Super Contributor
  • ***
  • Posts: 3282
  • Country: us
Re: Sensing (interfacing) high voltage with arduino or any Microcontroller
« Reply #26 on: September 11, 2019, 12:33:28 pm »
In this design how necessary is R2?

832281-0

It seems that R2 is just an additional load on the Zener regulated power supply formed by R1 and  D1.
 
The following users thanked this post: Laszlo

Offline LaszloTopic starter

  • Contributor
  • Posts: 36
  • Country: gb
Re: Sensing (interfacing) high voltage with arduino or any Microcontroller
« Reply #27 on: September 11, 2019, 03:07:34 pm »
If you want fewer components, you could look into LR8 linear regulators: http://ww1.microchip.com/downloads/en/DeviceDoc/20005399B.pdf

Tried it. Also tried the TL783, but the power dissipated was greater than I wanted it to be.

I don't think that multiple stages really buy you anything. 

Great answer. I've done the simulations, and you are right, the second voltage divider dissipates next to nothing, and the majority of the power gets "burned" at the first resistor. Built both circuits on a breadboard, and the only difference is the voltage levels in between the different stages at the divider. The first picture is the original, second is what you suggested. Ch1 is opto-led in, Ch2 is measured at the divider.
The other reasons why I was thinking of doing 2 stages of attenuation is to reduce the effect of EMI on the device. For example, the last Zener clamp would do nothing other than dissipating the occasional spikes. Am I wrong in there too?
Also, wouldn't an additional stage effect the ruggedness of the circuit (for example, the first resistor fails short.)?

Cheers,
Laszlo




 
 

Offline fourfathom

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: Sensing (interfacing) high voltage with arduino or any Microcontroller
« Reply #28 on: September 11, 2019, 03:28:33 pm »
In this design how necessary is R2?

(Attachment Link)

It seems that R2 is just an additional load on the Zener regulated power supply formed by R1 and  D1.
R1 and r2 form the voltage divider that establishes the drive source for the opto. In normal operation the zener might as well not be there, it only serves to clamp transients that vastly exceed the positive or negative voltage input range. I doubt if you need it. You could also eliminate the series resistor going to the opto,
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 3282
  • Country: us
Re: Sensing (interfacing) high voltage with arduino or any Microcontroller
« Reply #29 on: September 11, 2019, 08:55:33 pm »
R1 and r2 form the voltage divider that establishes the drive source for the opto.

Ok, after thinking about it here's my reasoning on why R2 is desirable -- it effectively raises the trigger voltage of the opto. If we assume the opto's LED doesn't conduct until it has a forward voltage of, say, 1V, then the voltage divider requires the input voltage to be >= 1V * 153/3 = 50V before the opto LED starts to turn on. Without R2 the LED would start to turn on at a much lower voltage.

 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 13217
Re: Sensing (interfacing) high voltage with arduino or any Microcontroller
« Reply #30 on: September 11, 2019, 09:56:56 pm »
Also, R3 is essential if you keep the clamping Zener, but pointless if you omit it as then it simply adds to the Thévenin equivalent resistance of the R1:R2 divider.

If you are going to add a second Zener, put it in series with the opto LED to give a higher and better defined threshold voltage.
 

Offline fourfathom

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: Sensing (interfacing) high voltage with arduino or any Microcontroller
« Reply #31 on: September 12, 2019, 02:47:52 am »
R1 and r2 form the voltage divider that establishes the drive source for the opto.

Ok, after thinking about it here's my reasoning on why R2 is desirable -- it effectively raises the trigger voltage of the opto. If we assume the opto's LED doesn't conduct until it has a forward voltage of, say, 1V, then the voltage divider requires the input voltage to be >= 1V * 153/3 = 50V before the opto LED starts to turn on. Without R2 the LED would start to turn on at a much lower voltage.

Yes, exactly. 

Also, R3 is essential if you keep the clamping Zener, but pointless if you omit it as then it simply adds to the Thévenin equivalent resistance of the R1:R2 divider.

If you are going to add a second Zener, put it in series with the opto LED to give a higher and better defined threshold voltage.

Yes. 

I would have been less terse in my explanation, but I was posting from my phone.

Since the on/off threshold voltage requirement is so loose, I decided that the simple resistive divider (without a series Zener) would be adequate, and would make it easier to control the opto-diode current.  Using a series Zener would have tightened up the switching threshold, but would have made the opto-diode current range be greater over the wide input voltage range.  You can play with this in simulation to get a feel for the tradeoffs.  There is no single "correct" answer.

Looking at the reverse-voltage spec for the 4N32N opto, I see a -3V maximum.  If you want to protect against reversed input connections (and you probably should) then you want either the Zener as shown in my schematic, or a simple diode (1N400X) reverse-polarity across the opto-diode.  The forward current spec is high enough that you really don't need the Zener or the series resistor R3.  If you eliminate R3 you could increase the values of R1 and R2, which has the benefit of reducing the load on your input.  By the way, that 4N32N opto isn't particularly sensitive, but it should work OK.

As far as worrying about the ruggedness of the components, as long as the voltage and power dissipation specs are kept in mind there isn't really anything to worry about.  To be extra-sure you could specify a special high-voltage resistor for R1, or use two 1/4W 75K resistors in series to double the power and standoff-voltage values.  Component layout and human factors will be more critical than component failure.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Offline fourfathom

  • Super Contributor
  • ***
  • Posts: 2005
  • Country: us
Re: Sensing (interfacing) high voltage with arduino or any Microcontroller
« Reply #32 on: September 12, 2019, 05:00:28 pm »
The other reasons why I was thinking of doing 2 stages of attenuation is to reduce the effect of EMI on the device.

Here's a simplified schematic.  The opto is just one chosen at random from the LTSpice library, there are no doubt more sensitive ones available.  I used a 1N4148 diode to clamp the reverse voltage, and even with 1 1KV sinewave applied the opto and D1 currents are under 6mA.  Of course at 1KV, R1 is getting fried.  Remember that with this simple resistive divider the switching threshold is not tightly controlled.

EMI suppression can be accomplished with a simple 0.1uF capacitor across the opto-diode.  With the approx 4K effective source resistance the -3dB frequency will be around 300Hz.  Any EMI in to 100 KHz-100 MHz will be well-suppressed.  For EMI over 100 MHz you might want a 0.01uF cap in parallel with the 0.1uF part.  For really bad EMI we can give you advice on more effective filters, but for normal bad EMI the single capacitor should work well.  Also, if your opto has the base of the phototransistor brought out (as does the one in my schematic), you can tie this to the output-side emitter through a small capacitor (say 0.01uF) to provide additional noise filtering.  This will slow down the on/off switching time, but since you are following this section with a Schmitt trigger this shouldn't matter.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf