Arun IoT 7
Arun IoT 7
Experiment 7
Student Name: Arun UID:22BET10320
Branch: IT Section/Group:22BET_IoT_703-B
Semester: 5th Date of Performance: /10/2024
Subject Name: IOT LAB Subject Code: 22ITP-329
1. Aim: To Assemble and Controlling of actuators using Arduino Uno.
2. Objective: The goal of this project is to assemble and control various actuators
(LED, motor, and buzzer) using an Arduino Uno. This project will involve
connecting the components to the Arduino and writing a program to control their
behavior, such as blinking the LED, turning the motor on and off, and sounding
the buzzer.
3. Input/Equipment Used: Arduino, LED, Motor, Buzzer
4. Theory:
Servo Motors: Servomotors have three wires: power, ground, and signal. The
power wire is typically red, and should be connected to the 5V pin on the Arduino
board. The ground wire is typically black or brown and should be connected to a
ground pin on the board. The signal pin is typically yellow or orange and should
be connected to PWM pin on the board.
5. Procedure:
• Place the Arduino Uno on a working surface or connect it to a breadboard for
easier wiring
• Connect the LED to the breadboard. Attach the longer leg (anode) of the LED
to pin 8 of the Arduino and the shorter leg (cathode) to ground (GND) through
a 220ohm resistor.
• If using a motor driver (L298N or similar), connect the control pins of the driver
to pin 9 of the Arduino, the power pins to a 5V external power supply, and the
motor output pins to the motor.
• Connect the Buzzer to pin 10 of the Arduino, with the other terminal connected
to ground.
• Install the Arduino IDE on your computer.
• Open the Arduino IDE
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
6. Code:
const int ledPin = 8; // Pin for LED
const int motorPin = 9; // Pin for Motor
const int buzzerPin = 10; // Pin for Buzzer
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(motorPin, OUTPUT);
pinMode(buzzerPin, OUTPUT);
}
void loop() { // Turn on LED
digitalWrite(ledPin, HIGH); // Turn on Motor
digitalWrite(motorPin, HIGH);// Turn on Buzzer
digitalWrite(buzzerPin, HIGH);
delay(1000); // Wait for 1 second
// Turn off LED
digitalWrite(ledPin, LOW); // Turn off Motor
digitalWrite(motorPin, LOW); // Turn off Buzzer
digitalWrite(buzzerPin, LOW);
delay(1000); // Wait for 1 second
}
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
7. Result:
Figure 1: Output