Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 47

A

MST Practical Activity Report


Submitted for

ENGINEERING DESIGN-II (UTA024)

Submitted by:

102106107 ARMAAN GUPTA

102106108 NISHKARSH JAIN

102106109 LAKSHYAA KAKKAR

102106110 KONARK KHANNA

BE Second Year

Batch:2022-25

Submitted to-

R.S. DHAKA

Computer Science and Engineering Department

TIET, Patiala
July-Dec 2022

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

The main objective of this report is to cover all the aspects of designing an electric buggy. A new
automated buggy is developed in this design project. The design and development of the buggy
comprised of the use of Arduino Uno to perform various experiments. We used Arduino IDE
software to write different codes related to different experiments. We used breadboard, LEDs,
probe/connecting wires, and Arduino UNO to make the circuits and executed the codes to see the
results. The buggy is capable of determining its own path, sending and receiving signals and
detecting hurdles. This report taught us various aspects of designing and coding a self capable
buggy cart.

3
DECLARATION
We hereby declare that the project work entitled “ENGINEERING DESIGN” submitted to
Thapar Institute of Engineering and Technology, Patiala is a record of group effort done under
the guidance of:

R.S. DHAKA

Computer Science and Engineering Department, Thapar Institute of Engineering and


Technology, Patiala

4
LIST OF EXPERIMENTS

Sr. No. Experiment no. Objective

1 1 Introduction to Arduino Microcontroller.

2 2 Write a program in Arduino to blink an even LED.

3 3 Write a program in Arduino to blink 2 LEDs simultaneously.

4 4 Write a program to glow 2 LEDs at a time.

5 5 Write a program to glow even and odd LEDs simultaneously

6 6
Write a program to glow LEDs in series (1,2,3,4,5) and reverse
(5,4,3,2,1)

7 7 (a) WAP to display numbers from 1to 7 on a 7 segment display


(b) WAP to display alphabets from A to F on a 7 segment
display

8 8 (a)WAP to display in serial port.


(b) WAP to show use of analog write .
(c)WAP to generate random values.

9 9 WAP in Arduino to control the brightness of an LED. The intensity


of the LED should be changed based on the values provided by the
serial input.

5
Experiment: 1

Objective: Introduction to Arduino Microcontroller.

Software Used: Arduino Uno

Hardware Component Used:


Sr. No Name of Components Value
1. Arduino UNO -

Logical Circuit diagram (Tinkercad Circuit diagram):

Theory:

6
1. Power USB: Arduino board can be powered by a USB cable.

2. Power (Barrel) Jack: Arduino can be powered directly from an AC main power supply.

3. Voltage Regulator: Controls the voltage given to the Arduino.

4. Crystal Oscillator: Helps in dealing with time issues.

5. Reset: Used to reset Arduino board i.e., starts program from beginning.

6. Pins: Used to connect components, voltage and ground to the Arduino.

7. Pins: Used to connect components, voltage and ground to the Arduino.

8. Pins: Used to connect components, voltage and ground to the Arduino.

9. Pins: Used to connect components, voltage and ground to the Arduino.

10. Analog Pin: Helps in reading signals from analog sensor and converts it into a digital
signal.

11. Main Microcontroller: It is the brain of the Arduino. It has its own microcontroller.

12. ICSP Pin: Tiny programming header for the Arduino. Consists of MOSI, MISO, SCK,
RESET, VCC and GND.

13. Power LED Indicator: Lights up when Arduino is powered.

14. Digital I/O: These pins can be configured to work as input or output pins to read logics
(0 &
1).

15. AREF: It is used to set external reference voltage.

Discussion:
In this experiment, we have learnt how to use the Arduino IDE and use some default
functions to print something and display it on the serial monitor. We get to learn some inbuilt
features of the Arduino Software.

Signature of Faculty member

7
Experiment: 2

Objective: Write a program in Arduino to blink an even LED.


Software Used: Arduino Uno

Hardware Component Used


Sr. No. Name of Components Value

1. Resistor 220 Ω

2. Arduino UNO 1

3. LED 1

Theory:

1. 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.

2. LED: The LED is a light source which uses semiconductors and electroluminescence to
create light.

3. Arduino UNO R3: Arduino Uno is a microcontroller board based on the ATmega328P
(datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs),
6 analogue inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB
connection, a power jack, an ICSP header and a reset button.

