You are on page 1of 15

[Type here] [Type here]

ELECTRICAL ENGINEERING DEPARTMENT


DEC50122: EMBEDDED ROBOTIC
PRACTICAL WORK : 1 / 2 / 3 / 4 / 5 / 6
TITLE :
PROGRAMME :
1.

LECTURER : 2.
3.
GROUP MEMBERS NAME REGISTRATION NUMBER
STUDENT 1 1.

STUDENT 2 2.

STUDENT 3 3.

STUDENT 4 4.

PRACTICAL SKILL EVALUATION (CLO3, PLO05)


SCORE
Excellent Good Average Weak Very Weak
Scale S1 S2 S3 S4
5 4 3 2 1
ASPECT
Recognize Shows a solid Shows Shows Shows some Shows little
the practical understanding to understanding to considerable understanding to understanding to
work do practical work do practical work understanding to do practical work do practical work X1
properly correctly properly do practical work
(P4)
The delay / speed The The code of The delay/ speed/ Unable to state
Able to
/ length / logic delay/speed/lengt
delay/ speed/ length/ logic code delay/ speed/
build
codes are very h/logic code is
length/ logic is is poorly stated length/ logic code
speed/lengt
well stated and simple to read,
readable; and very difficult X3
h (distance)
easily with some
however, it is a to read
/ logic
understandable. comments
little tricky to
coding (P3)
included.
understand.
The code is very The code is simple
The code is The code is poorly Unorganized code
Perform the
organized, easy to to read and is
readable; organized and
program
follow and in line supplemented by
however, it is a very difficult to X4
correctly
with the a few comments.
little tricky to read
(P4)
comments stated understand.
• Trends/ patterns • Trends / patterns • Trends/ patterns • Trends/ patterns • Trends/ patterns
Display the
are logically are logically are logically are not analysed are not analysed
practical
analysed analysed analysed Analysis is not No analysis X4
work task
Analysis is Analysis is too Analysis is relevant
(P4)
thoughtful general inconsistent
• Result: Excellent • Result: Clear and • Result: Clear and • Result: unclear, • Result:
and incredibly labelled, labelled, well missing labels, Disorganized,
beautifully excellent organized, well trends are not poorly recorded
recorded, highly recording recorded obvious, • Task: Not
structured flow. • Task: Completed • Task: disorganized, complete
Complete • Task: Complete with not more Completed with good recording Presentation: No
task as all tasks without than 2 errors some errors but shivering introduction and
X4
assigned error Presentation: • Presentation: • Task: Half explanation
(P4) • Presentation: very good completed
Introductions and
Excellent Introductions Presentation: has
introduction and and explanation. descriptions that an introduction
explanation. are commonly but the
used description is
inaccurate

80%

@Sesi 2:2022
B. LAB REPORT ASSESSMENT

SCORE
Excellent Good Average Weak Very Weak
SCALE SCORE
ASPECT 5 4 3 2 1

Able to write Able to write Able to write Write discussion Discussion was
discussion discussion with discussion with not related not written
clearly related clearly related to related to to practical work clearly and was X1
to practical work practical work practical work objective unrelated to
Discussion objective. Use objective objective the practical
good and work
appropriate objective.
language in
writing
Accurate Accurate A statement of A statement of No conclusion
statement of the statement of the the results of the the results of the included or
results of the lab results of the lab lab indicates lab indicates shows little X1
Conclusion indicates indicates whether results whether results effort and
whether results whether results support the support the reflection on
support the support the hypothesis hypothesis the lab
hypothesis hypothesis
Excellent. All- Almost of the Almost of the Some of the Incomplete/
important results have results have results are incorrect
trends have been correctly been correctly misinterpreted interpretation.
been interpreted and interpreted and and there is no Not answer
interpreted discussed. some correctly clear answer to the question
Question X2
correctly and Answer the answer the the question
discussed. question question
Answer the correctly
question
correctly.
20%

STUDENTS S1 S2 S3 S4

Total marks 100%

Prepared by: Revised by: Approved by:


Course Code & Course: DEC50122 – Embedded Robotic Lecturer:
Programme: DEE/DJK/DEP Date:
Assessment task: Labsheet 1 Total marks:

TITTLE : INTRODUCTION TO PROTEUS SIMULATION

