Eee250 Module 1-7

Download as pdf or txt
Download as pdf or txt
You are on page 1of 101

ELECTRICAL ENGINEERING STUDIES

COLLEGE OF ENGINEERING
UNIVERSITI TEKNOLOGI MARA

ELECTRICAL ENGINEERING LABORATORY


(EEE250)

MODULE 1

INTRODUCTION TO EMBEDDED SYSTEM

COURSE OUTCOME (CO) - PROGRAMME OUTCOME (PO)

CO1 Display good practical skills in conduction the experiments using modern
engineering tools during laboratory sessions.

C03 Work effectively as an individual and a team member while conducting the
experiments in a group.

PO5 Apply appropriate techniques, resources and modern engineering and IT tools to
well-defined engineering problems, with awareness of the limitations.

PO9 Function effectively as an individual, and as a member in diverse technical teams.

OUTCOMES

1. To construct an embedded system circuit with input and output devices.


2. To build and compile an appropriate Arduino code for the given task.
3. To build LED blinking and Push Button circuit.

EQUIPMENT

1. Personal Computer/Laptop
2. Tinkercad web-application

THEORY

Embedded System
An embedded system is a combination of computer hardware and software which is specially
designed for a dedicated function. It can be designed with several additional parts, either
mechanical or electronic. It involves microcontroller and software that can be write the codes
in assembly language or high-level language. Some examples of actual systems for
embedded systems may involve digital camera, digital phones, ticket machines, vending
machines, and temperature control units in air conditioners. There are many microcontroller
series and name which it depends to the manufacturer produced the microcontroller. Recently
years, there are several types of development boards that used to develop an embedded
system such as Raspberry Pi, Arduino and BeagleBone Black.

Microcontroller
In general, a microcontroller is a small computer in an integrated circuit that performs certain
functions in the electronic circuit. When all the necessary components in a small computer are
formed to be an embedded system, it will be able to perform specific tasks that users can
program. The microcontroller is produced by companies such as Atmel, Microchip
Technology, Freescale Semiconductor etc. All microcontrollers developed have their
specifications according to the user requirements. Basically, a Microcontroller consists of the
components as listed in Table 1.1.

Table Error! No text of specified style in document..1: List of Microcontroller components

Component Functions
Central Processing Unit The CPU is the brain to the microcontroller. The task is to
(CPU): take the instructions from the ROM, encode and run the
instructions. All components in the microcontroller are
connected to the CPU in a single system and
communicate through the system bus.

Memory: Memory is used to save the data, program or instructions.


There are two type of memory which are Random Access
Memory (RAM) and Read Only Memory (ROM).

Timers and Counters: They provide the operations of Time Delays and counting
external events. Additionally, Timers and Counters can
provide Function Generation, Pulse Width Modulation,
Clock Control, etc.

I/O Ports (I/O – The interface for the Microcontroller to the external world
Input/Output): is provided by the I/O Ports or Input/Output Ports. Inputs
device like Switches, Keypads, etc. provide information
from the user to the CPU in the form of Binary Data. The
CPU, upon receiving the data from the input devices,
executes appropriate instructions and gives response
through Output Devices like LEDs, Displays, Printers, etc.

Serial Communication One of the important requirements of a Microcontroller is


Interface to communicate with other device and peripherals
(external). Serial Port proves such interface through serial
communication. Most common serial communication
implemented in Microcontrollers is UART.

Analog to Digital Converter Analog to Digital Converter or ADC is a circuit that


(ADC) converts Analog signals to Digital Signals. The ADC
Circuit forms the interface between the external Analog
Input devices and the CPU of the Microcontroller. Almost
all sensors are analog devices and the analog data from
these sensors must be converted into digital data for the
CPU to understand.

Digital to Analog Converter Digital to Analog Converter or DAC is a circuit, that works
(DAC): in contrast to an ADC. It converts Digital Signals to
Analog Signals. DAC forms the bridge between the CPU
of the Microcontroller and the external analog devices.

Interrupt Mechanism: A very important feature of a Microcontroller is Interrupts


and its Interrupt Handling Mechanism. Interrupts can be
external, internal, hardware related or software related.

System Bus: Another important component of a Microcontroller, but


rarely discussed is the System Bus. A System bus is a
group of connecting wire that connect the CPU with other
peripherals like Memory, I/O Ports and other supporting
components.

Arduino
Arduino is a microcontroller board developed by Arduino.cc and based on AVR 8 bits family
by Atmel. Arduino is a microcontroller-based prototyping board that can be used in developing
digital devices that can read inputs and turning them into output. The Arduino board can be
programmed to do anything by simply programming the microcontroller onboard using a set
of instructions for which, the Arduino board consists of a USB plug to communicate with your
computer and a bunch of connection sockets that can be wired to external devices like motors,
LEDs etc. There are many types of Arduino boards available in the market, but all the boards
have one thing in common: they can be programmed using the Arduino IDE. The reasons for
different types of boards are different power supply requirements, connectivity options, their
applications etc. Arduino boards are available in different sizes, form factors, different no. of
I/O pins etc. Some of the commonly known and frequently used Arduino boards are Arduino
UNO, Arduino Mega, Arduino Nano, Arduino Micro and Arduino Lilypad. Figure 1.1 shows an
example of the Arduino board and its components.

Figure Error! No text of specified style in document..1: An example of Arduino Boards and its
Components.

Arduino IDE
The Arduino Integrated Development Environment (IDE) is free open-source software
available from the Arduino website. The Arduino IDE installer is available for download at
https://www.arduino.cc/en/software. The software is available for Windows, Mac OS, and
Linux. It is used to write and upload programmes to Arduino-compatible boards, as well as
other vendor development boards with the help of third-party cores. It contains a text editor for
writing code, a message area, a text console, a toolbar with buttons, a series of menus. It
connects to the Arduino to upload and communicate with them. The latest version of Arduino
IDE always updated on the website. Figure 1.2 shows the Interface of the Arduino IDE. The
Arduino IDE interface has features to be used during the development of code program.
Figure Error! No text of specified style in document..2: Arduino IDE Interface.
Digital Input and Output
The digits 0 and 1 represent physical quantities such as voltage values or magnetic polarities
in digital data or signals. The 0 signal corresponds to the concept of OFF, whereas the 1 signal
corresponds to the concept of ON. The voltage value at signal 0 in computers, particularly
microcontrollers, is 0V, while the voltage value at signal 1 is 3.3V or 5V, depending on the
type of microcontroller. Arduino has a certain number of digital output pins according to the
type of Arduino used. Digital output pins are pins that can be connected to other hardware
peripherals such as LEDs, relay, etc. Each pin on the Arduino board has been labelled as a
reference for the user to organise the pin. Figure 1.3 shows the digital pin on the Arduino
board. The number of digital input and output pins corresponds to the type of Arduino board
used.
Digital pins
(pin 2 – 13)

Figure Error! No text of specified style in document..3: Digital pins on Arduino board.

There are several digital input and output components can be used on the Arduino board. It
includes output components such as Light Emitting Diode (LED), Relay, and Buzzer. The input
component that are commonly use is switch. There is various type of switch such as push
button, toggle switch, limit switch and pressure switch. The information regarding how
components are to be used is available to the manufacturer in a datasheet.
PROCEDURES

PART A: Arduino Uno connection and IDE

1. Visit https://www.tinkercad.com/ and sign in with Google account. In the main homepage,
click “Circuits”, followed by “Create new Circuit” as shown in Figure 1.4.

Figure Error! No text of specified style in document..4: Tinkercad dashboard

2. Assemble the circuit as shown in Figure 1.5.

220 Ohm

Figure Error! No text of specified style in document..5: Schematic diagram of the assembled circuit

3. Click code editor on the right side and select mode Text (Figure 1.6).
Figure Error! No text of specified style in document..6

4. Edit code as given in the listing below.


(Set the input/output pin depends on your circuit connection)

//** Definitions **//


const int GREEN = 11;//It defines the value of the pin for the GREEN LED
//** Program **//
void setup() //declarations
{
pinMode(GREEN, OUTPUT);//It declares the GREEN pin as output
}
void loop() //repeat loop continuously
{
{
digitalWrite(GREEN, HIGH);//It turns on the GREEN LED
delay(1000);//wait 1 seconds
digitalWrite(GREEN, LOW);//It turns off the GREEN LED
delay(1000); //wait 1 seconds
}
}

5. Click on the Start Simulation button to test your project.


6. Understand the example code and observe the output. Include the result in the Table 1.1.
PART B: LED blinking

1. Create new circuit project and assemble the circuit by adding 1 more LED. Refer Figure
1.7 as example connection with two LEDs.

220 Ohm

Figure Error! No text of specified style in document..7: Connection with two LEDs

2. Modify code to make the LED blinking alternately between the two LEDs as given in the
listing below (pin no is difference depends on connection).

//** Definitions **//


const int GREEN = 11; //It defines the value of the pin for the GREEN LED
const int YELLOW = 12; //It defines the value of the pin for the YELLOW LED

//** Programa **//


void setup()//declarations
{
pinMode(GREEN, OUTPUT); //It declares the GREEN pin as output
pinMode(YELLOW, OUTPUT); //It declares the YELLOW pin as output
}

void loop()//repeat loop continuously


{
{
digitalWrite(GREEN, HIGH); //It turns on the GREEN LED
digitalWrite(GREEN, LOW); //It turns off the GREEN LED
delay(250);//wait 0.25 seconds

digitalWrite(YELLOW, HIGH); //It turns on the YELLOW LED


digitalWrite(YELLOW, LOW); //It turns off the YELLOW LED
delay(250);//wait 0.25 seconds
}
}

3. Click on the Start Simulation button and observe the output. Include the result in the Table
1.2
4. Modify the code to make the LED blink as a traffic light controller (3 LEDs: GREEN,
YELLOW & RED) with different amount of time. Click on Start Simulation and observe the
output. Include the result in the Table 1.3.
PART C: LED with Push Button
1. Assemble the connection as shown in Figure 1.8.

1k Ohm

Figure Error! No text of specified style in document..8

2. Edit code as given in listing below (pin no is difference depends on connection).


Understand the code and click Start Simulation button then observe the output. Include
the result in the Lab Sheet.

//** Definitions **//

const int BUTTON1 = 2;


