0% found this document useful (0 votes)
90 views

Lab Report IoT Group 7

This document contains the output from Group 7's Internet of Things assignment 3. It includes the group member names and matric numbers, pictures and descriptions of sensors and actuators in the kit, observations and explanations of coding examples, and a Knight Rider coding example with explanations of each line. It concludes with a discussion of over 100 words on the results and key learnings around sensors, actuators, and coding examples from the lab exercise.

Uploaded by

Amir Shazmil
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views

Lab Report IoT Group 7

This document contains the output from Group 7's Internet of Things assignment 3. It includes the group member names and matric numbers, pictures and descriptions of sensors and actuators in the kit, observations and explanations of coding examples, and a Knight Rider coding example with explanations of each line. It concludes with a discussion of over 100 words on the results and key learnings around sensors, actuators, and coding examples from the lab exercise.

Uploaded by

Amir Shazmil
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

CSW33703: INTERNET OF THINGS ASSIGNMENT 3: OUTPUT

GROUP NAME : GROUP 7

LABORATORY 3 : OUTPUT

MEMBERS’ NAMES & MATRIC NO :

NO NAME NO. MATRIC

1 MUHAMMAD SHAZMIL BIN MOHD SABILAN 047398

2 AHMAD NAZLAN B MOHD ISMAIL 047967

3 MUHAMMAD AZHAN ZAKARIA 047384

4 AHMAD SHAFIQ BIN AKRAM 041644

5 MOHAMAD IMRAN BIN MOHD AYOB 046995


A. (Q2) Pictures and names of sensors and actuators in the kit.

1. Sensor : A sensor is a device that detects and responds to some type of input
from the physical environment.

Ultrasonic Sensor

Example of Sensors include :-

 Fix Distance- Alarm


 Distance Measurement
 Smart Blind Stick

2. Actuator : An actuator is a device that moves or controls some mechanism. An


actuator turns a control signal into mechanical action such as an electric motor.

Servo Motor

Examples of Actuators include:-

 Electric Motor
 Solenoids
 Hard Drive Stepper Motors
 Comb Drives
B. (Q3)Observation of Q3-C.Explain the observation in no less than 20 words.

Before we upload the coding, ‘on’LED on the board are in the ‘ON’ state. ‘on’LED
light up because the board is connected to power supply from computer. For ‘L’ LED,
‘tx’ LED and ‘rx’ LED, the LED not light up and in off condition. This because the
coding that reside in it were unchanged or we could say has no instruction in it yet.
C. (Q3) Explain EACH line of the code in Q3-D.

Coding Description

void setup() For the setup to function once you run by


press the button ‘reset’ or ‘power’ on the
board.

pinMode(LED_BUILTIN, OUTPUT) To initialize the digital pin


LED_BUILTIN as an output.

void loop() For loop to function when run over and


over again until forever unless some
changes made.

digitalWrite(LED_BUILTIN, HIGH) For turn the LED on and “HIGH” is the


voltage level we use for it to turn on.

delay(1000) Time for the LED to blink again by wait


by what second(example:a second)

digitalWrite(LED_BUILTIN, LOW) For turn the LED off and “LOW” is the
voltage level we use for it to turn off.

delay(1000) Time for the LED to blink again by wait


by what second(example:a second)
D. (Q3) Observation of Q3-I. Explain the observation in no less than
20 words.

After we upload the coding, we find out that ‘on’LED still light up and in on
condition.‘L’ LED is ‘ON’ for a second and after several seconds ,the ‘TX’ and ‘RX’
LED is blink but only a few second and then both of them were light off. Then,the only
LED that are still blinking is ‘L’ LED that continue to light up or in on condition. We
figure out that this was occur due to our coding that put them some instruction so they
were execute it and the result was obtained. In term of coding, we might be careful from
do some logic or syntax error by always check the coding lines by lines. Also, in term of
handling the Arduino,be careful in arrangement of components on the board to prevent
the it from misfunction and also from make it from break down.
E. (Q4) Your code for Knight Rider complete with explanation for EACH line

CODE EXPLAINATION
This code is an array declaration to declare that
int pinArray[] = {2, 4, 5, 7, 10};
the specific digital input output pins on board

To initialize that count is an integer with the


int count = 0;
initiate value zero

To initialize that timer is an integer with the