CLO3, P4
OUTCOMES : Upon completion the task, students should be able to:
i) Construct circuit in Proteus simulation software
ii) Build Arduino sketch to controlling LED, buzzer/sounder and Ultrasonic
sensor

EQUIPMENTS / COMPONENTS:
Laptop/PC

THEORY :

1.0 Introduction To Proteus.

Proteus is used to simulate, design and drawing of electronic circuits. It was invented by the
Labcenter electronic. With the use of this engineering software, we can construct and simulate
different electrical and electronic circuits on personal computers or laptops.

Designing of circuits on the proteus takes less time than practical construction of the circuit.
The possibility of error is less in software simulation such as loose connection that takes a lot of time
to find out connections problems in a practical circuit. Furthermore, there is zero possibility of burning
and damaging of any electronic component in proteus.

There are 2 main parts of proteus first is used to design and draw different circuits and the
second is for designing of PCB layout. First is ISIS that used to design and simulate circuits. And second
is ARES that used for designing of a printed circuit board.

2.0 Introduction To Arduino.

Arduino is an open-source platform used for building electronics projects. Arduino consists of
both a physical programmable circuit board (often referred to as a microcontroller) and a piece
of software, or IDE (Integrated Development Environment) that runs on your computer, used to write
and upload computer code to the physical board.

Arduino board contains 14 digital input/output pins and 6 analog pins, USB and power jack.
5V pin supply 5V voltage from the on board regulator, while 3.3V pin supply 3.3 V voltage from on
board regulator. At the same time time maximum current is 50mA.

1
Figure 1 : Arduino board pinout

Digital pins of the board can be used as inputs or outputs, and use three functions:
pinMode(), digitalWrite(), digitalRead() and analogWrite () function, the last one works with the pins
that marked ~PWM symbol.

These pins operate with 5V voltage, maximum 40mA current and contains 20-50kOhm
internal resistors. Some pins however has specified functions:

GPIO 0 : Receive serial data.


GPIO 1 : Transmit serial data.
GPIO 2 and GPIO 3 : External interrupts.
GPIO 3, GPIO 5, GPIO 6, GPIO 9, GPIO 10, GPIO 11 : Provide 8-bit PWM output
with analogWrite() function.
GPIO 10, GPIO 11, GPIO 12, GPIO 13 : Provide SPI communication.
GPIO 13 : Connected to LED, indicating HIGH or LOW value.
GPIO 19, GPIO 18, GPIO 17, GPIO 16, GPIO 15, GPIO 14 : Analog inputs.
GPIO 19 and GPIO 18 : Provide TWI functionality .
AREF : Reference voltage for analog inputs.
Reset pin : Resets the microcontroller.

2
3.0 PROCEDURE :

3.1 LED AND BUZZER/SOUNDER SIMULATION BY USING PROTEUS

PART A : PROTEUS SETTING FOR ARDUINO UNO

1. Open “Arduino Library” folder.


2. Copy 2(two) files listed below :
a). Arduino.IDX
b). Arduino.LIB
3. Select : This PC > Local disk (C) > Program Files (x86) > Labcenter Electronics >
Proteus 8 Professional > Library
4. If there is no Library folder found, alternatively follow these step :
a). Select : This PC > Local disk (C) > View > Click “Hidden item” > Option
b). When folder option appear : Click “View” > Select “Show hidden files, folder and drives” >
apply > Ok
c). Select : This PC > Local disk (C) > Program data > Labcenter Electronics >
Proteus 8 Professional > Library
5. Paste Arduino.IDX and Arduino.LIB files into the Library folder.
6. Open the Proteus software. Select “New Project”. Save as <Labwork1a_X>. ‘X‘ indicate your
name.
7. Select the following part from library
a). Arduino Uno R3
b). SOUNDER
c). RED, YELLOW and GREEN LED
8. Drag all component into schematic layout, and use your own creativity for component
arrangement and pin connection. Use below schematic diagram in Figure 2 for guideline.

Figure 2 : Schematic diagram of LED and Buzzer with Arduino


3
9. Step to select components from proteus :
a). Click “Component Mode” icon. Then, click “P”(pick from library).

Figure 3 : Step to select component from Proteus

b). “Pick device” window will appear. Type the component that you want to use in “Keywords”
box. The related component will appear in the Result box as shown below.

Figure 4 : Schematic diagram of LED and Buzzer with Arduino

c). Choose and click OK.