const int BUTTON2 = 4;
const int LED1 = 10;
const int LED2 = 12;
int BUTTONstate1 = 0;
int BUTTONstate2 = 0;

//** Programa **//

void setup() //declarations


{
pinMode(BUTTON1, INPUT);
pinMode(BUTTON2, INPUT);
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
}

void loop() //repeat loop continuously


{
BUTTONstate1 = digitalRead(BUTTON1);
if (BUTTONstate1 == HIGH)
{
digitalWrite(LED1, HIGH);
}
else
{
digitalWrite(LED1, LOW);
}

BUTTONstate2 = digitalRead(BUTTON2);
if (BUTTONstate2 == HIGH)
{
digitalWrite(LED2, LOW);
}
else
{
digitalWrite(LED2, HIGH);
}
}
OUTPUT VALIDATION

Answer the questions based on the observation output:

1. From your observations of the results in Table 1.1, what happens when you change the
delay value in Tinkercad code from 1000ms to 100ms for Part A?

2. Based on the LED Push Button circuit in Part C, observe the LED light and measure the
voltage value at the output when the button is pressed and released. (hint: use a
multimeter)
ELECTRICAL ENGINEERING STUDIES
COLLEGE OF ENGINEERING
UNIVERSITI TEKNOLOGI MARA

ELECTRICAL ENGINEERING LABORATORY


(EEE250)

MODULE 2

FUNDAMENTALS TO HARDWARE DESCRIPTION LANGUAGE (HDL)

COURSE OUTCOME (CO) - PROGRAMME OUTCOME (PO)

CO1 Display good practical skills in conducting the experiments using modern
engineering tools during laboratory sessions.
CO3 Work effectively as an individual and a team member while conducting the
experiments in a group.
PO5 Apply appropriate techniques, resources, and modern engineering and IT tools to
well-defined engineering problems, with an awareness of the limitations
PO9 Function effectively as an individual, and as a member in diverse technical teams.

OUTCOMES

1. To construct a fundamental understanding of Verilog HDL Software for digital circuit


application.
2. To assemble the foundational principles of ModelSim Altera software for simulating
digital input/output (I/O) circuits.
3. To dismantle the concepts behind basic digital logic gates of OR and combinational
gates.

EQUIPMENTS

1. Personal computer/laptop/notebook
2. Altera 15.0.0.145 Web Edition Software
PRE-LAB

Before entering this lab session for Experiment 2, students are required to answer and fill in
all the required information in Tables 2.1, 2.2, 2.3, and 2.4. Some of the information has been
filled in for your own reference.

Table 2.1
Symbol for 2 inputs and 1 output
Name of Gate (name A and B as inputs and Y as Verilog HDL Operator
output)
Negation/NOT ~
Reduction AND/AND &

Reduction OR/OR
|

Reduction NAND/NAND
Reduction NOR/NOR
Reduction XOR/XOR
Reduction XNOR/XNOR

Table 2.2
Truth Table 2 inputs OR Gate
Inputs Output
A B Y
0 0
0 1
1 0
1 1

Table 2.3
Truth Table 2 inputs AND Gate
Inputs Output
A B Y
0 0
0 1
1 0
1 1

Table 2.4
Truth Table 2 inputs XOR Gate
Inputs Output
A B Y
0 0
0 1
1 0
1 1
THEORY

Verilog HDL Software


HDL is a language that describes the hardware of digital system in a textual form. It describes
the hardware structural and behavioural. IEEE supports two types of HDL, i.e. Very High
Speed Integrated Circuits Hardware Description Language (VHDL) and Verilog HDL. Verilog
is created for modelling and simulating logic gates and therefore better in terms of low-level
hardware modelling as compared to VHDL. In this laboratory exercises, Quartus II Computer
Aided System (CAD) version 15.0 will be used. CAD software is designed to implement a
desired logic circuit using a programmable logic device, such as a Field Programmable Gate
Array (FPGA) chip.

ModelSim Software
ModelSim is an Electronic Design Automation (EDA) software tools by Mentor Graphics, for
simulation of Verilog HDL and in conjunction with Intel Quartus. To verify that a design
operates correctly we use simulation, which is a process of testing the design by applying
inputs to a circuit and observing its behaviour. A HDL code known as test bench need to be
performed before the simulation can be done. The output of a simulation is a set of waveforms
that show how a circuit behaves based on a given sequence of inputs.

PROCEDURES

PART A (i): Behavioural Verilog HDL OR Gate

Install Altera 15.0.0.145 Web Edition package via this link.


Click on Quartus II 15.0 (64-bit) and then follow the descriptions below for Behavioural Verilog
HDL.

1. Click New Project Wizard icon.


2. Introduction window pop up. Click Next. Fill in the information as shown in Figure 2.1.
Click Next. Click Yes for the pop up question.

Figure 2.1

3. Click Next > Next until Family & Device Settings window pop up, ensure all the settings
is as shown in Figure 2.2. Click Next.
Figure 2.2

4. When EDA Tool Settings window pop up, ensure all the settings is as shown in Figure
2.3. Click Next.

Figure 2.3

5. Finally, the Summary window pop up as shown in Figure 2.4. Click Finish.
Figure 2.4

6. Click File > New. Choose Verilog HDL File. Click OK.
7. In the Text Editor window as shown in Figure 2.5, type the following:

module lab1 (output Y, input A, B);


assign Y = A | B;
endmodule

Figure 2.5

Click File > Save As. Make sure the directory is C:\altera\15.0\EEE250 and Save as
type: Verilog HDL Files (*.v *.vlg *.verilog) then at the column File Name: type lab1.
Click Save.
8. Click on the purple triangle icon (or click Processing > Start Compilation) as shown in
Figure 2.6.
Figure 2.6

9. During the compilation, the Flow Summary window pop up. Figure 2.7 shows the final
summary after completing compilation.

Figure 2.7

PART A (ii): ModelSim Simulation Software OR Gate

Click on ModelSim-Altera 10.3d (Quartus II 15.0) and then follow the descriptions below for
Verilog HDL OR Gate simulation.

10. Click Jumpstart icon.


11. Click Create a Project. In a Create Project window, for Project Name column, type
lab1_simu. Click OK.
12. When Add items to the Project window pop up, click Add Existing File. In Add file to
Project window, for File Name column, click Browse and click on the file lab1.v in which
the directory is C:\altera\15.0\EEE250. This will add lab1.v in the column File name:.
Click Open. Click OK.
13. Click Create New File on the Add items to the Project window. When the Create Project
File window pop up, make sure all the settings are as shown in Figure 2.8. Click OK.
Click Close.

Figure 2.8
14. Double click lab1HDL.v to get the edit window and type the following:

module t;
reg ain;
reg bin;
wire cout;

initial
begin
ain = 0;
bin = 0;
end

always
begin
# 20 ain = 1;
# 20 ain = ~ain;
end

always
begin
# 40 bin = 1;
# 20 bin = ~bin;
end

lab1 uut(
.A( ain ),
.B( bin ),
.Y( cout )
);
endmodule

then right click either on lab1HDL.v or lab1.v and choose Compile > Compile All until
a green check mark appears and successful messages appear in the Transcript window
as shown in Figure 2.9. Then File > Quit. Click Yes on any pop up question editors.
Figure 2.9

15. Reopen ModelSim-Altera 10.3d (Quartus II 15.0). Click Close on the pop up window.
Click Simulate > Start Simulation. On the Start Simulation window, choose the setting
as shown in Figure 2.10. Click OK.

Figure 2.10

16. Click View > Wave. This will cause a check mark appears next to Wave. Click Add > To
Wave > Signals in Design (or All items in design). Change the timing in the window
to “3 us” and click the button Run as shown in Figure 2.11.
Figure 2.11

17. Click View > Wave. Click on the Wave – Default window and click Zoom In/Zoom Out
button as shown in Figure 2.12 on the Wave window to control the size of the wave.
Observe all the inputs/outputs waveform ain, bin, cout, A, B and Y and confirms all the
data as shown in Table 2.5. Print screen the Wave window and include in the Lab Sheet.

Figure 2.12

Table 2.5
Symbol for OR gate
Waveforms Value
2-input
Inputs Output
ain/A bin/B cout/Y
0 0 0
0 1 1
1 0 1
1 1 1

PART B: Structural Verilog HDL OR Gate

1. Make sure Quartus II 15.0 (64-bit) and ModelSim-Altera 10.3d (Quartus II 15.0) are
closed.
2. Click on Quartus II 15.0 (64-bit) and repeat step 1 until 6 as in PART A (i): Behavioural
Verilog HDL OR Gate. In step 2, name the project as lab2 and the directory as
C:\altera\15.0\EEE250\lab2. The Summary window should pop up as shown in Figure
2.13.
Figure 2.13

3. In step 7, type the following:

module lab2 (output Y, input A, B);


or (Y, A, B);
endmodule

Click File > Save As. Make sure the directory is C:\altera\15.0\EEE250\lab2 then at the
column File Name: type lab2. The rest is exactly the same as before.
4. Repeat all steps in PART A (ii) ModelSim Simulation Software OR Gate.
i) In step 11, for Project Name column, type lab2_simu. Click OK.
ii) In step 12, in Add file to Project window, for File Name column, click Browse and
click on the file lab2.v in which the directory is C:\altera\15.0\EEE250\lab2. Click
Open. Click OK.
iii) In step 13, for column File Name, type lab2HDL and make sure all the settings is the
same as Figure 8.
iv) In step14, rename the first line of the coding as module s and line 20 as lab2 uut(.
v) In step 15, on the Start Simulation window, choose the setting as shown in Figure
2.14. Click OK.
Figure 2.14

The rest is exactly the same.


5. Demo your output ModelSim Wave window as in step 17 ModelSim Simulation Software
OR Gate to the instructor. Observe all the inputs/outputs waveform ain, bin, cout, A, B
and Y to fill-in Table 2.6. Print screen the Wave window and include in the Lab Sheet.

Table 2.6
Waveforms Value
Inputs Output
ain/A bin/B cout/Y
0 0
0 1
1 0
1 1

PART C: Behavioural Verilog HDL Combinational Gates

