Specifications

Chapter 6 - Samples
Previous page Table of contents Chapter overview Next page
The Relay
The relay is an electromechanical device, which transforms an electrical signal into mechanical
movement. It consists of a coil of insulated wire on a metal core, and a metal armature with one
or more contacts.
When a supply voltage was delivered to the coil, current would flow and a magnetic field would be
produced that moves the armature to close one set of contacts and/or open another set. When
power is removed from the relay, the magnetic flux in the coil collapses and produces a fairly high
voltage in the opposite direction. This voltage can damage the driver transistor and thus a reverse-
biased diode is connected across the coil to "short-out" the spike when it occurs.
Connecting a relay to the microcontroller via a transistor
Many microcontrollers cannot drive a relay directly and so a driver transistor is required. A HIGH
on the base of the transistor turns the transistor ON and this activates the relay. The relay can be
connected to any electrical device via the contacts.
The 10k resistor on the base of the transistor limits the current from the microcontroller to that
required by the transistor. The 10k between base and the negative rail prevents noise on the base
from activating the relay. Thus only a clear signal from the microcontroller will activate the relay.
http://www.mikroelektronika.co.yu/english/product/books/PICbook/6_06Poglavlje.htm (1 of 4) [4/2/2003 16:18:54]