d). The selected component should appear in the device list.

Figure 5 : Proteus device list

e). Click the component, then click again in the Proteus design sheet. The component will
appear and ready to use.
4
10. Step to change component value or label :
a). Right click the component. Select “Edit Properties”.

Figure 6 : Edit properties window

b). Type the label in part reference box and the value in resistance box (if the component
is resistor).

Figure 7 : Edit component window

11. Step to connect the components :


a). Point the cursor to the component terminal until you can see the red point. Click.
b). Drag the cursor to the other component until the red point appear. Click once again. Both
component was successfully connected.

Figure 8 : Connect the components

12. Minimize Proteus window.

5
PART B : ARDUINO SKETCH FOR LED SIMULATION

1. Open the Arduino software. Click on the ‘File’ menu and select ‘Preferences’. Click on
the checkbox like below (Figure 9).

Figure 9 : Preference window

2. Click ‘OK’ to close the pop-out window.


3. Create new file, naming it as <Labwork1a_X>. ‘X’ indicate your name.
4. Copy Arduino Sketch as shown below. Then, insert your name and registration number.

//Name :

//Reg.Num :

int RED_LED= 7;

int YEL_LED= 8;

int GRE_LED=9;

int BUZZER = 10;

void setup() {

// put your setup code here, to run once:

pinMode(RED_LED,OUTPUT);

pinMode(YEL_LED,OUTPUT);

pinMode(GRE_LED,OUTPUT);

void loop() {

// put your main code here, to run repeatedly:

digitalWrite (RED_LED,HIGH); //LED's ON for 1 sec

digitalWrite (YEL_LED,HIGH);

digitalWrite (GRE_LED,HIGH);

delay(1000);

6
digitalWrite (RED_LED,LOW); //LED's OFF for 1 sec

digitalWrite (YEL_LED,LOW);

digitalWrite (GRE_LED,LOW);

delay(1000);

digitalWrite (RED_LED,HIGH); //LED's ON for 1 sec

digitalWrite (YEL_LED,HIGH);

digitalWrite (GRE_LED,HIGH);

delay(1000);

digitalWrite (RED_LED,LOW); //LED's OFF for 1 sec

digitalWrite (YEL_LED,LOW);

digitalWrite (GRE_LED,LOW);

delay(1000);

digitalWrite (BUZZER,HIGH);//BUZZER ON for 1 sec

delay(1000);

digitalWrite (BUZZER,LOW);//BUZZER OFF for 1 sec

delay(1000);

digitalWrite (BUZZER,HIGH);//BUZZER ON for 1 sec

delay(1000);

digitalWrite (BUZZER,LOW);//BUZZER OFF for 1 sec

delay(1000);

digitalWrite (RED_LED,HIGH); //RED LED ON for 2 sec

digitalWrite (YEL_LED,LOW);

digitalWrite (GRE_LED,LOW);

delay(2000);

digitalWrite (RED_LED,LOW); //YELLOW LED ON for 2 sec

digitalWrite (YEL_LED,HIGH);

digitalWrite (GRE_LED,LOW);

delay(2000);

digitalWrite (RED_LED,LOW); //GREEN LED ON for 2 sec

digitalWrite (YEL_LED,LOW);

digitalWrite (GRE_LED,HIGH);

delay(2000);

5. Save your sketch.


7
6. Select Tools > Board > Arduino/Genuino UNO as shown in figure 7.

Figure 10 : Arduino window

7. Select “Verify” at the top of Arduino window. Wait until “Done Compiling” appear at the bottom
of the window.

Figure 11 : Verify in Arduino

8. After the window shows “Done Compiling”, find the hex file as shown below. Highlight and copy
the file.

Figure 12 : Hex file after compiling

9. Minimize the Arduino window.

8
PART C : ULTRASONIC SENSOR SIMULATION PROCESS

1. Go back to the Proteus window.

2. Double click on Arduino diagram in Proteus. Edit component window will appear.

3. Paste the hex file in Program file box. Then, Click OK.

Figure 13 : Edit component window for Arduino

4. Run the Simulation Button.

5. The LED and buzzer will function as the sketch.

9
3.2 ULTRASONIC SENSOR SIMULATION BY USING PROTEUS

PART A : PROTEUS SETTING FOR ULTRASONIC SENSOR

1. Open “Ultrasonic Sensor Library” folder.

2. Copy 2(two) files listed below :


a). UltrasonicTEP.IDX
b). UltrasonicTEP.LIB

