26
56 LAMPIRAN Lampiran 1 JADWAL PENGERJAAN TUGAS AKHIR Tabel 4.11 Jadwal Pengerjaan Tugas Akhir No Keterangan Waktu (Bulan) I II III IV V VI 1 Kajian Pustaka 2 Identifikasi Masalah 3 Perancangan Hardware 4 Perancangan Software 5 Pengujian Alat 6 Pembuatan Hasil Data 7 Pembuatan laporan dan sidang 8 Revisi dan jilid laporan akhir

LAMPIRAN - Repository IT Telkom Purwokerto

Embed Size (px)

Citation preview

56

LAMPIRAN

Lampiran 1

JADWAL PENGERJAAN TUGAS AKHIR

Tabel 4.11 Jadwal Pengerjaan Tugas Akhir

No Keterangan Waktu (Bulan)

I II III IV V VI

1 Kajian Pustaka

2 Identifikasi

Masalah

3 Perancangan

Hardware

4 Perancangan

Software

5 Pengujian Alat

6 Pembuatan

Hasil Data

7

Pembuatan

laporan dan

sidang

8 Revisi dan jilid

laporan akhir

57

Lampiran 2

ANGGARAN BELANJA

PROYEK TUGAS AKHIR

TEMPAT SAMPAH PINTAR MENGUNAKAN SENSOR ULTRASONIK

BERBASIS ANDROID

TAHUN AKADEMIK 2018/2019

Tabel 4.12 Anggaran Belanja Proyek Tugas Akhir

NO NAMA BIAYA QTY HARGA SATUAN JUMLAH HARGA KETERANGAN

1 NodeMCU V3

Lolin

3 Rp 41.500,00 Rp 124.500,00

-

2 Sensor Ultrasonik 3 Rp 11.500,00 Rp 34.500,00 -

3 Adapter Charger 1 Rp 65.000,00 Rp 65.000,00 -

4 USB Hub 3 Port 1 Rp 15.000,00 Rp 15.000,00

5 Micro USB 3 Rp 30.000,00 Rp 90.000,00 -

6 Administrasi 1 Rp 200.000,00 Rp 200.000,00 -

7 Transportasi 1 Rp 50.000,00 Rp 50.000,00 -

8 Lain-lain 1 Rp 150.000,00 Rp 150.000,00 -

Jumlah Anggaran Rp 729.000,00 -

58

Lampiran 3

CODING TEMPAT SAMPAH 1

#include <ESP8266WiFi.h>

#include <NTPClient.h>

#include <WiFiUdp.h>

const long utcOffsetInSeconds = 25200;

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday",

"Thursday", "Friday", "Saturday"};

// Define NTP Client to get time

WiFiUDP ntpUDP;

NTPClient timeClient(ntpUDP, "pool.ntp.org", utcOffsetInSeconds);

WiFiClient client;

String MakerIFTTT_Key ;

;String MakerIFTTT_Event;

char *append_str(char *here, String s) {

int i=0; while (*here++ = s[i]){i++;};return here-1;}

char *append_ul(char *here, unsigned long u) {

char buf[20]; return append_str(here, ultoa(u, buf, 10));}

char post_rqst[256];char *p;char *content_length_here;char *json_start;int compi;

int hours;

int minutes;

int seconds;

int Trigger_pin = D1;

int Echo_pin = D2;

int Led_pin = D3;

char str[50];

59

void setup()

{

Serial.begin(115200);

WiFi.disconnect();

delay(3000);

Serial.println("Start");

WiFi.begin("1","12345678");

while ((!(WiFi.status() == WL_CONNECTED))){

delay(300);

}

pinMode(Led_pin, OUTPUT);

pinMode(Trigger_pin, OUTPUT);

pinMode(Echo_pin, INPUT);

Serial.println(".................");

Serial.println("connected");

delay(1000);

timeClient.begin();

}

void loop()

