Author Topic: Safety issues when sensing AC voltage  (Read 8769 times)

0 Members and 3 Guests are viewing this topic.

Offline yelstorTopic starter

  • Contributor
  • Posts: 10
  • Country: co
Safety issues when sensing AC voltage
« on: November 04, 2023, 04:42:15 pm »
Hello guys,
I was asked to upgrade an AVR (AC voltage regulator) because it is using a very old freescale microcontroler wich is hard to find out, besides more expensive.
This AVR is very cheap, to make it affordable, so I have been told, new design can not go further than 10% above of the current production price.
The way it senses the AC voltage is attached. It is basically and half wave rectifier and resistor divider, then the signal go to the ADC pin. Here,  Neutral and micro controller GND are connected. I know, for safety it is better to have microcontroler gnd isolated from mains, but in this case I see no problem because people is not going handle the circuit. The pcb is going inside a box. Right? I am asking you guys because maybe I am forgetting something, that can affect either safety or perfomance.
I can sacrifice performance on a cheap design but not safety.
It is good to mention this design has worked like that for years and so far nobody has died.
Thanks guys.
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 11950
  • Country: us
  • Retired, now restoring antique test equipment
Re: Safety issues when sensing AC voltage
« Reply #1 on: November 04, 2023, 04:52:01 pm »
Can you add an inexpensive 60 Hz transformer before the rectifier input, to isolate line neutral from ADC ground?
A quick search at Mouser shows this series   https://www.mouser.com/datasheet/2/410/F56_020-781680.pdf   from Triad at about $8.00 USD in singles, with a range of secondary voltages available, at about 1.1 VA power.
I'm sure the cheap sites have similar parts.  These have full safety ratings.
« Last Edit: November 04, 2023, 04:56:55 pm by TimFox »
 

Offline yelstorTopic starter

  • Contributor
  • Posts: 10
  • Country: co
Re: Safety issues when sensing AC voltage
« Reply #2 on: November 04, 2023, 05:02:06 pm »
Thanks for the answer.
Unfortunatelly, 8USD is quite a lot for this producto. Telling them the price is going up 8 dollars they are going to go crazy. Unless I give them a very good argument . I would like to have a good example in wich situation the current way voltage is being sensed can be consider as a life threat
 

Offline djacobow

  • Super Contributor
  • ***
  • Posts: 1183
  • Country: us
  • takin' it apart since the 70's
Re: Safety issues when sensing AC voltage
« Reply #3 on: November 04, 2023, 05:26:15 pm »
It helps to understand the application. Are you selling these? Where are they in the product? Can we see a photo of the existing board? Was the old board UL or otherwise certified? Do you understand the safety considerations: creepage, fusing, appliance enclosure classes, etc?

If you know what you are doing, a circuit like the one you drew can be fine, but it's a big if.
 

Online zapta

  • Super Contributor
  • ***
  • Posts: 6596
  • Country: 00
Re: Safety issues when sensing AC voltage
« Reply #4 on: November 04, 2023, 05:39:56 pm »
>> If you know what you are doing, a circuit like the one you drew can be fine, but it's a big if.


Are there special safety considerations also on the component selection? E.g. the 300K resistor?
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 11950
  • Country: us
  • Retired, now restoring antique test equipment
Re: Safety issues when sensing AC voltage
« Reply #5 on: November 04, 2023, 05:54:38 pm »
Thanks for the answer.
Unfortunatelly, 8USD is quite a lot for this producto. Telling them the price is going up 8 dollars they are going to go crazy. Unless I give them a very good argument . I would like to have a good example in wich situation the current way voltage is being sensed can be consider as a life threat

That's the price in singles:  I'm sure you can find a similar transformer much cheaper, since it does not require heavy iron for low-power applications.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 9071
  • Country: ca
Re: Safety issues when sensing AC voltage
« Reply #6 on: November 04, 2023, 06:00:59 pm »
You can't take an old product and toss it at modern safety standards.
There is a big difference nowadays.

If you "touch" this old design, the safety responsibility is on you, the engineer.
Regardless of a cheap, lazy company that wants to make it work with "only little changes" - I would be looking at a redesign of the board, you are changing the MCU anyways. Or tell them you won't touch this old product without redesigning it including safety. It might cost a few dollars more, or not.

