Project in progress
GO-4 Smart Home Arduino Bot

GO-4 Smart Home Arduino Bot

A robot that uses IoT technology to control your home appliances remotely through the Internet.

  • 5,490 views
  • 0 comments
  • 34 respects

Components and supplies

Apps and online services

About this project

In this project, I will show you how to build a smart home bot using IoT technology to control your home appliances remotely through the Internet.

But before we start, let’s talk about this technique as we used to do…

What is the IoT?

The Internet of Things (IoT) is a system of interrelated computing devices, mechanical and digital machines, objects, people that are provided with unique identifiers and the ability to transfer data over a network without requiring human-to-human or human-to-computer interaction.

A thing, in the Internet of Things, can be a person with a heart monitor implant, an Irrigation systems in a farm with a biochip transponder, a vehicle that has built-in sensors to alert the driver when tire pressure is low or any other natural or man-made object that can be assigned an IP address and provided with the ability to transfer data over a network.

So let’s say that the IoT is a huge system over the internet that embraces every single machine using a unique ID calls IP address.

How can I become a part of this world using my Arduino board?

There is a small technological marvel device called ESP8266 and it is a great tool for enabling your project to access the internet. You can plug it into an Arduino easily as shown and allow your project to communicate through the internet. To control it from anywhere in the world via IP address!

Specifications of the internal controller:

  • The Espressif processor is 32-bit and 80MHz and can be upgraded to 160MHz.
  • 64KB memory bootloader.
  • 64KB Quick RAM memory dedicated to the microcontroller.
  • 96KB random access memory.

*note (1)

the ESP8266 device is usually sold without any module, and in my personal opinion I prefer to use its ESP-01 adapter to make it easily to connect to Arduino board.

Step 1: Required Components

  • Robot model (available in step 3)
  • Arduino Uno R3
  • ESP8266 module
  • ESP-01 adapter
  • Four ways Relay
  • LCD module 16x2
  • LED with 220 ohm resistor
  • Jumper wires

Step 2: Installing ESP8266 Module

Unlike the rest of other components ESP8266 module needs to be setup before using, because it’s stand-alone module and there are many methods you can follow to upload the code to it.

*note (2)

The robot is accessed through the local Wi-Fi network only. In order to control it throw the internet, you may have to do port forwarding on your router.

For more details about this subject:

https://www.pcworld.com/article/244314/how_to_forward_ports_on_your_router.html

Step 3: Assembling the Robot Base

At this time I choose a simple cardboard model that can be assembled in couple of hours.

Download the Model from here:-

http://paper-replika.com/index.php?option=com_cont...

Assembling this base is pretty simple it also allows you to fix the whole circuit inside without any messy wires look, so I fixed LCD 16*8 display module in the front of it to facilitate dealing with robot outputs and I will explain it later.

In this link you will learn how to use LCD display module

https://www.arduino.cc/en/Tutorial/LiquidCrystalDisplay

Step 4: Assembling Robot Torso

The robot torso consists of a single piece, and there is two holes in the front so you can fix your LED flasher with 220 ohm resistor and camera module if you want to.

Step 5: Relay Circuit

HOW TO ADD RELAYS TO ARDUINO

This is the type of relay its able to use to switch mains powered devices. These relays will handle most devices used in homes except the highest powered ones like room heaters, stoves, and motors. Make sure the VA (Volts x Amps) of the device you are switching on/off is less than the relay rating.

Warning: Always be very careful when experimenting with AC, electrical shock can result in serious injuries.

Relay module from bottom side is open when AC is connected do not touch the circuit.

For the DC part of the circuit:

  • Arduino digital pin 10 –> module pin S
  • Arduino GND –> module pin –
  • Arduino +5V –> module pin +

Step 6: Tips and Tricks

While developing your own projects with Arduino, there are a few tricks that are helpful to keep in mind in case you get stuck.

  • Make sure you included the correct library #include ESP8266WiFi.h
  • Make sure you’re reading off the right port in Arduino 115200 instated of port 9600 Serial.begin(115200);
  • The project doesn’t need any extra power source.
  • Also, make sure that use write down the correct SSID and password to your local WIFI network
const char* ssid = "YOUR_SSID";
const char* password = "YOUR_PASSWORD";
  • Once you open the serial screen make sure that the URL is showing like this:

Use this URL to connect: http://192.168.1.100/ , copy the URL and paste it in your web browser.

Stage of initial assembly

Code