{

timeClient.update();

hours=timeClient.getHours();

minutes=timeClient.getMinutes();

seconds=timeClient.getSeconds();

Serial.print(daysOfTheWeek[timeClient.getDay()]);

Serial.print(", ");

Serial.print(hours);

Serial.print(":");

Serial.print(minutes);

60

Serial.print(":");

Serial.println(seconds);

//Serial.println(timeClient.getFormattedTime());

int Echo_state = digitalRead(Echo_pin);

long duration, distance;

digitalWrite(Trigger_pin,HIGH);

delayMicroseconds(500);

digitalWrite(Trigger_pin, LOW);

duration=pulseIn(Echo_pin, HIGH);

distance =(duration/2)/29.1;

Serial.print(distance);

Serial.println("CM");

delay(1000);

if (distance>6)

{

digitalWrite(Led_pin, LOW);

}

if (distance<=6)

{

digitalWrite(Led_pin, HIGH);

}

if (hours == 8)

{

if (minutes == 0)

{

if (seconds == 0)

{

sprintf (str, "Tinggi Sampah Pada Tempat Sampah 1 : %d", 21-distance);

if (client.connect("maker.ifttt.com",80)) {

MakerIFTTT_Key

="dwZrrTHyYY4nNzAP1ZNdu86R3qOb8SKZwbOXD4acjf";

61

MakerIFTTT_Event ="email";

p = post_rqst;

p = append_str(p, "POST /trigger/");

p = append_str(p, MakerIFTTT_Event);

p = append_str(p, "/with/key/");

p = append_str(p, MakerIFTTT_Key);

p = append_str(p, " HTTP/1.1\r\n");

p = append_str(p, "Host: maker.ifttt.com\r\n");

p = append_str(p, "Content-Type: application/json\r\n");

p = append_str(p, "Content-Length: ");

content_length_here = p;

p = append_str(p, "NN\r\n");

p = append_str(p, "\r\n");

json_start = p;

p = append_str(p, "{\"value1\":\"");

p = append_str(p, str);

p = append_str(p, "\"}");

compi= strlen(json_start);

content_length_here[0] = '0' + (compi/10);

content_length_here[1] = '0' + (compi%10);

client.print(post_rqst);

}

Serial.println("Pesan Dikirim...............");

Serial.println(str);

delay(10000);

}

}

}

}

62

CODING TEMPAT SAMPAH 2

#include <ESP8266WiFi.h>

#include <NTPClient.h>

#include <WiFiUdp.h>

const long utcOffsetInSeconds = 25200;

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday",

"Thursday", "Friday", "Saturday"};

// Define NTP Client to get time

WiFiUDP ntpUDP;

NTPClient timeClient(ntpUDP, "pool.ntp.org", utcOffsetInSeconds);

WiFiClient client;

String MakerIFTTT_Key ;

;String MakerIFTTT_Event;

char *append_str(char *here, String s) {

int i=0; while (*here++ = s[i]){i++;};return here-1;}

char *append_ul(char *here, unsigned long u) {

char buf[20]; return append_str(here, ultoa(u, buf, 10));}

char post_rqst[256];char *p;char *content_length_here;char *json_start;int compi;

int hours;

int minutes;

int seconds;

int Trigger_pin = D1;

int Echo_pin = D2;

int Led_pin = D3;

char str[50];

63

void setup()

{

Serial.begin(115200);

WiFi.disconnect();

delay(3000);

Serial.println("Start");

WiFi.begin("1","12345678");

while ((!(WiFi.status() == WL_CONNECTED))){

delay(300);

}

pinMode(Led_pin, OUTPUT);

pinMode(Trigger_pin, OUTPUT);

pinMode(Echo_pin, INPUT);

Serial.println(".................");

Serial.println("connected");

delay(1000);

timeClient.begin();

}

void loop()

