Csed MST Baw
Csed MST Baw
Csed MST Baw
File Report
Submitted For
Engineering Design Project - II (UTA-024)
Submitted by:
Submitted to -
Mr . Gurpreet Singh
1
TABLE OF CONTENTS
Abstract i
Declaration ii
Table of Contents iii
List of Tables iv
List of Figures v
List of Abbreviations vi
2
Abstract
This report contains the use of Arduino Uno to perform various experiments. We used
Arduino IDE software to write different codes, which were used in performing various
experiments. We used Arduino Uno, breadboard, LEDs, probe/connecting wires, and other
various components to make multiple circuits and execute the codes to see the results.
3
Declaration
● We, the undersigned, solemnly declare that the project report EST PRACTICAL
ACTIVITY REPORT is based on our work carried out during our study under the
supervision of Mr. Gurpreet Singh.
● The work contained in the report is original and has been done by
us under the general supervision of our supervisor.
● The work has not been submitted to any other Institution for any
other degree/diploma/certificate in this university or any other
University in India or abroad.
● We have followed the guidelines provided by the university in writing the report.
● Whenever we have used materials (data, theoretical analysis, and text) from other
sources, we have given due credit to them in the report's text and their details in
the references.
4
LIST OF TABLES
Table 1 Experiment 1 8
Table 2 Experiment 2 10
Table 3 Experiment 3 13
Table 4 Experiment 4 20
Table 5 Experiment 5 24
Table 6 Experiment 6 30
Table 7 Experiment 7 33
Table 8 Experiment 8 35
Table 9 Experiment 9 39
Table 10 Experiment 10 44
Table 11 Experiment 11 47
5
LIST OF FIGURES
6
INDEX
S. Name of Experiments
No.
1 Introduction to Arduino Micro-Controller.
2 To make a circuit for blinking an LED using Arduino Uno and breadboard.
3 Write an Arduino program to blink multiple LEDs using: While loop, Array, Switch Case, If
else, Function.
4 Write an Arduino program to design an odd-even pattern and perform the reverse operation.
For example- Sequence = 1 3 5 2 4--- 4 2 5 3 1
5 Develop a program to blink five LEDs with five distinct patterns, each implemented in a
separate function using analogWrite. Describe each pattern in your code.
10 WAP to perform the following movements of Robo Car (Buggy): forward, backward, left,
right, clockwise and anti-clockwise motion. (Use a function for each)
11 Write a program that visually displays binary inputs taken up to 2^5 on 5 LEDs through serial
communication. (Take input trough serial communication)
7
5. PWM – The pins marked with the (~) symbol can simulate analog output.
6. USB Connection – Used for powering up your Arduino and uploading sketches.
8. ATmega Microcontroller – This is the brains and is where the programs are stored 9.
Power LED Indicator – This LED lights up anytime the board is plugged in a power
source.
10. Voltage Regulator – This controls the amount of voltage going into the Arduino
board.
11. DC Power Barrel Jack – This is used for powering your Arduino with a power
supply.
12. 3.3V Pin – This pin supplies 3.3 volts of power to your projects.
14. Ground Pins – There are a few ground pins on the Arduino and they all work the
same.
15. Analog Pins – These pins can read the signal from an analog sensor and convert it to
digital.
DISCUSSIONS
In this experiment, we get to know about basics of Arduino Uno Microcontroller and its various
functions and components.
9
EXPERIMENT-2
OBJECTIVE: Write a program to blink a single LED using Arduino and breadboard.
SOFTWARE USED: Tinkercad Simulator.
HARDWARE USED:
2. Breadboard 1
3. Jumper Wires 5
4. LED 1
THEORY:
Resistor: Resistors are used in virtually all electronic circuits and many electrical ones.
Resistors, as their name indicates resist the flow of electricity and this function is key to the
operation most circuits.
LED: A light-emitting diode (LED) is a semiconductor light source that emits light when
current flows through it. Electrons in the semiconductor recombine with electron holes,
releasing energy in the form of photons (Energy packets).
Arduino UNO Board: The Arduino UNO is an open-source microcontroller board based on
the Microchip ATmega328P microcontroller and developed by Arduino. cc.
Breadboard: A breadboard is used to place components (resistor, capacitor, LED etc.) that are
wired together. It is used to make temporary circuits.
Jumper Wires: A jumper wire is an electric wire that connects remote electric circuits used
for printed circuit boards.
10
EXPERIMENT-3
OBJECTIVE: To blink multiple LEDs using Arduino Uno and breadboard. Using for loop,
while loop, array, switch case, functions.
HARDWARE USED:
2 Breadboard 1
3. Jumper Wires 10
4. LED 4
THEORY:
Resistor: Resistors are used in virtually all electronic circuits and many electrical ones.
Resistors, as their name indicates resist the flow of electricity and this function is key to the
operation most circuits.
LED: A light-emitting diode (LED) is a semiconductor light source that emits light when
current flows through it. Electrons in the semiconductor recombine with electron holes,
releasing energy in the form of photons (Energy packets).
Arduino Uno Board: The Arduino Uno is an open-source microcontroller board based on the
Microchip ATmega328P microcontroller and developed by Arduino.cc.
Breadboard: A breadboard is used to place components (resistor, capacitor, LED’s etc.) that
are wired together. It is used to make temporary circuits.
Jumper Wires: A jumper wire is an electric wire that connects remote electric circuits used
for printed circuit boards.
12
CODE:
//To Blink Multiple LED’s using:
1. For loop
2. While loop
3. Array
4. Switch case
5. Function
1) For loop
void setup()
{
for(int i=5;i<=8;i++)
{
pinMode(i, OUTPUT);
}
}
void loop()
{
for(int i =5;i<=8;i++)
{
digitalWrite(i, HIGH);
delay(1000); // Wait for 1000 millisecond(s)
digitalWrite(i, LOW);
delay(1000); // Wait for 1000 millisecond(s)
}
}
2) While loop
void setup()
{
for(int i=5;i<=8;i++)
{
pinMode(i, OUTPUT);
}
}
void loop()
{
int i=5;
while(i<=8)
{
digitalWrite(i, HIGH);
delay(1000);
14
digitalWrite(i, LOW);
delay(1000);
i++;
}
}
3) Array
void loop()
{
for(int i=0;i<=4;i++)
{
digitalWrite(A[i], HIGH);
delay(1000);
digitalWrite(A[i], LOW);
delay(1000);
}
}
4) Switch case
void setup()
{
for(int i=5;i<=8;i++)
{
pinMode(i, OUTPUT);
}
}
void loop()
{
int i=5;
while(true)
15
{
switch(i)
{
case 5:
digitalWrite(i, HIGH);
delay(1000);
digitalWrite(i, LOW);
delay(1000);
i++;
break;
case 6:
digitalWrite(i, HIGH);
delay(1000);
digitalWrite(i, LOW);
delay(1000);
i++;
break;
case 7:
digitalWrite(i, HIGH);
delay(1000);
digitalWrite(i, LOW);
delay(1000);
i++;
break;
case 8:
digitalWrite(i, HIGH);
delay(1000);
digitalWrite(i, LOW);
delay(1000);
i++;
break;
default:
i=5;
}
}
5) Function
void setup()
{
for(int i=5;i<=8;i++)
16
{
pinMode(i, OUTPUT);
}
}
void blinkLED(int i)
{
digitalWrite(i,HIGH);
delay(1000);
digitalWrite(i,LOW);
delay(1000);
}
void loop()
{
blinkLED(5);
blinkLED(6);
blinkLED(7);
blinkLED(8);
RESULTS:
In this experiment, we learnt how to blink multiple LEDs using Arduino Uno and breadboard.
17
EXPERIMENT-4
OBJECTIVE: Write an Arduino program to design an odd-even pattern and perform the
reverse operation. For example- Sequence = 1 3 5 2 4--- 4 2 5 3 1
HARDWARE USED:
2. Breadboard 1
3. Jumper Wires 5
4. LED 1
THEORY:
Resistor: Resistors are used in virtually all electronic circuits and many electrical ones.
Resistors, as their name indicates, resist the flow of electricity and this function is key to the
operation of most circuits.
LED: A light-emitting diode (LED) is a semiconductor light source that emits light when
current flows through it. Electrons in the semiconductor recombine with electron holes,
releasing energy as photons (Energy packets).
Arduino Uno Board: The Arduino Uno is an open-source microcontroller board based on the
Microchip ATmega328P microcontroller and developed by Arduino. cc.
Breadboard: A breadboard is used to place components (resistor, capacitor, LED’s etc.) that
are wired together. It is used to make temporary circuits.
Jumper Wires: A jumper wire is an electric wire that connects remote electric circuits used
for printed circuit boards.
18
}
}
RESULTS:
In this experiment, we learnt how to demonstrate sending data from the computer to the
Arduino board and control brightness of LED.
20
EXPERIMENT-5
OBJECTIVE: Develop a program to blink five LEDs with five distinct patterns, each
implemented in a separate function using analogWrite. Describe each pattern in your code.
HARDWARE USED:
2 Breadboard 1
3 Jumper Wires 5
4 LED 1
THEORY:
Arduino Uno Board: The Arduino Uno is an open-source microcontroller board based on the
Microchip ATmega328P microcontroller developed by Arduino. cc.
Resistor: Resistors are used in virtually all electronic and electrical circuits. Resistors, as their
name indicates, resist the flow of electricity and this function is key to the operation of most
circuits.
LED: A light-emitting diode (LED) is a semiconductor light source that emits light when
current flows through it. Electrons in the semiconductor recombine with electron holes,
releasing energy in the form of photons (Energy packets).
Breadboard: A breadboard is used to place components (resistor, capacitor, LED etc.) that are
wired together. It is used to make temporary circuits.
Jumper Wires: A jumper wire is an electric wire that connects remote electric circuits used
for printed circuit boards.
21
CODE:
int Pins[] = {9, 10, 11, 12, 13}; // Pins connected to LEDs
void setup() {
for (int i = 0; i < 5; i++) {
pinMode(Pins[i], OUTPUT); // Initialize LED pins as outputs
}
}
void loop() {
pattern1(); // Call pattern 1
delay(1000); // Wait for 1 second
23
void pattern3() {
for (int i = 0; i < 5; i += 2) {
analogWrite(Pins[i], 255); // Turn on LED at full brightness
}
delay(500); // Wait for 0.5 seconds
for (int i = 0; i < 5; i += 2) {
analogWrite(Pins[i], 0); // Turn off LED
}
delay(500); // Wait for 0.5 seconds
for (int i = 1; i < 5; i += 2) {
analogWrite(Pins[i], 255); // Turn on LED at full brightness
}
delay(500); // Wait for 0.5 seconds
for (int i = 1; i < 5; i += 2) {
analogWrite(Pins[i], 0); // Turn off LED
}
}
RESULTS: In this experiment we studied how to make different led patterns using functions
in Arduino programming.
24
interface where users can send commands to turn on/off LEDs, adjust motor speeds, or
change other parameters.
1. Ensure that your Arduino board is connected to your computer via USB.
2. Open the Arduino IDE.
3. Upload your sketch to the Arduino board.
4. Click on the "Serial Monitor" button in the Arduino IDE toolbar, or navigate to Tools
> Serial Monitor.
5. Set the baud rate in the bottom right corner of the Serial Monitor to match the baud rate
specified in your Arduino sketch (Serial.begin()).
6. You should now see the Serial Monitor window, where you can send and receive text
data.
CODE:
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println("ArduinoGetStarted");
delay(1000);
}
RESULTS:
In this experiment, The Serial Monitor is an invaluable tool for Arduino development, enabling
you to interact with your Arduino projects and debug your code effectively.
26
void loop() {
printAsterisks();
Serial.println("Name-"); Serial.println(name);
printAsterisks();
Serial.println("Class-");Serial.println(class_1);
printAsterisks();
Serial.println("Roll No.");Serial.println(rollno);
printAsterisks();
delay(5000);
void printAsterisks() {
Serial.println("****************************");
RESULTS:
In this experiment, we learnt print the following pattern
29
EXPERIMENT-8
OBJECTIVE: Write an Arduino program that takes data from a serial monitor and uses it to
control the brightness, number of blinks, and which LED blinks.
2 Breadboard 1
3 Jumper Wires 15
4 LED 5
5 Resistor 5 x 220-ohm
THEORY:
Resistor: Resistors are used in virtually all electronic circuits and many electrical ones.
Resistors, as their name indicates resist the flow of electricity and this function is key to the
operation most circuits.
LED: A light-emitting diode (LED) is a semiconductor light source that emits light when
current flows through it. Electrons in the semiconductor recombine with electron holes,
releasing energy in the form of photons (Energy packets).
Arduino Uno Board: The Arduino Uno is an open-source microcontroller board based on the
Microchip ATmega328P microcontroller and developed by Arduino. cc.
Breadboard: A breadboard is used to place components (resistor, capacitor, LED etc.) that are
wired together. It is used to make temporary circuits.
Jumper Wires: A jumper wire is an electric wire that connects remote electric circuits used
for printed circuit boards.
30
CODE:
void setup(){
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(3,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(9,OUTPUT);
}
void loop() {
//Serial.println("Hello");
LED=Serial.parseInt();
bright = Serial.parseInt();
int times = Serial.parseInt();
for(int i = 0;i<times;i++)
analogWrite(LED,bright);
delay(1000);
analogWrite(LED,0);
delay(1000);
}
RESULTS:
In this experiment, how Arduino takes data from a serial monitor and uses it to control the
brightness, number of blinks, and which LED blinks.
32
EXPERIMENT-9
OBJECTIVE: Write a program for virtual LED Dice using a random function
SOFTWARE USED: Tinkercad Simulator.
HARDWARE USED:
2 Breadboard 1
3 Jumper Wires 15
4 LED 5
5 Resistor 5 x 220-ohm
THEORY:
Resistor: Resistors are used in virtually all electronic circuits and many electrical ones.
Resistors, as their name indicates resist the flow of electricity and this function is key to the
operation most circuits.
LED: A light-emitting diode (LED) is a semiconductor light source that emits light when
current flows through it. Electrons in the semiconductor recombine with electron holes,
releasing energy in the form of photons (Energy packets).
Arduino Uno Board: The Arduino Uno is an open-source microcontroller board based on the
Microchip ATmega328P microcontroller and developed by Arduino.cc.
Breadboard: A breadboard is used to place components (resistor, capacitor, LED’s etc.) that
are wired together. It is used to make temporary circuits.
Jumper Wires: A jumper wire is an electric wire that connects remote electric circuits used
for printed circuit boards.
33
CODE:
int A[] = {3,5,6,9,10,11,12};
void setup()
{
for (int i=0;i<7;i++){
pinMode(A[i],OUTPUT);
}
pinMode(2,INPUT); // Roll button
Serial.begin(9600);
}
void loop()
{
int number = 0;
for(int i =0;i<7;i++){
digitalWrite(A[i],LOW);
}
if(digitalRead(2)==HIGH)
{ number = random(1,7);
}
switch(number)
{
case 1:
digitalWrite(A[0],HIGH);
break;
case 2:
digitalWrite(A[1],HIGH);
break;
case 3:
digitalWrite(A[2],HIGH);
break;
case 4:
digitalWrite(A[4],HIGH);
break;
case 5:
digitalWrite(A[5],HIGH);
break;
case 6:
digitalWrite(A[6],HIGH);
break;
default:
digitalWrite(A[3],HIGH);
break;
}
35
delay(2000);
}
RESULTS:
In this experiment, we learnt virtual LED Dice using a random function
36
CODE:
void setup(){
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
}
void forward()
{
digitalWrite(5,HIGH);
digitalWrite(8,HIGH);
digitalWrite(6,LOW);
digitalWrite(7,LOW);
}
void backward()
{
digitalWrite(5,LOW);
digitalWrite(8,LOW);
digitalWrite(6,HIGH);
digitalWrite(7,HIGH);
}
void clockwise()
{
digitalWrite(5,LOW);
digitalWrite(8,HIGH);
digitalWrite(6,HIGH);
digitalWrite(7,LOW);
}
void anticlockwise()
{
digitalWrite(5,HIGH);
digitalWrite(8,LOW);
digitalWrite(6,LOW);
digitalWrite(7,HIGH);
}
void lowall()
{
digitalWrite(5,LOW);
digitalWrite(8,LOW);
digitalWrite(6,LOW);
digitalWrite(7,LOW);
}
void loop() {
clockwise();
38
delay(3000);
lowall();
delay(1000);
forward();
delay(10000);
}
RESULTS:
In this experiment, we learnt how to control of DC Motor using forward, backward, left, right
turn motion and clock- wise/anti clock- wise rotation.
39
EXPERIMENT-11
OBJECTIVE: Write a program that visually displays binary inputs taken up to 2^5 on 5 LEDs
through serial communication. (Take input trough serial communication)
SOFTWARE USED: Tinkercad Simulator.
HARDWARE USED:
2 Breadboard 1
3 Jumper Wires 15
4 LED 5
5 Resistor 5 x 220-ohm
THEORY:
Resistor: Resistors are used in virtually all electronic circuits and many electrical ones.
Resistors, as their name indicates resist the flow of electricity and this function is key to the
operation most circuits.
LED: A light-emitting diode (LED) is a semiconductor light source that emits light when
current flows through it. Electrons in the semiconductor recombine with electron holes,
releasing energy in the form of photons (Energy packets).
Arduino Uno Board: The Arduino Uno is an open-source microcontroller board based on the
Microchip ATmega328P microcontroller and developed by Arduino.cc.
Breadboard: A breadboard is used to place components (resistor, capacitor, LED’s etc.) that
are wired together. It is used to make temporary circuits.
Jumper Wires: A jumper wire is an electric wire that connects remote electric circuits used
for printed circuit boards.
40
CODE:
int A[]={3,5,6,9,10};
void setup()
{
for(int i =0;i<5;i++)
{
pinMode(A[i], OUTPUT);
}
Serial.begin(9600);
}
void loop()
{
int LED=0;
int Bright = 0;
if(Serial.available()>0)
{
//LED = Serial.parseInt();
//Bright = Serial.parseInt();
int number = 0;
number = Serial.parseInt();
int a,b,c,d,e;
a = (number/1)%2;//3
b = (number/2)%2;//5
c = (number/4)%2;//6
d = (number/8)%2;//10
e = (number/16)%2;//11
digitalWrite(3,a);
digitalWrite(5,b);
digitalWrite(6,c);
digitalWrite(10,d);
digitalWrite(11,e);
}
RESULTS:
In this experiment, binary inputs taken up to 2^5 on 5 LEDs through serial communication.
(Take input trough serial communication)
42