VACF line would have a fuse, D3 and R5 must be able to withstand mains transient overvoltages, as well as have the required PCB spacings.

Example is 300V Cat. II is 2.5kV so how will you ensure those parts can take it? It is likely why the MCU input gets damaged. Several MELF's to make up R5 is what is usually done.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: fi
Re: Safety issues when sensing AC voltage
« Reply #7 on: November 04, 2023, 06:15:02 pm »
Adding random isolation layers for no reason does no increase safety (*), so ignore all advice about magical transformers.

(*) if you don't understand where the dangers are, reducing them to smaller area is not that helpful, because the risk is still there; for example, if you isolate the power but forget to isolate the voltage measurement signal and then assume "the power side is safe because it's isolated", you have a classical example of false sense of security.

Without isolation, the circuitry in whole is simply like any mains wiring, with the related creepage, clearance distances and IP ratings to user accessible parts. Possibly warning notes if that is deemed beneficial to avoid false assumptions.

Isolation is needed when you have to interface with SELV / human touchable stuff, but not all electronics need this; LED lightbulbs and simple AVRs (voltage regulators, not the microcontroller brand) are perfect examples. LED lightbulb does not have interfacing at all, and a simple AVR usually just a potentiometer where you can use a plastic shaft (similar to master/slave switches, which also are non-isolated and use plastic shaft potentiometers for adjustment).

If you are making a product, reading the relevant standards (to your legislation) is a pretty good idea, so that you will know more exactly what kind of distances, casing and markings are needed for a compliant product.
« Last Edit: November 04, 2023, 06:22:57 pm by Siwastaja »
 
The following users thanked this post: Someone, wraper, shakalnokturn, yelstor

Offline yelstorTopic starter

  • Contributor
  • Posts: 10
  • Country: co
Re: Safety issues when sensing AC voltage
« Reply #8 on: November 04, 2023, 11:18:53 pm »
It helps to understand the application. Are you selling these? Where are they in the product? Can we see a photo of the existing board? Was the old board UL or otherwise certified? Do you understand the safety considerations: creepage, fusing, appliance enclosure classes, etc?

If you know what you are doing, a circuit like the one you drew can be fine, but it's a big if.
Yes, those AVRs are   being sold  here in  my country for around 20 years. It is used for home apliances such TV, pc, refrigerator etc.
There is a national certification this product every year gets wich is based on the standard IEC 60686:1980 (yes, very old standard :scared:). Anyways, the only thing I found on this standard about safety was Fusing and earthing. The current product has  thermal magnetic breaker for over current, and of course the earth is connected to the chasis. So far I know that standard does not requiere to open up the chasis and check clearances or something like that.
Unfortunatelly I do not have now one of these AVRs but inside the box there is only a big autotransformer and the board wich controls some ralys adding or resting depending on the input voltage.The board is held by a plastic bracket,  allowing some clearence between the board and the chasis.
I can  only think in 2 situations where someone can get shocked. If they use the avr without the cover, they could touch the board accidentaly and get shocked. The other  one  is, for some reason the live wire touches the cover and then user touches the cover. In these 2 situation, I can not blame the product because it is very clear the product must operate with the cover on. In  the  second example, here it  is mandatory to have a diferential circuit breaker, so this one must go off in case some current is going to the earth.   
I have came up an idea, and is using  the autotransformer,  give  few turns and use this one as my isolated voltage sensor. The  problem with this is I would  be sensing the input voltage instead the output.
 

Offline yelstorTopic starter

  • Contributor
  • Posts: 10
  • Country: co
Re: Safety issues when sensing AC voltage
« Reply #9 on: November 04, 2023, 11:30:29 pm »
I totally agree with you, more safety the better, but we can not have everything. If we want  the safest product with a really good performance, that is not going to be cheap. In this particulary case I think on people safety, but not in the circuit itself safety. If there is a trasient that damage the microcontroller pin, people should understand that they have not bought the best product out there, they have bought the cheapest. You get what you pay for  I guess
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 9071
  • Country: ca
Re: Safety issues when sensing AC voltage
« Reply #10 on: November 05, 2023, 01:15:57 am »
Do you want "safety" or not?
It's not always electrocution, there can be fire hazard as well. If the old 1980 design has no circuit breaker, for example.
 

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 8801
  • Country: ca