int timer = 5;
initiate value 5

The setup function runs once when you press


void setup(){
reset or power the board

This is for statement to loop the count from 0 to


for (count=0;count<5;count++) {
5. It’s start from 0 and count will plus 1 after
complete the for statement until count reach 4

This is continue from for statement to output the


pinMode(pinArray[count], OUTPUT);
pinmode value from count.

The loop function runs over and over again


void loop() {
forever

This is for statement to loop the count to get


for (count=0;count<4;count++) {
count value . It’s start from 0 and count will plus
1 after complete the for statement until count
reach 3
Turn the LED on (HIGH is the voltage level)
digitalWrite(pinArray[count], HIGH);
PinArray[count] is the pin value get from for
statement from count

This will wait for timer value(second) before


delay(timer);
run the next code

Turn the LED on (HIGH is the voltage level)


digitalWrite(pinArray[count + 1], HIGH);
PinArray[count + 1] is the pin value get from
for statement from count and the value will
plus by 1
This will wait for timer value(second) before
delay(timer);
run the next code

Turn the LED off by making the voltage LOW


digitalWrite(pinArray[count], LOW);
PinArray[count] is the pin value get from for
statement from count

This will wait for timer value(second) which is


delay(timer*2);
the value will multiple by 2 before run the next

} code

This is for statement to loop the count to get


for (count=5;count>0;count--) {
count value . It’s start from 5 and count will
minus 1 after complete the for statement until
count reach 1
Turn the LED on (HIGH is the voltage level)
digitalWrite(pinArray[count], HIGH);
PinArray[count] is the pin value get from for
statement from count

This will wait for timer value(second) before


delay(timer);
run the next code

Turn the LED on (HIGH is the voltage level)


digitalWrite(pinArray[count - 1], HIGH);
PinArray[count - 1] is the pin value get from for
statement from count and the value will minus
by 1
This will wait for timer value(second) before
delay(timer);
run the next code

Turn the LED off by making the voltage LOW


digitalWrite(pinArray[count], LOW);
PinArray[count] is the pin value get from for
statement from count

his will wait for timer value(second) which is


delay(timer*2);
the value will multiple by 2 before run the next

} code

}
F. Results and Discussion of the whole lab exercise (>100 WORDS).

In the lab of IOT, what we get results and discussion of the whole lab exercise
are more about the components inside IT separate between sensors and actuators. The
sensor means a transducer the converts a physical stimulus from one form into a more
useful form to measure the stimulus. Two basic of sensors are analog and discrete.
Some of example of sensor are temperature, RFID, proximity, vision, compass and
another more.

Then, actuators are about hardware device that convert controller command
signal into a change in a physical parameter. The change is usually mechanical such as
position or velocity. An actuator is also a transducer because it changes one type of
physical quantity into some alternative form.

An actuator Is usually active by a low-level command signal, so an amplifier


may be required to provide sufficient power to drive the actuator. Some of example of
actuators are Electrical actuators, hydraulic actuators and Pneumatic actuators.

After that, we learn about Programming the Arduino. We start with Start the
Arduino IDE software on the computer. After that, Connect the Arduino with the
computer using the USB cable provided and than observe all LEDs on the board. Jot
down all their state (ON or OFF) also Write the code inside the Arduino. That are
summary what we learning in the lab.

The result Arduino for knight rider is the led is blinking from led first to fifth led
and the blinking runs continuously. The led become blink after the coding is compile
and run into the board via Arduino software.

In the conclusion, the results of the whole lab exercise are acquire about the
components inside IT separate between sensors and actuators also we learn about
Programming the Arduino. We very liked it what we learn in lab exercise.
G. Conclusion. (>50 words)

In conclusion, this lab test has helped us to learn how to assemble the Arduino
components and implement the Arduino software such as “Knight Rider”. We also
learn that we need to assemble the right component on the Arduino board and use the
right software coding or otherwise LEDs on the Arduino board will not light up as
being instruct by our lecture. Therefore, precision it is very important to make sure the
lab test to run smoothly without any or less error. During the lab test, we’ve learned
how to encapsulate these state machines into C++ classes to make sure the code is
simple and compact. Arduino is small but surprisingly powerful little processor.
Finally, after conduct the lab test we have learned more about iot (internet of thing)
subject.

You might also like