0% found this document useful (0 votes)
17 views4 pages

Arun IoT 7

experiment 7 of IOT 5th sem in Chandigarh University

Uploaded by

kumararunlamba89
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views4 pages

Arun IoT 7

experiment 7 of IOT 5th sem in Chandigarh University

Uploaded by

kumararunlamba89
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

DEPARTMENT OF

COMPUTER SCIENCE & ENGINEERING

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

• Open a new sketch in Arduino IDE and write the code.


• Connect the Arduino to your computer using a USB cable
• Select the correct board and port in the Arduino IDE. Upload the code to the
Arduino.
• Once the code is uploaded, the LED will blink, the motor will spin, and the
buzzer will sound simultaneously for 1 second and then turn off for 1 second in
a loop.

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

8. Conclusions: we successfully controlled multiple actuators (LED, motor, and


buzzer) using an Arduino Uno. By setting the appropriate pin modes and
controlling the output signals with code, we were able to blink the LED, control
the motor, and sound the buzzer in a synchronized pattern. This experiment
demonstrates how Arduino can be used to control various electronic components
in automation or robotics applications.
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING

You might also like