Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

Hello and EMI/RFI

Hello and EMI/RFI

2004-03-11 by John Johnson

Hello!

I'm JJ, AVR, electronics, machinist type person. It's good to find a 
resource for AVR folks.

I have two designs that use an AVR. One is a garage door manager, using 
a 2313, keypad, dip relay driven by a transistor. On occasion it would 
just "go nuts." The door would start going up-down-up-down at about the 
speed you read that.

The other is a heater controller. It uses an 8535 to read an LM74(37?) 
temperature device, and turn a space heater on and off. It uses a hiigh 
current mechanical relay driven by a transistor that is driven by an 
optoisolator (4N22?). It has the same problem as the garage door 
control. Sometimes, it gets spastic, turning the relay 
on-off-on-bzzt-off-bzzt, etc.

I use the normal resistor to Vcc, cap to Gnd on the reset line, along 
with bypass caps (100nf) close to the ICs. I guess I'm missing 
something. Any suggestions? I really like the AVR, and am trying to 
convince myself it something I've done, so I won't think they're 
unreliable.

Thanks!

Regards,
   JJ

RE: [AVR-Chat] Hello and EMI/RFI

2004-03-11 by Kathy Quinlan

> -----Original Message-----
> From: John Johnson [mailto:johnatl@mac.com] 
> Sent: Thursday, 11 March 2004 8:59 PM
> To: AVR-Chat@yahoogroups.com
> Subject: [AVR-Chat] Hello and EMI/RFI
> 
> 
> Hello!

Welcome to our list.
 
> I'm JJ, AVR, electronics, machinist type person. It's good to find a 
> resource for AVR folks.
> 
> I have two designs that use an AVR. One is a garage door 
> manager, using 
> a 2313, keypad, dip relay driven by a transistor. On occasion 
> it would 
> just "go nuts." The door would start going up-down-up-down at 
> about the 
> speed you read that.

We need more information, like a schematic, but a few common problems:

Do you have a reverse diode across the relay coil ?
Do you have a snubber network across the relay contacts ?
Do you have a ground plane on the PCB ?
Are the supplies isolated between the AVR and the relay ?

A solidstate relay would solve some of the problems. Or a triac and zero
crossing opto coupler.

 
> The other is a heater controller. It uses an 8535 to read an 
> LM74(37?) 
> temperature device, and turn a space heater on and off. It 
> uses a hiigh 
> current mechanical relay driven by a transistor that is driven by an 
> optoisolator (4N22?). It has the same problem as the garage door 
> control. Sometimes, it gets spastic, turning the relay 
> on-off-on-bzzt-off-bzzt, etc.

Same as above ;o)

> 
> I use the normal resistor to Vcc, cap to Gnd on the reset line, along 
> with bypass caps (100nf) close to the ICs. I guess I'm missing 
> something. Any suggestions? I really like the AVR, and am trying to 
> convince myself it something I've done, so I won't think they're 
> unreliable.

They are quite the oposite, very reliable if you treat them with respect
(IE no over voltage) and follow good design practices (I will write an
appnote one day and put on my website, as this is a common problem)

 
> Thanks!
> 
> Regards,
>    JJ

Regards,

Kat (list mom) 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.618 / Virus Database: 397 - Release Date: 9/03/2004

Re: [AVR-Chat] Hello and EMI/RFI

2004-03-12 by John Johnson

On Thursday, Mar 11, 2004, at 09:32 US/Eastern, Kathy Quinlan wrote:
>> From: John Johnson [mailto:johnatl@mac.com]
>> Hello!
>
> Welcome to our list.

>> I have two designs that use an AVR. One is a garage door
>> manager, using
>> a 2313, keypad, dip relay driven by a transistor. On occasion
>> it would
>> just "go nuts." The door would start going up-down-up-down at
>> about the
>> speed you read that.


> We need more information, like a schematic, but a few common problems:

Working on the schematic. It's built on proto board with point to 
point, however,
I'm going to mill a PC board for it and move all the parts to it.
> Do you have a reverse diode across the relay coil ?
yes
> Do you have a snubber network across the relay contacts ?
no, what do you recommend? 10ohm and 10nf in series? I couldn't find a 
good
web resource, so I'm kind of guessing.

