This is another simple interfacing circuitry with the microcontroller. In this circuit we interface the mechanical relay with the microcontroller. Relay interfacing is very important and common type of interfacing which occurs in most of the microcontroller projects. Relay is basically electrically operated switch and act as a switching device to turn on and off the devices connected to the microcontroller, as well as provide isolation between the microcontroller and the operating device, assume we have to turn on and off the high voltage load then we cannot directly interface the device to the microcontroller as it can burn the microcontroller so we use Relay as a switch and isolator. We can control the high voltage devices with low power control signal. Logical operation can also be obtained by connecting relays in different combinations, In the early ages before the invent of vacuum tubes and transistor relays wee used as an logical element in the early computers.

The working mechanism of the relay is very simple. Relay works electromagnetically when the control signal given to the relay the magnetic flux produces in its coil either made the contacts to get apart or connect with each other. There are many types of Relay available differs in their type of application and working for example:

Latching relay

Reed relay

Mercury-wetted relay

Polarized relay

Machine tool relay

Contactor relay

Solid-state relay

Solid state contactor relay

Buchholz relay

Forced-guided contacts relay

Overload protection relay


In our circuit we are using Latch Relay.


For circuit diagram and the coding click the link given below:

Download attachment