1. Make sure Quartus II 15.0 (64-bit) and ModelSim-Altera 10.3d (Quartus II 15.0) are
closed.
2. Click on Quartus II 15.0 (64-bit) and repeat step 1 until 6 in PART A (i): Behavioural
Verilog HDL OR Gate. In step 2, name the project as lab3 and the directory as
C:\altera\15.0\EEE250\lab3.
3. In step 7, you are required to design Behavioural Verilog HDL for the circuit as shown in
Figure 2.15.
Figure 2.15

When you have done with the design, click File > Save As. Make sure the directory is
C:\altera\15.0\EEE250\lab3 then at the column File Name: type lab3. The rest is exactly
the same as before until step 9.
4. Repeat all steps in PART A (ii) ModelSim Simulation Software OR Gate.
i) In step 11, for column File Name, type lab3HDL.
ii) In step 12, rename the first line of the coding as module u and wherever possible as
lab3 uut(.
iii) Then, with reference to Figure 2.15, design the Verilog test bench coding to produce
the required waveform simulation. The rest is exactly the same.
5. Demo your output ModelSim Wave window as in step 17 ModelSim Simulation Software
OR Gate to the instructor. Observe all the inputs/outputs waveform ain, bin, cin, din,
cout, A, B, C, D and X to fill-in Table 2.7. Print screen the Wave window and include in
the Lab Sheet.

Table 2.7
Waveforms Value
Inputs Output
ain/A bin/B cin/C din/D cout/X
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1

PART D: Structural Verilog HDL Combinational Gates