GO-4_bot_Code.inoC/C++
// Include WIFI module
#include <ESP8266WiFi.h>

// Include LCD
#include <LiquidCrystal.h>

// WiFi parameters
const char* ssid = "YOUR_SSID";//type your ssid
const char* password = "YOUR_PASSWORD";//type your password

// Relay pin (contcted to TV or Light)
int relayPin = 10; // GPIO2 of ESP8266

int botled = 9; // this led will flash to help is if its working

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

// Create an instance of the server
WiFiServer server(80);
 
void setup() {
  Serial.begin(115200);
  delay(50);
 
  pinMode(relayPin, OUTPUT);
  pinMode(botled, OUTPUT);
  
  digitalWrite(botled, HIGH); // turn on robot led as a guide
     
  // Connect to WiFi network
  Serial.println();
  Serial.println();
  Serial.print("Connecting to: ");
  Serial.println(ssid);
   
  WiFi.begin(ssid, password);
   
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");
   
  // Start the server
  server.begin();
  Serial.println("Server started");
 
  // Print the IP address
  Serial.print("Use this URL to connect: ");
  Serial.print("http://");
  Serial.print(WiFi.localIP());
  Serial.println("/");


  //*************** set up the LCD's number of columns and rows: *** ********
  lcd.begin(16, 2);
  lcd.clear();
  
}
 
void loop() {

    // Sets the cursor to col 0 and row 0
    lcd.setCursor(0,0);
      // Print a message to the LCD.
    lcd.print("GO-4");
    
    lcd.setCursor(0,1); // Sets the cursor second line to write other msgs
    
    
  // Check if a client has connected
  WiFiClient client = server.available();
  if (!client) {
    return;
  }
   
  // Wait until the client sends some data
  Serial.println("new client");
  while(!client.available()){
    delay(1);
  }
   
  // Read the first line of the request
  String request = client.readStringUntil('\r');
  Serial.println(request);
  client.flush();
   
  // Read the request from the web server
 
  int value = LOW;
  if (request.indexOf("/LED=ON") != -1) {
    digitalWrite(relayPin, HIGH);
    value = HIGH;

    BlinkRobotLed(2);
  } 
  if (request.indexOf("/LED=OFF") != -1){
    digitalWrite(relayPin, LOW);
    value = LOW;

    BlinkRobotLed(2);
  }
   
  // Return the response
  client.println("HTTP/1.1 200 OK");
  client.println("Content-Type: text/html");
  client.println(""); //  do not forget this one
  client.println("<!DOCTYPE HTML>");
  client.println("<html>");
   
  client.print("Relay pin is now: ");
   
  if(value == HIGH) {
    client.print("On"); 
    lcd.print("Relay bin On"); // you can change the msg as you like
  } else {
    client.print("Off");
    lcd.print("Relay bin OFF"); // you can change the msg as you like
  }
  client.println("<br><br>");
  client.println("Click <a href=\"/LED=ON\">here</a> turn the LED on pin 2 ON<br>");
  client.println("Click <a href=\"/LED=OFF\">here turn the LED on pin 2 OFF<br>");
  client.println("</html>");
 
  delay(1);
  Serial.println("Client disconnected");
  Serial.println("");
}

void BlinkRobotLed(int x)
{
  //blink robot led
    for(int i = 0 ; i < x; i++)
    {
      digitalWrite(botled, LOW);
      delay(50);
      digitalWrite(botled, HIGH);
      delay(50);
    }
  }

Schematics

Real Circuit

No document.

Comments

Similar projects you might like

Smart Garden

Project showcase by patel Dipen

  • 22,355 views
  • 15 comments
  • 59 respects

RF BASED SMART HOME AUTOMATION SYSTEM

by Dennis Mwanza

  • 28,738 views
  • 4 comments
  • 45 respects

Alexa Based Smart Home Monitoring

Project tutorial by Adithya TG

  • 16,647 views
  • 19 comments
  • 47 respects

Home Monitoring System and Smart Home Solution

Project showcase by Akash Kumar

  • 5,471 views
  • 0 comments
  • 21 respects

Rampiot - Cool Smart Lock

Project tutorial by Robinson Mesino

  • 3,693 views
  • 1 comment
  • 23 respects

Arduino Controlled Smart Hydroponic Modular System

Project in progress by Luis Antonio Martin Nuez

  • 9,215 views
  • 2 comments
  • 62 respects
Add projectSign up / Login