Yahoo Groups archive

AVR-Chat

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

Thread

Relay Control

Relay Control

2004-02-10 by Joe

I am using a Atmega16 running at 7.37Mhz.  

I am also using a LCDPlus. I talk to it with the Rs232 Hardware UART. 
It has a ULN2803A with 8 relay Darlington Drivers. This also includes 
blocking diodes. I am using 5v Relays with contacts rated at 250v 10a.

The setup uses a momentary button to interrupt on Int0. The relays 
energise Mains contactors 120v 1a and ring a bell 120v .6a.
The system works fine with no load on the relay contacts. 

When I connect the contactor and bell I get false interrupts. I can 
software out the problem by disable/enable Int0 before and after the 
relay call. But I would like to fix it.

What I have done:
Use 1 supply for relays and 1 for the AVR.
Adding a power line filter before the power supplies.
I used a car battery and a dc to ac inverter to Isolate the unit from 
the contactor power.

So far no real fix.
Any Ideas??

JoeT

RE: [AVR-Chat] Relay Control

2004-02-10 by Kathy Quinlan

> -----Original Message-----
> From: Joe [mailto:joet@attg.net] 
> Sent: Tuesday, 10 February 2004 3:40 PM
> To: AVR-Chat@yahoogroups.com
> Subject: [AVR-Chat] Relay Control
> 
> 
> I am using a Atmega16 running at 7.37Mhz.  
> 
> I am also using a LCDPlus. I talk to it with the Rs232 Hardware UART. 
> It has a ULN2803A with 8 relay Darlington Drivers. This also includes 
> blocking diodes. I am using 5v Relays with contacts rated at 250v 10a.
> 
> The setup uses a momentary button to interrupt on Int0. The relays 
> energise Mains contactors 120v 1a and ring a bell 120v .6a.
> The system works fine with no load on the relay contacts. 
>
> When I connect the contactor and bell I get false interrupts. I can 
> software out the problem by disable/enable Int0 before and after the 
> relay call. But I would like to fix it.
> 
> What I have done:
> Use 1 supply for relays and 1 for the AVR.
> Adding a power line filter before the power supplies.
> I used a car battery and a dc to ac inverter to Isolate the unit from 
> the contactor power.
> 
> So far no real fix.
> Any Ideas??
> 
> JoeT

Ground plane for the PCB, Shielded metal box for the PCB, a snubber
network on the contactor, a pull up resistor on int0 pin (1K).....

This is a common problem, with lots of answers, the above is just a
start.

Regards,

Kat.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.580 / Virus Database: 367 - Release Date: 6/02/2004

RE: [AVR-Chat] Relay Control

2004-02-10 by JoeT

I was going to go for the PCB shielding next. It does not have a ground
plane.
I used a 10k a pull up resistor on int0, I'll try 1k.
What is a "a snubber network on the contactor" ?

Thanx
JoeT
Show quoted textHide quoted text
-----Original Message-----
From: Kathy Quinlan [mailto:kat-yahoo@kaqelectronics.dyndns.org]
Sent: Tuesday, February 10, 2004 2:10 AM
To: AVR-Chat@yahoogroups.com
Subject: RE: [AVR-Chat] Relay Control




> -----Original Message-----
> From: Joe [mailto:joet@attg.net]
> Sent: Tuesday, 10 February 2004 3:40 PM
> To: AVR-Chat@yahoogroups.com
> Subject: [AVR-Chat] Relay Control
>
>
> I am using a Atmega16 running at 7.37Mhz.
>
> I am also using a LCDPlus. I talk to it with the Rs232 Hardware UART.
> It has a ULN2803A with 8 relay Darlington Drivers. This also includes
> blocking diodes. I am using 5v Relays with contacts rated at 250v 10a.
>
> The setup uses a momentary button to interrupt on Int0. The relays
> energise Mains contactors 120v 1a and ring a bell 120v .6a.
> The system works fine with no load on the relay contacts.
>
> When I connect the contactor and bell I get false interrupts. I can
> software out the problem by disable/enable Int0 before and after the
> relay call. But I would like to fix it.
>
> What I have done:
> Use 1 supply for relays and 1 for the AVR.
> Adding a power line filter before the power supplies.
> I used a car battery and a dc to ac inverter to Isolate the unit from
> the contactor power.
>
> So far no real fix.
> Any Ideas??
>
> JoeT