1. Make sure Quartus II 15.0 (64-bit) and ModelSim-Altera 10.3d (Quartus II 15.0) are
closed.
2. Click on Quartus II 15.0 (64-bit) and repeat step 1 until 6 as in PART A (i): Behavioural
Verilog HDL OR Gate. In step 2, name the project as lab4 and the directory as
C:\altera\15.0\EEE250\lab4.
3. In step 7, you are required to design Structural Verilog HDL for the circuit as shown in
Figure 2.15. Then, click File > Save As. Make sure the directory is
C:\altera\15.0\EEE250\lab4 then at the column File Name: type lab4. The rest is exactly
the same as before.
4. Repeat all steps in PART A (ii) ModelSim Simulation Software OR Gate.
i) In step 11, for Project Name column, type lab4_simu. Click OK.
ii) In step 12, in Add file to Project window, for File Name column, click Browse and
click on the file lab4.v in which the directory is C:\altera\15.0\EEE250\lab4. Click
Open. Click OK.
iii) In step 13, for column File Name, type lab4HDL.
iv) In step 14, rename the first line of the coding as module v and wherever possible as
lab4 uut(.
5. Demo your output ModelSim Wave window as in step 17 ModelSim Simulation Software
OR Gate to the instructor. Observe all the inputs/outputs waveform ain, bin, cin, din, A,
B, C, D and X to fill-in Table 2.8. Print screen the Wave window and include in the Lab
Sheet.

Table 2.8
Waveforms Value
Inputs Output
ain/A bin/B cin/C din/D cout/X
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1

OUTPUT VALIDATION

1. What steps are crucial in the implementation of a logic gate design?

2. Demonstrate the key practical differences between executing behavioural HDL procedures
and structural HDL procedures when working with logic gate designs.
ELECTRICAL ENGINEERING STUDIES
COLLEGE OF ENGINEERING
UNIVERSITI TEKNOLOGI MARA

ELECTRICAL ENGINEERING LABORATORY


(EEE250)

MODULE 3

INTRODUCTION TO NUMERICAL COMPUTING USING PYTHON

COURSE OUTCOME (CO) - PROGRAMME OUTCOME (PO)

CO1 Display good practical skills in conduction the experiments using modern
engineering tools during laboratory sessions.
PO5 Apply appropriate techniques, resources and modern engineering and IT tools to
well-defined engineering problems, with awareness of the limitations.

OUTCOMES

1. To find optimal parameters to a function (objective functions) that maps example of inputs
and outputs using python.
2. To use curve fitting in SciPy to fir a range of different curve to a set of observations.

EQUIPMENT

1. Personal Computer

THEORY
Python is an object-oriented language that was developed in the late 1980s. In its current state,
it is an excellent language for developing engineering applications. Python has offer
advantages over mainstream languages that are important in a learning environment:
1. Python is an open-source software, which means that is free, it is included in most Linux
distributions.
2. Python is available for all major operating systems. A program written on one system runs
without modification on all systems.
Curve fitting is a statistical process for estimating the relationships among variables. It
includes many techniques for modelling and analyzing several variables when the focus is on
the relationship between a dependent variable and one or more independent variable
(predictors). Curve fitting can be used to infer causal relationships between the independent
and dependent variables.
Consider that we have collected examples of data from the problem domain with inputs and
outputs. The x-axis is the independent variable or the input to the function. The y-axis is the
dependent variable or the output of the function. We don’t know the form of the function that
maps examples of inputs to outputs, but we suspect that we can approximate the function with
a standard function form.
Curve fitting involves first defining the functional form of the mapping function (also called
the basis function or objective function), then searching for the parameters to the function that
result in the minimum error.

PROCEDURE

In this lab module, Google Colaboratory IDE is used as the platform to write the python
code. Please have your google account ready and activate Google Colaboratory IDE. The
python code can be written in Google Colaboratory by creating ‘New Notebook’.
Please refer below link for quick tutorial on Google Colaboratory.
https://www.youtube.com/watch?v=i-HnvsehuSw

Part A: Introduction to Python


You need to familiarize yourself with Python by following the step by step guidance on below
github link. You may download the ipynb file from GitHub and open the file by uploading to your
google colab account.
https://github.com/adiizhar/EEE250_NumericalComputing.git

Task Python Source Code


Iterate from an array of [1,2,3] and print the value for x in [1,2,3]
on each iteration. print(x)
Create a function of summing two input values. def myFunction(x,y)
return x+y

PART B1: Linear Curve Fitting


1. Go through the coding in the table below and write comments on each line of the code.
2. Write and run the code in Google Colaboratory IDE.
3. Observe and display the output in the provided lab sheet.

Task Python Source Code


Import Heading import numpy as np
import matplotlib.pyplot as plt
from scipy import optimize
from pandas import read_csv
Load Data Set url =
'https://raw.githubusercontent.com/jbrownlee/Data
sets/master/longley.csv'
dataframe = read_csv(url, header=None)
data = dataframe.values
x_data, y_data = data[:, 4], data[:, 6]
plt.figure(figsize=(6, 4))
plt.scatter(x_data, y_data)

OUTPUT A1: Please Include in Lab Sheet


Define Linear Curve def objective(x,m,c):
Fitting Objective return m*x + c
Function
Generate Curve Fitting [m,c],params_covariance =
to Data X and Data Y optimize.curve_fit(objective,x_data,y_data)
Plot Curve Fitted data plt.figure(figsize=(6, 4))
plt.scatter(x_data, y_data, label='Data')
plt.plot(x_data, objective(x_data, m, c), label=
'Fitted function')
plt.legend(loc='best')
plt.show()
OUTPUT A2: Please Include in Lab Sheet
Find the optimal print('y = %.5f * x + %.5f' %(m,c))
parameters OUTPUT A3: Please Include in Lab Sheet

PART B2: Polynomial Curve Fitting

By using the same dataset, follow the same procedure as in Part A for the following:
i. Define your own polynomial objective function.
def objective(x, a, b, c):
return a * x + b * x**2 + c
ii. Find the optimal parameters a,b and c for the polynomial objective function:
y = ax + bx^2 +c

PART C: OPEN DATASET

From dataset in the GitHub, retrieve the dataset and find the best curve fitting for any
parameters available in the dataset. Record your finding in result Part C.
https://github.com/adiizhar/EEE250_NumericalComputing.git

OUTPUT VALIDATION

1. Discuss linear and polynomial curve fitting error for Data X and Data Y.

2. Discuss on how SciPy is used to fit different curves to a set of observations.


SCHOOL OF ELECTRICAL ENGINEERING
UNIVERSITI TEKNOLOGI MARA

ELECTRICAL ENGINEERING LABORATORY


(EEE250)

CST FOR BEGINNERS

COURSE OUTCOME (CO) - PROGRAMME OUTCOME (PO)

CO1 Display good practical skills in conduction the experiments using modern
engineering tools during laboratory sessions.

PO5 Apply appropriate techniques, resources and modern engineering and IT tools to
well-defined engineering problems, with awareness of the limitations.

OUTCOMES

1. To design antenna using CST STUDIO SUITE software.


2. To design and simulate microstrip patch antenna for Wi-Fi application.

EQUIPMENT

1. Personal computer/laptop/notebook installed with CST STUDIO SUITE Student Edition


Software.

THEORY

Simulation allows engineers to experiment with virtual prototypes even at the earliest stages
of the design process, to compare the performance of different configurations, and to optimize
their products. Simulation can reduce the number of physical prototypes required and shorten
the development process, cutting both costs and time-to-market.

Computer Simulation Technology (CST) Studio Suite is the most reliable and precise
computer simulation for electromagnetic devices. CST Microwave Studio (MWS) is one part
of the CST Studio Suite. CST MWS can be used to analyze and solve any high frequency
electromagnetic problems and can also be used to design verities of 3D electromagnetic
components like antennas, transmission lines, resonators and also filters.

Figure Error! No text of specified style in document..1

Antenna Theory
Antenna is a device, which is used to transmit or receive electromagnetic waves. An
electromagnetic wave is composed of an electric field and a magnetic field, which propagate
at 3 x 108 meters per second in air. A transmitting antenna is one, which converts electrical
signals into electromagnetic waves and radiates them, while a receiving antenna is one, which
converts electromagnetic waves from the received beam into electrical signals. The operating
frequency of the antenna depends on the application i.e. WI-FI, GSM, and 5G.

Figure Error! No text of specified style in document..2

Microstrip Patch Antenna


A microstrip or patch antenna is a low-profile antenna that has several advantages over other
antennas including simple design, inexpensive, and easy to fabricate. Microstrip patch
antenna consists of a radiating patch, feedline, substrate, and ground plane as shown in
Figure 4.3. The patch of the microstrip antenna can be in a variety of shapes including
rectangle, circular, and square depending on the antenna’s application and operating
frequency.

Microstrip Feed Patch


Substrate

Ground Plane
Figure Error! No text of specified style in document..3

PROCEDURES

PART A: STEPS TO DOWNLOAD CST STUDIO SUITE STUDENT EDITION

1. Go to the web page Dassault Systèmes (3DS) to install the CST Studio Suite Student
Edition via this link https://tinyurl.com/ahneewmb

2. Click GET SOFTWARE and choose CST STUDIO SUITE Student Edition.

Figure Error! No text of specified style in document..4

3. Click “Create your 3DEXPERIENCE ID” and include all the details for registration as
shown in Figure Error! No text of specified style in document..5. Next, verify the registered
account through your email.

Figure Error! No text of specified style in document..5


4. After successfully registered, click “SIGN IN”. Next, find the software folder as shown in
Figure Error! No text of specified style in document..6 and start to install using the
installation guide.

Figure Error! No text of specified style in document..6

PART B: STEPS TO SETUP NEW TEMPLATE FOR ANTENNA DESIGN

1. Open new project template > MICROWAVE & RF/OPTICAL > Antennas > Next

Figure Error! No text of specified style in document..7

2. Choose Planar (Patch, Slot, etc.) > Next

Figure Error! No text of specified style in document..8

3. Choose Time Domain solver > Next


Figure Error! No text of specified style in document..9

4. Check all the units: Dimension (mm), Frequency (GHz)


5. Insert the frequency range: 1-5 GHz. Then, select the E-field, H-field and Farfield monitor
and define the frequency to be monitored, which is 2.4 GHz.

Figure Error! No text of specified style in document..10

6. Then, review your choice and click 'Finish' to create the template.
7. After that, save the template with the name of your project (i.e. Microstrip Patch Antenna).

PART C: STEPS TO DESIGN MICROSTRIP PATCH ANTENNA FOR WIFI APPLICATION


(FREQUENCY = 2.4 GHz)
Radiating Patch

Substrate
Ground plane
Figure Error! No text of specified style in document..11

Table Error! No text of specified style in document..1

Parameters Dimension [mm] Description


L 28.8 Length of Patch
W 37 Width of Patch
Gf 1 Width of Slot
Lf 8.85 Length of Slot
Wf 3.1 Width of feed line
ts 1.6 FR-4 thickness
tc 0.035 Copper thickness

STEP 1: DESIGN SUBSTRATE


1. Create a rectangular block by selecting Modeling > Brick and then press Escape (esc).

Figure Error! No text of specified style in document..12


2. Insert all parameters as shown in Figure Error! No text of specified style in document..13,
then click Preview.
Figure Error! No text of specified style in document..13

3. Insert all values for W, L, and ts as given in Table 4.1. Then, press OK.
4. A rectangular substrate as shown in Figure Error! No text of specified style in document..14
will be created.

Figure Error! No text of specified style in document..14

STEP 2: DESIGN RADIATING PATCH


1. First, pick the center point of the substrate. Select Pick Points > Pick Face Center (Figure
Error! No text of specified style in document..15) and then double click at the center of the
substrate. A red point will be appeared at the center of the substrate as shown in Figure
Error! No text of specified style in document..16.

Figure Error! No text of specified style in document..15


Figure Error! No text of specified style in document..16

2. Select Align WCS as shown in Figure Error! No text of specified style in document..17. The
coordinate UVW will be appeared at the center of the substrate.

Figure Error! No text of specified style in document..17

3. Create a rectangular block by selecting Modeling > Brick, and then press Escape (esc).
4. Insert all parameters as shown in Figure Error! No text of specified style in document..18
and click Preview. Then, insert the value for tc as given in Table 4.1 and press OK.

Figure Error! No text of specified style in document..18


5. A rectangular patch will be created on the substrate as shown in Figure Error! No text of
specified style in document..19.

Figure Error! No text of specified style in document..19

STEP 3: DESIGN FEEDING LINE

Figure Error! No text of specified style in document..20

1. Select Pick Points > Pick Edge Center (Figure Error! No text of specified style in
document..21) and then double click at the lower edge of the radiating patch. A red point
will be appeared at the lower edge as shown in Figure Error! No text of specified style in
document..22.

Figure Error! No text of specified style in document..21


Figure Error! No text of specified style in document..22

2. Select Align WCS, then the coordinate UVW will be appeared at the selected point.
3. Then, create a block by selecting Modeling > Brick, and then press Escape (esc).
4. Insert all the parameters as shown in Figure Error! No text of specified style in
document..23, then click Preview. Then, insert the value for Wf, Gf and Lf as given in Table
1 and press OK.

Figure Error! No text of specified style in document..23

5. A ‘Shape Intersection’ window will appear as shown in Figure Error! No text of specified
style in document..24. Select “Cut away highlighted shape” and press OK.

Figure Error! No text of specified style in document..24


6. After that, select Pick Points > Pick Edge Center or just press M for the short cut. Then,
double click at the lower edge of the substrate. A red point will be appeared at the center
of the substrate lower edge as shown in Figure Error! No text of specified style in
document..25. Then, click Align WCS to move the WCS to the selected point.

Figure Error! No text of specified style in document..25

6. To create the feed line, select brick and insert the dimensions of the feed line as shown in
Figure 4.26 (a) and then press OK. The feed line is created as shown in Figure 4.26 (b).

(a)
(b)
Figure Error! No text of specified style in document..26
7. Then, combine the patch and the feed line into one object. In the Navigation Tree on the
left side of the working plane, click Components > component1 > patch, then go to Boolean
> Add and go back to the Navigation Tree, click feed line then press Enter.

Figure Error! No text of specified style in document..27

STEP 4: GROUND PLANE


1. To draw the ground plane, first change the view to Back as shown in Figure Error! No text
of specified style in document..28.

Figure Error! No text of specified style in document..28

2. Then, select the face of the background. Click Picks > Pick face (shortcut: F) as shown in
Figure Error! No text of specified style in document..29 and double click on the surface of
the background.

Figure Error! No text of specified style in document..29


3. Then, click Extrude Face and insert the name and the height of the ground plane as shown
in Figure Error! No text of specified style in document..30, then press OK.

Figure Error! No text of specified style in document..30


STEP 5 : INSERT WAVEGUIDE PORT
1. Select Picks > Pick Face (shortcut: F), then double click on the bottom face of the feed
line as shown in Figure Error! No text of specified style in document..31.

Figure Error! No text of specified style in document..31

2. Then, go to Macros > Solver > Ports > Calculate port extension coefficient. The window
‘Calculate port extension coefficient’ will appear as shown in Figure 4.33. After that, click
‘Calculate’, follow with ‘Construct port from picked face’. Then, close the window.

Figure Error! No text of specified style in document..32


3. The antenna is then ready to simulate using Time Domain Solver. Go to Simulation and
select Setup Solver.
Figure Error! No text of specified style in document..33

4. Finally, click Start and the simulation will begin.

Figure Error! No text of specified style in document..34

OUTPUT VALIDATION

1. Observe the S-Parameter (S11), E-field and H-field results (See 1D and 2D Results in the
Navigation Tree).
2. If the antenna is changed to operate at mid-band 5G application with the operating
frequency of 3.5 GHz, predict the modification that needs to be done to the antenna design.
SCHOOL OF ELECTRICAL ENGINEERING
UNIVERSITI TEKNOLOGI MARA

ELECTRICAL ENGINEERING LABORATORY


(EEE250)

MODULE 5

CLOUD & DRIVE

COURSE OUTCOME (CO) - PROGRAMME OUTCOME (PO)


CO1 Display good practical skills in conducting the experiments/project using modern
engineering tools during laboratory sessions. (P4)
CO4 Demonstrate verbal and written communication skills in reporting the conducted
experiments and project. (A3)
PO5 Apply appropriate techniques, resources, and modern engineering and IT tools to well-
defines engineering problems, with an awareness of the limitations.
PO9 Function effectively as an individual, and as a member in diverse technical teams.

OUTCOMES

1. To build Cloud Software, Cloud Storage and Cloud Computing as modern & up-to-date
engineering tools.
2. To construct Cloud Software, Cloud Storage and Cloud Computing to solve engineering
problem.
3. To display the limitation of Cloud Software, Cloud Storage and Cloud Computing.

EQUIPMENT

Personal computer/laptop/notebook preinstalled with Google Chrome

COMPONENTS

Personal computer/laptop/notebook.

THEORY

1
Cloud & Drive
Cloud and drive are data centres with on-demand availability of computer systems resource
to many users over the Internet, especially software-as-a-service (Cloud SaaS), data storage
(Cloud Storage) and computing power (Cloud Computing). Cloud may be limited to a single
organization such as within UiTM or be available to multiple organizations (Google Cloud).

Figure 5.1: Cloud and Drive


Cloud Software
Cloud Software as a service (SaaS) is a software distribution model in which a cloud provider
hosts applications and makes them available to end users over the internet. One example of
Cloud SaaS is Tinkercad. Tinkercad is a free, easy-to-use web app that equips the next
generation of designers and engineers with the foundational skills for innovation: 3D design,
electronics, and coding.

Figure 5.2: Cloud and Drive

Cloud Storage
Cloud storage is a model of computer data storage in which the digital data is stored in multiple
servers (sometimes in multiple locations). The physical environment is typically owned and
managed by a hosting company. These cloud storage providers are responsible for keeping
the data available and accessible 24/7. Two examples of cloud storage are Microsoft OneDrive
and Google Drive.

2
Microsoft OneDrive is a file hosting service and synchronization service operated by Microsoft
as part of Office 365. OneDrive allows users to store files and personal data like Microsoft
Office documents across Android, Windows Phone, and iOS mobile devices, Windows and
macOS computers. UiTM students are offered 5 TB of storage in OneDrive.

Figure 5.3: Microsoft OneDrive


Google Drive is a file storage and synchronization service developed by Google. Google Drive
allows users to store files in the cloud (on Google's servers), synchronize files across devices,
and share files. In addition to a web interface, Google Drive can be accessed from Windows
and macOS computers, and Android and iOS smartphones and tablets. Google Drive includes
Google Docs, Google Sheets, and Google Slides. Files created and edited through the Google
Docs suite are saved in Google Drive.

Figure 5.4: Google Drive

Cloud Computing
Cloud computing can be utilized for building, testing, deploying, and managing applications
and services through data centres. It provides software as a service (SaaS), platform as a
service (PaaS) and infrastructure as a service (IaaS) and supports many different
programming languages, tools, and frameworks. Colaboratory (also known as Colab) is a free
cloud computing environment from Google that runs in the cloud and stores its notebooks on

3
Google Drive. The Colaboratory UI only allows for the creation of notebooks with Python 2
and Python 3 kernels.

Figure 5.5: Google Colaboratory

4
PROCEDURES

PREPARATION: Office 365 activation

1. Visit https://mail.uitm.edu.my/.
2. Click Microsoft 365. In office.com, click Sign in (Figure 5.6).

Figure 5.6: Office 365 Sign in screen

3. For new student, please sign-in to your account using the following instructions:
Login ID: [email protected] (* Username by default: Student ID)
Example: [email protected]
Password: Default password have been created as combination:
“The first two letters of student’s name (the first letter is uppercase) + ‘@’
+ last 6 digit of student ID”

Example: Name: Muhammad Hijaz | Student ID: 2017123456


Password: Mu@123456

4. For current student, please sign-in to your account using the following instructions:
Login ID: [email protected] (* Username by default: Student ID)
Example: [email protected]
Password: Default password have been created as: Passw0rd

5. For safety reason, please change your default password immediately.

5
PREPARATION: Google activation

1. Visit https://mail.uitm.edu.my/.
2. Click Gmail Student. You will be directed to the following page (Figure 5.7).

Figure 5.7: Google login screen

3. Please sign-in to your account using the following instructions:


Login ID: [email protected] (* Username by default: Student ID)
Example: [email protected]
Password: Default password have been created as combination:
“The first two letters of student’s name (the first letter is uppercase) + ‘@’
+ last 6 digit of student ID”

Example: Name: Muhammad Hijaz | Student ID: 2017123456


Password: Mu@123456

4. Then go to your Google account setting by clicking your profile icon in the upper right
corner and select “Manage your Google Account”. Update your phone number in the
“Personal Info”. Phone number is required when registering for a cloud service.
5. For safety reason, please change your default password immediately.

6
PART A: CLOUD SOFTWARE

1. Visit https://www.tinkercad.com/. Click “JOIN NOW”, and then choose “Create a personal
account” (Figure 5.9).

Figure 5.8: Creating a file

Figure 5.9: Tinkercad sign up screen

2. Choose “Sign in with Google” to proceed (Figure 5.10). Enter your email details & verify
your account by phone.

Figure 5.10: Tinkercad sign up screen

7
3. At the end of this process, you’ll be welcomed by the Tinkercad tutorial screen. You may
follow the tutorial or just skip by closing it and instead go to the main homepage. Click
“Circuits”, followed by “Create new Circuit” (Figure 5.11).

Figure 5.11: Tinkercad dashboard

4. This is what a project’s main interface looks like (Figure 5.12). The interface is composed
of the following:

Top toolbar, with more general tools like “Rotate”, “Delete”, “Undo”, “Redo”, “Wire
type” and “Wire colour” on the left, as well as design operations like “Code”, “Start
Simulation”, “Export” and “Share” on the right.

Workplane at the center. You can use mouse wheel to zoom in or zoom out the circuit.
Alternatively, you can click “Zoom to Fit” button on the top left of workplane to view the
whole circuit design.

Components Panel, containing “All” and “Basic” components.

Figure 5.12: Project interface


8
5. Create the following circuit by selecting “Basic” from the Components Panel, then drag
and drop the components as shown in Figure 5.13 below.

Figure 5.13: Placing the components

6. Click each component and the properties for the component will be displayed, as shown
in Figure 5.14. Change the properties of each component, based on the Table 5.1.

Figure 5.14: Component properties dialog box

Table 5.1: LED properties setup


LED Color: RED
Resistor Resistance: 22 Ω

7. Then connect each component, by hovering your mouse over each component. A red box
will be displayed to indicate the polarity of the component. Click the red box and move your
mouse to another red box. Click again to create wire between components as shown in
Figure 5.15.

9
Figure 5.15: Connecting the components

8. Click “Start Simulation” at the top to start the circuit simulation. If the connections are
performed correctly, then the LED will light up as shown in Figure 5.16. Include the
simulation result in the Lab Sheet.

Figure 5.16: Simulating the circuit

9. Stop the simulation. Search for Multimeter from the search box. Drag and drop the
Multimeter onto the workplace. Connect the Multimeter, as shown in Figure 5.17. Click the
Multimeter and change the Mode to Amperage.

10
Figure 5.17: Measuring the amperage across resistor

10. Start the simulation again. Observe value from the Multimeter and include in the Lab
Sheet.
11. Export the circuit by clicking “Export” button on the top right of Top Toolbar. Click download
and a BRD file will be downloaded to your local computer. Keep the BRD file for Part B of
this laboratory.

EXERCISE

1. Use Multimeter to measure Amperage and Voltage between the LED, Resistor and
Battery. Observe the value and include in the Lab Sheet.
2. Export and rename the file with your student ID.

Example: 2020123456.brd

PART B: CLOUD STORAGE

MICROSOFT ONEDRIVE

1. In your local computer (Desktop or Laptop), select the “Start” button. Search for
“OneDrive”, and then open it (Figure 5.18).

11
Figure 5.18: OneDrive shortcut

2. When OneDrive Setup starts, enter your personal account, or your work or school account,
and select “Sign in” (Figure 5.19).

Figure 5.19: OneDrive login

3. On the This is your OneDrive folder screen, select Next to accept the default folder location
for your OneDrive files. If you want to change the folder location, select Change location
(Figure 5.20).

Figure 5.20: OneDrive setup


12
4. On the All your files, ready and on-demand screen, you will see how files are marked to
show them as online-only, locally available, or always available. Files On-Demand helps
you access all your files in OneDrive without having to download all of them and use
storage space on your Windows device (Figure 5.21). Select Next.

Figure 5.21: Type of files in OneDrive

5. You are all set. Your OneDrive files will appear in File Explorer in the OneDrive folder.
Your work or school files appear under OneDrive – Universiti Teknologi MARA (Figure
5.22). You can store over 300 types of files on OneDrive.

Figure 5.22: Local OneDrive

6. You now have a new white or blue cloud icon (or both) in your notification area and your
files are synced to your computer. Your blue cloud icon will appear as OneDrive –
Universiti Teknologi MARA when you hover over the icon (Figure 5.23).

Figure 5.23: OneDrive in Taskbar


13
7. Locate BRD file that you have created in Part A and store it in your local OneDrive folder.
The file will be automatically uploaded to Microsoft Cloud Storage.
8. Verify the file by going to office.com and click OneDrive under the list of Office 365 icons
(Figure 5.24). Make sure the BRD file is inside the OneDrive folder. Screenshot your
screen and include in the Lab Sheet.

Figure 5.24: Online Office 365 icons

9. If the file does not exist, you may drag & drop the BRD file into cloud OneDrive.

GOOGLE DRIVE

1. Download the Google Drive desktop app to your computer


(https://google.com/drive/download) (Figure 5.25).

Figure 5.25: Download Backup and Sync

2. Once the file has been downloaded, click on the installer to start the installation (if you are
using Google Chrome, you will find the downloaded file in the bottom left corner of the
browser). Follow the on-screen instruction.
14
3. Once it is installed, you will see a new Google Drive folder in your Folder Explorer. Any
files you move into this folder will automatically be uploaded to your Google Drive (Figure
5.26).

Figure 5.26: Local Google Drive

4. Locate BRD file that you have created in Part A and store it in your local Google Drive
folder. The file will be automatically uploaded to Google Cloud Storage.
5. Verify the file by going to google.com and click Drive under the list of icons. Make sure the
BRD file is inside the Drive folder. Screenshot your screen and include in the Lab Sheet.

Figure 5.27: Online Google Drive

6. If the file does not exist, you may drag & drop the BRD file into cloud OneDrive.

EXERCISE

1. Use web-based Google Drive to upload BRD file (with the student ID) to instructors’ Drive.
Ask your respective instructor for the link.

15
PART C (Cloud Computing)

1. Assuming that you are already logged into your Google Drive, click Open More Apps from
create file menu in Google Drive (Figure 5.28).

Figure 5.28: Apps selection in Google Drive


2. Your browser would display the Google Workspace Marketplace. Search for
Colaboratory in the search bar. Proceed to install the Collaboratory app (Figure 5.29).

Figure 5.29: Colaboratory installation

3. Again, from create file menu, search for Google Colaboratory. Click to open app (Figure
5.30).

Figure 5.30: Colaboratory selection


16
4. A new notebook would open as shown in the screen below (Figure 5.31). This is what a
project’s main interface looks like. The interface is composed of the following:

Top toolbar, with more general tools like “CODE”, “TEXT”, and “CELL” on the left, as
well as operations like “CONNECT” on the right. You may add coding area by click
CODE. To add comment or explanation, click TEXT.

Figure 5.31: Colaboratory UI

5. To rename the notebook, click on this name and type in the desired name in the edit box
as shown here (Figure 5.32).

Figure 5.32: Renaming

6. Click CONNECT on the top right side of the toolbar. Google Colaboratory will try to
establish a connection a cloud server. If the connection is successful, then the CONNECT
will change to green tic and the server specs (Figure 5.33).

Figure 5.33: Server status

7. You will now enter a trivial Python code in the code window and execute it. Enter the
following two Python statements in the code window.

import time
print(time.ctime())
Figure 5.34: Program list to display current time

17
8. To execute the code, click on the arrow on the left side of the code window (Figure 5.35).

Figure 5.35: Code and execution

9. After a while, you will see the output underneath the code window, as shown here (Figure
5.36). Include the code and output in the Lab Sheet (Part C (i)).

Mon Jun 17 05:58:40 2019


Figure 5.36: Output for current time

10. You can clear the output anytime by clicking the icon on the left side of the output display
(Figure 5.37).

Figure 5.37: Output clearing button

11. To add more code to your notebook, just hover the mouse at the bottom center of the Code
cell. When the CODE and TEXT buttons appear, click on the CODE to add a new cell
(Figure 5.38).

Figure 5.38: Adding more codes button

18
12. A new code cell will be added underneath the current cell.
13. Next, we will execute the Equation 5.1. Click CODE button and write codes from Figure
5.39. Run the cell & verify if the output is similar to Figure 5.40. Include your code and
output in the Lab Sheet Part C (ii).

Equation 5.1
# Importing Required Libraries
import numpy as np
import matplotlib.pyplot as plt

# Generating time data using arange function from numpy


time = np.arange(-3*np.pi, 3*np.pi, 0.01)

# Finding amplitude at each time


amplitude = np.sin(time)

# Plotting time vs amplitude using plot function from


pyplot
plt.plot(time, amplitude)

# Settng title for the plot in blue color


plt.title('Sine Wave', color='b')

# Setting x axis label for the plot


plt.xlabel('Time')

# Setting y axis label for the plot


plt.ylabel('Sin(time)')

# Showing grid
plt.grid()

# Highlighting axis at x=0 and y=0


plt.axhline(y=0, color='k')
plt.axvline(x=0, color='k')

# Finally displaying the plot


plt.show()
Figure 5.39: Program list for Equation 5.1

Figure 5.40: Output from Equation 5.1

19
14. During the development of your project, you may have introduced a few now-unwanted
cells in your notebook. You can remove such cells from your project easily with a single
click. Click on the vertical-dotted icon at the top right corner of your code cell (Figure 5.41).

Figure 5.41: Cell deletion

OUTPUT VALIDATION
1. Measure Part A with an actual experiment. Demonstrate the advantage and
disadvantages of performing experiments in the cloud and state the outcomes from
this lab session.

2. Examine the output of Equation 5.2 and Equation 5.3 using the code in Figure 5.42.
Replace XX with last 2 digit of your student ID. Show your result to instructor.

Equation 5.2
Equation 5.3

# import libraries
import numpy as np
from matplotlib import pyplot as plt

GAP = XX
# Creating equally spaced data in range 0 to 2*pi
theta = np.linspace(0, 2 * np.pi, GAP)

# Generating x and y data

20
x = 16 * ( np.sin(theta) ** 3 )
y = 13 * np.cos(theta) - 5* np.cos(2*theta) - 2 * np.cos(3*theta)
- np.cos(4*theta)

# Plotting
plt.plot(x, y)
plt.title('Shape')
plt.show()

Figure 5.42: Program list for Equation 5.2 & Equation 5.3

21
SCHOOL OF ELECTRICAL ENGINEERING
UNIVERSITI TEKNOLOGI MARA

ELECTRICAL ENGINEERING LABORATORY


(EEE250)

MODULE 6

INTRODUCTION TO EXCEL

COURSE OUTCOME (CO) - PROGRAMME OUTCOME (PO)


CO1 Display good practical skills in conducting the experiments/project using modern
engineering tools during laboratory sessions. (P4)
CO4 Demonstrate verbal and written communication skills in reporting the conducted
experiments and project. (A3)
PO5 Apply appropriate techniques, resources, and modern engineering and IT tools to well-
defines engineering problems, with an awareness of the limitations.
PO10 Communicate effectively on well-defined engineering activities with the engineering
community and with society at large, by being able to comprehend the work of others,
document their own work, and give and receive clear instructions

OUTCOMES

1. To build basic excel spreadsheet and workbook.


2. To build LOOKUP function and combo boxes.
3. To manipulate conditional formatting.
4. To manipulate nested IF statements.

EQUIPMENT

Personal computer/laptop/notebook preinstalled with Microsoft Excel.

COMPONENTS

Personal computer/laptop/notebook.

1
THEORY

Microsoft Excel is a spreadsheet program that is used to record and analyse numerical data.
There are numbers of spreadsheet programs but from all of them, Excel is most widely used.
People have been using it for last 30 years and throughout these years, it has been upgraded
with more and more features.

The best part about Excel is, it can apply to many business tasks, including statistics, finance,
data management, forecasting, analysis, inventory, billing, and business intelligence.
Following are the few things which it can do for you:
• Number Crunching
• Charts and Graphs
• Store and Import Data
• Manipulating Text
• Templates/Dashboards
• Automation of Tasks
• And Much More
There are three most important components in Excel.
1. Cell: A cell is a smallest but most powerful part of a spreadsheet. You can enter your data
into a cell either by typing or by copy-paste. Data can be a text, a number, or a date. You
can also customize it by changing its size, font color, background color, borders, etc. Every
cell is identified by its cell address, cell address contains its column number and row
number (If a cell is on 11th row and on column AB, then its address will be AB11).

2. Worksheet: A worksheet is made up of individual cells which can contain a value, a


formula, or text. It also has an invisible draw layer, which holds charts, images, and
diagrams. Each worksheet in a workbook is accessible by clicking the tab at the bottom of
the workbook window. In addition, a workbook can store chart sheets; a chart sheet
displays a single chart and is accessible by clicking a tab.

3. Workbook: A workbook is a separate file just like every other application has. Each
workbook contains one or more worksheets. You can also say that a workbook is a
collection of multiple worksheets or can be a single worksheet. You can add or delete
worksheets, hide them within the workbook without deleting them, and change the order
of your worksheets within the workbook.

2
MICROSOFT EXCEL WINDOW COMPONENTS
Before you start using it, it’s important to understand that what’s where in its window. So ahead
we have all the major component which you need to know before entering the world of
Microsoft Excel.

Figure 0.1 : Microsoft Excel window components

1. Active Cell: A cell which is currently selected. It will be highlighted by a rectangular box
and its address will be shown in the address bar. You can activate a cell by clicking on it
or by using your arrow buttons. To edit a cell, you double-click on it or use F2 to as well.
2. Columns: A column is a vertical set of cells. A single worksheet contains 16384 total
columns. Every column has its own alphabet for identity, from A to XFD. You can select a
column clicking on its header.
3. Rows: A row is a horizontal set of cells. A single worksheet contains 1048576 total rows.
Every row has its own number for identity, starting from 1 to 1048576. You can select a
row clicking on the row number marked on the left side of the window.
4. Fill Handle: It’s a small dot present on the lower right corner of the active cell. It helps you
to fill numeric values, text series, insert ranges, insert serial numbers, etc.
5. Address Bar: It shows the address of the active cell. If you have selected more than one
cell, then it will show the address of the first cell in the range.
6. Formula Bar: The formula bar is an input bar, below the ribbon. It shows the content of
the active cell and you can also use it to enter a formula in a cell.
7. Title Bar: The title bar will show the name of your workbook, followed by the application
name (“Microsoft Excel”).
3
8. File Menu: The file menu is a simple menu like all other applications. It contains options
like (Save, Save As, Open, New, Print, Excel Options, Share, etc).
9. Quick Access Toolbar: A toolbar to quickly access the options which you frequently use.
You can add your favourite options by adding new options to quick access toolbar.
10. Ribbon Tab: Starting from the Microsoft Excel 2007, all the options menus are replaced
with the ribbons. Ribbon tabs are the bunch of specific option group which further contains
the option.
11. Worksheet Tab: This tab shows all the worksheets which are present in the workbook. By
default you will see, three worksheets in your new workbook with the name of Sheet1,
Sheet2, Sheet3 respectively.
12. Status Bar: It is a thin bar at the bottom of the Excel window. It will give you an instant
help once you start working in Excel.

4
MICROSOFT EXCEL BASIC FUNCTIONS
Functions are one of the most important features of Excel. It helps you to perform the basic
calculations as well complex. Below I have listed 10 Basic Excel Functions which you need to
learn.

1. SUM: It returns the sum of numeric values in a cell. You can refer to the cells where you
have values or simply insert the values into the function.
2. COUNT: It returns the count of numeric values in a cell. You can refer to the cells where
you have values or simply insert the values into the function.
3. AVERAGE: It returns the average of numeric values in a cell. You can refer to the cells
where you have values or simply insert the values into the function.
4. TIME: It returns a valid time serial number as per Excel's time format. You need to specify
hours, minutes and seconds.
5. DATE: It returns a valid date serial number as per Excel's time format. You need to specify
day, month and year.
6. LEFT: This function extracts specific characters from the a cell/string starting from the left
(start). You need to specify the text and number of characters to extract.
7. RIGHT: This function extracts specific characters from the a cell/string starting from the
right (last). You need to specify the text and number of characters to extract.
8. VLOOKUP: It looks up for a value in a column and can return that value or a value from
the correspondent columns using same row number.
9. IF: This function returns a value when the specific condition is TRUE and returns another
values it condition is FALSE.
10. NOW: It returns the current date and time in the cell where you insert it using your system's
settings

PROCEDURE
The exercise will focus on the development of a grade book. The spreadsheet will allow to
keep track of two tests (A and B) and automatically calculate the percentage and the grade
(Distinction, Merit, Pass or Fail).

PART A: Formatting Text and Numbers


1. Before you begin to work through this section, you should already be able to open
Microsoft Excel and set up worksheet as shown in Figure 6.2. Make sure to format each
column to the appropriate category (right click mouse > format cells > number) e.g. name
should be formatted as “Text”, telephone numbers should be formatted as “Text” to allow
you enter a zero before each number, the percentage column as “Percentage” etc.
5
Figure 0.2

Four things you need to format once you have entered the data as above:
i. Set the title of the grade book to bold and font size 14 (Arial).
ii. Merge cells D6 to F6 and label as “Test A” and colour cell green
iii. Merge cells G6 to I6 and label as “Test B” and colour cell orange.
iv. Draw border as shown in Figure 6.2 (click on Format and then Border and Shading)

Now enter the marks for both Test A and Test B which each student achieved as shown in
Figure 6.3.

Figure 0.3

2. Create another table as shown below which will hold the total marks for test A and Test B
(Figure 6.4). Include the worksheet that you have created in the Lab Sheet.

Figure 0.4
6
PART B: Set Up the Formula
1. Now you must set up the formulas in both the percentage columns to automatically
calculate the total percentage. To calculate the percentage, you need to divide each raw
mark by the total marks for each text and work out the percentage.
2. Enter a formula using absolute referencing in which the exact address of a cell,
regardless of the position of the cell that contains the formula is maintained. (Example of
absolute cell reference is $A$1).
3. In cells E8 enter the following formula = D8/$B$17 (make sure that you format the column
E to percentage category. Set the number of decimal places to 0). Notice the use of dollar
sign in the formula which denotes an absolute reference to cell B17. Now replicate the
formula to cover the range E8-E14. Repeat to calculate the percentage for Test B
(column H). At the end of this step, you should have a worksheet which looks like
Figure 6.5. Include the worksheet that you have created in the Lab Sheet.

Figure 0.5

PART C: Excel Nested IF Statements

1. Now you want to automatically work out what the grade each student has obtained based
on the percentage. First, you need to set up another table with the grade boundaries for
each test as shown in Figure 6.6. Both test A and B have different grade boundaries which
will determine whether a student achieves a final grade of distinction, merit, pass or fail.

7
Figure 0.6

2. The IF function can be used to tests the value in a cell, the output of comparison can be
either true or false. Unlike the basic IF function which tests two conditions; we have to test
each condition against the three grade boundaries. Hence for this condition, nested IF
will be used instead of normal IF function. For example, for test A, if the percentage is
greater than 80%, then the student gets a distinction.

This statement should be :

IF E8 > B19, grade is distinction;


IF E8 > B20, grade is merit;
IF E8 > B21, grade is pass;
IF E8 < B21, grade is fail.

To construct a formula, you will use a nested IF statement and absolute referencing.

Enter the following formula in cell F8 :


=IF(E8>$B$19,"Distinction",IF(E8>$B$20,"Merit",IF(E8>$B$21,"Pass","Fail")))

3. Once entered, the worksheet should be seen as Figure 6.7.

8
Figure 0.7

4. Use the same method to calculate the grades for Test B. Include the worksheet that you
have created in the Lab Sheet.

PART D: Conditional Formatting


1. The using of conditional formatting can create cells stand out if they meet certain criteria.
For example, you may want to colour all distinction grades as green and all fail grades
as red.
2. To achieve this, highlight all the cells to which you want to apply conditional formatting in
one block by dragging across cells F8 to F14 as shown in Figure 6.8.

Figure 0.8

9
3. Next click on Conditional Formatting. Choose equal from the drop-down list as shown
in Figure 6.9.

Figure 0.9

4. Set the value to Distinction as shown in Figure 6.10.

Figure 0.10

5. Choose Custom Format from the drop-down and click on the Fill tab to set the
Background Color to green (Figure 6.11).

Figure 0.11

10
6. Repeat the same method to set a second conditional format for value Fail. Set the
Background Color to red.
7. Repeat the same method to set a conditional format for Merit and Pass.
8. For checking the Formatting Rules, click Conditional Formatting. Choose Manage Rules
(Figure 6.12).

Figure 0.12

9. Once you click OK, the worksheet should now appear as shown in Figure 6.13.

Figure 0.13

Now set the conditional formatting for Test B as done for Test A. Your final worksheet
should appear as shown in Figure 6.14. Include the worksheet that you have created in
the Lab Sheet.

11
Figure 0.14

10. Let’s revisit and see the advantage of absolute referencing and setting up a separate table
for grade boundaries. Let’s say that you as a teacher decided to change the grades
boundaries for both Test A and B. It’s simple as all you have to do is change the values in
the Grades boundaries table. All the rest is automatically generated. Change the grades
boundaries value (i.e. Passing mark for Test B is changed to 40%) as below and you
should get a worksheet similar to the one shown in Figure 6.15. Notice the change in colour
of grades as defined by conditional formatting.

Figure 0.15

11. It’s time to do something really exciting with the grade book you have created. You want
to set up another worksheet and create a user-friendly interface to retrieve information
from the grade book you have just created. First, click on the sheet 2 of your Excel
Workbook and enter data as shown below (Figure 6.16)

12
Figure 0.16

PART E: Create Form Control Combo box.


1. The next step is to create a Combo box to select a name of a student whose details you
want to bring up in the page.
2. The first thing you need to do is to ensure the Developer tab is visible in the Excel Ribbon.

If you have already enabled the Developer tab in your version of Excel, you should be able
to find it next to the View tab (Figure 6.17).

Figure 0.17

3. If you don’t see the Developer tab, you will need to walk through the following steps.
i. Go to the File tab , Click on Options (Figure 6.18).

Figure 0.18

13
ii. When the Excel Options dialog box opens, click on Customize Ribbon (Figure 6.19).

Figure 0.19

iii. In the column on the right under Customize the Ribbon, make sure to select the
checkbox for Developer.
iv. If you do not see Developer in that column, select All Tabs from the Choose
commands from drop down. This will be at the top of the left column (Figure 6.20).

Figure 0.20

v. Then click on Developer to highlight and click on the Add button between the
columns. Again, make sure to select the checkbox for Developer once it shows up in
the right column.
vi. Now click OK and you should find the Developer tab in your Ribbon.
14
4. Now that we have set Excel up to create a Combo Box, let’s create a simple list to use.
5. Next, go to the Controls group of the Developer tab and click on the arrow under
Insert.
6. Now you should see both Form Control and ActiveX Control elements (Figure 6.21).

Figure 0.21

7. Let’s select from Form Controls (Figure 6.22).

Figure 0.22

8. Once you click on ComboBox, you can now drag your mouse and draw the ComboBox
into your worksheet (Figure 6.23).

Figure 0.23

15
9. The next step is to right click on our new ComboBox element and select Format Control
(Figure 6.24).

Figure 0.24

10. Once the Format Object dialog box opens, go to the Control tab.
11. Then click on the button to the right of the Input range text box to select the range of
values for our list. (Figure 6.25)

Figure 0.25

12. In the Input Range Box enter the range of the table (on sheet 1) which contains all the
names. However, note that you are entering the range in worksheet 2 but linking to the
table on worksheet 1 hence the notation as below.

i. Sheet1!$B$8:$I$14 (Sheet1! Identifies the link and $B$8:$I$14 is the range with
absolute referencing).
ii. Next, choose a cell link which will be used to provide a link between the
worksheet 1 and information to be retrieved into the form created in worksheet 2.
In cell link, enter $E$4 and click on OK (Figure 6.26)

16
Figure 0.26

13. Once this is completed, you should be able to click on the Combo box and see the list of
all the names of the students. Notice that when a name is selected, a cell link value
appears in cells E4 which corresponds to the student number (the left most column of the
table). Include the Combo box that you have created in the Lab Sheet.

Figure 0.27

PART F: Excel VLOOKUP Function


1. Once a name has been selected from the drop-down list, you want the grades for Test A,
Test B and telephone details to automatically appear. To do this, you will use an Excel
lookup function called VLOOKUP. This function is used to retrieve information stored in a
table and when the desired value is stored elsewhere on the workbook.

The VLOOKUP has the following arguments:


VLOOKUP (lookup_value, table_array, col_index_num)

lookup_value: The value to be found in a column which in this example is in cell E4


table_array: The table of information in which the data is looked up.
col_index_num: the numeric position of the column that is being searched.

2. Enter the VLOOKUP function in cell C6 as follows: =VLOOKUP(E4,Sheet1!A8:I14,6)


3. Enter the VLOOKUP function in cell C8 as follows: =VLOOKUP(E4,Sheet1!A8:I14,9)
17
4. Enter the VLOOKUP function in cell C10 as follows: =VLOOKUP(E4,Sheet1!A8:I14,3)
5. When you choose Faizal as the student whose details you want brought up, the following
information should appear as shown below (Figure 6.28)

Figure 0.28

6. Formatting the final screen. Insert a colour for the complete worksheet by selecting a part
of worksheet and choosing a colour.
7. Next you want to make the cell link value in E4 invisible. You can do this by making it the
same colour as the background.
8. Add an image to the page to enhance the design by clicking on Insert and picture from file
(Figure 6.29). Include the final screen that you have created in the Lab Sheet.

Figure 0.29

OUTPUT VALIDATION
1. From the given data, measure the minimum, maximum and average value for Test 1 and
Test 2.
2. Demonstrate the outcomes from this lab session.

18
ELECTRICAL ENGINEERING STUDIES
COLLEGE OF ENGINEERING
UNIVERSITI TEKNOLOGI MARA

ELECTRICAL ENGINEERING LABORATORY


(EEE250)

EXPERIMENT 7

INTRODUCTION TO AUTOCAD

COURSE OUTCOME (CO) - PROGRAMME OUTCOME (PO)

CO1 Display good practical skills in conduction the experiments using modern
engineering tools during laboratory sessions.
C03 Work effectively as an individual and a team member while conducting the
experiments in a group.
PO5 Apply appropriate techniques, resources and modern engineering and IT tools to
well-defined engineering problems, with awareness of the limitations.
PO9 Function effectively as an individual, and as a member in diverse technical teams.

OUTCOMES

1. To construct a simple line and circle drawing using AutoCAD.


2. To sketch a simple floor plan consists of electrical symbol using AutoCAD.
3. To build an electrical wiring plan using AutoCAD.

EQUIPMENT

1. AutoCAD software

THEORY
AutoCAD is a commercial computer-aided design and drafting software application. Developed
and marketed by Autodesk, AutoCAD was first released in December 1982 as a desktop app
running on microcomputers with internal graphics controllers. Before AutoCAD was introduced,
most commercial CAD programs ran on mainframe computers or minicomputers, with each
CAD operator (user) working at a separate graphics terminal. AutoCAD is also available as
mobile and web apps. AutoCAD is used in industry, by architects, project managers, engineers,
graphic designers, city planners and other professionals. It was supported by 750 training
centers worldwide in 1994.

Figure 7.1 : AutoCAD software

AutoCAD Installation
1. Go to AUTODESK web page to install the AutoCAD software via this link:
https://tinyurl.com/9c22r7k
2. First, create a new account and follow all the registration procedures. You are required to
upload a copy of documentation issued to you by your university (e.g. tuition receipt or
student ID) to complete the registration process.
3. Once your registration is successful, go to AUTOCAD, click Get started > Download.

AutoCAD User Interface


Figure 7.3 illustrate the parts of the AutoCAD workspace when you launch the software. The
user interface configuration may vary depending on user settings.

Ribbon Tabs and Panels

Application Drawing Close Button


Menu/Application Bar
Application Close Button
‘ Quick Access Toolbar Title Bar Help Button
View Cube

Model Space Drawing Area

User Coordinate System Command Prompt

Status Bar
Figure 7.2 : The AutoCAD 2022 Drafting & Annotation workspace with its various part

AutoCAD Workspace
Workspace are sets of menus, toolbars, palettes and ribbon control panels that are grouped
and organize so that you can work in custom, task-oriented drawing environment. The standard
workspace assessible are:
i) Drafting & Annotation
ii) 3D Basics
iii) 3D Modeling
Table 7.1 : Tasks and their steps to use in AutoCAD