{

timeClient.update();

hours=timeClient.getHours();

minutes=timeClient.getMinutes();

seconds=timeClient.getSeconds();

Serial.print(daysOfTheWeek[timeClient.getDay()]);

Serial.print(", ");

Serial.print(hours);

Serial.print(":");

Serial.print(minutes);

Serial.print(":");

64

Serial.println(seconds);

//Serial.println(timeClient.getFormattedTime());

int Echo_state = digitalRead(Echo_pin);

long duration, distance;

digitalWrite(Trigger_pin,HIGH);

delayMicroseconds(500);

digitalWrite(Trigger_pin, LOW);

duration=pulseIn(Echo_pin, HIGH);

distance =(duration/2)/29.1;

Serial.print(distance);

Serial.println("CM");

delay(1000);

if (distance>6)

{

digitalWrite(Led_pin, LOW);

}

if (distance<=6)

{

digitalWrite(Led_pin, HIGH);

}

if (hours == 8)

{

if (minutes == 0)

{

if (seconds == 0)

{

sprintf (str, "Tinggi Sampah Pada Tempat Sampah 2 : %d", 21-distance);

if (client.connect("maker.ifttt.com",80)) {

MakerIFTTT_Key

="dwZrrTHyYY4nNzAP1ZNdu86R3qOb8SKZwbOXD4acjf";

MakerIFTTT_Event ="email";

65

p = post_rqst;

p = append_str(p, "POST /trigger/");

p = append_str(p, MakerIFTTT_Event);

p = append_str(p, "/with/key/");

p = append_str(p, MakerIFTTT_Key);

p = append_str(p, " HTTP/1.1\r\n");

p = append_str(p, "Host: maker.ifttt.com\r\n");

p = append_str(p, "Content-Type: application/json\r\n");

p = append_str(p, "Content-Length: ");

content_length_here = p;

p = append_str(p, "NN\r\n");

p = append_str(p, "\r\n");

json_start = p;

p = append_str(p, "{\"value1\":\"");

p = append_str(p, str);

p = append_str(p, "\"}");

compi= strlen(json_start);

content_length_here[0] = '0' + (compi/10);

content_length_here[1] = '0' + (compi%10);

client.print(post_rqst);

}

Serial.println("Pesan Dikirim...............");

Serial.println(str);

delay(10000);

}

}

}

}

66

CODING TEMPAT SAMPAH 3

#include <ESP8266WiFi.h>

#include <NTPClient.h>

#include <WiFiUdp.h>

const long utcOffsetInSeconds = 25200;

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday",

"Thursday", "Friday", "Saturday"};

// Define NTP Client to get time

WiFiUDP ntpUDP;

NTPClient timeClient(ntpUDP, "pool.ntp.org", utcOffsetInSeconds);

WiFiClient client;

String MakerIFTTT_Key ;

;String MakerIFTTT_Event;

char *append_str(char *here, String s) {

int i=0; while (*here++ = s[i]){i++;};return here-1;}

char *append_ul(char *here, unsigned long u) {

char buf[20]; return append_str(here, ultoa(u, buf, 10));}

char post_rqst[256];char *p;char *content_length_here;char *json_start;int compi;

int hours;

int minutes;

int seconds;

int Trigger_pin = D1;

int Echo_pin = D2;

int Led_pin = D3;

char str[50];

67

void setup()

{

Serial.begin(115200);

WiFi.disconnect();

delay(3000);

Serial.println("Start");

WiFi.begin("1","12345678");

while ((!(WiFi.status() == WL_CONNECTED))){

delay(300);

}

pinMode(Led_pin, OUTPUT);

pinMode(Trigger_pin, OUTPUT);

pinMode(Echo_pin, INPUT);

Serial.println(".................");

Serial.println("connected");

delay(1000);

timeClient.begin();

}

void loop()

{

timeClient.update();

hours=timeClient.getHours();

minutes=timeClient.getMinutes();

seconds=timeClient.getSeconds();

Serial.print(daysOfTheWeek[timeClient.getDay()]);

Serial.print(", ");

Serial.print(hours);

Serial.print(":");

Serial.print(minutes);

Serial.print(":");

68

Serial.println(seconds);

//Serial.println(timeClient.getFormattedTime());

int Echo_state = digitalRead(Echo_pin);

long duration, distance;

digitalWrite(Trigger_pin,HIGH);

delayMicroseconds(500);

digitalWrite(Trigger_pin, LOW);

duration=pulseIn(Echo_pin, HIGH);

distance =(duration/2)/29.1;

Serial.print(distance);

Serial.println("CM");

delay(1000);

if (distance>6)

{

digitalWrite(Led_pin, LOW);

}

if (distance<=6)

{

digitalWrite(Led_pin, HIGH);

}

if (hours == 8)

{

if (minutes == 0)

{

if (seconds == 0)

{

sprintf (str, "Tinggi Sampah Pada Tempat Sampah 3 : %d", 21-distance);

if (client.connect("maker.ifttt.com",80)) {

MakerIFTTT_Key

="dwZrrTHyYY4nNzAP1ZNdu86R3qOb8SKZwbOXD4acjf";

MakerIFTTT_Event ="email";

69

p = post_rqst;

p = append_str(p, "POST /trigger/");

p = append_str(p, MakerIFTTT_Event);

p = append_str(p, "/with/key/");

p = append_str(p, MakerIFTTT_Key);

p = append_str(p, " HTTP/1.1\r\n");

p = append_str(p, "Host: maker.ifttt.com\r\n");

p = append_str(p, "Content-Type: application/json\r\n");

p = append_str(p, "Content-Length: ");

content_length_here = p;

p = append_str(p, "NN\r\n");

p = append_str(p, "\r\n");

json_start = p;

p = append_str(p, "{\"value1\":\"");

p = append_str(p, str);

p = append_str(p, "\"}");

compi= strlen(json_start);

content_length_here[0] = '0' + (compi/10);

content_length_here[1] = '0' + (compi%10);

client.print(post_rqst);

}

Serial.println("Pesan Dikirim...............");

Serial.println(str);

delay(10000);

}

}

}

}