Re: Safety issues when sensing AC voltage
« Reply #11 on: November 05, 2023, 01:52:22 am »
well if the safety is not a priority

i would not help in that case,   and saying you want the cost down and get over safety is a NO

and some people here will be reluctant to help  because you want or may pass a blind eye over this, and nobody here want to assume repercussions or accidents

how much is safety, how much is it worth ...

if your "clients" can not understand that   DROP THEM  even if you're saying it was fine before,  the design and considerations are changing ...
« Last Edit: November 05, 2023, 01:56:43 am by coromonadalix »
 

Offline bdunham7

  • Super Contributor
  • ***
  • Posts: 9437
  • Country: us
Re: Safety issues when sensing AC voltage
« Reply #12 on: November 05, 2023, 03:23:38 am »
Here,  Neutral and micro controller GND are connected. I know, for safety it is better to have microcontroler gnd isolated from mains, but in this case I see no problem because people is not going handle the circuit. The pcb is going inside a box. Right? I am asking you guys because maybe I am forgetting something, that can affect either safety or perfomance.

I think as long as your resistor R5 is an appropriate type I don't see any issue.   It should have a high-voltage rating, I've linked a datasheet for a series I would use--they're as little as 5 cents in bulk.  Having control circuitry floating at mains potential is actually not so uncommon and as long as the circuit board is appropriately spaced and isolated, I think it's fine.  I don't know what specific regulations you have to meet and I'm no expert in that area, so perhaps there is more to think about.  I don't think anyone can give you an actual answer here in that regard without a diagram and description of the entire product. One issue I would look at is to make sure that the input impedance of the ADC pin on your replacement device is sufficiently high, since this circuit only provides a few hundred microamperes.  Also, D3 should be a 1N4007 or similar if it isn't already (cheap, good) and I don't see why D4 is needed.  If you are going SMD, then you'll need to look up different parts but the same idea applies. 

https://www.vishay.com/docs/30260/hvr2537.pdf

« Last Edit: November 05, 2023, 03:26:41 am by bdunham7 »
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 2614
  • Country: is
Re: Safety issues when sensing AC voltage
« Reply #13 on: November 05, 2023, 02:39:16 pm »
I'm curious about how the 'regulator' portion works? Is it an SCR / Triac control similar to a dimmer or is it more like a mechanically driven variac?
Perhaps a tap changing autotransformer? Circuits being referenced to neutral could be o.k. but can you be certain there is no possibility of the unit being mis-wired if it gets moved to another location on the factory floor? Are the any external connections to the MCU like a data link or voltage monitor output connected to an external computer for instance that would get blown to smitherines in the event neutral and hot got swapped? Your name is on the final re-design in the event someone gets killed!!
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 4035
  • Country: es
Re: Safety issues when sensing AC voltage
« Reply #14 on: November 05, 2023, 11:02:00 pm »
This is what optoisolators are for.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline miket6000

  • Contributor
  • Posts: 11
  • Country: nz
Re: Safety issues when sensing AC voltage
« Reply #15 on: November 06, 2023, 01:51:51 am »
Assuming the AVR is properly designed there is nothing inheritly unsafe with the digital electronics being mains referenced, it's done in appliance design all the time. If course the assumption is that suitable creepage and clearances are meet and that the design is either double isolated (class II) or in an earthed enclosure (class I).

As a hardware (and / or SW) developer you will need to be very careful about programming and developing the controls.

The questions you're asking on a public forum do seem to suggest you don't have the skills to be developing something like this for public use, especially since you don't seem to be aware of the compliance requirements and are suggesting there will be no detailed 3rd party compliance checks.

I would be very careful, if you do make a mistake it's ultimately you who could be responsible for an accident.
 

Offline yelstorTopic starter

  • Contributor
  • Posts: 10
  • Country: co
Re: Safety issues when sensing AC voltage
« Reply #16 on: November 07, 2023, 01:20:59 pm »
Thanks guys for your help.
Here I atach the schematic of the product that is actually being used. My job is to change only the box that controls taps.
I am going to check out high voltage resistor and ADC impendance. I am still looking for one microcontroller, but I think I am going to go with STM32C0(very good price for 32bits 8)).
 

Online wraper

  • Supporter
  • ****
  • Posts: 19502
  • Country: lv