Task Steps
Create new drawing At menu bar, click New > acadiso > Open.
Figure 7.3 : To create new drawing

Another option to create new drawing, when you open


autoCAD software, click New.

Figure 7.4 : Another option to create new drawing

Save as new drawing At menu bar, click Save As > Rename Your File > Save
Figure 7.5 : To save as new drawing

1. In this lab manual, the units used to draw the drawing are
in milimeters.
2. Type Units at the command prompt, choose Length
Type: Decimal, and Precision: 0.0, for Angle Type:
Decimal Degree, and Precision: 0, and Units to scale
inserted content: Milimeters as.

Units command

Figure 7.6 : Drawing units

1. Click orthomode, at the status bar if you want the


straight line to be in the angle of 0o, 90o, 180 o or 270o.

Or click Polar Tracking, at the status bar if you want


Create a straight line to draw the straight line to be in any angle.
2. At ribbon tabs, choose Line to create a straight line.
3. Click any point in the drawing area, for example type 100
that represents the length of the straight line.
4. Then, press enter.

Figure 7.7 : Straight line


1. At ribbon tabs, choose circle Circle to create a circle using
Create a circle
a center point and a radius.
2. Click any point in the drawing area, for example type 18
that represents the radius of the circle.

Figure 7.8 : Circle with radius of 18

