Post Top Ad

Tuesday, April 11, 2023

on video Connecting a Relay Module to a Microcontroller


 Connecting a Relay Module to a Microcontroller

Today we are driving high current high voltage applications using only a microcontroller and relay. To accomplish this, we are going to take a closer look at a few different types of relay modules you might find across the Internet. We will first go over the components and connections available on each module, then we will go over the schematic to get a better understanding of how each module works, and finally we will demonstrate how to connect these modules into our circuits. Throughout this video I will touch on important considerations to mindful of to ensure you don't damage your microcontroller or worse the item connected to the relay.

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 wounded coil on a soft iron core. 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 drain is 25mA while a relay needs about 50-100mA current.

A relay is activated by energizing its coil. Microcontroller may stop working due to 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 a 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 the 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 a freewheeling diode.


Interfacing Relay with PIC Microcontroller using ULN2003

If you want to use more relays, using transistors will be difficult. In these cases you may use ULN2003 or ULN2803. These are monolithic ICs consist of High Voltage High Current Darlington transistor arrays. You can connect seven relays using ULN2003 and eight relays using ULN2803. When using these driver ICs we don't need to connect a freewheeling diode as they have built in clamp diodes.


 Connecting a Relay Module to a Microcontroller

Today we are driving high current high voltage applications using only a microcontroller and relay. To accomplish this, we are going to take a closer look at a few different types of relay modules you might find across the Internet. We will first go over the components and connections available on each module, then we will go over the schematic to get a better understanding of how each module works, and finally we will demonstrate how to connect these modules into our circuits. Throughout this video I will touch on important considerations to mindful of to ensure you don't damage your microcontroller or worse the item connected to the relay.

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 wounded coil on a soft iron core. 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 drain is 25mA while a relay needs about 50-100mA current.

A relay is activated by energizing its coil. Microcontroller may stop working due to 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 a 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 the 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 a freewheeling diode.


Interfacing Relay with PIC Microcontroller using ULN2003

If you want to use more relays, using transistors will be difficult. In these cases you may use ULN2003 or ULN2803. These are monolithic ICs consist of High Voltage High Current Darlington transistor arrays. You can connect seven relays using ULN2003 and eight relays using ULN2803. When using these driver ICs we don't need to connect a freewheeling diode as they have built in clamp diodes.

No comments:

Post a Comment

Post Top Ad

Pages