Ground plane for the PCB, Shielded metal box for the PCB, a snubber
network on the contactor, a pull up resistor on int0 pin (1K).....

This is a common problem, with lots of answers, the above is just a
start.

Regards,

Kat.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.580 / Virus Database: 367 - Release Date: 6/02/2004





Yahoo! Groups Links

Re: Relay Control

2004-02-10 by Joe

I posted the schematic in the files section.

http://groups.yahoo.com/group/AVR-Chat/files/relaycontrol.pdf

I did not mention this before but there is a Manual overide switch. 
And when it is switched from ON to Off I get a interrupt every time. 
From Off to On sometimes. This is what really needs to be fixed. I 
can not code it out.

For now I am going to add a reset button to reset the device when 
this happens.

Thanx
JoeT


--- In AVR-Chat@yahoogroups.com, "Wagner Lipnharski" <wagner@u...> 
wrote:
> Joe, please post your schematics.
> It is difficult to give suggestions just by imagine what you have 
in hands.
> Perhaps we will help better.

Re: [AVR-Chat] Relay Control

2004-02-10 by Wagner Lipnharski

Joe, please post your schematics.
It is difficult to give suggestions just by imagine what you have in hands.
Perhaps we will help better.

RE: [AVR-Chat] Relay Control

2004-02-10 by Mike Murphree

JoeT said:
> I was going to go for the PCB shielding next. It does not have a ground
> plane.
> I used a 10k a pull up resistor on int0, I'll try 1k.
> What is a "a snubber network on the contactor" ?

A snubber provides EMI suppression.   Can be as simple as a resistor and a
capacitor.

It sounds your contactor and bell are AC operated, but you haven't put any
suppression network on them yet?

Have you considered using solid-state relays?

Mike

RE: [AVR-Chat] Relay Control

2004-02-11 by Kathy Quinlan

> -----Original Message-----
> From: JoeT [mailto:joet@attg.net] 
> Sent: Wednesday, 11 February 2004 1:14 AM
> To: AVR-Chat@yahoogroups.com
> Subject: RE: [AVR-Chat] Relay Control
> 
> 
> I was going to go for the PCB shielding next. It does not 
> have a ground plane. I used a 10k a pull up resistor on int0, 
> I'll try 1k. What is a "a snubber network on the contactor" ?
> 
> Thanx
> JoeT

The opto isolator *should* provide the isolation from spikes, so the 10K
is probably fine. I would suggest the problem is the EMI from the
Contactors getting into the processor and triggering the Int0.

A snubber network is a cap and resistor placed across the contacts of
the contactor (and also the drive relay) the function is to quench the
arc drawn as the contacts open, this is achieved by the resistor and
capacitor providing a path for the current to flow as the contacts open,
the leakage current is not high, so the device being driven does not
operate.

Any good electrical shop (industrial) should be able to sell you a
snubber network in a signal package with two leads hanging out. IT will
need to be selected to suit the load, but they may be able to help you.

Remember young Jedi ;o) google is your friend.

Regards,

Kat.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.580 / Virus Database: 367 - Release Date: 6/02/2004

RE: [AVR-Chat] Relay Control

2004-02-11 by MuRaT KaRaDeNiZ

are ATMEL AVR micros more vulnerable to EMI than other
micros? what do you think? Or can the EMI problems be
addressed to circuit design & environment directly? A
elektronik circuit design firm in my country was using
atmel micros beside nec,mitsubishi,pic and the manager
had some complaints about atmel. He was happy with
mitsubishi in contrast.