1. At ribbon tabs, choose Rectangle.


2. At any point in the drawing area, type @25,50 for example,
25 and 50 represent as a width and length respectively
3. Then, press enter.

Create a rectangle

Figure 7.9 : Rectangle

To trim objects, selects the objects to be trimmed individually,


press drag to start a freehand selection path. All objects
automatically act as cutting edges.

Trim objects to meet the


edges of other objects

(a) (b)

Figure 7.10 : (a) Before trim, (b) After trim

You can create objects that represent half of the drawing,


Creates a mirrored copy of
select them and mirror them across a specified line to create
selected objects
the other half.
Figure 7.11 : Mirror object

Moves the view planar to By using pan, point the cursor to where you would like to zoom
the screen and turn the mouse wheel to zoom in and out.

Note : Hit Escape (Esc) key to cancel the commands

PROCEDURE
PART A (i): Line and Angle

Figure 7.12 : Drawing for Part A

1. Open a new drawing template as shown in Figure 7.3 or 7.4.


2. Set the units scale in millimeters as shown in Figure 7.6.
3. Type DS in the Command Prompt and choose DS (SETTINGS). Go to Object Snap Tab
and click on Endpoint, Midpoint and Center.
Figure 7.13 : Drafting setting

4. Students are required to draw the simple shape as shown in Figure 7.12.

