1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Measuring AC voltage

Discussion in 'Arduino' started by elecaau, Mar 2, 2017.

  1. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,043
    Likes:
    960
    Location:
    NJ
    Hi again,

    Well reliability is also affected by quality control, and apparently there is a variation because i have had neons blow out after only a few months and some that last for years. I have had in the past five years two blow out already. Sometimes they just get dimmer, and dimmer as time goes on. Sometimes they also start to flicker noticeably.
    But sometimes reliability is not measured by the performance of just one device, it is measured by two or more devices such as in this case a neon vs an LED. The LED will last a long time if driven properly and quality control is pretty good.
    One thing i do remember is that if the series resistor for a neon is made larger the neon lasts longer but yes with less brightness.

    You say you are using an opto coupler but you know what i meant, and that is a commercially made opto coupler with internal LED not neon.

    You may not mind changing a neon bulb, but the real question is can your application tolerate a down time while it waits for that replacement.

    The 'flicker' problem may or may not affect your application depending on how bad the LED or Neon flickers and how the transistor turning on and off 100 times per second may affect your application. It may matter, it may not matter. If it does not matter, you dont need a cap, if it does matter, you do need a cap. See how simple that was? :)

    Transformer isolation for commercial use is not the same as a general purpose transformer. They are wound differently. The typical wall wart is much safer than a 'regular' transformer because for the wall wart the windings are DOUBLE isolated. First, they are not wound one on top of the other, they are wound side by side, which puts a physical distance between ANY two turns of both windings. Second, they have a spacer that separates the two windings made of some insulating material so even certain crush directions wont even cause them to touch. Of course they also have the usual wire insulation, but that's not considered as part of the protection really that's of course just so the individual turns dont touch.

    This is coming from someone who worked in the power industry for many years who did design and some actual hands on testing of power equipment ranging in power from less than a watt to maybe 30k Watts, physical size about one square inch to cabinet designs that were 5 feet tall, 6 feet wide, and 2 feet deep.

    It's always your choice what you want to do with your own design, i only make suggestions based on experience and education in electrical engineering science.
     
  2. Superdat

    Superdat Member

    Joined:
    Mar 3, 2015
    Messages:
    115
    Likes:
    4
    Hi Mr Al
    I don't disagree with anything you've said. I'm just offering an alternative, I'm not saying it's the best thing since sliced bread, just an alternative.
    That said it doesn't help the OP.
    My comment about transformers was made to highlight irrational fears about using anything but a transformer. If the original circuit had a fuse or two it would be as safe as 220vac can be, an opto coupler of any sort makes it better still. As I said before I've never heard of a resistor or diode failing as a short circuit.
    By the time any voltage gets to the microprocessor it's not 220vac, same for an optocoupler, its diode is not working at 220vac otherwise it would be a fuse ( a blown one).
    During my time in the navy valves were in vogue and working with 200vdc or higher was the norm. The same was true for early Cathode Ray Televisions, big volts inside.
    You just needed to be much more careful about what you touched. Because microPs use 5vdc or less ppl become complacent about touching stuff, 220vac hurts don't touch it ;-)
     
  3. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,295
    Likes:
    647
    Location:
    Derbyshire, UK
    Nothing irrational about recommending transformers for safety, quite the opposite.

    However, for transferring a 'signal' an opto-isolator is ideal - there seems a huge amount of confusion in the posts here, confusing 'transformerless power supplies', 'opto-isolator switching', 'wanting AC or DC output', and the tread title is completely different again.

    However, as to never hearing of diodes failing S/C, then you can't have heard of much :D as it's by FAR the most common failure mode for a diode - any other failure is really very rare. As far as resistors go, it's unusual for them to go low resistance, but it does happen very occasionally, but required specific types of resistor for it to happen, and specific values as well - I've never seen it since the valve days, where it was a fairly common fault in a couple of TV models.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,043
    Likes:
    960
    Location:
    NJ

    Hi,

    As Nigel was saying, diodes regularly fail short circuit.

    That's an interesting point though about the view from another era to the present time. Back then we HAD to deal with 200v or even 300v circuits and there was no way around it back then. Now that we are used to 5vdc circuits, we frown on 200v circuits. Unfortunately the danger is still there, more so than with 5vdc because for one thing it's just more dangerous as power goes up as the square of the voltage, and also because we got 'used' to 5vdc circuits a 200v circuit might surprise us and catch us off guard. This actually happened to someone i know a couple months ago.
    So back then 200v was the norm, but today it is not, so maybe that is a good enough reason to stress the danger especially for new people in the field.

    Fuses do not always protect PEOPLE. They usually can protect an electronic device from further damage, but people can be more susceptible to damage, that's why ground fault interrupters were invented and are incorporated into buildings rather than simply using fuses alone.
     
  6. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,295
    Likes:
    647
    Location:
    Derbyshire, UK
    Do they EVER? :D

    Mostly they are to protect against further damage 'down line', and to prevent overheating and fires.
     
  7. Superdat

    Superdat Member

    Joined:
    Mar 3, 2015
    Messages:
    115
    Likes:
    4
    OK I've learned something about diodes, I did say "I've never known one to go short ciccuit", not that they never do. A modern film resistor by nature of it's method of manufacture is not likely to go short circuit, which is supported by Nigel. I'm sort of getting the dog with the bone feeling though, I haven't said anything that was intentionally contentious but there seems to be a need to contradict.
    To say a fuse is only to protect equipment isn't true, if it was we would still be able to buy unfused domestic items like in the bad old days. A defective device might take out the ground leakage circuit, even the old mains fuse when it goes wrong but it usually also takes out the fuse in the device. So an attempt to reuse the device fails because it's fuse has failed, the fuse didn't protect the device but it did prevent further use with possible fire risk etc etc. If the device has been wrongly fused the breaker will trip at next use, this is quite likely why self repairing fuseboxes are being replaced with mcb earth leakage types. "I solved the problem of the fuse blowing by fitting a nail instead, works perfect now!!!!"
    Point I'm trying to make is, when designing a DIY circuit, from a safety perspective what's the worse case senario and how can I/you reasonably stop creating an even worse senario. An experimental 220vac circuit ought to be in a box, I have done the odd one laid out on a bench but only for a few seconds just to see if I get the desired result. All the while with a hand on the switch, as I said before 220vac hurts and I don't like to touch.
    Conecting a transformerless ac circuit directly to a microprocessor isn't IMO a good idea. If a component fails and now that it's established that a diode can fail short circuit, it could put a much higher voltage than expected on the MicroP causing its demise. So a pain in the butt but not a major disaster. Unless you like to lay in the bath with your latest project laid on your chest it's also very unlikely to kill you. The AC mains input would probably kill you anyway when it was switched on. For ac mains to be at the Arduino on the OP's circuit the 82k resistor would also need to fail short circuit and any fitted fuse fail to blow. The 82k resistor is dropping most of the voltage so the 220vac would be between it's input terminal and the 82k resistor. Even if it did, my guess is there might be a bang and a non working arduino.

    So what the hell am I talking about :)
    AC mains is dangerous and it hurts, if you want to try something that uses it be extra careful and plan for the worst case, especially if it's new territory. Could it explode, burst into flames, kill me etc. Then either think of something else to do or design appropriate safety features. For a prototype a fuse is OK, just make sure it's the right value and to keep fingers out, cover the bits that can hurt with a suitable insulator like an ice cream box. If you plan on releasing your grand design on the general public and that includes Aunts and Uncles etc. then you need to look very hard at safety aspects.

    By the way using a transformer doesn't let you of the hook completely, ac mains is still there, just fewer access points.
     
  8. GromTag

    GromTag Active Member

    Joined:
    Nov 23, 2016
    Messages:
    307
    Likes:
    41
    Location:
    North Carolina
    hmm, just going to ask this, would not 230V A/C mains rectified through diodes and filtering capacitor as of reach 330V DC levels via forward rectification at the capacitor?

    Or am I just going at a wrong direction towards this topic?
     
  9. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,043
    Likes:
    960
    Location:
    NJ
    Hello again,

    When someone says something that doesnt sound right then we might contradict them, but that does not mean there is a "need to contradict". Ok maybe, but only when warranted. If something sounds unusually wrong, someone might say something, that's the way it goes in a discussion about any topic.

    You say you did not say anything contentious, but if you say something that doesnt sound quite right then you'll get contradictions, of course. You can always try to back up your claim with some data. Try to remember too that this is not about you as you do what you feel is right for you, it's more about new people coming into the field that may not realize the dangers involved sometimes.

    One issue that came up was the issue of a fuse and how it might protect human life, but fuses are almost always rated at currents many times that of what it takes to kill a human. For example, stand in a basement partly full of water and touch either side of a 120vac fuse and see how well the fuse protects you (dont actuaoly do that of course). The bottom line is it will not protect you, and it wont even blow out. This is why we say that in general the fuse does not protect the human, it mostly protects the equipment from further damage. A human can be killed with 5ma of current while a fuse might be rated for 20 amps which is 4000 times higher.
    It's not that a fuse might SOMETIMES help a human, it's really about the more general case where it does not.

    The other issue that came up was that high voltage is more dangerous than low voltage, it's as simple as that.

    You should not really take a contradiction personally it's just about seeking out the facts and then presenting them. It's also not as much about you as the new person entering the field who has little experience with high voltages.
     
  10. Superdat

    Superdat Member

    Joined:
    Mar 3, 2015
    Messages:
    115
    Likes:
    4
    OK maybe time to close this branch off from the OPs original question.
    The OP might have helped himself better if he'd stated what his intentions were. Is this just a "I want to see if I can do it" or "I don't want to buy a kit", "I want to make a commercial product". etc.

    This search on Google "how to detect over voltage 220vac" came up with a number of hits including some kits one even explains how it works reasonably well.
    http://www.eleccircuit.com/over-voltage-and-low-voltage-protection-circuit/
    The only disadvantage I can see is that the circuit reduces the ac voltage to a much smaller DC level then does a comparison between the desired and the actual.
    I know nothing about this type of circuit so I don't know if this is really a disadvantage.
     
  11. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,295
    Likes:
    647
    Location:
    Derbyshire, UK
    Suggesting diodes never go S/C is HIGHLY contentious, as it's almost their only failure mode (and an EXTREMELY common one) :D
     
    • Agree Agree x 1
  12. Superdat

    Superdat Member

    Joined:
    Mar 3, 2015
    Messages:
    115
    Likes:
    4
    I've just looked up failure modes and yes the main one for diodes is a short circuit but if they are subject to enough current they will burn out to OC or just explode.

    An exploding diode of the type used here is no big deal despite overplayed safetly issues. A shorted diode in a low current will just stop the circuit working proberly. I will restate that I've never had a diode fail SC but then I've never had a Diode fail. Maybe selection of the correct one helps.
    As I suspected you are just being pedantic for the sake of it.

    Taking this to the extreme, the optocoupler has a diode so why is there no concern about that going short circuit and destroying the world.

    Strong smell of BS in here.

    Bye my last post.
     
  13. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,295
    Likes:
    647
    Location:
    Derbyshire, UK
    No, I've replaced thousands of S/C diodes, as any service engineer has.

    It's a VERY common failure, going well back to the valve days - and even pre-dating silicon rectifiers (although meal rectifiers didn't go S/C as such, because their design was inherently resistive - but they went as S/C as it was possible fr them to do).
     
  14. Superdat

    Superdat Member

    Joined:
    Mar 3, 2015
    Messages:
    115
    Likes:
    4
    No what?
    If they are so troublesome you could always use a Neon but you don't like them
     
  15. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,043
    Likes:
    960
    Location:
    NJ

    Hello again,


    Yes strong smell of BS in here, but we have to first know where it is actually coming from :) [just kidding]

    No need to get bent out of shape here. We're discussing common behaviors of various parts, that's going to bring up different views.
    I cant agree with your view sometimes though mainly because it seems like you take the least likely scenario and then make a case out of it. Like with the diode failing short, then you say that with enough current it will blow open. Yes that's true, but the most usual case is that the fuse blows out first and so that brings us back to square 1 where the most likely case is where the diode fails short.
    I have two particular cases i remember well. The first is with a small RCA TV set where one of the diodes in the main full wave bridge rectifier blew short. I replaced that one diode and got it up and running again. The second case was with a 300 watt DC power supply where in a rush i connected a battery with reversed polarity to the power supply, and the blew out the reverse connected internal protection diode. That took a while to fix because the diode was hidden and not on the main circuit board. The diode did blow short and thus protected the main power supply part of the circuit. After that though i modified the circuit to make it even better protected.

    I did agree that the view about the old 200vdc circuits where we worried less about the fact that we had to deal with 200v and not just 5v.

    I do have to wonder how much repair experience you have had in the past. Perhaps you can mention a few things you've fixed in the past and the rest of us can list some of our fixes in the past. My list spans close to 50 years now, with some more active periods and some less active periods though. Devices from tube amps to computer terminals, various other electronic devices, field service in the US and Canada, design work from small circuits to large converters, computer programs embedded and for electronic circuit analysis.

    It would be interesting to see your list of devices you've worked on in the past or something like that. We could also talk about electrical circuit theory to get an idea what you've had in the past.

    Even with my own wide experience over 5 decades i still have a lot of respect for people who have had long term experience in any field, and so do not take their opinions and ideas lightly.
     
  16. Superdat

    Superdat Member

    Joined:
    Mar 3, 2015
    Messages:
    115
    Likes:
    4
    Hi Mr Al

    I decided to wait a while before responding (or not). Some may not like it but here it is.
    I will try to be objective as against subjective.
    My irritation was not meant for you' I see you have made a number of good suggestions to the circuit layout proposed by the OP.
    We do disagree in some areas, see below.
    So what’s bugging me? I’ll go through the postings briefly.

    1. The OP posted, OK the heading could have been better.
    2. MikeMI posts 3 times warning of the dangers of A/C voltage “don’t do it”. Not really very helpful.

    At this point the original purpose of the project has been lost, focus is now on the dreaded 220vac.

    The OP only wants to measure voltage fluctuations so he doesn’t need high current at the MicroP so he doesn’t need heavy duty resistors on the A/C side just enough to supply the Arduino with a representation of A/C mains. How to calculate this isn’t mentioned even though the OP asked.
    The OP has also indicated that he doesn’t want to spend a lot of money.
    3. Posts supporting avoiding A/C + a more reasoned one to isolate the A/C components.
    4. I make a post but not having read the Ops 1st post properly, make the mistake of assuming it’s all about how to detect A/C at logic level. I did notice the comment about not wanting to spend much.
    5. Colin makes a post that tries to bring the thread back on track.
    6. I post the neon circuit diagram.
    7. Next post did I use an oscilloscope?

    This is an example of what I find irritating. Although JimB may have meant to be helpful, it comes across as “If you haven’t got an oscilloscope, you don’t know what you’re doing.” Why do I say this? There are millions of neons about that have never seen an oscillocope, but they still work.
    IMO it sounds pompous. A better response might have been, “If the neon isn’t bright enough try a capacitor across it to reduce 100hz flicker. So the knowledge is passed on in a helpful way.

    8. Mr Al suggested a capacitor to reduce flicker, but he doesn’t like neons.

    At this point the tread is well and truly derailed, OK I didn’t help, but if the OP could have used the neon suggestion it was cheap. I doubt if he would be interested in the commercial long term reliability of neons or service costs. I pointed out that the thread had lost it’s way, but the dogs had seen some bones and didn’t want to let go.

    9. How dare I say transformers weren’t safe! I didn’t, I said. “My comment about transformers was made to highlight irrational fears about using anything but a transformer.”

    10. Now although I agree with a lot of what Mr Al says, his opion on neon/leds is blinkered, yes leds are the latest technology but neons still work and when used in an opto isolator circuit are very easy and CHEAP. Mr Al is also a bit blinker over Opto Couplers, and doesn’t like a neon and phototransistor being called an Optocoupler, it has to be a bought, purpose made optocoupler. What does he think is inside these magic opto couplers? An LED and a phototransistor. What does he think photo transistors with a range of light spectrum are made for?

    But a really good bone has appeared now I didn’t know that diodes failed S/C. OMG have that heretic burnt.

    10. Gromtag asks a valid question but no gets answers.
    I suggest that since the thread is so of topic maybe it should end, but no the bone is too juicy.
    I’ve worked in techy stuff for a very long time but I don’t use it as proof that I know best.
    I’ve know many ppl who worked as techies for many years who weren’t very good at their job!
    I too worked as a service engineer and replaced many transistors and maybe to odd diode but here’s the good bit.
    It was always the same ones, suggesting a badly designed circuit.
    Now did they fail short or open circuit? I can’t remember and I didn’t care, it doesn’t matter, you just fix it.

    If a diode fails it stops something working. If failing as a short was a major safety issue they wouldn’t be used. If they caused fires etc etc. NigelG would never have need to change them. The fact that they got back to be repaired shows that failing S/C is not a problem.

    Commercial products often fail because of under specified components (think Sky Box). If you are building your own over specify, then they shouldn’t fail. OK I’m sure someone will have to jump on this one but think general rather that specific.

    The OP has said he wants cheap he doesn’t even want to buy a transformer, so he isn’t looking at it from a commercial view point. If everything had to be done to this standard and throw in CE regulations, there wouldn’t be any hobbyists. Safety is definitely a consideration but let’s not go over the top. Suggestions of how to avoid, rather than don’t do that would be better.

    Although the OP hasn’t commented, who came up with any suggestions to help the main part of his project? How to measure A/C mains overvoltage on an Arduino?

    Summary
    Everyone is entitled to an opinion, if someone has a different opinion you have to come to terms with it, not run them out of town which seems to be the usual approach. Your opinion can be just as alien to them as theirs is to you.
    Facts are totally different but some ppl confuse facts with opinion.
    E.g. I spotted an answer to a post that was quite good and gave credit and added an alternative suggestion.
    Next post, “I’ve already supplied the OP with a solution.”

    Arrogant or what!
     

Share This Page