Re: Safety issues when sensing AC voltage
« Reply #17 on: November 07, 2023, 01:32:36 pm »
As Siwastaja said adding layers of "safety theater" does not improve actual safety. If circuit is totally isolated from human, adding random isolation only increases cost but has no beneficial impact on actual safety whatsoever.
 
The following users thanked this post: yelstor

Online wraper

  • Supporter
  • ****
  • Posts: 19502
  • Country: lv
Re: Safety issues when sensing AC voltage
« Reply #18 on: November 07, 2023, 01:36:59 pm »
well if the safety is not a priority

i would not help in that case,   and saying you want the cost down and get over safety is a NO

and some people here will be reluctant to help  because you want or may pass a blind eye over this, and nobody here want to assume repercussions or accidents

how much is safety, how much is it worth ...

if your "clients" can not understand that   DROP THEM  even if you're saying it was fine before,  the design and considerations are changing ...
Suggesting adding random transformers is not helpful at all. Those who suggested transformer did not even ask if MCU is powered from isolated source to begin with, which I really doubt.
« Last Edit: November 07, 2023, 03:08:49 pm by wraper »
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 11253
  • Country: fi
Re: Safety issues when sensing AC voltage
« Reply #19 on: November 07, 2023, 02:25:08 pm »
It's simply that some people can't resist the temptation of hitting the "reply" button and write something, even when they don't understand the question and have nothing to contribute. These people could be easily replaced by ChatGPT. For some reason, magic keyword of "safety" triggers all sort of zero-information "but think about the children" rationalizations. People whose mind work like this are a significant safety risk because they always fall for false sense of security, every time. They also mask real discussion which could be had about real safety, which, in this case, would be about enclosure design, plastic flammability ratings, impact testing, IP ratings, clearances and creepages. Adding a transformer does not change the fact that the damn circuit still operates on mains and therefore these safety aspects cannot be avoided.
« Last Edit: November 07, 2023, 02:28:24 pm by Siwastaja »
 
The following users thanked this post: wraper, shakalnokturn

Online wraper

  • Supporter
  • ****
  • Posts: 19502
  • Country: lv
Re: Safety issues when sensing AC voltage
« Reply #20 on: November 07, 2023, 03:19:26 pm »
BTW I suggest to get rid of R7 potentiometer and do digital calibration instead.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 9071
  • Country: ca
Re: Safety issues when sensing AC voltage
« Reply #21 on: November 07, 2023, 06:40:54 pm »
The MOV clamps spikes to a lower voltage, check the part's rating because that gives you some slack with spacings and the HV resistor requirements. I never see just one resistor used for voltage sense on 240VAC systems - it's typically 2-3 parts in series, MELF preferred.

The relays used for tap changing will arc a lot so the EMI will be high level, your board will need some extra design I would say.
 
The following users thanked this post: yelstor

Offline yelstorTopic starter

  • Contributor
  • Posts: 10
  • Country: co
Re: Safety issues when sensing AC voltage
« Reply #22 on: November 07, 2023, 07:43:20 pm »
Thanks guys. You all have really helped me a lot. I did not want to add more "safety" when is not really needed.
I think the idea of dividing 120V resistor in more in series is really good. I am going to apply it.
 I am going to follow up mechanical design to give a good clearence between the chasis and board.
Cheers 
 

Online wraper

  • Supporter
  • ****
  • Posts: 19502
  • Country: lv
Re: Safety issues when sensing AC voltage
« Reply #23 on: November 07, 2023, 08:35:09 pm »
Quantity of resistors in series needed depends on their voltage rating. Overall larger resistors have higher voltage raring but you need to check the datasheets as it can vary quite a bit between different series and there are special high voltage series too. There is nothing wrong with single resistor if it's a part with appropriate ratings.
EDIT: if you suspect this design may be assembled with random resistor series in future, of course it's better to just put multiple of them so it will be fine regardless of part used.
« Last Edit: November 07, 2023, 08:41:00 pm by wraper »
 

Offline yelstorTopic starter

  • Contributor
  • Posts: 10
  • Country: co
Re: Safety issues when sensing AC voltage
« Reply #24 on: November 07, 2023, 09:04:25 pm »
unfortunatelly I dont know where are they sourcing this resistor. thats why I think its better to go safe and add multiple series resistor do divide the voltage. Space it's not a problem on this design. besides I know they are preatty mean and as soon I leave the project working, they are going to start looking where to save some cents.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->