5. Select the symbol , then click on the drawing area, drag the cursor horizontally which
o
is 0 , type 450 and press enter.
6. Draw the vertical line, type 100, press enter.
7. Draw the horizontal line, type 150, press enter
8. Draw the vertical line, type 200, press enter.
9. To draw the line with angle of 135 o, type 200, press tab, type 135, press enter.
10. Draw the horizontal line, type 175, press enter.
11. Draw the vertical line, type 120, press enter.
12. Draw the horizontal line, type 283.58, press enter.
13. Draw the vertical line to the end point of the shape, click to the point, press esc.
14. To label the dimension, type DIMSTYLE in the command prompt, select Modify as shown
in Figure 7.14.

Figure 7.14 : Dimension Style Manager


15. Select Text, at Text height, change to 15 and select Symbol and Arrow, at arrow size,
change to 15, click close.

16. Click Annotate, select , click on each end point of line as shown in Figure 7.15
and Figure 7.16.

First End Point

Figure 7.15 : First End Point of First Line

Last End Point

Figure 7.16 : Last End Point of First Line

17. Move the cursor up or down to draw the dimension of the first line as shown in Figure 7.17.
Figure 7.17 : Dimension of The First Line

18. Repeat the step 16 and 17 for other lines.


19. To zoom in and zoom out, press ctrl and scroll the button mouse up and down.
20. To drag the layout out, press the button mouse and move.
21. Save as the drawing with name Part A(i)
22. Include the image of your drawing in the Lab Sheet.

