The Relay Module project demonstrates how to control a relay using an Arduino Mega. The relay can be used to control high-power devices like lights, fans, or other electronic devices by switching them on or off.
- Arduino Mega
- Relay Module
- Jumper Wires
- Power Supply for the device controlled by the relay
-
Connecting the Relay Module to Arduino Mega:
- Relay Pin: Connect the IN pin of the relay module to a digital output pin on the Arduino Mega (e.g., pin 7).
- VCC: Connect the VCC pin of the relay module to the 5V pin on the Arduino Mega.
- GND: Connect the GND pin of the relay module to the GND on the Arduino Mega.
-
Connecting the Device to the Relay:
- COM (Common): Connect the common terminal of the relay to one terminal of the device's power supply.
- NO (Normally Open): Connect the normally open terminal of the relay to one terminal of the controlled device.
- Device's other terminal: Connect the other terminal of the device to the remaining terminal of the power supply.
-
Code Upload:
- Open the Arduino IDE and create a new sketch.
- Copy and paste the provided Arduino code into the sketch.
- Upload the code to the Arduino Mega.
-
Testing:
- Open the Serial Monitor in the Arduino IDE (set to 9600 baud) to monitor the output.
- Observe the relay turning on and off every 2 seconds, controlling the connected device.
- Home Automation: Control lights, fans, or other appliances.
- Industrial Automation: Control machinery or equipment.
- Remote Switching: Turn devices on or off remotely using sensors or wireless modules.
- Safety: Ensure the relay module is rated for the voltage and current of the device being controlled.
- Isolation: The relay provides electrical isolation between the control circuit and the device being controlled, enhancing safety.
🌐 ProjectsLearner
📧 projectslearner@gmail.com
📸 Instagram
📘 Facebook
📘 LinkedIn
Crafted for you with ❤️ from ProjectsLearner