Difference between revisions of "Controlling AC devices with AVR using Relays"
Line 5: | Line 5: | ||
<html> | <html> | ||
<div class="jumbotron "> | <div class="jumbotron "> | ||
− | <span> <i class = "fa fa-warning fa- | + | <span> <i class = "fa fa-warning fa-5x pull-left" style="color:red;"></i></span> |
<p>Be careful while driving AC loads. It can be quite dangerous. Do not turn on the mains power while hooking up the circuit. You've been warned!</p> | <p>Be careful while driving AC loads. It can be quite dangerous. Do not turn on the mains power while hooking up the circuit. You've been warned!</p> | ||
</div> | </div> | ||
</html> | </html> | ||
+ | |||
=Hookup= | =Hookup= | ||
The Ultra AVR Dev board comes with Relays on board. You simply need to hook up the relay inputs with the the port pins as shown in the figure below. | The Ultra AVR Dev board comes with Relays on board. You simply need to hook up the relay inputs with the the port pins as shown in the figure below. |
Revision as of 18:15, 28 March 2016
Everyone of us wants to control a bulb, a fan etc at some point in time. We will look at driving single phase AC devices with a Relay using Atmega32.
Basics
The relay is driven using a simple transistor switch circuit. You may look at the schematic of the driver circuit from Ultra AVR Dev Board Schematic. It is a common collector transistor switch circuit. It provides additional current required to drive the relay. The current from the controller port pin is not sufficient, hence the driver is used.
Be careful while driving AC loads. It can be quite dangerous. Do not turn on the mains power while hooking up the circuit. You've been warned!
Hookup
The Ultra AVR Dev board comes with Relays on board. You simply need to hook up the relay inputs with the the port pins as shown in the figure below.
Code
The code turns ON and OFF the relays, every 5 seconds.