Avr connected to mains with a resistor ? any comments ?

Go To Last Post
23 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I found this some time ago...

http://ww1.microchip.com/downloa...

Do you think it is doable with an atmel mcu ?
What do you think of that design ?
Is it really safe ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's safe provided it's properly insulated and the precautions they mention are observed.

There is no reason why it couldn't be done with an AVR or any other MCU.

Leon

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Like Leon says, if you take all necessary precautions an AVR can do the same tricks. BUT: let your username here on Freaks not become reality: EVERYTHING that is connected to the AVR in this setup is LIVE and DEADLY. Even a led that is controlled by the AVR.

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well Yes it is possible but it is very hot. if you need 10mA -->230V 2.3W to burn out.
By the wat, the AN do not use resistor but condensator 2x2.25uF.
Thierry
I have done more than 1billion board (for real)with C power or R power. Ask me if you need some help.

Thierry Pottier

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Killertoffy,
As everyone has said YES it can be done AND FOR CRYIN' OUT LOUD CHECK IT A COUPLE OF TIMES BEFORE PLUGGING IT IT IN!!! :roll:

I don't know your geographical location, but just in case, a little word of caution. I am in New York USA, and here in the states god forbid something goes wrong and a fire breaks out, any insurance policies are null and void.

Also, as I said check it several times before plugging it in. The idea of no safety ground is kinda scary

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes it is not a problem wuth safety. But it is clear you need more than one resistor ( some safety device) and not a std resistor.
It is a lot of product in USA some use than power. Open your hairfan or another appliance.
Thierry

Thierry Pottier

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

very detailed app note...although described quite well if you are not "DIEING" to try it, you could just use the Safe X10 RS232 interface module for experimentation to an AVR...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Fuses are your friend, I would use 1 fast blow fuses, one on the line side of your transformer and one on the load side. Even if the fuses are rated too high to save your project (1A or 1/2A) they will at least protect your house; a $2 1/2A fuse will make sure that your wires will not catch on fire.

I'm not a cartoon character but I play one in real life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Qema, preventing a fire is an issue too, you're right, and the use of a fuse is a good idea.

My concern was about the risks we (in general, so me included) must be aware of when working with live-mains. Touching a wire that is connected with the AVR can be lethal. Where normally you do this every day, used as we are to concept "AVR and logic circuits are OK to touch"
I learned from a TV-repairman to keep one hand in the pocket when working with live circuits. And make sure that no part of you is connected to earth (via shoes or chair). An accidental touch will still "tickle" (or "hurt" for those who mis-interpret "tickle"), but you will survive.

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jim is pointing an important issue regarding insurance policies...
I'm in europe and I don't know if there's any issue with that design here.

I though about putting the dangerous parts including the mcu into a very well insulated box, then opto isolators to talk to another "safe" mcu.
Well of course now comes the problem of the heat...

Also we are all used to touch components all around, and suddenly it becomes life threatening...
Habbits are there and I'm scared of that "false" move trying to catch the box falling on the floor...

On the other hand, it's not my first "mains contact" and I'm still there...

Don't know how many of you already experienced it, but I wouldn't be suprised to learned you all had...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Plons wrote:
Qema, preventing a fire is an issue too, you're right, and the use of a fuse is a good idea.

My concern was about the risks we (in general, so me included) must be aware of when working with live-mains. Touching a wire that is connected with the AVR can be lethal. Where normally you do this every day, used as we are to concept "AVR and logic circuits are OK to touch"
I learned from a TV-repairman to keep one hand in the pocket when working with live circuits. And make sure that no part of you is connected to earth (via shoes or chair). An accidental touch will still "tickle" (or "hurt" for those who mis-interpret "tickle"), but you will survive.

Nard

That's right, Electricity is dangerous in at all levels and in all forms.

Some people might not be afraid to work with 240.
However, they are trained, certified and experienced, is not the same as following some instructions you find on the internet.

I hear certified lineman bragging about how they work with 10,000V+ all the time, and that its nothing to worry about, but none of them will tell you that they have a full EMS team standing by, how long it takes them to get ready (evaluating the dangers, testing safety equipment ... etc).

Like with anything use common sense.

I'm not a cartoon character but I play one in real life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

killertoffy wrote:
Jim is pointing an important issue regarding insurance policies...
I'm in europe and I don't know if there's any issue with that design here.

I though about putting the dangerous parts including the mcu into a very well insulated box, then opto isolators to talk to another "safe" mcu.
Well of course now comes the problem of the heat...

Also we are all used to touch components all around, and suddenly it becomes life threatening...
habits are there and I'm scared of that "false" move trying to catch the box falling on the floor...

On the other hand, it's not my first "mains contact" and I'm still there...

Don't know how many of you already experienced it, but I wouldn't be surprised to learned you all had...

