The End of Long Journey

First of all, let me deliver my deepest sorry for my course lecturer and his assistant for not publishing this post on time. I am such a perfectionist and I was busy in making good documentation for this project that I finally late in publishing this last journal.
Hello, again! This post will be the longest post that I have ever made and will be the last post of my Human-Computer Interaction course. Yes, it has been last two weeks of my sixth semester and I soon will be leaving my third year of university. Wow, how time flies. I already have to think about my thesis. But I have to pass this course first by typing whole report for my last mission which is Smart Traffic Light. This post will be so long because I will resume our long journey in one post so my lecturer will not find it hard to check my final report. Check it out!


We raise traffic jam as our main background for this project because the traffic in Bandung is getting worse day by day. Duh. As an addition, I will give you some facts about Indonesia and its traffic congestion. Fact 1. Did you know? Jakarta, Indonesia is the third country with the worse congestion in the world. The source of this fact is Business Insider and the article can be accessed here. Fact 2 and Fact 3. Did you know? According to Indonesia Ministry of Transportation, Bandung is the third city with the worse congestion and its volume to capacity (VC) ratio is 0.85 which is high enough because the highest value of VC ratio is 1. Let's go to the last fact which is Fact 4. Did you know? There are several traffic light that has wrong calculation in Indonesia. This wrong calculation could lead bad traffic congestion. You can read the fact here, and the relation between bad traffic light calculation and traffic congestin here, here and here. Based on these facts, we, team FAT (Fanni, Alif and There), comes up with the idea of Smart Traffic Light. Why smart? Because this traffic light has its own calculation to give optimal time for every red light and green light in traffic light. In short, this system can manage traffic with its unique calculation. We hope so.