--- Kathy Quinlan
<kat-yahoo@kaqelectronics.dyndns.org> wrote:
> 
> 
> > -----Original Message-----
> > From: JoeT [mailto:joet@attg.net] 
> > Sent: Wednesday, 11 February 2004 1:14 AM
> > To: AVR-Chat@yahoogroups.com
> > Subject: RE: [AVR-Chat] Relay Control
> > 
> > 
> > I was going to go for the PCB shielding next. It
> does not 
> > have a ground plane. I used a 10k a pull up
> resistor on int0, 
> > I'll try 1k. What is a "a snubber network on the
> contactor" ?
> > 
> > Thanx
> > JoeT
> 
> The opto isolator *should* provide the isolation
> from spikes, so the 10K
> is probably fine. I would suggest the problem is the
> EMI from the
> Contactors getting into the processor and triggering
> the Int0.
> 
> A snubber network is a cap and resistor placed
> across the contacts of
> the contactor (and also the drive relay) the
> function is to quench the
> arc drawn as the contacts open, this is achieved by
> the resistor and
> capacitor providing a path for the current to flow
> as the contacts open,
> the leakage current is not high, so the device being
> driven does not
> operate.
> 
> Any good electrical shop (industrial) should be able
> to sell you a
> snubber network in a signal package with two leads
> hanging out. IT will
> need to be selected to suit the load, but they may
> be able to help you.
> 
> Remember young Jedi ;o) google is your friend.
> 
> Regards,
> 
> Kat.
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system
> (http://www.grisoft.com).
> Version: 6.0.580 / Virus Database: 367 - Release
> Date: 6/02/2004
>  
> 
> 
> 
> ------------------------ Yahoo! Groups Sponsor
> 
>  
> Yahoo! Groups Links
> 
> 
>      AVR-Chat-unsubscribe@yahoogroups.com
> 
>  
> 


__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

RE: [AVR-Chat] Relay Control

2004-02-11 by Dave VanHorn

At 02:30 PM 2/11/2004 -0800, you wrote:
>are ATMEL AVR micros more vulnerable to EMI than other
>micros? what do you think? Or can the EMI problems be
>addressed to circuit design & environment directly?

I see no reason why AVRs would be more or less susceptible than other 
similar chips.
Mostly, it's a matter of proper PCB layout, managing where the currents flow.

I use the AVR in a couple of applications now, where we are gating 3-10A 
currents on timescales of 300uS to 2mS, without any emi problems.
Of course if you do the ground management wrong, you can make pretty much 
anything fail.

Re: [AVR-Chat] Relay Control

2004-02-11 by Brian Dean

On Wed, Feb 11, 2004 at 02:30:08PM -0800, MuRaT KaRaDeNiZ wrote:

> are ATMEL AVR micros more vulnerable to EMI than other
> micros? what do you think? Or can the EMI problems be
> addressed to circuit design & environment directly? A
> elektronik circuit design firm in my country was using
> atmel micros beside nec,mitsubishi,pic and the manager
> had some complaints about atmel. He was happy with
> mitsubishi in contrast.

Atmel's AVR040 application note does a pretty good job of talking
about the issues:

  http://www.atmel.com/dyn/resources/prod_documents/doc1619.pdf

Toward the later parts of the document, they talk about AVR specific
considerations.

-Brian
-- 
Brian Dean, bsd@bdmicro.com
BDMICRO - Maker of the MAVRIC ATmega128 Dev Board
http://www.bdmicro.com/

RE: [AVR-Chat] Relay Control

2004-02-12 by Ricardo Callejo

Can you suggest where can i find some examples of good and wrong pcbs?

Thanks.

-----Mensaje original-----
De: Dave VanHorn [mailto:dvanhorn@cedar.net]
Enviado el: Miércoles, 11 de Febrero de 2004 07:39 p.m.
Para: AVR-Chat@yahoogroups.com
Asunto: RE: [AVR-Chat] Relay Control

At 02:30 PM 2/11/2004 -0800, you wrote:
>are ATMEL AVR micros more vulnerable to EMI than other
>micros? what do you think? Or can the EMI problems be
>addressed to circuit design & environment directly?

I see no reason why AVRs would be more or less susceptible than other
similar chips.
Mostly, it's a matter of proper PCB layout, managing where the currents flow.

I use the AVR in a couple of applications now, where we are gating 3-10A
currents on timescales of 300uS to 2mS, without any emi problems.
Of course if you do the ground management wrong, you can make pretty much
anything fail.





---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.553 / Virus Database: 345 - Release Date: 18/12/2003


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.553 / Virus Database: 345 - Release Date: 18/12/2003

RE: [AVR-Chat] Relay Control

2004-02-12 by Al Welch

The relay should have a reverse diode across the coil to clamp the back voltage generated when it is turned off. Some relays offer the diode built into the part. Also a capacitor should be next to the + supply to the relay coil. A .1 ufd and maybe a 1 UFD tantalum.
Al Welch
Show quoted textHide quoted text
-----Original Message-----
From: Ricardo Callejo [mailto:surbyte@satlink.com]
Sent: Wednesday, February 11, 2004 7:26 PM
To: AVR-Chat@yahoogroups.com
Subject: RE: [AVR-Chat] Relay Control

Can you suggest where can i find some examples of good and wrong pcbs?

Thanks.

-----Mensaje original-----
De: Dave VanHorn [mailto:dvanhorn@cedar.net]
Enviado el: Miércoles, 11 de Febrero de 2004 07:39 p.m.
Para: AVR-Chat@yahoogroups.com
Asunto: RE: [AVR-Chat] Relay Control

At 02:30 PM 2/11/2004 -0800, you wrote:
>are ATMEL AVR micros more vulnerable to EMI than other
>micros? what do you think? Or can the EMI problems be
>addressed to circuit design & environment directly?

I see no reason why AVRs would be more or less susceptible than other
similar chips.
Mostly, it's a matter of proper PCB layout, managing where the currents flow.

I use the AVR in a couple of applications now, where we are gating 3-10A
currents on timescales of 300uS to 2mS, without any emi problems.
Of course if you do the ground management wrong, you can make pretty much
anything fail.






---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.553 / Virus Database: 345 - Release Date: 18/12/2003


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.553 / Virus Database: 345 - Release Date: 18/12/2003

RE: [AVR-Chat] Relay Control

2004-02-12 by Dave VanHorn

At 12:26 AM 2/12/2004 -0300, Ricardo Callejo wrote:

>Can you suggest where can i find some examples of good and wrong pcbs?

Not offhand.

PCB design is somewhat of an art.

I'm not at home, so I can't refer you to any books directly, but the 
general idea is that the micro should not have large currents passing by or 
through it.
The currents translate to voltage according to the resistance of the 
traces, and to magnetic fields according to the loop area.

The loop area refers to how a high current source and return path form a loop.

You might do something like this:

/---------------------------------\
|                                  |
PS                             RY
|                                  |
\---------------------------------/

which has a large loop area.

Or like this:

/-PS-\                          |/\
|       \-------------------------/  RY
\-----------------------------------/

which has a much smaller loop area.

Those tracks above would ideally be right next to each other, but I can't 
draw that in ascii.

RE: [AVR-Chat] Relay Control

2004-02-12 by Al Welch

The pcb web site has tips at this link. Most relate to board layout but it is good info.
Al Welch
Show quoted textHide quoted text
-----Original Message-----
From: Ricardo Callejo [mailto:surbyte@satlink.com]
Sent: Wednesday, February 11, 2004 7:26 PM
To: AVR-Chat@yahoogroups.com
Subject: RE: [AVR-Chat] Relay Control

Can you suggest where can i find some examples of good and wrong pcbs?

Thanks.

-----Mensaje original-----
De: Dave VanHorn [mailto:dvanhorn@cedar.net]
Enviado el: Miércoles, 11 de Febrero de 2004 07:39 p.m.
Para: AVR-Chat@yahoogroups.com
Asunto: RE: [AVR-Chat] Relay Control

At 02:30 PM 2/11/2004 -0800, you wrote:
>are ATMEL AVR micros more vulnerable to EMI than other
>micros? what do you think? Or can the EMI problems be
>addressed to circuit design & environment directly?

I see no reason why AVRs would be more or less susceptible than other
similar chips.
Mostly, it's a matter of proper PCB layout, managing where the currents flow.

I use the AVR in a couple of applications now, where we are gating 3-10A
currents on timescales of 300uS to 2mS, without any emi problems.
Of course if you do the ground management wrong, you can make pretty much
anything fail.






---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.553 / Virus Database: 345 - Release Date: 18/12/2003


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.553 / Virus Database: 345 - Release Date: 18/12/2003

Re: Relay Control

2004-02-16 by Joe

Thanx to everybody that contributed to the Thread.
I got good ideas and the problem is solved.

I think the main fixes were:
1) MOV's across the relay contacts
2) 6.2v zeiner across VCC to ground
3) .01uf caps at the LCD+, AVR power pins

