AI Assistant
Detail Karya Portofolio

Smart Home : Voice-Activated Light Control

Rima Nur Badriyah Oleh: Rima Nur Badriyah

Ringkasan Portofolio

This portfolio showcases my efforts to integrate Internet of Things (IoT) technology into daily life, focusing on home automation. The goal of this project is to develop a system that allows users to turn lights on and off using voice commands. 

Deskripsi & Detail Proyek

smart home systems are becoming increasingly popular. This technology not only saves time but also energy. Additionally, this project presented an exciting challenge in integrating hardware and software.

This project involves the following key components:

1.         Microcontroller: Arduino uno as the control center.

2.         Voice Recognition: Google Assistant  for voice command recognition.

3.         bluetooth Hc-05 functions to connect the control device with a smartphone

4.         Relay Module: To connect and control the electric current to the lights.

5.         Internet Connection: To connect the system to the cloud and process voice data.

6.         Supporting Application: A smartphone app for initial setup and manual control.

In conclusion Through this project, I have learned a great deal about integrating IoT technology and voice-based applications. I believe systems like this can become an essential part of modern homes in the future.

Pemograman Arduino

// Pendeklarasian PIN yang digunakan

String voice;

int

relay1 = 8, 

relay2 = 9, 

relay3 = 10, 

relay4 = 11; 

 

// Pendeklarasian fungsi I/O 

//FUNGSI KETIKA SEMUA AKTIF

void allon()

{

     digitalWrite(relay1, LOW); 

     digitalWrite(relay2, LOW); 

     digitalWrite(relay3, LOW); 

     digitalWrite(relay4, LOW); 

}

//FUNGSI KETIKA SEMUA MATI

void alloff () {

     digitalWrite (relay1, HIGH); 

     digitalWrite (relay2, HIGH); 

     digitalWrite (relay3, HIGH); 

     digitalWrite (relay4, HIGH); 

     

}

 

// DEKLARASI PIN I/O

Void setup () 

{

  Serial.begin(9600);

  pinMode(relay1, OUTPUT); 

  pinMode(relay2, OUTPUT); 

  pinMode(relay3, OUTPUT); 

  pinMode(relay4, OUTPUT); 

 

}

 

//FUNGSI PERULANGAN

void loop() {

  while (Serial.available()){  //Check if there is an available byte to read

  delay(10); //Delay added to make thing stable

  char c = Serial.read(); //Conduct a serial read

  if (c == '#') {break;} //Exit the loop when the # is detected after the word

  voice += c; //Shorthand for voice = voice + c

  } 

  if (voice.length() > 0) {

    Serial.println(voice); 

 

   

// FUNGSI NYALAKAN DAN MATIKAN SEMUA RELAY

  if(voice == "*semua aktif") {allon();}  //Turn Off All Pins (Call Function)

  else if(voice == "*semua mati"){alloff();} //Turn On  All Pins (Call Function)

 

// FUNGSI MATIKAN SATU PERSATU RELAY

  else if(voice == "*monitor mati") {digitalWrite(relay1, HIGH);} 

  else if(voice == "*kipas mati") {digitalWrite(relay2, HIGH);}

  else if(voice == "*lampu kamar mati") {digitalWrite(relay3, HIGH);}

  else if(voice == "*lampu dapur mati") {digitalWrite(relay4, HIGH);}

 

// FUNGSI AKTIFKAN SATU PERSATU RELAY

  else if(voice == "*monitor aktif") {digitalWrite(relay1, LOW);} 

  else if(voice == "*kipas aktif") {digitalWrite(relay2, LOW);}

  else if(voice == "*lampu kamar aktif") {digitalWrite(relay3, LOW);}

  else if(voice == "*lampu dapur aktif") {digitalWrite(relay4, LOW);}

 

voice="";}} //RESET VARIABLE SETELAH INISIALISASI