3. Select : This PC > Local disk (C) > Program Files (x86) > Labcenter Electronics >
Proteus 8 Professional > Library

4. If there is no Library folder found, alternatively follow these step :


a). Select : This PC > Local disk (C) > View > Click “Hidden item” > Option
b). When folder option appear : Click “View” > Select “Show hidden files, folder and drives” >
apply > Ok
c). Select : This PC > Local disk (C) > Program data > Labcenter Electronics >
Proteus 8 Professional > Library

5. Paste UltrasonicTEP.IDX and UltrasonicTEP.LIB files into the Library folder.

6. Open the Proteus software. Select “New Project”. Save as <Labwork1b_X>. ‘X‘ indicate your
name.
7. Select the following part from library
a). Arduino Uno R3
b). Ultrasonic Sensor
c). Virtual Terminal

8. Drag all component into schematic layout, and use your own creativity for component
arrangement and pin connection. Use below schematic diagram in Figure 11 for guideline.

Figure 14 : Schematic diagram of Ultrasonic Sensor


10
9. Save your project.
10. Double click Ultrasonic Sensor diagram. A windows as in Figure 12 will appear. Click the folder
icon.

Figure 15 : Edit component window for Ultrasonic

11. Find your “Ultrasonic Sensor Library” Location. Select UltrasonicTEP.HEX folder. Then, click ok.

PART B : ARDUINO SETTING FOR ULTRASONIC SENSOR

1. Open Arduino software. Create new file, naming it as <Labwork1b_X>. ‘X’ indicate your name.
2. Copy Arduino Sketch as shown below. Then, insert your name and registration number.

//Name :
//Reg.Num :
const int echoPin = 2; // Echo Pin of Ultrasonic Sensor
const int pingPin = 3; // Trigger Pin of Ultrasonic Sensor
void setup()
{
Serial.begin(9600); // Starting Serial Communication
pinMode(pingPin, OUTPUT); // initialising pin 3 as output
pinMode(echoPin, INPUT); // initialising pin 2 as input
}
void loop()
{
long duration, inches, cm;
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(10);
digitalWrite(pingPin, LOW);
duration = pulseIn(echoPin, HIGH); // using pulsin function to determine total time
inches = microsecondsToInches(duration); // calling method
cm = microsecondsToCentimeters(duration); // calling method
Serial.print(inches);
Serial.print("in, ");
Serial.print(cm);
Serial.print("cm");
Serial.println();
delay(100);
}
long microsecondsToInches(long microseconds) // method to covert microsec to inches
{
return microseconds / 74 / 2;
}
long microsecondsToCentimeters(long microseconds) // method to covert microsec to centimeters
{ 11
return microseconds / 29 / 2;
}
3. Save your sketch.

4. Select Tools > Board > Arduino/Genuino UNO.

5. Select “Verify” at the top of Arduino window. Wait until “Done Compiling” appear at the bottom
of the window.

6. After the window shows “Done Compiling”, find the hex file. Highlight and copy the file.

PART C : ULTRASONIC SENSOR SIMULATION PROCESS

1. Go back to the Proteus window.


2. Double click on Arduino diagram in Proteus. Edit component window will appear.
3. Paste the hex file in Program file box. Then, Click OK.

Figure 16 : Edit component window for Arduino

4. Run the Simulation Button. The Ultrasonic reading will appear on the Virtual Terminal window.

Figure 17 : Virtual Terminal Display

5. The distance shown in the Virtual Terminal window will vary, based on how we set the
adjustable potentiometer in the circuit.
12
4.0 QUESTION :

1. a). Connect Green LED to GPIO 4, Red LED to GPIO 5 and sounder to GPIO 3 in Proteus. Build an
Arduino sketch to light up the Green LED for 2 seconds. Then, the Red LED will light up in 3
seconds. After that let the sounder ON in 2 seconds.
b). Write while(1); command at the end of the sketch in question 1(i) in Arduino. Observe and
explain what will happen to the circuit operation in Proteus.

2. Base on the virtual terminal display, explain what will happen if the potentiometer in Figure 14
was change to :
a). 25%
b). 50%
c). 75%
(3 marks)

5.0 DISCUSSION :

6.0 CONCLUSION :

13

You might also like