I also changed:
1) Removed the cap across the switch - no difference
2) Added diodes across the relay coils - no difference
3) I also left in the Int0 interrupt disable before switching the 
relays on.

I tried changing the resistor on the Int0 but a lower value did not 
pull the VCC down far enough. I will try to post an updated schematic.

JoeT

Re: [AVR-Chat] Re: Relay Control

2004-02-16 by MuRaT KaRaDeNiZ

As I remember MOV's do wear, you might want to
consider this. What is voltage rating for them?

>I also left in the Int0 interrupt disable before
> switching the 
> relays on.

this doesn't seem to me a proper solution, you should
better have fixed the problem with other cautions, so
that you can free your mind from this.

> 2) Added diodes across the relay coils - no
> difference

when working with inductive loads, these clamping
diodes are always needed, this is why most designs
include them. The ULN2803 driver ICs, IRF530 like
transistors for example do include them internally,
because most people use them with inductive loads, and
integrating them was so natural.




--- Joe <joet@attg.net> wrote:
> Thanx to everybody that contributed to the Thread.
> I got good ideas and the problem is solved.
> 
> I think the main fixes were:
> 1) MOV's across the relay contacts
> 2) 6.2v zeiner across VCC to ground
> 3) .01uf caps at the LCD+, AVR power pins
> 
> I also changed:
> 1) Removed the cap across the switch - no difference
> 2) Added diodes across the relay coils - no
> difference
> 3) I also left in the Int0 interrupt disable before
> switching the 
> relays on.
> 
> I tried changing the resistor on the Int0 but a
> lower value did not 
> pull the VCC down far enough. I will try to post an
> updated schematic.
> 
> JoeT 
> 
> 


