Smart lamp with gsm modul sim800 l

24
SMART LAMP WITH A GSM MODULE SIM 800 L By : Arisa Tri Rahayu/151611005 Farid Giffari Akbar/151611010 Ricky Jordan Antono/151611024 Cllas : 2A PRODI D3-TEKNIK PENDINGIN DAN TATA UDARA JURUSAN TEKNIK REFRIGERASI DAN TATA UDARA POLITEKNIK NEGERI BANDUNG

Transcript of Smart lamp with gsm modul sim800 l

SMART LAMP WITH A GSM MODULE SIM 800 L

By :

Arisa Tri Rahayu/151611005

Farid Giffari Akbar/151611010

Ricky Jordan Antono/151611024

Cllas : 2A

PRODI D3-TEKNIK PENDINGIN DAN TATA UDARA

JURUSAN TEKNIK REFRIGERASI DAN TATA UDARA

POLITEKNIK NEGERI BANDUNG

• Supervisor :

• Drs. Ismail Wellid, MT

• Muhammad Arman ST., S.Psi., M.Eng

• Ary Surjanto, ST., MTC. Bambang Dwi Kuncoro, ST.,MT

Purpose

 1. Can plan a project that will be created with a theme that commanded namely Green House2. Can search for suitable reference sources as the main capitalAble to operate program Arduino3. Diagnosing can no longer operate the system4. Can Adapt and modify the project with advanced technology.

•  

Background

COMPONENTS USED

a. 1. LM2596 DC-DC Step Down Voltage Regulator Operating Temperature: standard

Dissipation Power: 93%

Type: Voltage Regulator

Supply Voltage: 4-40V

Model Number: DC-DC Step Down Adjustable Power Supply Module

Item: DC-DC Step Down Adjustable Power Supply Module With LED Voltmeter

Input voltage range: 4-40VDC

Output voltage range: 1.25-37DC adjustable

Output current: 2A

Voltmeter range: 0 to 40V,error +-0.1V

Size: 6.1 x 3.4 x12cm(approx.)  

• 2. Module Relay Standard• Load maximum : AC 250 V/10A, DC 30 V/10A

•Current : 5mA•Voltage: 5 V

• meassurement modul : 50x26x18.5mm (L x W x H)•empapemasangan baut, diameter 3.1mm•DC +: positif power supply (VCC)•DC-: catu daya negatif (GND)•DALAM: bisa tinggi atau rendah tingkat kontrol relay

• NO: antarmuka estafet biasanya terbuka•COM: Common Interface Relay•NC: antarmuka estafet biasanya tertutup•aeProduct.getSubject()

• itu adalah tingkat rendah memicu ketika jumper terhubung ke RENDAH pin• ini adalah tingkat tinggi memicu ketika jumper terhubung ke TINGGI pin

•aeProduct.getSubject()•1 Pcs 5 V 1 Channel Relay Modul tingkat Rendah•aeProduct.getSubject()•aeProduct.getSubject()•aeProduct.getSubject()

A light-emitting diode (LED) is a two lead semiconductor light source. It is p-n junction diode, which emits light

when activated.

3. Resistor 1K

A resistor is a passive two- terminal electrical component that implements electrical resistance as a circuit element.

4. LED

5. ARDUINO UNO

Processor: ATmega328 (8-bit CPU, 16MHz clock speed, 2KB SRAM, 32KB flash storage)

Features: 14 digital I/O pins, 6 analog input pins, removable microcontroller

Form Factor: 2.7” x 2.1” rectangle

6. SIM800L GPRS

7. PCBA printed circuit board (PCB) mechanically supports and electrically

conects electronic components using conductive track, pads and other features etched from copper sheets laminated onto a non-conductive subsrate.

8. Male-Female Cable

In electrical and mechanical trades and manufacturing, each half of a pair of mating connectors or fasteners is conventionally assigned the designation male or female. The “Female” connector is generally a receptacle that receives and holds the “male” connector

An electrical light is a device that produces

visible light bye the flow of electrical current.

9. Lampu bohlam

• 10. Sensor LDRLDR sensor module is used to detect the intensity of light. It is associated with both analog output pin and digital output pin labelled as OA and DO respectively on the board.Specification: - Input Voltage : DC 3.3V to 5 V- Output : Analog and Digital - Sensitivity adjustable

WIRRING

SKETCH PROGRAM ARDUINO• #include <gprs.h>

• #include <sim800.h>•

• #include <gprs.h>

• #include <softwareserial.h>•

• #define TIMEOUT 500

• #define LED_PIN 13

• #define ON 1

• #define OFF 0

• const int MERAH = 5;•

• int LDR= A2; // membuat variabel LDR untuk pin A2

• int LED= 13; // membuat variabel LED untuk pin 13

• int nilaiLDR= 0; // variabel nilai awal untuk nilaiLDR

• int StatusMerah;

• GPRS gprs;