4. Jumper wires: The breadboard jump wire/cable helps you to build any circuitry on
breadboard easily. These cables are flexible with both ends of a prototyping board
connector.

Code:
void setup() {

pinMode(13, OUTPUT);

8
pinMode(12, OUTPUT);

pinMode(11, OUTPUT);

pinMode(10, OUTPUT);

void loop() {

digitalWrite(12, HIGH);

delay(1000);// turn the LED on (HIGH is the voltage level)

digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)

// wait for a second

delay(1000);

digitalWrite(13,LOW);

digitalWrite(12,LOW);

delay(1000);

Picture of Circuit:

Discussion:

9
In this experiment we have learnt how to blink a LED using an Arduino adding a
resistor along its anode end to protect the LED from getting fused to large amount of
current. We also learnt how to make the correct connections of LED with the resistor.

Signature of Faculty member

Experiment: 3
Objective: Write a program to blink 2 LEDs simultaneously.

10
Software Used: Arduino Uno

Theory:

1. 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.

2. LED: The LED is a light source which uses semiconductors and electroluminescence to
create light.

3. Arduino UNO R3: Arduino Uno is a microcontroller board based on the


ATmega328P
(datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs),
6 analogue inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB
connection, a power jack, an ICSP header and a reset button.

4. Jump wires: The breadboard jump wire/cable helps you to build any circuitry on
breadboard easily. These cables are flexible with both ends of a prototyping board
connector.

Hardware Component Used:

Sr. No. Name of Components Value

1. Resistor(s) 220 Ω

2. Arduino UNO 1

3. LED(s) 6

Code:

11
void setup() {

// initialize digital pin LED_BUILTIN as an output.

pinMode(8, OUTPUT);

pinMode(9, OUTPUT);

pinMode(10, OUTPUT);

pinMode(11, OUTPUT);

void loop() {

digitalWrite(9, HIGH); // turn the LED on (HIGH is the voltage level)

delay(1000); // wait for a second

digitalWrite(11, HIGH); // turn the LED off by making the voltage LOW

delay(1000);

digitalWrite(9, LOW);

digitalWrite(11, LOW);

delay(1000);

Picture of Circuit:
12
Discussion:
In this experiment we have learnt how to make more than one LED blink at the same time with
different patterns of our choice with the help of a few resistors to protect the LEDs from fusing.
We have learnt how to use a variable to set the delay speed in the LED’s so as to not set new
values every case.

Signature of Faculty member

13
Experiment: 4
Objective: Write a program to glow 2 LEDs at a time .
Software Used: Arduino Uno
Theory:

1. 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.

2. LED: The LED is a light source which uses semiconductors and electroluminescence to
create light.

3. Arduino UNO R3: Arduino Uno is a microcontroller board based on the


ATmega328P
(datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs),
6 analogue inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB
connection, a power jack, an ICSP header and a reset button.

4. Jump wires: The breadboard jump wire/cable helps you to build any circuitry on
breadboard easily. These cables are flexible with both ends of a prototyping board
connector.

Hardware Component Used:

Sr. No. Name of Components Value

1. Resistor(s) 220 Ω

2. Arduino UNO 1

3. LED(s) 1

Code:
void setup() {
// initialize digital pin LED_BUILTIN as an output.

14
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
}

// the loop function runs over and over again forever


void loop() {
for(int i=9;i<=10;i++){
digitalWrite(i, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(i, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}}

Picture of Circuit:

Discussion
In this experiment we have learnt how to make more than one LED blink at the same
time with different patterns of our choice with the help of a few resistors to protect the LEDs

15
from fusing. We have learnt how to use a variable to set the delay speed in the LED’s so as to
not set new values every case.

Signature of Faculty member

Experiment: 5
Objective: Write a program to glow odd even LEDs simultaneously.
Software Used: Arduino Uno

16
Theory:

1. 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.

2. LED: The LED is a light source which uses semiconductors and electroluminescence to
create light.

3. Arduino UNO R3: Arduino Uno is a microcontroller board based on the


ATmega328P
(datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs),
6 analogue inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB
connection, a power jack, an ICSP header and a reset button.

4. Jump wires: The breadboard jump wire/cable helps you to build any circuitry on
breadboard easily. These cables are flexible with both ends of a prototyping board
connector.

Hardware Component Used:


Sr. No. Name of Components Value

1. Resistor(s) 220 Ω

2. Arduino UNO 1

3. LED(s) 1

Code:
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
}

// the loop function runs over and over again forever

17
void loop() {
digitalWrite(9, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(11, HIGH); // turn the LED off by making the voltage LOW
delay(1000);
digitalWrite(9, LOW);
digitalWrite(11, LOW);
delay(1000);}
Picture of Circuit:

Discussion:
In this experiment we have learnt how to make more than one LED blink at the same
time with different patterns of our choice with the help of a few resistors to protect the LEDs

18
from fusing. We have learnt how to use a variable to set the delay speed in the LED’s so as to
not set new values every case.

Signature of Faculty member

Experiment: 6

Objective: WAP to glow LEDs in series (1,2,3,4,5) and reverse (5,4,3,2,1)


Software Used: Arduino Uno

19
Theory:
1. 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.

2. LED: The LED is a light source which uses semiconductors and electroluminescence to
create light.

3. Arduino UNO R3: Arduino Uno is a microcontroller board based on the


ATmega328P
(datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs),
6 analogue inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB
connection, a power jack, an ICSP header and a reset button.

4. Jump wires: The breadboard jump wire/cable helps you to build any circuitry on
breadboard easily. These cables are flexible with both ends of a prototyping board
connector.

Hardware Component Used:


Sr. No. Name of Components Value

1. Resistor(s) 220 Ω

2. Arduino UNO 1

3. LED(s) 1

Code:
void setup() {

for (i = 9 ; i <= 13; i++) {

pinMode(i, OUTPUT);

20
}

void loop() {

for (i = 9; i <= 13 ; i++) {

digitalWrite(i, HIGH);

delay(500);

digitalWrite(i, LOW);

delay(500);

for (i = 13; i >= 9 ; i--)


{ digitalWrite(i,
HIGH);

delay(500);

digitalWrite(i, LOW);

delay(500);

Pictures Of Circuit:

21
Discussion
In this experiment we have learnt how to make more than one LED blink at the same time with different
patterns of our choice with the help of a few resistors to protect the LEDs from fusing. We have learnt
how to use a variable to set the delay speed in the LED’s so as to not set new values every case.

Signature of Faculty member

22
Experiment: 7
Objective:
(a)WAP to display numbers from 1 to 9 on a 7 segment display.

(b) WAP to display alphabets from A to F on a 7 segment display.

Software Used: Tinkercad Simulator

Theory:

1. LED: The LED is a light source which uses semiconductors and electroluminescence to
create light.

2. Arduino UNO R3: Arduino Uno is a microcontroller board based on the


ATmega328P
(datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs),
6 analogue inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB
connection, a power jack, an ICSP header and a reset button.

3. Jumper wires: The breadboard jump wire/cable helps you to build any circuitry on
breadboard easily. These cables are flexible with both ends of a prototyping board
connector.

Hardware Component Used:

Sr. No. Name of Components Value

1. Arduino UNO 1

2. 7 segment display 1

23
Code:
(A)

// the setup function runs once when you press reset or power the board

void setup() {

pinMode(3, OUTPUT);

pinMode(4, OUTPUT);

pinMode(5, OUTPUT);

pinMode(8, OUTPUT);

pinMode(9, OUTPUT);

pinMode(10, OUTPUT);

pinMode(11, OUTPUT);

void loop() { int n=(char)70;

int a=9,b=8,c=5,d=4,e=3,f=10,g=11;

switch(n)

case 0:

digitalWrite(a, HIGH);

digitalWrite(b, HIGH);

digitalWrite(c, HIGH);

digitalWrite(d, HIGH);

digitalWrite(e, HIGH);

digitalWrite(f, HIGH);

digitalWrite(g, LOW);

break;

24
case 1:

digitalWrite(a, LOW);

digitalWrite(b, HIGH);

digitalWrite(c, HIGH);

digitalWrite(d, LOW);

digitalWrite(e, LOW);

digitalWrite(f, LOW);

digitalWrite(g, LOW);

break; case 2:

digitalWrite(a, HIGH);

digitalWrite(b, HIGH);

digitalWrite(c, LOW);

digitalWrite(d, HIGH);

digitalWrite(e, HIGH);

digitalWrite(f, LOW);

digitalWrite(g, HIGH);

break;

case 3:

digitalWrite(a, HIGH);

digitalWrite(b, HIGH);

digitalWrite(c, HIGH);

digitalWrite(d, HIGH);

digitalWrite(e, LOW);

digitalWrite(f, LOW);

digitalWrite(g, HIGH);

25
break;

case 4:

digitalWrite(a, LOW);

digitalWrite(b, HIGH);

digitalWrite(c, HIGH);

digitalWrite(d, LOW);

digitalWrite(e, LOW);

digitalWrite(f, HIGH);

digitalWrite(g, HIGH);

break;

case 5:

digitalWrite(a, HIGH);

digitalWrite(b, LOW);

digitalWrite(c, HIGH);

digitalWrite(d, HIGH);

digitalWrite(e, LOW);

digitalWrite(f, HIGH);

digitalWrite(g, HIGH);

break;

case 6:

digitalWrite(a, HIGH);

digitalWrite(b, LOW);

digitalWrite(c, HIGH);

digitalWrite(d, HIGH);

digitalWrite(e, HIGH);

26
digitalWrite(f, HIGH);

digitalWrite(g, HIGH);

break;

case 7:

digitalWrite(a, HIGH);

digitalWrite(b, HIGH);

digitalWrite(c, HIGH);

digitalWrite(d, LOW);

digitalWrite(e, LOW);

digitalWrite(f, LOW);

digitalWrite(g, LOW);

break;

case 8:

digitalWrite(a, HIGH);

digitalWrite(b, HIGH);

digitalWrite(c, HIGH);

digitalWrite(d, HIGH);

digitalWrite(e, HIGH);

digitalWrite(f, HIGH);

digitalWrite(g, HIGH);

break;

case 9:

digitalWrite(a, HIGH);

digitalWrite(b, HIGH);

digitalWrite(c, HIGH);

27
digitalWrite(d, HIGH);

digitalWrite(e, LOW);

digitalWrite(f, HIGH);

digitalWrite(g, HIGH);

break;

Pictures of Circuit:

28
29
(B)

/ the setup function runs once when you press reset or power the board

void setup() {

// initialize digital pin LED_BUILTIN as an output.

pinMode(3, OUTPUT);

pinMode(4, OUTPUT);

pinMode(5, OUTPUT);

pinMode(8, OUTPUT);

pinMode(9, OUTPUT);

pinMode(10, OUTPUT);

pinMode(11, OUTPUT);

// the loop function runs over and over again forever void loop() {

int a=9,b=8,c=5,d=4,e=3,f=10,g=11;

for(int n=0;n<10;n++){

switch(n)

case 0:

digitalWrite(a, HIGH);

digitalWrite(b, HIGH);

digitalWrite(c, HIGH);

digitalWrite(d, HIGH);

digitalWrite(e, HIGH);

digitalWrite(f, HIGH);

30
digitalWrite(g, LOW);

delay(500);

digitalWrite(a, LOW);

digitalWrite(b, LOW);

digitalWrite(c, LOW);

digitalWrite(d, LOW);

digitalWrite(e, LOW);

digitalWrite(f, LOW);

digitalWrite(g, LOW);

break;

case 1:

digitalWrite(a, LOW);

digitalWrite(b, HIGH);

digitalWrite(c, HIGH);

digitalWrite(d, LOW);

digitalWrite(e, LOW);

digitalWrite(f, LOW);

digitalWrite(g, LOW);

delay(500);

digitalWrite(a, LOW);

digitalWrite(b, LOW);

digitalWrite(c, LOW);

digitalWrite(d, LOW);

digitalWrite(e, LOW);

digitalWrite(f, LOW);

31
digitalWrite(g, LOW);

break;

case 2:

digitalWrite(a, HIGH);

digitalWrite(b, HIGH);

digitalWrite(c, LOW);

digitalWrite(d, HIGH);

digitalWrite(e, HIGH);

digitalWrite(f, LOW);

digitalWrite(g, HIGH);

delay(500);

digitalWrite(a, LOW);

digitalWrite(b, LOW);

digitalWrite(c, LOW);

digitalWrite(d, LOW);

digitalWrite(e, LOW);

digitalWrite(f, LOW);

digitalWrite(g, LOW);

break;

case 3:

digitalWrite(a, HIGH);

digitalWrite(b, HIGH);

digitalWrite(c, HIGH);

digitalWrite(d, HIGH);

digitalWrite(e, LOW);

32
digitalWrite(f, LOW);

digitalWrite(g, HIGH);

delay(500);

digitalWrite(a, LOW);

digitalWrite(b, LOW);

digitalWrite(c, LOW);

digitalWrite(d, LOW);

digitalWrite(e, LOW);

digitalWrite(f, LOW);

digitalWrite(g, LOW);

break;

case 4:

digitalWrite(a, LOW);

digitalWrite(b, HIGH);

digitalWrite(c, HIGH);

digitalWrite(d, LOW);

digitalWrite(e, LOW);

digitalWrite(f, HIGH);

digitalWrite(g, HIGH);

delay(500);

digitalWrite(a, LOW);

digitalWrite(b, LOW);

digitalWrite(c, LOW);

digitalWrite(d, LOW);

digitalWrite(e, LOW);

33
digitalWrite(f, LOW);

digitalWrite(g, LOW);

break;

case 5:

digitalWrite(a, HIGH);

digitalWrite(b, LOW);

digitalWrite(c, HIGH);

digitalWrite(d, HIGH);

digitalWrite(e, LOW);

digitalWrite(f, HIGH);

digitalWrite(g, HIGH);

delay(500);

digitalWrite(a, LOW);

digitalWrite(b, LOW);

digitalWrite(c, LOW);

digitalWrite(d, LOW);

digitalWrite(e, LOW);

digitalWrite(f, LOW);

digitalWrite(g, LOW);

break;

case 6:

digitalWrite(a, HIGH);

digitalWrite(b, LOW);

digitalWrite(c, HIGH);

digitalWrite(d, HIGH);

34
digitalWrite(e, HIGH);

digitalWrite(f, HIGH);

digitalWrite(g, HIGH);

delay(500);

digitalWrite(a, LOW);

digitalWrite(b, LOW);

digitalWrite(c, LOW);

digitalWrite(d, LOW);

digitalWrite(e, LOW);

digitalWrite(f, LOW);

digitalWrite(g, LOW);

break;

case 7:

digitalWrite(a, HIGH);

digitalWrite(b, HIGH);

digitalWrite(c, HIGH);

digitalWrite(d, LOW);

digitalWrite(e, LOW);

digitalWrite(f, LOW);

digitalWrite(g, LOW);

delay(500);

digitalWrite(a, LOW);

digitalWrite(b, LOW);

break;

}}

35
}

Pictures of Circuit :

36
37
Discussion:
In this experiment we have learnt how to display digits in a 7 segment display

And counter them.

Signature of Faculty member

Experiment: 8
Objective:
(a)WAP to display in serial port.

(b) WAP to show use of analog write .

(c)WAP to generate random values.

38
Software Used: Tinkercad Simulator
Theory:

1. LED: The LED is a light source which uses semiconductors and electroluminescence to
create light.

2. Arduino UNO R3: Arduino Uno is a microcontroller board based on the


ATmega328P
(datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs),
6 analogue inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB
connection, a power jack, an ICSP header and a reset button.

3. Jumper wires: The breadboard jump wire/cable helps you to build any circuitry on
breadboard easily. These cables are flexible with both ends of a prototyping board
connector.
Hardware Component Used:

Sr. No. Name of Components Value

1. Arduino UNO 1

Code:

(A)

39
Pictures of Circuit :

40
41
(B)

Pictures of Circuit :

(C)

42
Pictures of Circuit :

Discussion:
43
In this experiment we have learnt how to display random values, take analog input and use of serial port.

Signature of Faculty member

44
Experiment: 9
Objective:
WAP in Arduino to control the brightness of an LED. The intensity of the LED should
be changed based on the values provided by the serial input.
Software Used: Tinkercad Simulator
Theory:

1. LED: The LED is a light source which uses semiconductors and electroluminescence to
create light.

2. Arduino UNO R3: Arduino Uno is a microcontroller board based on the


ATmega328P
(datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs),
6 analogue inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB
connection, a power jack, an ICSP header and a reset button.

3. Jump wires: The breadboard jump wire/cable helps you to build any circuitry on
breadboard easily. These cables are flexible with both ends of a prototyping board
connector.

4. Photodiode: It is a diode that is used to detect light.


Hardware Component Used:

Sr. No. Name of Components Value

1. Arduino UNO 1

2. 7 segment display 1

3. photodiode 1

4. LED 1

CODE:
45
Pictures of Circuit :

46
Discussion:
In tis experiment we made use of photodiode to show the intensity of light on serial port and glow LED
accordingly.

Signature of Faculty member

47

You might also like