Kumpulan 31: Iot Based Object Counting and Colour Detection
Kumpulan 31: Iot Based Object Counting and Colour Detection
Norafiqah Nazirah binti Jailani, Noor Farhana binti Md Husin, Nor Farisha Diana
binti Rosli,
Muhammad Shukri bin Ahmad
1.0 INTRODUCTION
Student in school nowadays are still less exposed to Industry 4.0 does not
clearly related it the subject taken by the student. This problem can cause
lack of students in the field of engineering. They also cannot visualize the
concept of what they a supposed to learn based on their subject and this
leads them to stop learning about the interesting application around them.
Page | 1
Technology on their hand but does not adequately explored.
Page | 2
very easy way to get start working with embedded electronics.
4.0 METHODOLOGY
Infrared sensor is used to detect the movement of the object and IR Led
will be on. In the same time, colour sensor will detect the colour of the load
and RGB Led will be light up depends the colour of the object. Colour sensor
only detect three colour which is red, green and blue. Every detection of the
infrared sensor and colour sensor will be sort and count the object
depending on colour detection. IoT is implemented by using NodeMCU to
collect the data and display on the smartphone. NodeMCU collect data and
send it to the local server. Local server the upload the data to the Blynk and
display it by using virtual connection.
Page | 3
Figure 2 : Flowchart of system in this project
Blynk app is the Platform for IOS and android to control microcontroller over
the internet. It allows to create interface by using various widgets. To set up
for server, use Blynk cloud for easily handle thousands of devices and be
launched on microcontroller. Set up Blynk Libraries to enable communicates
with server and process all the incoming and outcoming commands.
Connection between Arduino MEGA, NodeMCU and others
component.
Reset
Sensor
System
NodeMCU
Infrared
OLED I2C Colour Sensor Sensor
Display
Page | 4
Table 1 : Programming and explanation of
the coding
No Programming Explanation
.
#include <SoftwareSerial.h>
SoftwareSerial
At NodeMCU, attach library
softSerial(D9,D10);
softwareserial and declare
void setup() {
1. RX=D9 and TX=D10. softSerial
softSerial.begin(9600); }
sent to Arduino a character ‘H’
void loop(){
and start proceed the task.
softSerial.print('H');
Delay(1000); }
#include <SoftwareSerial.h>
SoftwareSerial softSerial(10,11);
At Arduino MEGA, attach
(softSerial.begin(9600);
softwareSerial library and
Void loop()
2. declare RX=10 and TX=11.
{char InChar;
softSerial receive character ‘H’
InChar = softSerial.read();
and start proceed the task.
Serial.println(InChar);
if(InChar == 'H')}
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include Including library for Blynk and
<BlynkSimpleEsp8266.h> Wi-fi connections. Enter token
3. char auth[] = fot auth and Wi-fi ssid and
"eec4aaf106134e43bfbc66aee9 password for Blynk to access
86xxxx"; Wi-fi.
char ssid[] = "Wi-fi name";
char pass[] = "password Wi-fi";
#include <SPI.h>
#include <Wire.h> Library for declaration the I2C
6.
#include <Adafruit_GFX.h> display based on SSD1306.
#include <Adafruit_SSD1306.h>
Page | 5
5.0 RESULT & DISCUSSION
In this chapter, it is explained about the results that have been obtained
through some testing in this project.
Table 2 : Result
Colour
Movement Counter to Display in Blynk
Detectio
detection counting (IoT)
n
Number of R
RED (R)
detection
GREEN Number of G
Obstacle
(G) detection
Number of B
BLUE (B)
detection
No
- -
Obstacle
From Table 2, there had two conditions that movement detected obstacle or
no obstacle. When movement detected by IR sensor data achieved neither
obstacle nor no obstacle. After movement detected, colour sensor active for
colour detected. There only three colours detected which is red, green and
blue. Data of colour sensor received will continue to counter to counting
system for kept data for display at Blynk LCD Widget. If movement detected
no obstacles, automatically on-activated follow by all device also non-
activated. In both conditions, display on Blynk LCD Widget always display the
same as obstacle condition, no data being transfer or received.
6.0 CONCLUSION
Based on the results obtained, this can help in the learning process in the
student to understand the subject STEM very well. This project can provide
additional support for interest in their education. With the results of this
project, the objective is achieved as a kit learning project can give an impact
in attracting students to understand the learning process more efficiently.
7.0 APPENDICES
[3]M. H. Land, "Full STEAM ahead: the benefits of integrating the arts into
STEM", Procedia Computer Science, vol. 20, pp. 547-552, 2013
Page | 7
2