% 5 wrds: 436 https://dspace.uii.ac.id/bitstream/handle/123456789/7912/KOTAK%20SAMPAH%20PINTAR%20MENGGUN...

% 2 wrds: 195 https://alifrijas.blogspot.com/2016/12/tugas-embedded-system_13.html

% 2 wrds: 191 https://bagoestezo.blogspot.com/2016/12/embedded-system-for-internet-of-things.html

[Show other Sources:]

[Show other Sources:]

id: 1Plagiarism detected: 0.06% https://dspace.uii.ac.id/bitstream/...

Plagiarism Detector v. 1092 - Originality Report:

Analyzed document: 8/5/2019 4:36:21 PM

"Laporan TA 16201039 Buyung Atmagalih (1).docx"Licensed to: Heru Priyanto_License12

Relation chart:

Distribution graph:

Comparison Preset: Word-to-Word. Detected language: Indonesian

Top sources of plagiarism:

Processed resources details:

146 - Ok / 17 - Failed

Important notes:

Wikipedia: Google Books: Ghostwriting services: Anti-cheating:

[not detected] [not detected] [not detected] [not detected]

Excluded Urls:

Included Urls:

Detailed document analysis:

TEMPAT

SAMPAH PINTAR MENGGUNAKAN SENSOR ULTRASONIK BERBASIS

ANDROIDSMART TRASH CANUSING ULTRASONIC SENSOR BASED ON ANDROIDLAPORANTUGAS AKHIRDisusun oleh

https://Plagiarism-Detector.com 1/32

INTRODUCTION TO

www.einstronic.com

NodeMCU ESP8266JULY 2017DEVKIT v1.0

NodeMCU ESP8266 ESP-12EWiFi Development Board

FeaturesVersion : DevKit v1.0

Breadboard Friendly

Light Weight and small size.

3.3V operated, can be USB powered.

Uses wireless protocol 802.11b/g/n.

Built-in wireless connectivity capabilities.

Built-in PCB antenna on the ESP-12E chip.

Capable of PWM, I2C, SPI, UART, 1-wire, 1 analog pin.

Uses CP2102 USB Serial Communication interface module.

Arduino IDE compatible (extension board manager required).

Supports Lua (alike node.js) and Arduino C programming language.

PINOUT DIAGRAMNodeMCU ESP8266 v1.0

NodeMCU is an open source IoT platform. It includes firmware which runs on the

ESP8266 Wi-Fi SoC from Espressif Systems, and hardware which is based on the

ESP-12 module. The term “NodeMCU” by default refers to the firmware rather than

the DevKit. The firmware uses the Lua scripting language. It is based on the eLua

project, and built on the Espressif Non-OS SDK for ESP8266. It uses many open

source projects, such as lua-cjson, and spiffs.

Wireless Connectivity Breadboard Friendly USB Compatible Lightweight

TM

Arduino IDE Compatible Low Power Consumption

Internet of Things

1Sourcehttps://iotbytes.wordpress.com/nodemcu-pinout/

All GPIO runs at 3.3V !!Safety Precaution

Specifications of ESP-12E WiFi Module

Wireless Standard

Frequency Range

Power Transmission

Receiving Sensitivity

Wireless Form

IO Capability

Electrical Characteristic

Operating Temperature

Serial Transmission

Wireless Network Type

Security Type

Encryption Type

Firmware Upgrade

Network Protocol

User Configuration

IEEE 802.11 b/g/n

2.412 - 2.484 GHz

802.11b : +16 ± 2 dBm (at 11 Mbps)

802.11g : +14 ± 2 dBm (at 54 Mbps)

802.11n : +13 ± 2 dBM (at HT20, MCS7)

802.11b : -93 dBm (at 11 Mbps, CCK)

802.11g : -85 dBm (at 54 Mbps, OFDM)