> Do you have a ground plane on the PCB ?
On the board I'm designing, I'm going to surround the relay area with a 
pour
(I think it's called). Maybe I could upload a pic of the design for 
critique?

> Are the supplies isolated between the AVR and the relay ?
On the garage door minder, no. The relay is a 5v reed unit, the AVR 
pulls
one leg of the coil to ground to turn it on.

> A solidstate relay would solve some of the problems. Or a triac and 
> zero
> crossing opto coupler.
>

> They are quite the oposite, very reliable if you treat them with 
> respect
> (IE no over voltage) and follow good design practices (I will write an
> appnote one day and put on my website, as this is a common problem)
>

Thanks again Kat. It's good to hear they are reliable. I kind of thought
they would be, and that, surely it is me.

It would be nice if Atmel had some reference design boards on their
site (like the Butterfly). I guess the applications vary so widely that 
that is virtually
impossible.


Regards,
   JJ

Re: Hello and EMI/RFI

2004-03-14 by Stefan Wimmer

--- In AVR-Chat@yahoogroups.com, John Johnson <johnatl@m...> wrote:
> > Do you have a snubber network across the relay contacts ?
> no, what do you recommend? 10ohm and 10nf in series? I couldn't 
find a good web resource, so I'm kind of guessing.


This subject is asked astonishingly often (not only in this mailing 
list). Are people involved in embedded systems nowadays pure software 
people? Anybody remember physics in school/university? No (E-)
engineers here??


Ok, back to the basics:
As one (I hope at least _one_ of the readers) might remember, at 
least 90% of all problems in physics (where EE does belong to) can be 
solved by energy balancing.

So what do we have in steady state? There is a circuit which is 
closed by your relay contacts. Either the load itself and/or some 
stray inductors are "charged" with some current flowing thru it. The 
energy stored in the magnetic field is: 1/2 L * I * I.

Now when you switch off the relay, this energy has to go somewhere. 
The current "wants to continue flowing" and according to the equation 
U = -L dI/dt we get some really high voltages with even very small 
(stray) inductors, as long as the switch off time (dt) is short 
enough. This high voltage will cause some nice arcing at the contacts 
and due to the negative differential resistance of an arc, RF is 
generated (Tune a radio to the LW or SW range while your relay 
switches if you don't believe this - you will hear the RF, no matter 
what exact frequency you dialed in).

Now what can we do?
Best would be to tune down dt (make it longer), but that would kill 
your relay contacts by high current arcing (which is a different kind 
of animal since the current path is here provided by metal vapors in 
the (too slowly) growing gap between the contacts) in no time. So we 
have to take care of the current and give it an alternate path (while 
attenuating it - we want to switch off - don't we? :-)). A good 
measure would be a capacitor parallel to the relay contacts. It is 
held discharged as long as the contacs are closed. When they open, 
the current can (at first) continue to flow and charge the capacitor. 
This will result in an increasing voltage across the capacitor which 
will finally stop the current flowing. 

If we want to know how big the capacitor has to be - we're back to 
energy balancing:
    1/2 L * I * I = 1/2 C * U * U.

Now you can reorganize and resolve for C.

And for the voltage rating keep in mind, that your capacitor will be 
charged to  the peak voltage of your (AC) operating voltage plus what 
you just calculated above.

That's it.


Really?
No!

What happens if the relay contact close again? Oops! Yes, they will 
short circuit a charged capacitor. Well, since we don't really want 
to weld the contacts shut, we should include a resistor to limit the 
current to a value that can be handled by the relay contacts 
additionally to the load current (iow: the difference between the 
current rating of the contacts and the (inrush) current of the load).
Usual Ohm's law applies (calculating with Umax as discussed above).

If you "guesstimated" your (stray) L in the equation above, it is 
good practise to double or triple your C and calculate the needed R 
accordingly, just to be on the safe side.

Now you have your snubber circuit (RC-network) without any magic, 
guessing (ok, stray inductance) and head scratching (I hope :) ).



Sorry for any wrong wordings or phrases, but english is not my native 
language. An if I sounded a little brisk - maybe I just needed a 
little venting :)

Re: [AVR-Chat] Re: Hello and EMI/RFI

2004-03-14 by VA3TO

>Sorry for any wrong wordings or phrases, but english is not my native 
>language. An if I sounded a little brisk - maybe I just needed a 
>little venting :)
>
>  
>

Your english is better than many posters of which is their native 
language :)

Hugh

Re: [AVR-Chat] Re: Hello and EMI/RFI

2004-03-14 by John Johnson

Thanks for the reply!

No, we aren't all EEs. Some of us do this for fun :-)

So, I have about 4 m of 24 awg wire going to a Genie garage door opener  
with unknown circuitry inside. How would I determine the inductance?  
What if I sold one of these, and the customer had 1 m or 10 m of wire?

In the heater circuit, I have about 2 m of 14 awg wire to the heater,  
unknown inductance in the heater, and unknown length of wire in the  
walls. How would I determine the inductance of that? Do snubber work on  
AC circuits? Or should I just stick a MOV across the contacts and hope  
for the best.

Thanks!

Regards,
   JJ
Show quoted textHide quoted text
On Sunday, Mar 14, 2004, at 15:13 US/Eastern, Stefan Wimmer wrote:

> --- In AVR-Chat@yahoogroups.com, John Johnson <johnatl@m...> wrote:
>>> Do you have a snubber network across the relay contacts ?
>> no, what do you recommend? 10ohm and 10nf in series? I couldn't
> find a good web resource, so I'm kind of guessing.
>
>
> This subject is asked astonishingly often (not only in this mailing
> list). Are people involved in embedded systems nowadays pure software
> people? Anybody remember physics in school/university? No (E-)
> engineers here??
>
>
> Ok, back to the basics:
> As one (I hope at least _one_ of the readers) might remember, at
> least 90% of all problems in physics (where EE does belong to) can be
> solved by energy balancing.
>
> So what do we have in steady state? There is a circuit which is
> closed by your relay contacts. Either the load itself and/or some
> stray inductors are "charged" with some current flowing thru it. The
> energy stored in the magnetic field is: 1/2 L * I * I.
>
> Now when you switch off the relay, this energy has to go somewhere.
> The current "wants to continue flowing" and according to the equation
> U = -L dI/dt we get some really high voltages with even very small
> (stray) inductors, as long as the switch off time (dt) is short
> enough. This high voltage will cause some nice arcing at the contacts
> and due to the negative differential resistance of an arc, RF is
> generated (Tune a radio to the LW or SW range while your relay
> switches if you don't believe this - you will hear the RF, no matter
> what exact frequency you dialed in).
>
> Now what can we do?
> Best would be to tune down dt (make it longer), but that would kill
> your relay contacts by high current arcing (which is a different kind
> of animal since the current path is here provided by metal vapors in
> the (too slowly) growing gap between the contacts) in no time. So we
> have to take care of the current and give it an alternate path (while
> attenuating it - we want to switch off - don't we? :-)). A good
> measure would be a capacitor parallel to the relay contacts. It is
> held discharged as long as the contacs are closed. When they open,
> the current can (at first) continue to flow and charge the capacitor.
> This will result in an increasing voltage across the capacitor which
> will finally stop the current flowing.
>
> If we want to know how big the capacitor has to be - we're back to
> energy balancing:
>     1/2 L * I * I = 1/2 C * U * U.
>
> Now you can reorganize and resolve for C.
>
> And for the voltage rating keep in mind, that your capacitor will be
> charged to  the peak voltage of your (AC) operating voltage plus what
> you just calculated above.
>
> That's it.
>
>
> Really?
> No!
>
> What happens if the relay contact close again? Oops! Yes, they will
> short circuit a charged capacitor. Well, since we don't really want
> to weld the contacts shut, we should include a resistor to limit the
> current to a value that can be handled by the relay contacts
> additionally to the load current (iow: the difference between the
> current rating of the contacts and the (inrush) current of the load).
> Usual Ohm's law applies (calculating with Umax as discussed above).
>
> If you "guesstimated" your (stray) L in the equation above, it is
> good practise to double or triple your C and calculate the needed R
> accordingly, just to be on the safe side.
>
> Now you have your snubber circuit (RC-network) without any magic,
> guessing (ok, stray inductance) and head scratching (I hope :) ).
>
>
>
> Sorry for any wrong wordings or phrases, but english is not my native
> language. An if I sounded a little brisk - maybe I just needed a
> little venting :)
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor  
> ---------------------~-->
> Upgrade to 128-bit SSL Security!
> http://us.click.yahoo.com/LPJzrA/yjVHAA/TtwFAA/dN_tlB/TM
> --------------------------------------------------------------------- 
> ~->
>
>
> Yahoo! Groups Links
>
>
>
>
>

Re: [AVR-Chat] Re: Hello and EMI/RFI

2004-03-15 by David VanHorn

At 06:30 PM 3/14/2004 -0500, John Johnson wrote:

>Thanks for the reply!
>
>No, we aren't all EEs. Some of us do this for fun :-)
>
>So, I have about 4 m of 24 awg wire going to a Genie garage door opener  
>with unknown circuitry inside. How would I determine the inductance?  
>What if I sold one of these, and the customer had 1 m or 10 m of wire?
>
>In the heater circuit, I have about 2 m of 14 awg wire to the heater,  
>unknown inductance in the heater, and unknown length of wire in the  
>walls. How would I determine the inductance of that? Do snubber work on  
>AC circuits? Or should I just stick a MOV across the contacts and hope  
>for the best.

In these examples, the wire inductance is trivial, compared to the other elements in the circuit. There is a formula for wire inductance, but it's rarely used in this domain. 

Here's a handy reference for you: On a ground planed 2 layer PCB, a 104 mil track has 50 ohms impedance. An 8 mil, IIRC is 104 ish.(?)  So in the domain where bypass caps operate, think of the tracks as resistors. We aren't much concerned with energy stored in the fields. 

When subbing a relay coil, then you have some serious energy to get rid of. 
Either provide it a path to discharge through, or it will make one.

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.