• void setup() {

• pinMode (MERAH , OUTPUT);

• pinMode (LED_PIN, OUTPUT);

• Serial.begin(9600);

• while(!Serial);

• Serial.println("Starting SIM800 Auto Read SMS");

• gprs.preInit();

• delay(1000);

• while(0 != gprs.init()) {

• delay(100);

• Serial.print("init error\r\n");

• pinMode(LED, OUTPUT); // menentukan LED menjadi OUTPUT

• Serial.begin(9600); // komunikasi Arduino ke Komputer

• delay(100);

• }

• //Set SMS mode to ASCII

• if(0 != gprs.sendCmdAndWaitForResp("AT+CMGF=1\r\n", "OK", TIMEOUT)) {

• ERROR("ERROR:CNMI");

• return;

• }

• //Start listening to New SMS Message Indications

• if(0 != gprs.sendCmdAndWaitForResp("AT+CNMI=1,2,0,0,0\r\n", "OK", TIMEOUT)) {

• ERROR("ERROR:CNMI");

• return;

• }

• Serial.println("Init success");

• }

• //Variable to hold last line of serial output from SIM800

• char currentLine[500] = "";

• int currentLineIndex = 0;

• //Boolean to be set to true if message notificaion was found and next

• //line of serial output is the actual SMS message content

• bool nextLineIsMessage = false;

• void loop() {

• //Write current status to LED pin

• digitalWrite(MERAH, StatusMerah);

• digitalWrite(BIRU, StatusBIRU);

• //If there is serial output from SIM800

• if(gprs.serialSIM800.available()){

• char lastCharRead = gprs.serialSIM800.read();

• //Read each character from serial output until \r or \n is reached (which denotes end of line)

• if(lastCharRead == '\r' || lastCharRead == '\n'){• String lastLine = String(currentLine);

• //If last line read +CMT, New SMS Message Indications was received.

• //Hence, next line is the message content.

• if(lastLine.startsWith("+CMT:")){

• Serial.println(lastLine);

• nextLineIsMessage = true;

• } else if (lastLine.length() > 0) {

• if(nextLineIsMessage) {

• Serial.println(lastLine);

• // ########## MEMBACA KONTEN SMS DAN MENCARI+MENGARTIKAN KONTEN SMS KE PROGRAM #########

• //Kendali LED MERAH

• if(lastLine.indexOf("LAMPU ON") >= 0){

• StatusMerah = 1;

• Serial.println(LAMPU DINYALAKAN");}

• else if(lastLine.indexOf("LAMPU OFF") >= 0) {

• StatusMerah = 0;

• Serial.println("LAMPU DIMATIKAN");}

• nextLineIsMessage = false;

• }

• }

• //Clear char array for next line of read

• for( int i = 0; i < sizeof(currentLine); ++i ) {

• currentLine[i] = (char)0;

• }

• currentLineIndex = 0;

• } else {

• currentLine[currentLineIndex++] = lastCharRead;

• }

• }

• nilaiLDR= analogRead(LDR); // menyimpan nilai yang dibaca dari LDR ke variabel nilaiLDR

• Serial.print("NilaiLDR= "); // menampilkan teks nilaiLDR=

• Serial.println(nilaiLDR); // menampilkan nilai dari nilaiLDR

• if(nilaiLDR <2) { // jika nilai dari LDR kurang dari 500

• digitalWrite(LED, LOW);

• delay(100);

• }

• else { // jika tidak

• digitalWrite(LED, HIGH);

• delay(100);

• }

• }

Data analysis (when the less light the lights on)

Data analysis (When the lights go out enough light)

DESIGN

Conclusion• The use or application of arduino very much, one of them in the

establishment of this intrumentasi project. As for some of the points that we can take.

•1. LDR is an electronic component that can read light. This component is needed in this project, to know less or insufficient lighting on the plant.2. SIM 800L is a modification to this project. Which of these components that will send commands and information or as a medium for information concerning lacking or insufficient lighting. In the component too, we may order the lights to be turned on.3. In the overall series, if the lighting is less then the lights will be turned on, and if the lighting is sufficient then the lights will be turned off.

Sumber:

•  • http://anislinuwih.blogspot.co.id/2013/11/macam-macam-resistor-dan-fungsinya.html

• https://diyhacking.com/arduino-ldr-sensor/

• http://belajararduino.com/kendali-lampu-ac-menggunakan-relay-220-v-arduino/

• http://belajararduino.com/2016/06/sim800l-control-relay-4-channel-with.html?m1

• https://www.arduino.cc/en/Guide/ArduinoGSMShield

• https://sismik.stei.itb.ac.id/2016/05/24/green-house-system/

• http://arduinoach.blogspot.co.id/2016/01/remote-control-via-gprs-gsm-sms-arduino.html

• http://www.google.com/url?q=http://agroteknologi.web.id/faktor-faktor-yang-menyebabkan-tanaman-gagal-berbuah/&sa=U&ved=0ahUKEwiWpcuVspjRAhWDto8KHTgECt0QFgggMAI&usg=AFQjCNH4jkzAVInimhOS4rNY-k9l1dL7Ig

• http://agroteknologi.web.id/faktor-faktor-yang-menyebabkan-tanaman-gagal-berbuah/

• http://agroteknologi.web.id/faktor-faktor-yang-menyebabkan-tanaman-gagal-berbuah/

• http://www.ebay.com/itm/1pc-Light-Dependent-Resistor-LDR-Photoresistor-Sensor-Module-for-Arduino-TW-/141691049267

• http://en.m.wikipedia.org/wiki/Gender_of_connector _and_fasteners

• http://www.instructabled.com /id/LDR-Sensor Module-Users-Manual-V10/

•