802.11n : -82 dBm (at HT20, MCS7)

On-board PCB Antenna

UART, I2C, PWM, GPIO, 1 ADC

3.3 V Operated

15 mA output current per GPIO pin

12 - 200 mA working current

Less than 200 uA standby current

-40 to +125 ºC

110 - 921600 bps, TCP Client 5

STA / AP / STA + AP

WEP / WPA-PSK / WPA2-PSK

WEP64 / WEP128 / TKIP / AES

Local Serial Port, OTA Remote Upgrade

IPv4, TCP / UDP / FTP / HTTP

AT + Order Set, Web Android / iOS, Smart Link APP

NodeMCU ESP8266

2

Front View Front View

DisclaimerInformation provided in this document are compilation from various online resources. Einstronic Enterprise does not ensure the completeness, accuracy andreliability of the information and do not own any rights on any registered trademarks involved. Information provided should be intended for references only.

Images used are for illustration purpose only, and is genuinely of Einstronic Enterprise, unless stated otherwise. All Rights Reserved. Einstronic Enterprise, 2017.

010 - 2181014 ( Henry - Owner ) facebook.com/[email protected]

CONTACT INFORMATION

For more details, we can be reached at the addresses below.Terms & Condition apply.

Related SitesNodeMCU official sitehttp://nodemcu.com/index_en.html

NodeMCU Documentationhttps://nodemcu.readthedocs.io/en/master/

NodeMCU Firmware (GitHub)https://github.com/nodemcu/nodemcu-firmware

Project tagged with NodeMCU, HACKADAY.IO

https://hackaday.io/projects?tag=NodeMCU

ESP8266 Getting started, by ACROBOTIC industries

http://learn.acrobotic.com/tutorials/post/esp8266-getting-started

Quick Start to Nodemcu (ESP8266) on Arduino IDEby Magesh Jayakumar

http://www.instructables.com/id/Quick-Start-to-Nodemcu-ESP8266-on-Arduino-IDE/

GETTING STARTED WITH PLATFORMIO AND ESP8266 NODEMCUby Brandon Cannaday

https://www.losant.com/blog/getting-started-with-platformio-esp8266-nodemcu

Programming ESP8266 ESP-12E NodeMCU V1.0 With Arduino IDE

Into Wireless Temperature Loggerby Shin Teo

http://www.instructables.com/id/ESP8266-NodeMCU-v10-ESP12-E-with-Arduino-IDE/

July 2017

Tech Support: [email protected]

Ultrasonic Ranging Module HC - SR04

Product features:

Ultrasonic ranging module HC - SR04 provides 2cm - 400cm non-contact measurement function, the ranging accuracy can reach to 3mm. The modules includes ultrasonic transmitters, receiver and control circuit. The basic principle of work: (1) Using IO trigger for at least 10us high level signal, (2) The Module automatically sends eight 40 kHz and detect whether there is a pulse signal back. (3) IF the signal back, through high level , time of high output IO duration is the time from sending ultrasonic to returning. Test distance = (high level time×velocity of sound (340M/S) / 2,

Wire connecting direct as following:

� 5V Supply � Trigger Pulse Input � Echo Pulse Output � 0V Ground

Electric Parameter

Working Voltage DC 5 V

Working Current 15mA

Working Frequency 40Hz

Max Range 4m

Min Range 2cm

MeasuringAngle 15 degree

Trigger Input Signal 10uS TTL pulse

Echo Output Signal Input TTL lever signal and the range in

proportion

Dimension 45*20*15mm

Vcc Trig Echo GND

Timing diagram

The Timing diagram is shown below. You only need to supply a short 10uS pulse to the trigger input to start the ranging, and then the module will send out an 8 cycle burst of ultrasound at 40 kHz and raise its echo. The Echo is a distance object that is pulse width and the range in proportion .You can calculate the range through the time interval between sending trigger signal and receiving echo signal. Formula: uS / 58 = centimeters or uS / 148 =inch; or: the range = high level time * velocity (340M/S) / 2; we suggest to use over 60ms measurement cycle, in order to prevent trigger signal to the echo signal.

Attention:

� The module is not suggested to connect directly to electric, if connected electric, the GND terminal should be connected the module first, otherwise, it will affect the normal work of the module. � When tested objects, the range of area is n ot less than 0.5 square meters and the plane requests as smooth as possible, otherwise ,it will affect the results of measuring.

www.Elecfreaks.com