The best thing you could do is talk to a hydro inspector about it. In Canada it does not cost you anything to have an inspector look over your plans and tell you what he would like to see. Because it's free he will not give you any specific details or calculations, BUT he will tell you what he wants to see fuses, GFIs, if he wants a special enclosure .. etc. And he will usually point you to the specific section of the code book that you should look at (which should be available to browse through and your local library or home building center).

Once you think everything is ok GET IT CERTIFIED. It's only a few bucks but it can save you a lot of trouble if something happens, or stop something from happening in the first place.

EDIT:
Try dropping by your local college/university. Some of the profs I had loved this kind of projects and would take a quick browse at it out of interest alone.

I'm not a cartoon character but I play one in real life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From AN521 page 2 ( http://laurent.deschamps.free.fr... )
"A short is the most unlikely failure mode for a resistor,
and resistors are more reliable than transformers or
capacitors, which are the alternate components for
measuring line parameters. This reliability can be
enhanced even further by using two resistors in series.
Both would have to fail short to cause catastrophic
failure, a very unlikely event."

Should I then propose to replace all transformers by resistors ? just for safety ? ;-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

killertoffy wrote:
From AN521 page 2 ( http://laurent.deschamps.free.fr... )
"A short is the most unlikely failure mode for a resistor,
and resistors are more reliable than transformers or
capacitors, which are the alternate components for
measuring line parameters. This reliability can be
enhanced even further by using two resistors in series.
Both would have to fail short to cause catastrophic
failure, a very unlikely event."

Should I then propose to replace all transformers by resistors ? just for safety ? ;-)

suggest it to your local hydro provider. Think of all the money they can save by using resistors instead of transformers :wink:

I'm not a cartoon character but I play one in real life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was repairing a TV for a friend of mine a few months ago. I was showing him how to discharge the tube. Well... I gently lifted the anode cap with my finger and the next thing I remember was him asking me if I was OK while he picked me up off of the floor. I was thrown back onto the floor and had a 1 second blackout period. 10,000 VDC made for quite a snapping sound and a flash of light. I thought I had "seen the light" that day. I since given up working on TV's. Complacency kills.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think all of us will have had such an experience. I took it as a warning: "I can make you see the light :evil: " I didn't give up, but treat CRT's with respect :P And that means: don't touch the anode with your fingers. Use a screwdriver instead, with a wire and a high value resistor from the metal-part to ground.

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And then wait ten minutes, and do it again - you should be discharging the HT contact on the tube itself, not the HT lead. It's worth waiting for a second ten minutes and doing it again, too, particularly if it's dry weather.

Neil (mended too many TV monitors over the years)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Neil, why that extra 10 minutes ? Is the CRT building up charge ? Or does that only apply when the monitor is switched off 5 seconds earlier ?

I slide the screwdriver between the rubber anode-cover and the crt, wait a few seconds, and then remove the clip from the tube. Now we're talking about it .... even when it's discharged, I don't touch the anode contact ... I use the screwdriver to get one leg of the contact out, the second one comes easy.

Yes Neil, the nowadays TFT's are boring .... except for the background-light :D

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nard, for reasons that were never fully explained to me (or if they were, I wasn't listening - it was thirty years ago so I was probably thinking about girls), the charge mysteriously reappears at the anode connection once the feed is removed. The whole tube's a capacitor, of course - I suspect that the charge migration inside is slow across the insulating parts but I don't know enough about them to be certain.

All I know is that the effect was there, and real; nice fat spark the first time, smaller spark the second.

Also, in a broadcast environment (I worked in the BBC for nearly thirty years) it's likely to have just come out of a live stack, so turned off in the last ten minutes. At the very least, if you've got as far as changing the tube, you've probably had it turned on just to confirm that it's a tube-change fault.

Neil

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Nard, for reasons that were never fully explained to me (or if they were, I wasn't listening - it was thirty years ago so I was probably thinking about girls), the charge mysteriously reappears at the anode connection once the feed is removed. The whole tube's a capacitor, of course - I suspect that the charge migration inside is slow across the insulating parts but I don't know enough about them to be certain.

Happened to me also. I was repairing my scope. First disconnection: shocking experience. Second disconnection: shorted it out against the chassis, when I touched it, it shocked me again.

Really strange. As for the topic: Don't forget to optoisolate yer ISP.

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Could it be that the HV builds up by electrons emitted from the (still warm) cathode ?

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think it unlikely. I think it's charge that's already there...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

2 weeks ago, I had the pleasure of replacing a 200 amp service entrance cable from a house roof to the breaker panel. You always have a natural shake when doing those jobs knowing the nearest disconnect is up on the pole, which would also shut down others. Us electricians hate to interrupt others, so we work hot. One mistake and you become "a human fuse".