Switching a relay with an AVR

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

Hi Guys,

I need to control two 10A, 240V supplies independently with a relay. I am using an 8bit AVR. I have yet to choose the one.

So I went to jaycar (an electronics supply store) and I bought a relay on advice.

Well it seems to require 12V to switch ^&%$^%
I can't find a clear spec for it.

So can I use this relay, is there a better option that I can use (I am space constricted). Is there any advice you guys can give me on switching relays with a microprocessor ?

Thanks
George

PS: This is my first project that I will post here if and when I finish

Attachment(s): 

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

Have a look here, top L/H side (A2) there is a relay circuit.
http://www.members.optusnet.com....

The coil will of course need 12V as you have a 12V relay.

You may also want to put an additional 10K resistor from base to ground of the transistor.

The BC547 should be just enough as the coil needs 75mA, perhaps you may want to use a beefier transistor like a BC327 (ZT-2110) and use a 4K7 instead of the 10K shown there.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

And please don't miss the diode in parallel with the coil. It's not cosmetic. Search for "back EMF", "freewheeling diode", "relay diode" etc for more.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

I am restricted for space. I am hoping not to have to supply an extra voltage level. Could you guys recomend some other relay ?

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

Relays are not very fussy. The input to your 5V regulator should do just fine.

Running a relay off the regulated power supply is best for critical applications where switching speed is important. If you want to do that, you can. Just select a relay with the same switch specifications but with the lower desired coil voltage.

If you think education is expensive, try ignorance.

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

Here is one from Mouser.

Or you could try for the - FRA7 T A DC 5V - which is the same relay you posted above w/ 5v coil. It may be obsolete...don't know.

JOHN

Just some guy

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

The lower the coil voltage, the higher the neccessary coil current. You would need a driver transistor either way. Relays don't need a super clean power supply. A 12V relay would work with an unstabilized supply voltage in the range of 10-15V. So usually you don't need a second regulator.

Regards
Sebastian

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

Do you have to use a normal relay, or would it be possible to use semiconductor relay or optocoupled triacs etc for this?

- Jani

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

It is a simple box with 240V in, 2x240V out
There is an independant time display for each output.
A thumb weel to select the time
A reset button to set the time display for each 240V output.

I need to make sure it is robust. Speed is not important as it will switch on and off a few times a day.

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

So what is the problem with a 12V supply? How is the board powered up? Are you using some regulator on it or just a 5V power pack?

Most of my boards use either a 12 or 24V supply and have on board regulator. So the relays used would be either 12 or 24V coil. Jaycar would only stock popular types.

Farnell has a 5V coil similar to the one you are showing
http://www.farnell.com/datasheet...

It DOES NOT mean that you can drive it from the micro however. Still need the transitor etc.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

No matter what the power source for the relay, a transistor will be needed to interface between the micro and the relay coil. The transistor needs to handle the DC coil current and the unloaded coil supply voltage. Plus, you will need a flyback diode across the relay coil.

The supply voltage for the relay depends on the coil rating. Relays will usually pull in at about 80% of the rated voltage. Sometimes a bit lower.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

Intermatic makes a whole slew of timers with various features from the simplest mechanical timer to the one shown. These are already set up for years of reliable service. Unless this project is for fun you might consider something similar. These devices are microprocessor controlled and have all the "bells and whistles!"

Kind Regards!

John

Just some guy

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

If you don't want to provide another voltage source, you can use solid state relay (TRIAC), bear in mind to drive TRIAC indirectly using opto-TRIAC to keep the microcontroller's circuit protected from high voltage.
Any way, this is just a suggestion.

KISS - Keep It Simple Stupid!

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

Giorgis wrote:
Hi Guys,

I need to control two 10A, 240V supplies independently with a relay. I am using an 8bit AVR. I have yet to choose the one.

So I went to jaycar (an electronics supply store) and I bought a relay on advice.

Well it seems to require 12V to switch ^&%$^%
I can't find a clear spec for it.

So can I use this relay, is there a better option that I can use (I am space constricted). Is there any advice you guys can give me on switching relays with a microprocessor ?

Thanks
George

PS: This is my first project that I will post here if and when I finish

Ultimately were u able to make the AC switch using the micro and other components?Because I also want to make one.Please tell me.