Lesson-09 : Introduction to the interfacing of Relay with Arduino Uno
Updated: 3 days ago
Let us now understand basics of Relay and then will move on to the interfacing part of Relay with Arduino Uno.
Relay
A relay is an electrically operated switch. It consists of a set of input terminals for a single or multiple control signals, and a set of operating contact terminals. The switch may have any number of contacts in multiple contact forms, such as make contacts, break contacts, or combinations thereof.
Interfacing Relay with Arduino
Components Required:
Arduino Uno with usb cable
Relay module and dc pump
Jumper wires (Male to Male (3))
Extension wire
9V battery
Breadboard (optional)
Step by step Connections
Connect the Signal pin of relay to the Digital pin 2 of the Arduino uno
Connect the VCC pin to the +5v of Arduino
Connect the GND pin to the GND of Arduino
Connect the +ve line from the battery to the Normally OPEN or NO port
Connect one terminal of the motor or pump to the relays COM port
Connect the other terminal of the motor to the –ve line of the battery
Code for Interfacing the Relay
Define the Pin Mode in the void Setup
Define the logic in the void Loop
Functions used in this example:
pinMode(Pin_Number, IN/OUT); to set the mode i.e. input or output for example pinMode(3,OUTPUT);
digitalWrite(Pin_Number,LOW/HIGH); to set the pin as High or low for example digitalWrite(3,LOW);
delay(microseconds) to put a time delay between two instructions. For example delay(1000) i.e. 1 sec delay
Thank you guys that is it in this lesson. If you want to learn more about Arduino based projects do register for IoT course provided by Nation innovation.
Recent Posts
See AllFirstly will look into the introduction of servo motor and it's working. Then we will study how to interface this servo motor with Arduino Uno. Description of Servo motor Positional rotation servo mot
Let us first understand what is Ultrasonic sensor and why, where it is used? Then will move to interfacing part. Ultrasonic sensor As shown below the HC-SR04 Ultrasonic (US) sensor is a 4 pin module,
Let us start with introduction of IR sensor and then will see interfacing of IR sensor with Arduino Uno. IR sensor: An infrared (IR) sensor is an electronic device that measures and detects infrared r