A relay is an electromagnetic switch which is used to switch High Voltage/Current using Low power circuits. Relay isolates low power circuits from high power circuits. It is activated by energizing a coil wounded on a soft iron core. The Role and Function of Relays include controlling the flow of electricity between circuits, providing electrical isolation, amplifying signals, and facilitating the automation of various processes. For detailed working of relay please visit this page. A relay should not be directly connected to a microcontroller, it needs a driving circuit.
A relay should not be connected directly to a microcontroller due to following reasons..
- A microcontroller is not able to supply current required for the working of a relay. The maximum current that a PIC Microcontroller can source or sink is 25mA while a relay needs about 50 – 100mA current.
- A relay is activated by energizing its coil. Microcontroller may stop working by the negative voltages produced in the relay due to its back emf.
Interfacing Relay with PIC Microcontroller using Transistor
A relay can be easily interfaced with microcontroller using a transistor as shown below. Transistor is wired as a switch which carries the current required for operation of the relay. When the pin RB7 of the PIC microcontroller goes high, the transistor BC547 turns On and current flows through the relay. The diode D1 is used to protect transistor and the microcontroller from Back EMF generated in the relays coil. Normally 1N4148 is preferred as it is a fast switching diode having a peak forward current of 450mA. This diode is also known as freewheeling diode.
Interfacing Relay with PIC using Transistor
Note: VDD and VSS of the pic microcontroller is not shown in the circuit diagram. VDD should be connected to +5V and VSS to GND.
Read More: Interfacing Relay with PIC Microcontroller
Related projects
Voice Activated Power Sockets (Home Automation)
Yet another voice controlled home automation system! As shown in the picture, the system can control any electrical appliance, by turning ON...
Home Automation & SecurityHome Security System with GSM Using 8051 Microcontroller
Security is a big challenge everywhere because thefts are increasing day by day owing to the unsafe and insecure security systems in...
Home Automation & SecurityHome Automation and Security System using Microcontroller ATMEGA8 with Arduino Programming
Home automation and security systems have become very popular these days, today industrial automation techniques are widely adopted by luxurious homes and...
Home Automation & Security · PIC16F84ABicycle Persistence of Vision Light Display using PIC16F84
In February of 2007 I spent a little while prototyping a board that turns any bicycle wheel into a moving display billboard...
Home Automation & SecurityFTS-8 subtone encoder
Many Yaesu transceivers from the 1990s and thereabouts could use an optional FTS-8 module, that provided subtone generation for transmission, and subtone...
Home Automation & SecurityHand Sign Lock
Introduction Security using technology is a growing and expanding field to protect against the user's identity or property. As more advanced tools...