PART A (ii): Circle and Tangent

1. Repeat steps 1 until 3 in Part A (i).


2. Student is required to draw the simple shape as shown in Figure 7.18.

Figure 7.18
3. Select the symbol , then click on the drawing area, drag the cursor horizontally which
is 0o, type 255 and press enter.
4. Draw the second line, type 350 and press tab, type 30, press enter to draw the angle of
150o.

5. Select the , click on the center, radius. Click on the first point of the line, type 30,
press enter.

6. For second circle, select the , click on the center, diameter, click on the same point,
type 100, press enter.
7. For other circles, repeat the step 5 and 6.

8. To create the tangent line, select the symbol , then click on the circle with diameter
100, then press shift and right click, select the tangent. Click on the circle with radius 100

until show the tangent green symbol .


9. For other tangent lines repeat step 8.
10. Save as the drawing with name Part A(ii).
11. Include the image of your drawing in the Lab Sheet.

PART B: Floor Plan Drawing

Figure 7.19: Simple floor plan design with electrical symbols


1. Repeat steps 1 until 3 in Part A (i).

2. Choose symbol , click on the drawing area, drag the cursor vertically in straight
line, type 8600, press enter then esc. Zoom out if the drawing is too big.
3. Repeat step 2 to draw Line B horizontally with the value of 7600 in Figure 7.20.

Figure 7.20

4. Select symbol Offset on the menu bar, press enter then click on the Line B.
Bring the cursor upward, type 300 then press enter to form Line C.
5. Click on line C then bring the cursor upward with the value of 3700 and press enter to
form Line D. Continue these steps until finish as shown in Figure 7.21.

Figure 7.21
6. Choose Offset , press enter and click to line A. Bring the cursor to the right, type 300
then press enter. Repeat the steps using the Offset tool with the measurement as shown
in Figure 7.22.

Figure 7.22

7. To erase lines, select Trim and click on the unwanted lines until form a floor plan
exactly as Figure 7.23.

Figure 7.23

8. Refer to Figure 7.24, select OFFSET , press enter, click on line E, bring the cursor
downward with the value of 2500 then press enter. Click on the line F, repeat this step-in
order to draw line G with the value of 300.
9. Continue draw Line H and Line I using the Offset tool with the measurement shown in
Figure 7.24. By using the same step, click on Line J and bring the cursor to the right with
value of 900.

Figure 7.24

10. Choose Extend from Trim menu bar then click on the left end side of Line I
as well as on the right end side so that Line I become as shown in Figure 7.25. Then
press esc.

Figure 7.25
11. Select trim to erase the unwanted lines as in Figure 7.26. Then press esc.

Figure 7.26

12. Select OFFSET > Enter > click Line K > bring cursor upward > type 900 > Enter >
click Line L > bring cursor downward > type 900 > Enter > esc.

13. Refer to Figure 7.27, choose EXTEND from Trim menu bar, click the right end
side of Line M then do the same on the Line N. Then press esc.

Figure 7.27
14. Select trim to erase the unnecessary lines as Figure 7.28. Then press esc.

Figure 7.28

15. To draw a door, please refer to Figure 7.29. Select rectangle , click on point a,
move the cursor to the left, type -900,50 and press enter.

16. To draw an arc of the door, choose circle , click on point a, move the cursor, type

900, press enter and then esc. Use trim to remove unnecessary lines.

Figure 7.29

18. Select Copy on the menu bar, click on the door (rectangle and arc), press enter, click
on point a, move the cursor and click on point b. Then click on any space on the drawing
area for the extra door as shown in Figure 7.30. Press esc.
Figure 7.30

19. Select Rotate , click on the extra door, press enter, click somewhere on the right side, move

to 270 degrees then click anywhere. Use Move , select the extra door, press enter, click
anywhere above the door, then move the extra door to the point c so that the door located as
shown in Figure 7.31.

Figure 7.31

20. Figure 7.32 shows the electrical appliances to be put in the floor plan. To draw fluorescent
lamp, choose Line > draw horizontal line with value of 1000 > press esc > Copy > click
on the line > Enter > click somewhere below the line > drag the cursor below > parallel
the line > esc.
Figure 7.32

21. Draw vertical lines at both sides of the horizontal lines with the value of 300. Options to
draw the lines that can be used are by using Line, Mirror, Copy or Move.
22. To draw downlight lamp, select Rectangle > click on the drawing area > type size of
400,400 > Enter > select Circle > press shift together with right click > choose Geometric
Center > draw circle on center point in the rectangle > Enter > Esc.
23. To draw fan, choose Circle (Center, Radius) > draw circle size 400 > select Line > draw
a line from the center of the circle with value of 400 (direction of 2 o’clock) > Enter > Esc
> choose Extend > extend the line > Esc. Repeat these steps to draw a cross line in the
circle or use Mirror.
24. Type a command HATCH then click on the two quarters of the cycle to fill in the color
inside.
25. To draw the socket, select Line > draw vertical Line with length of 600 > Enter > Esc >
choose Arc (Center, Start, End) > click on the midpoint of the line > click point below the
midpoint (within the line) > click above the midpoint > choose Line to draw the cross line
at the socket.
26. After finish drawing all these symbols, place them in any part of the floor plan
appropriately, for example as shown in Figure 7.33. Tools that can be used for this step
are Copy, Move or Rotate.
Figure 7.33

27. Save as the drawing with name Part B.


28. Include the image of your drawing in the Lab Sheet.
PART C: Electrical Plan

Figure 7.34 Sample wiring plan


1. Using AutoCAD, construct an electrical plan for floor plan above. Plan must include:
i) Lighting systems
ii) Ventilation system (Fan)
iii) Socket
2. Layouts the electrical wiring for all the electrical loads (lighting system with each
corresponding switches and electric fans with their corresponding controllers)
3. Make legends for each electrical load and devices.

OUTPUT VALIDATION

Perform a modification to the floor plan in Part B based on your creativity and display the final
design in the lab sheet.
Examples: Add furniture / additional rooms

You might also like