__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

RE: [AVR-Chat] Re: Relay Control

2004-02-19 by JoeT

>As I remember MOV's do wear, you might want to
>consider this. What is voltage rating for them?

 I used v150la20, 150v (22mm) MOV's. I am still researching 
 the correct values. I may put them on the contactors 
 instead of the PCB next time.


>>I also left in the Int0 interrupt disable before
>> switching the 
>> relays on.
>
>this doesn't seem to me a proper solution, you should
>better have fixed the problem with other cautions, so
>that you can free your mind from this.

 It did get it to work without disabling the Int0. I left 
 it in because it did not seem to affect the operation
 and was insurence against the problem.


>> 2) Added diodes across the relay coils - no
>> difference
>
>when working with inductive loads, these clamping
>diodes are always needed, this is why most designs
>include them. The ULN2803 driver ICs, IRF530 like
>transistors for example do include them internally,
>because most people use them with inductive loads, and
>integrating them was so natural.

 This is why adding the diodes did not help and the
 unit worked with its own relays and not the contactors.

 I am making a second unit that will control more. I will
 include what I have done and experiment some more.

 Thanx 
JoeT


--- Joe <joet@attg.net> wrote:
> Thanx to everybody that contributed to the Thread.
> I got good ideas and the problem is solved.
> 
> I think the main fixes were:
> 1) MOV's across the relay contacts
> 2) 6.2v zeiner across VCC to ground
> 3) .01uf caps at the LCD+, AVR power pins
> 
> I also changed:
> 1) Removed the cap across the switch - no difference
> 2) Added diodes across the relay coils - no
> difference
> 3) I also left in the Int0 interrupt disable before
> switching the 
> relays on.
> 
> I tried changing the resistor on the Int0 but a
> lower value did not 
> pull the VCC down far enough. I will try to post an
> updated schematic.
> 
> JoeT 
> 
> 


__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html



 
Yahoo! Groups Links

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.