→WELCOME EMBEDDED ROBOTIC TO OUR MAGIC WORLD! Education is not preparation for life; education is life itself. JOHN DEWEY WEE SIUW SIA CT SALWANIEE BINTI BAHAYAHKHISURIATI BINTI RAMLE
First Published Learning Module, 2022 © Wee Siuw Sia, Ct Salwaniee binti Bahayahkhi & Suriati binti Ramle All rights reserved. No part of this book (article, illustration and content) may be reproduced or used in any form or by any means, electronic or mechanical including photocopying, recording or otherwise without the prior permission of the author. This Learning Module edition is published without any assessment or editing process. The quality of this edition will be improved from time based on feedbacks received from learning activities. Published and printed by: Department of Electrical Engineering Politeknik Sultan Mizan Zainal Abidin KM. 08, Jalan Paka, 23000 Dungun, Terengganu
In the name of Allah, The Most Gracious and Merciful. All praise to Allah S.W.T for His great loving kindness and blessing, this book is successfully published. This Practical Work Assessment book is designed to assist students in performing practical works for topics Introduction to Robotic and Controller, Sensor and Actuator, Mobile Robot Design and Mobile Robot Application. This book is organized according to the Embedded Robotic (DEC50122) course syllabus for Diploma in Electronic Engineering (Communication), Diploma in Electronic Engineering (Computer) and Diploma in Electric & Electronic Engineering students under the Department of Electrical Engineering, Politeknik Sultan Mizan Zainal Abidin, Dungun, Terengganu. The authors would be like to express deepest appreciation to all those who provided the possibility in publishing this book especially friends and colleagues. Many thanks also go to the Electrical Engineering Department administration team for the support and guidance throughout the process of completing this book. This authors hope that this book will help students to accomplish the practical works in this course successfully based on the using of input-output devices, Internet of Things and processor relate to the theory. Hopefully, students and lecturers can give feedbacks to improve the quality of this Practical Work book. Thank You. PREFACE
1 2 3 4 5 LED FLASHER 05-14 READING DATA FROM INPUT PIN 15-28 DC MOTOR & SERVO MOTOR AS ACTUATOR 29-37 WIRELESS COMMUNICATION WITH BLYNK 38-55 READING DATA USING BLYNK 56-78 CONTENTS Welcome Embedded Robotic Practical Work → 6 MOBILE ROBOT DESIGN 79-85
PRACTICAL WORK 1LED FLASHER 3
PRACTICAL WORK 1 : LED FLASHER Total marks MATRIC NUMBER STUDENT NAME PRACTICAL WORK ASSESSMENT (80%) – CLO3, PLO5, P4 PRACTICAL SKILL ASSESSMENT STUDENT 1 Student able to assembles the circuit correctly Student able to write the coding correctly Student able to manipulates the coding correctly Result Housekeeping / Video presentation NO 1. 2. 3. 4. 5. /10 /10 /10 /30 /10 STUDENT 2 /10 /10 /10 /10 /30 LAB REPORT ASSESSMENT (20%) – CLO3, PLO5, P4 PRACTICAL SKILL ASSESSMENT Discussion (hardware) Conclusion NO 1. 2. /10 Discussion (software) /10 3. /10 STUDENT 1 STUDENT 2 /10 /10 /10 4
Investigate the concept and fundamentals of mobile robotic, embedded controller, sensors and actuators based on land mobile robot design. Design the concept of robot positioning, identification and communication in mobile robot control according to a standard robot organization regulation. Manipulate the application of sensor and actuator, robot identification and communication during practical work based on land mobile robot design. Demonstrate good ability in managing a well-defined engineering-based project in a cost effective manner. 1. 2. 3. 4. 1.ESP8266 Development Board Wemos D1R2 2.Breadboard 3.Red LED 4.Yellow LED 5.Green LED 6.330Ω Resistor x 3 7.Jumper Wires APPARATUS / EQUIPMENT : LEARNING OUTCOME : → 5
Go to Google search for CH340. Download the Windows CH340 Driver. Unzip the file. Run the installer which you unzipped. Plug in data USB cable to your laptop /desktop port 1. 2. 3. 4. 5. After connecting the board, open the Device Manager & note the Ports (COM & LPT) allotted to the module as Figure 1.2. WEMOS D1R2 INTRODUCTION/THEORY: ESP8266 Development Board WEMOS D1R2 as Figure 1.1 is a WIFI development board based on ESP8266. It is built resembling Arduino UNO. The D1R2 board can be configured to work on Arduino environment using BOARDS MANAGER. Therefore, it is not necessary to use a separate Arduino board and itself can be programmed on Arduino IDE. This is handy in using with IOT projects. Figure 1.1: WeMos D1R2 To power up and setup the D1R2 board, use a MicroUSB cable to connect D1R2 board with PC. Make sure that the cable is capable of handling both Data & power (some of the mobile cables can handle only power & not data). As the serial chip used on D1R2 is CH340, you need to install the corresponding drivers. Figure 1.2 Allocate COM PORT CH340 INSTALLATION 6
ARDUINO IDE INSTALLATION To start programming, you need to install Arduino IDE from the website arduino.cc under software -> download. Try to get the latest version (version 1.8.14) to be installed in your laptop. Execute the software after it is being installed and your laptop screen will display as below: Figure 1.3: Display on laptop screen after execute the software The setup() function is run once and once only at the start of the program and is where you will issue general instructions to prepare the program before the main loop runs, such as setting up pin modes, setting serial baud rates, etc. The loop() function is the main program function and runs continuously as long as our Arduino is turned on. Every statement within the loop() function (within the curly braces) is carried out, one by one, step by step, until the bottom of the function is reached, then the loop starts again at the top of the function, and so on forever or until you turn the Arduino off or press the Reset switch. To upgrade the Arduino IDE so that it can connect to the D1R2 board that we are using, please refer to the procedures in the website https://alselectro.wordpress.com/2018/04/14/wifi-esp8266-development-board-wemosd1/ 7
UPGRADE ARDUINO IDE 1. Go to FILE –> PREFERENCES on Arduino IDE. 3. Now open the Tools –> Board –> Boards Manager... Figure 1.5 Figure 1.4 8 Paste the link http://arduino.esp8266.com/stable/package_esp8266com_index.json against the Additional Boards Manager URLs ,seen at the bottom of preferences screen & click OK. 2.
Figure 1.6 Figure 1.7 9 Search for ESP8266. Now you will find the package from ESP8266 Community. Select the latest version from drop down and install it. It takes a awhile and requires internet connection. 4. Once the package is installed, you can see the list of boards under Tools Menu.Select the board as WEMOS D1R2 and select Upload Speed as 115200 5.
6. Make sure correct COM Port was selected same as registered at Ports (COM & LPT) Figure 1.8 PRECAUTION STEP: Make sure that your Arduino is powered off. You can do this either by unplugging the USB cable or by taking out the Power Selector Jumper on the Arduino board. 10
// Project 1 – LED Flasher int ledPin = D7; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, HIGH); delay(1000); digitalWrite(ledPin, LOW); delay(1000); } EXPERIMENT PROCEDURE: LED FLASHER PRACTICAL WORK 1.1 Connect the D1 board, resistor and LED as Figure 1.9 below. Make sure that your LED is connected in the right way. 1. Figure 1.9 Connection D1R2 with 1 LED 2. Power up your Arduino with connecting it via the micro-USB cable. 3. Execute the Arduino IDE and type in the following code :- 11 5. Observe the result and write in the Table 1. Press the Verify/Compile button at the top of the IDE to make sure there are no errors in your code. If it is successful, you can click the Upload button to upload the code to your Arduino. 4.
1. Connect the D1 board with 3 LED as Figure 1.10. 12 Blinking pattern with the interval period of 0.8 second. Running light pattern with the interval period of 1.2 second. PRACTICAL WORK 1.3 1.Draw the schematic diagram in Practical Work 1.2. 2. Modify the program in Practical Work 1.2 to flash the LED’s in: a. b. 3. How to ON the LED’s for 2 hours? Write your coding in the result Table 1 . PRACTICAL WORK 1.2 Connect 3 LEDs with the anode of each one going to Digital Pins D5, D6 and D7, via 330Ω resistor each. 2. Take a jumper wire from Ground to the Ground rail at the top of the breadboard and a ground wire goes from the Cathode leg of each LED to the common ground rail 3. Figure 1.10 Connection D1 Board With 4 LED
RESULT: PRACTICAL WORK PROGRAMMING CODE (PASTE YOUR CODING HERE) OBSERVATION MARKS 1.1 1.2 1.3.1 1.3.2(a) 1.3.2(b) 1.3.3 /5 /5 /5 /5 /5 /5 TOTAL /30 Table 1 13
Discuss in steps the operation to control a traffic light . (Record and submit the discussion result in video) ANALYSIS / DISCUSSION: LIGHT TIME RED GREEN 20 SECOND 40 SECOND YELLOW 10 SECOND What have you achieved / learnt in this practical work? CONCLUSION: 14
PRACTICAL WORK 2 R E A D I N G D A T A F R O M I N P U T P I N 15
Total marks MATRIC NUMBER STUDENT NAME PRACTICAL WORK ASSESSMENT (80%) – CLO3, PLO5, P4 PRACTICAL SKILL ASSESSMENT STUDENT 1 Student able to assembles the circuit correctly Student able to write the coding correctly Student able to manipulates the coding correctly Result Housekeeping / Video presentation NO 1. 2. 3. 4. 5. /10 /10 /10 /30 /10 STUDENT 2 /10 /10 /10 /10 /30 LAB REPORT ASSESSMENT (20%) – CLO3, PLO5, P4 PRACTICAL SKILL ASSESSMENT Discussion (hardware) Conclusion NO 1. 2. /10 Discussion (software) /10 3. /10 STUDENT 1 STUDENT 2 /10 /10 /10 PRACTICAL WORK 2: READING DATA FROM INPUT PIN 16
Investigate the concept and fundamentals of mobile robotic, embedded controller, sensors and actuators based on land mobile robot design. Design the concept of robot positioning, identification and communication in mobile robot control according to a standard robot organization regulation. Manipulate the application of sensor and actuator, robot identification and communication during practical work based on land mobile robot design. Demonstrate good ability in managing a well-defined engineering-based project in a cost effective manner. 1. 2. 3. 4. APPARATUS / EQUIPMENT : LEARNING OUTCOME : → 17 ESP8266 Development Board Wemos D1 LED x 3 330Ω Resistor x 3 10K Ω Resistor Push button / Tact switch TCRT5000 IR Sensor HR-Ultrasonic Sensor Gas Sensor MQ2 LDR Jumper Wires 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
void setup { pinMode(D6, INPUT); // set pin to input } void loop { Variable_name = digitalRead(pin); } A. PUSH BUTTON / TACT SWITCH The pins on the Arduino can be configured as either inputs or outputs. To configure it, we use the instruction pinMode(pin, INPUT) or pinMode(pin OUTPUT) to perform the task. To set a particular pin (says pin D6) as input pin, the code is as:- INTRODUCTION / THEORY: Often it is useful to steer an input pin to a known state if no input is present. This can be done by adding a pullup resistor (to +5V), or a pulldown resistor (resistor to ground) on the input. A 10K resistor is a good value for a pullup or pulldown resistor. Figure 2.1 Pull-up And Pull-down Resistor To read the input pin, the code is as below:- 18
VCC - Vin GND -GND ECHO - D4 TRIG - D5 B. ULTRASONIC SENSOR Ultrasonic is a distance measurement and an object detection sensor. HC-SR04 ultrasonic sensor can detect range accuracy and fairly stable readings at a very low cost. It requires two digital I/O pins to interface with it. An ultrasonic sensor is created based on the principle of echolocation used by animals. Since the ultrasonic sensor uses sonar to determine the distance to an object, its operation is not affected by sunlight and spotlight which will affect the readings of any infrared distance sensors. However acoustically soft materials such as clothes can be difficult to detect. Figure 2.2 Pin Configuration Of An Ultrasonic Sensor Distance Calculation Of A Ultrasonic Sensor In order to generate the ultrasound you need to set the Trig on a High State for 10 µs. That will send out an 8 cycle sonic burst which will travel at the speed sound and it will be received in the Echo pin. The Echo pin will output the time in microseconds the sound wave traveled. For example, if the object is 10 cm away from the sensor, and the speed of the sound is 340 m/s or 0.034 cm/µs the sound wave need to travel about 294 u seconds. The Echo pin will be double that number because the sound wave needs to travel forward and bounce backward. So in order to get the distance in cm we need to multiply the received travel time value from the echo pin by 0.034 and divide it by 2. 19
C. INFRARED (IR) SENSOR Distance measuring is very easy using IR sensor. A beam of IR is transmitted to target and reflected beam is captured by the photodiode. Photodiode measures the intensity of light (here mostly IR light). IR diode does not measure intensity of just IR light but it is also sensitive to visible light. Intensity of IR light recorded by photodiode represents the distance between target and sensor. Closer the target is the higher intensity of light is recorded and reduces with increase in distance. TCRT5000 IR Module has 4 pins: Gnd - Connect to ground on D1 board VCC - Connect to 5v on D1 board DO - Connect to digital Pin on Arduino board AO - Connect to analog Pin on Arduino board Use either AO pin or DO pin based on project. Example for digital project use DO pin. Figure 2.3 Pin Configuration Of A Infrared Sensor 20 D. GAS SENSOR MQ2 Detects or measure Gases like LPG, Alcohol, Propane, Hydrogen, CO and even methane Air quality monitor Gas leak alarm Safety standard maintenance Maintaining environment standards in hospitals The MQ-2 Gas sensor can detect or measure gasses like LPG, Alcohol, Propane, Hydrogen, CO and even methane. This sensor module comes with a Digital Pin which makes this sensor to operate even without a microcontroller and that comes in handy when you are only trying to detect one particular gas. When it comes to measuring the gas in ppm the analog pin has to be used, the analog pin also TTL driven and works on 5V and hence can be used with most common microcontrollers. Applications: VCC - Vin GND -GND A0 - A0 Figure 2.4 Pin Configuration Of A Gas Sensor MQ2
PRECAUTION STEP: Always make sure that your circuit is powered off (recommend) during uploading your coding. You can do this by disconnected the jumper on the Arduino board to your circuit. E. LDR (LIGHT DETECTOR RESISTOR) LDR is a light sensitive resistor, the resistance will decrease when the surface is expose to light. It is widely used to detect Day or Night, example in automatic car porch light. It is nonlinear sensor, when it is not expose to light, the resistance can goes up to 500K ohm. Whit normal room condition, it will be 10 to 20K ohm when the light is not illuminate. When light is activated, the resistance drops to 1K or less. Figure 2.5 LDR sensor SN-LIGHT-MOD is a photosensitive resistor module, suitable to detect environmental light intensity and ambient brightness. Its sensitivity can be tuned with an on board potentiometer, where turning it clockwise will increase the sensitivity and increase the detection range. Figure 2.6 LDR sensor module 21
EXPERIMENT PROCEDURE: READING DATA FROM INPUT PIN PRACTICAL WORK 2.1 Connect the D1 board, resistors and LEDs as Figure 2.7 below as in the previous laboratory work. Make sure that your LEDs are connected in the right way. 1. Figure 2.7 LED Connection 22 Figure 2.8 Connection between button and LED Write a program to flash the LEDs in running pattern with the interval period of 0.8 seconds. You may refer back to the previous laboratory work as guidance to do the coding. 2. 3. Power up your Arduino by connecting the USB cable to your laptop. Verify your program to make sure that there is no error in the coding. Then, upload your program to the Arduino. Make sure your LEDs flash in the right way (running light). 4. Now, connect an input switch to pin D2 in Arduino as below with the output LEDs remain connected: 5. With the help of the program in File -> Examples -> Digital -> Button, modify the program to flash the LEDs in running pattern when the switch is pressed. (The LEDs are OFF at the beginning). 6. 7. Observe the result and write the result in Table 1.
PRACTICAL WORK 2.2 Connect the Wemos D1 board, MQ2 and buzzer as Figure 2.8 below. Make sure that your sensor is connected in the right way. 1. Figure 2.8 MQ2 gas sensor connection 23 2. Power up your board and connect the USB cable. 3. Open up the Arduino IDE and type in the following code (next page) :- Press the Verify/Compile button at the top of the IDE to make sure there are no errors in your code. If it is no error on the coding, you can proceed with clicking the Upload button to upload the code to your board. 4. Light up a lighter in front of the MQ2 and click the Serial monitor to observe the gas concentration. 5. 6. Observe the result and write the result in Table 1
24 int buzzer = D4; int redLed = D5; int smokeA0 = A0; int sensorThres = 400; // Your threshold value void setup() { pinMode(redLed, OUTPUT); pinMode(buzzer, OUTPUT); pinMode(smokeA0, INPUT); Serial.begin(9600); } void loop() { int analogSensor = analogRead(smokeA0); Serial.print("Pin A0: "); Serial.println(analogSensor); if (analogSensor > sensorThres) // Checks if it has reached the threshold value { digitalWrite(redLed, HIGH); tone(buzzer, 1000); // Send 1KHz sound signal... delay(1000); // ...for 1 sec noTone(buzzer); // Stop sound... delay(1000); // ...for 1sec } else { digitalWrite(redLed, LOW); } delay(100); }
Figure 2.9 Ultrasonic sensor connection TRIG > D3 ECHO > D2 VCC and GND had been connected internally. PRACTICAL WORK 2.3 Connect the D1 board and HC-SR04 ultrasonic sensor as Figure 2.9 below. Make sure that your sensor is connected in the right way. 1. 25 Figure 2.10 Serial Monitor Serial Monitor 2. Power up your board and connect the USB cable. 3. Open up the Arduino IDE and type in the following code (next page) :- Press the Verify/Compile button at the top of the IDE to make sure there are no errors in your code. If it is not error on the coding, you can proceed with clicking the Upload button to upload the code to your board. 4. Put an obstacle in front of the ultrasonic and click the Serial monitor to observe the distance between ultrasonic and obstacle. 5.
26 const int trigPin = D3; // defines pins numbers const int echoPin = D4; long duration; // defines variables int distance; void setup() { pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output pinMode(echoPin, INPUT); // Sets the echoPin as an Input Serial.begin(9600); // Starts the serial communication } void loop() { digitalWrite(trigPin, LOW); // Clears the trigPin delayMicroseconds(2); digitalWrite(trigPin, HIGH); // Sets the trigPin on HIGH state for 10 microseconds delayMicroseconds(10); digitalWrite(trigPin, LOW) duration = pulseIn(echoPin, HIGH); // Reads the echoPin, returns the sound wave travel in us distance= duration*0.034/2; // Calculating the distance Serial.print("Distance: "); // Prints the distance on the Serial Monitor Serial.println(distance); } DISTANCE from object OUTPUT CONDITION < 5 cm 1ST LED ON > 5cm && < 15 cm 2ND LED ON 15cm and above 3RD LED ON Table 1 PRACTICAL WORK 2.4 Modify the program in Practical Work 2.3 according to the condition given in the Table 1 below: 1. 2. Observe the result and write the result in Table 2.
RESULT: PRACTICAL WORK PROGRAMMING CODE (PASTE YOUR CODING HERE) OBSERVATION MARKS 2.1 (button as input) /6 /6 /6 /6 (demo) /6 (coding) TOTAL /30 Table 2 2.2 (gas sensor as input) 2.3 (Ultrasonic as input) 2.4 (Ultrasonic with different distance) 27
Discuss in steps the operation to control an automatic street lamp by using MORDET. Connect the circuit, record the video and paste the coding in the report. CONDITION LIGHT DAY NIGHT ON OFF What have you achieved / learnt in this practical work? CONCLUSION: ANALYSIS / DISCUSSION: 28
PRACTICAL WORK 3 DC MOTOR AS ACTUATOR DC MOTOR 29
Total marks MATRIC NUMBER STUDENT NAME PRACTICAL WORK ASSESSMENT (80%) – CLO3, PLO5, P4 PRACTICAL SKILL ASSESSMENT STUDENT 1 Student able to assembles the circuit correctly Student able to write the coding correctly Student able to manipulates the coding correctly Result Housekeeping / Video presentation NO 1. 2. 3. 4. 5. /10 /10 /10 /30 /10 STUDENT 2 /10 /10 /10 /10 /30 LAB REPORT ASSESSMENT (20%) – CLO3, PLO5, P4 PRACTICAL SKILL ASSESSMENT Discussion (hardware) Conclusion NO 1. 2. /10 Discussion (software) /10 3. /10 STUDENT 1 STUDENT 2 /10 /10 /10 PRACTICAL WORK 3: DC MOTOR AS AN ACTUATOR 30
Investigate the concept and fundamentals of mobile robotic, embedded controller, sensors and actuators based on land mobile robot design. Design the concept of robot positioning, identification and communication in mobile robot control according to a standard robot organization regulation. Manipulate the application of sensor and actuator, robot identification and communication during practical work based on land mobile robot design. Demonstrate good ability in managing a well-defined engineering-based project in a cost effective manner. 1. 2. 3. 4. APPARATUS / EQUIPMENT : LEARNING OUTCOME : → 31 MORDET Trainer set 9V Battery Jumper Wires 1. 2. 3.
A direct current, or DC, motor is the most common type of motor used in building of mobile robot. DC motors normally have just two leads, one positive and one negative. If you connect these two leads directly to a battery, the motor will rotate. If you switch the leads, the motor will rotate in the opposite direction. To control the direction of the spinning of DC motor, without changing the way that the leads are connected, you can use a circuit called an H-Bridge. A H-bridge is an electronic circuit that can drive the motor in both directions. H-bridges are used in many different applications, one of the most common used is to control motors in robots. It is called an H-bridge because it uses four transistors connected in such a way that the schematic diagram looks like an “H.” You can use discrete transistors to make this circuit or using H-bridge IC (L298) to drive the motors. INTRODUCTION / THEORY: Figure 3.0 H-Bridge connection for a DC motor 32 Figure 3.1 L298 IC and the L298N motor driver module
L298 is a high-power version of L293 motor driver IC. It is a high voltage, high current, dual full-bridge driver designed to accept standard TTL logic levels (Control Logic) and drive inductive loads such as relays, solenoids, DC and Stepper motors. Two enable inputs are provided to enable or disable the device independently of the input signals. The emitters of the lower transistors of each bridge are connected and the corresponding external terminal can be used for the connection of an external sensing resistor. The table below shows how to program the bidirectional Motor Controller Circuit (Hbridge connection) using L298N module for a motor. INPUT A INPUT B 0 1 DESCRIPTION 0 1 1 0 1 1 Motor stop Clockwise Anti Clockwise Motor stop 33
IN1 = D5 IN2 = D4 GND = GND 5V = 5V void setup { pinMode(motorPin1, OUTPUT); //Set pins as outputs pinMode(motorPin2, OUTPUT); } EXPERIMENT PROCEDURE: DC MOTOR AS AN ACTUATOR PRACTICAL WORK 3.1 1. Connect the D1 board, L298N motor driver module and motors as Figure 3.2 below. Figure 3.2 DC motor connection via L298N module To set pins to control a motor, the code is as below: - To turn on a motor with clockwise and ant-clockwise rotation, the code is as below: - 34 Then, write the coding below to turn on a motor in clockwise, anti-clockwise and stop the motor. 2.
void loop { digitalWrite(motorPin1, HIGH); //motor rotates clockwise for 2 sec digitalWrite(motorPin2, LOW); delay(2000); digitalWrite(motorPin1, LOW ); //motor stops for 200 µ sec digitalWrite(motorPin2, LOW); delay(200); digitalWrite(motorPin1, LOW); //motor rotates anti-clockwise for 2 sec digitalWrite(motorPin2, HIGH); delay(2000); digitalWrite(motorPin1, LOW ); //motor stops for 200 µ sec digitalWrite(motorPin2, LOW); delay(200); } 3. Observe the result and write the result in Table 1. Express the operation in a flow chart. 35 PRACTICAL WORK 3.2 Connect the switch button to control the fan motor 1 and fan motor 2. When the switch is PRESS, the motor will operate as practical 3.2. 1. 2. Connect another DC motor to the output terminal (OUT3 and OUT4) of the driver module and it will be controlled by input terminal IN3 and IN4. Write a program to turn two motors on and off according to the operation below: 1. 2. BOTH MOTOR 4 sec clockwise > REST for 1 sec > BOTH MOTOR 4 sec anti-clockwise > REST for 2 sec > MOTOR 1 clockwise for 3 sec > REST for 2 sec > MOTOR 2 anticlockwise for 3 sec > REST for 1 sec > repeat. PRACTICAL WORK 3.3 Observe the result and write the result in Table 1. Express the operation in a flow chart. 3.
RESULT: PRACTICAL WORK PROGRAMMING CODE (PASTE YOUR CODING HERE) OBSERVATION MARKS 3.1 /5 (demo) /5 (flowchart TOTAL /30 Table 1 3.2 3.3 /5 (demo) /5 (flowchart) /5 (demo) /5 (flowchart & coding) 36
An eco-friendly house is using a sensor to control fan in the house. The fan will only switch ON when there are people in the room. Design the room controller system. Use a suitable sensor to detect people enter the room. What have you achieved / learnt in this practical work? CONCLUSION: ANALYSIS / DISCUSSION: 37
PRACTICAL WORK 4 BLYNK IOT PLATFORM WIRELESS COMMUNICATION WITH BLYNK 38
Total marks MATRIC NUMBER STUDENT NAME PRACTICAL WORK ASSESSMENT (80%) – CLO3, PLO5, P4 PRACTICAL SKILL ASSESSMENT STUDENT 1 Student able to assembles the circuit correctly Student able to write the coding correctly Student able to manipulates the coding correctly Result Housekeeping / Video presentation NO 1. 2. 3. 4. 5. /10 /10 /10 /30 /10 STUDENT 2 /10 /10 /10 /10 /30 LAB REPORT ASSESSMENT (20%) – CLO3, PLO5, P4 PRACTICAL SKILL ASSESSMENT Discussion (hardware) Conclusion NO 1. 2. /10 Discussion (software) /10 3. /10 STUDENT 1 STUDENT 2 /10 /10 /10 PRACTICAL WORK 4: WIRELESS COMMUNICATION WITH BLYNK 39
Investigate the concept and fundamentals of mobile robotic, embedded controller, sensors and actuators based on land mobile robot design. Design the concept of robot positioning, identification and communication in mobile robot control according to a standard robot organization regulation. Manipulate the application of sensor and actuator, robot identification and communication during practical work based on land mobile robot design. Demonstrate good ability in managing a well-defined engineering-based project in a cost effective manner. 1. 2. 3. 4. APPARATUS / EQUIPMENT : LEARNING OUTCOME : → 40 MORDET Trainer Jumper Wires Smartphones 1. 2. 3.
Blynk App - allows to you create amazing interfaces for your projects using various widgets we provide. Blynk Server - responsible for all the communications between the smartphone and hardware. You can use our Blynk Cloud or run your private Blynk server locally. It’s open source, could easily handle thousands of devices and can even be launched on a Raspberry Pi. Blynk Libraries - for all the popular hardware platforms - enable communication with the server and process all the incoming and out-coming commands. Blynk was designed for the Internet of Things. It can control hardware remotely, display sensor data, store data and visualize it and do many other cool things. There are three major components in the platform: INTRODUCTION / THEORY: Figure 4.1 Concept of wireless communication in Blynk 41
A. GETTING STARTED WITH BLYNK CLOUD 1. Login at https://blynk.cloud/dashboard/login . Select Create new account 42 3. After creating a new account your Blynk dashboard login appear like Figure 4.2 below. Sign up and you will get an activation link in your email. You must create a password and login again. 2.
4. Start creating your first template by add New Template Figure 4.2 Blynk dashboard after creating an account 5. Create New Template by fill all the details 43 ESP 8266 WiFi LED Blinking Practical Work 4
6. Go to Datastreams 44 7. Click + New Datastream add the Digital pin that your LED is currently using. 8. Fill the details for your Digital Datastream Insert the digital pin number 9. Save the template
10. Go to the Search icon and click +New Device 11. Add new device and pick template to choose your previous template 12. Choose template Practical Work 4 as your setup before to create new device 451
13. After choose template, click create 46 Go to Device info and copy the TEMPLATE_ID, DEVICE_NAME and AUTH_TOKEN to be use later 14.
B. GETTING STARTED WITH BLYNK AT ARDUINO IDE 1. Go to https://examples.blynk.cc 2. Add the info by copy the code that you got previously into the respective input field. insert your WiFi SSID and password here 4. Change your WiFi SSID and password at ARDUINO IDE code 6. Verify and upload it to your Wemos D1R2 board 47 Copy the code by clicking the copy example and paste the code at your ARDUINO IDE new sketch 3. In the Arduino IDE, you need to install Blynk Libraries to make sure your smart phone can be connected Blynk application. Refer the website below for the library’s installation. References: https://github.com/blynkkk/blynk-library 5.
C. GETTING STARTED WITH BLYNK IOT APPLICATION USING SMART PHONES 1. Install Blynk IOT in your smart phone 2. Click Log In 3. Insert the email and password that use in Blynk.cloud 48 4. Make sure the WEMOS board is connected to WiFi. Please check the WiFi name and Password in Arduino coding. Make sure the WiFi is ON. The WEMOS board connection is show here. Offline means the board does not connect to WiFi. Solution: 1. 2.