A L T E R N A T I V E    T R O U B L E S H O O T I N G
As an engineer (we soon to be engineer, aren't we?), we have to define several concepts to combat this traffic congestion in Indonesia, especially Bandung. As an engineer (again), we need to analysis the feasibility of each concept and choose the most proper concept. So we do it! We defined the system requirements as mold for our concepts, then we define three concepts the choose the best among them. Below are the functional requirement of our Smart Traffic Light. 
  • System able to receive input from sensor
  • System able to process data from input
  • System able to calculate and decide the duration of red light and green light
  • System able to send data from a lamp to another lamp which means all of the traffic light is being integrated.
From those functional requirement above, we make the Functional Block Diagram to illustrate all of the functional requirement.

Using those system requirements, we make three alternatives concepts from brainstorming process. Here you go!

A. Fully-Integrated System
In this concept, every existing car has to be equipped with a chip that allow every car communicate or send data to the traffic light. This concept offers a high accuracy because the input not only come from a sensor in a traffic light but also from the car. Yet unfortunately, the cost of this concept is too high. 

B. Partially-Integrated System
This concept is using research from Harris County as a theoretical basis. This research states that if there are minimal 30% vehicles that can communicate with the system, then those who don't apply the system also get benefit. The cost of this concept is medium. 

C. Smartphone-Based System
With this concept, the system will be using phone as its basis device. This system will be implemented like waze or google maps.

Every concept has its own plus and minus yet we have to choose one to be implemented. Then we decide the aspects that we will give score for its aspect and concept. The score will be give in scale 1-5 and there are six aspects as you can see from the table below. Coverage is talking about the scope of data, downtime is talking about at the time the system is not able to operate, accuracy is for data, cost well.. about money, risk of course about risk and ease of effective implementation is talking about the implementation. 
From the table above, we all know that the chosen concept is B. Partially-Integrated System. Yeay!

D E S I G N    S P E C I F I C A T I O N
This part will be talking about the system specification which are, input, output, component and its protocol. These things will be illustrate using the diagram below. There will be sensor on our smart traffic light which will detect the existing of vehicles and give input to the system. The input will be used for calculation that will give time as the output. The time will be duration for red light and green light. The duration then will be send to the internet and will be displayed on a website. 
Our system will be modeled using a microcontroller which is Arduino UNO and other components that we can afford a.k.a low cost he he he. You can see the prototype diagram below. The detail will be explained in next part. 

H A R D W A R E    D E S I G N
I will explain the detail of the prototype here. We will be using Arduino UNO, LED light, seven segments, Ultasonic Sensor HC-SR04, Servo Motor, Wi-Fi Module ESP8266, and breadboard. You can see how they look at the picture below. 
Maybe some of you wonder what are those things for? Below is the table that will give brief explanation for you.
Nama Hardware
Arduino UNO (Mikroprosesor)
1 unit
as a single-board microcontroller
Lampu LED
3 unit
as a representation of red light, yellow light and green light.
Seven Segments
1 unit
as a representation of traffic light duration 
Sensor Ultrasonik HC-SR04
1 unit
As a representation of vehicles density detector. Sensor will detect the height of the system to the street and send the result to system.
Motor Servo
1 unit
This component is used to move the sensor. 
WiFi Modul ESP8266
1 unit
Sebagai media agar perangkat dapat langsung terhubung dengan wifi dan membuat koneksi TCP/IP
1 unit
To connect some components.
Below is a diagram that will explain how the hardware components are being related one to another. 
And below is an illustration how the hardware will be implemented.

S O F T W A R E    D E S I G N 
For the software design, below is flowchart diagram to explain how the system will work according to our design. You can click on the image to be able to view a bigger size. We code the arduino using Arduino IDE that can be downloaded here. For the connection to wifi module, we use Blynk because there are lot of tutorial on the internet. (Still we find it hard to build the system huhu)
U S E R    I N T E R F A C E    D E S I G N
We use website for the user interface itself. The website is being development with PHP, HTML, CSS, Javascript and JSON. For the database, we use MySQL and PHPmyadmin. The website and its database are being deployed in a free hosting provider named https://www.000webhost.com/. You can go there to have your own website. I really love that hosting because we can upload our own code yet they also provide us cool templates for those who haven't code their website. So here you go some screenshot of how our website look :) 

Oh, you can access our website here anyway. 
H A R D W A R E    I M P L E M E N T A T I O N
So it's time for implementation! Yoohoo! It's not as fun as you think tho. But, it was fun hehe. Below is the diagram how the component are being connected in our implementation. It might be seem complex yet it is not. You just need to be patience and focus to make the circuit. 

S O F T W A R E   I M P L E M E N T A T I O N
There are few source codes that we use in this final project. Here you go!
Arduino code
HTML Web User Interface
Connection code

Find the full website code here. If you are wonder how to know if the blynk is already connected to the system or not, here are a screenshot you may see.
T E S T I N G 
The test process we did is consist of two stages. The first stage is unit test where we try each of the component to see whether the component work well or not. We also use unit test to test each of our code in developing the system. At the end of the development process, we do integration test to test the whole system we make. Below are the aspects, scenario, parameter and method of our integration test. 
Sistem dapat mendeteksi kendaraan dengan baik.
Black box
·         Pengesetan kondisi simulasi dengan kendaraan dan komponen
·         Komponen mendeteksi kepadatan dan memberikan hasil
·         Membandingkan hasil dengan kondisi sebenarnya
Sistem dapat menganalisis data kepadatan dan memberikan reaksi yang tepat.
Black box
·         Pemberian input pada program
·         Program menghitung dan mengeluarkan hasil
·         Membandingkan hasil dengan hasil hitungan manual
Sending data
Sistem dapat memberikan data dan hasil perhitungan kepada lampu lalu lintas secara baik.
Black box
·         Pembuatan sebuah simulasi sistem lampu lalu lintas
·         Hasil dari tahap (ii) dijadikan input kepada sistem simulasi
·         Membandingkan performa reaksi sistem dengan reaksi yang diinginkan
Hubungan komponen deteksi dengan sistem utama.
Black box
·         Pembuatan koneksi antara komponen deteksi, analisis dan instruksi
·         Melakukan prosedur testing secara keseluruhan

W O R K   C O M P L E T E N E S S
Well, the system is fully work indeed yet we still can not find the right calculation because the lack of source and component. I will say that our project is not fully complete and is still 80% done. I hope in the future we can find the right calculation and component to combat this traffic problem in Indonesia. 

S I D E   S T O R Y
I remember that my lecturer told us to not write a report with an awakward way. But....the template of the report make me awkward while writing this report. So I end up adding new part where I can talk freely and tell people my story. To be honest, there was time when I think I want to give up on this idea because I can not find the right calculation. I am responsible of the software development anyway. But considering we already at the middle of the project make me feel like..."woah, it must be hard to start another idea". It was fun working with my team which named FAT. Eventhough we are not success 100%, we do learn a lot of things. I was disappointed of today assignment demo since my team did not perform well. But the most important thing is the process right? I should have be thankful for the process we have went through together. This course is still as fun as the first day of its class tho. I literally learn sooooooo many things about computer and its interaction with human. You have to believe that watchig tutorial to connect the wi-fi module to Arduino does not really help while connecting your own component. You have to try dan failed for couple of times. You need to ask those friends who already able to connect their component or teach those friends who don't know something you know. I think it's enough for me to babbling. Here are some documentations of us and our projects.  
Cheers to this FAT team! Thank you this fabulous semester!

T H E    E N D    O F    T H E   R E P O R T 

with love,
Eka Theresia Kartika Suri