You are on page 1of 19

JOMO KENYATTA UNIVERSITY

OF AGRICULTURE AND TECHNOLOGY


Academic Year 2023/2024

FOURTH YEAR 1ST SEMESTER LABWORK FOR THE DEGREE OF


BACHELOR OF SCIENCE IN ELECTRONICS AND COMPUTER ENGINEERING

EEE 2408: INTEGRATED CIRCUITS

TERM LAB PROJECT


DATE: 4ST AUGUST 2023

MEMBERS:
1. KELVIN NGATIA ENE212-0064/2019
2. LENNY KIBE ENE212-0066/2019
3. BRIAN LEMAYIAN ENE212-0076/2019
4. DAVID KINYANJUI ENE212-0080/2019
Contents
Chapter 1....................................................................................................................................................3
1.1 Abstract............................................................................................................................................3
1.2 Introduction......................................................................................................................................3
1.3 Objectives........................................................................................................................................4
Chapter 2....................................................................................................................................................4
Literature Review...................................................................................................................................4
Chapter 3....................................................................................................................................................5
3.1 Materials and components...............................................................................................................5
3.2 Methodology....................................................................................................................................6
3.3 Circuit design...................................................................................................................................6
3.4 Programming....................................................................................................................................6
3.5 PCB design and Fabrication............................................................................................................9
3.6 Assembly and Testing....................................................................................................................12
Chapter 4..................................................................................................................................................12
4.1 Results............................................................................................................................................12
4.2 Discussion......................................................................................................................................13
Conclusion...............................................................................................................................................13
Budget......................................................................................................................................................13
Chapter 1
1.1 Abstract
This report presents the design and implementation of a smart bulb control system utilizing a
communication chip, Arduino micro-controller, and relay module to enable remote switching of a bulb
over WiFi. The objective of this project was to create an efficient and user-friendly solution for
remotely controlling household lighting, enhancing convenience, and energy management. The system
architecture comprises an Arduino micro-controller, which acts as the central processing unit,
integrated with a communication chip, enabling WiFi connectivity. A relay module is employed to
interface with the bulb and control its power supply. Communication between the user's smartphone
and the smart bulb control system is facilitated through a custom-developed mobile application. The
report details the hardware and software components utilized in the project, emphasizing the selection
criteria for the communication chip, Arduino board, and relay module. Furthermore, the software
design focuses on the development of the mobile application for seamless user interaction with the
smart bulb control system. The implementation process, including circuit assembly, firmware
programming, and mobile application development, is elaborated step-by-step. Extensive testing and
validation procedures were conducted to ensure the reliability and safety of the system. Results
obtained from the experiments demonstrate the successful integration of the communication chip,
Arduino, and relay module, enabling reliable and real-time control of the bulb over WiFi. The mobile
application provides an intuitive interface for users to remotely switch the bulb on and off, irrespective
of their location, enhancing home automation capabilities. This project contributes to the growing field
of Internet of Things (IoT) applications and home automation. The integration of the communication
chip, Arduino micro-controller, and relay module presents a cost-effective and accessible solution for
individuals seeking to augment their living spaces with smart lighting technology. This report presents
a comprehensive overview of the design, implementation, and testing of a WiFi-enabled smart bulb
control system using Arduino and a communication chip. The project's success signifies its potential for
scalability and adaptability, fostering further advancements in home automation and IoT-based
applications.

1.2 Introduction
With the advent of the Internet of Things (IoT) and the growing trend of home automation, smart
control systems have become an integral part of modern living. In this context, the design and
implementation of a WiFi-enabled bulb control system using an Arduino micro-controller, a
communication chip, and a relay module present a promising solution to enhance the convenience and
efficiency of household lighting. This report aims to explore the development process and outcomes of
this innovative project, focusing on the integration of hardware and software components to achieve
remote bulb control over WiFi. The need for smart home solutions has gained considerable momentum
due to their ability to offer enhanced comfort, energy management, and user-friendliness. In this
project, we leverage the capabilities of Arduino, a versatile micro-controller renowned for its ease of
use and extensive community support, along with a carefully selected communication chip to enable
WiFi connectivity. Additionally, the relay module serves as a critical interface between the smart
control system and the bulb, ensuring efficient power management and safe switching operations.
1.3 Objectives
Develop a WiFi-enabled smart bulb control system
Implement a relay module for efficient power management

Chapter 2
Literature Review

The integration of Internet of Things (IoT) technology in smart home applications has revolutionized
the way we interact with our living spaces. Among various IoT devices, smart lighting systems have
garnered significant attention due to their potential for energy savings, convenience, and enhanced user
experience. This literature review explores the existing research and developments related to IoT-based
smart bulb control systems utilizing a relay, communication chip, and Arduino micro-controller. IoT
technology has gained widespread adoption in various fields, including smart homes. Researchers have
highlighted the potential of IoT-based systems to improve home automation, energy efficiency, and user
convenience. Smart lighting, in particular, has emerged as a prominent application area, offering remote
control, scheduling, and energy-saving capabilities through seamless integration of devices and data
exchange. Relays serve as critical components in IoT-based smart bulb control systems, enabling
efficient power management and remote switching of the lighting source. Existing literature
demonstrates how relays facilitate the connection between the micro-controller and the bulb, allowing
users to remotely turn the bulb on or off through a communication channel. Communication chips play
a vital role in establishing wireless connectivity in IoT devices. Researchers have explored various
communication protocols, such as WiFi, Bluetooth to enable seamless data transmission between the
smart bulb control system and user interfaces, such as smartphones and web applications. The selection
of a suitable communication chip is crucial for achieving real-time and reliable control of smart bulbs.
Arduino micro-controllers have emerged as popular choices in DIY home automation projects due to
their open-source nature, ease of programming, and compatibility with a wide range of sensors and
modules. Previous literature showcases the versatility of Arduino in smart lighting applications, where
it acts as the central processing unit, handling user inputs, relay control, and communication with
external devices. Smart bulb control systems have been studied extensively for their energy-saving
potential. Literature emphasizes the importance of smart lighting solutions in reducing energy
consumption, especially when combined with scheduling algorithms, occupancy sensors, and daylight
harvesting techniques. Studies have shown that IoT-based smart lighting can significantly contribute to
environmental sustainability by minimizing carbon footprints.

Chapter 3
3.1 Materials and components
1. Arduino board (Arduino Uno)
2. ESP8266-01 module
3. ESP-01 relay module
4. Jumper wires
5. USB cable for Arduino programming
6. Mobile device with Wi-Fi capability
7. EasyEDA for PCB design
8. Hydrochloric acid (HCl)
9. Hydrogen peroxide (H2O2)
10. Water
11. Copper-clad PCB board
12. Iron Box
13. L7805cv
14. Soldering gun
15. Two 10uf capacitors
Some images of the components used:
ESP8266-01

ESP-01 RELAY:
3.2 Methodology
The aim of this project was to develop a simple home automation system using Arduino, ESP8266-01
Wi-Fi module, and ESP-01 relay module. The system enables remote control of an external device,
such as a light bulb or fan, using a mobile device connected via Wi-Fi. The PCB design and fabrication
were carried out using EasyEDA, and the etching process involved the use of Hydrochloric acid (HCl)
and Hydrogen peroxide (H2O2) for creating the copper traces on the PCB.
3.3 Circuit design
The first step was to design the circuit diagram of this project . The ESP8266-01 module was interfaced
with the Arduino board using UART serial communication. This was done to program ESP8266-01
access point (AP) to establish a Wi-Fi connection with a mobile device or a router.The ESP8266-01
module was then mounted in the ESP-01 relay module. The relay was used to control the external
device's power supply based on commands received from the mobile device.
3.4 Programming
The following code was programmed to the esp8266-01
#include <ESP8266WiFi.h>

const char* ssid = "rnk"; // wifi SSID


const char* password = "12345678"; // wifi password
#define RELAY 0 // relay connected to GPIO0
WiFiServer server(80);

void setup()
{
Serial.begin(115200); // same baudrate with the Serial Monitor

pinMode(RELAY,OUTPUT);
digitalWrite(RELAY, LOW);

// 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(WiFi.localIP());
Serial.println("/");

void loop()
{
// 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();

// Match the request


int value = LOW;
if (request.indexOf("/RELAY=ON") != -1)
{
Serial.println("RELAY=ON");
digitalWrite(RELAY,LOW);
value = LOW;
}
if (request.indexOf("/RELAY=OFF") != -1)
{
Serial.println("RELAY=OFF");
digitalWrite(RELAY,HIGH);
value = HIGH;
}

// Return the response


client.println("HTTP/1.1 200 OK");
client.print("{status:");
client.print(value);
client.println("}");
client.println("Content-Type: text/html");
client.println("");
client.println("<!DOCTYPE HTML>");
client.println("<html>");
client.println("<head><title>ESP8266 RELAY Control</title></head>");
client.print("Relay is now: ");

if(value == HIGH)
{
client.print("OFF");
}
else
{
client.print("ON");
}
client.println("<br><br>");
client.println("Turn <a href=\"/RELAY=OFF\">OFF</a> RELAY<br>");
client.println("Turn <a href=\"/RELAY=ON\">ON</a> RELAY<br>");
client.println("</html>");

delay(1);
Serial.println("Client disonnected");
Serial.println("");
}
3.5 PCB design and Fabrication
The circuit diagram was translated into a PCB layout using EasyEDA. The components, including the
ESP8266-01 module, ESP-01 relay module, and Arduino board, were positioned on the PCB layout.
Proper care was taken to ensure that the traces were correctly connected between the components.
Additional components such L7805cv and two 10uf capacitors were included as needed to ensure
proper voltage regulation and noise reduction.
Below is the circuit diagram:
Once the PCB layout was finalized, the design files were exported from EasyEDA for PCB fabrication.
A copper-clad PCB board was used for the fabrication process. The PCB design files were transferred
to the copper-clad board using a photoresist mask or a laser printer transfer method. The board was
then subjected to the etching process using Hydrochloric acid (HCl) and Hydrogen peroxide (H2O2).
The etching process removed the unwanted copper from the board, leaving behind the desired copper
traces forming the circuit.
Below are images of the fabricated pcb:
3.6 Assembly and Testing
After the PCB fabrication, the components were assembled onto the PCB. The ESP8266-01 module
was soldered onto its designated headers, and the ESP-01 relay module was mounted at its appropriate
location. Resistors, capacitors, and other components were soldered based on the PCB design. Careful
attention was given to avoid solder bridges or cold solder joints. The final step involved testing the
home automation system. The PCB was powered up.The ESP8266-01 module was configured to
establish a Wi-Fi connection with the mobile device. The system's functionality was tested by sending
commands from the mobile device to control the relay and observing the external device's response.The
bulb was turning on and off based on the given command on the phone.

Chapter 4
4.1 Results
The smart bulb control system using Arduino, ESP8266-01 module, and ESP-01 relay module was
successfully designed, fabricated, and tested. The PCB design was created using EasyEDA, and the
etching process involved the use of Hydrochloric acid (HCl) and Hydrogen peroxide (H2O2) for PCB
fabrication. The system allowed remote control of an external device through a mobile device
connected via Wi-Fi.During testing, the ESP8266-01 module effectively established a Wi-Fi
connection, acting as an access point, and received commands from the mobile device. It sent
appropriate signals to the ESP-01 relay module, successfully controlling the relay switch. The external
device, connected to the relay module, responded accordingly, demonstrating the practicality of the
smart bulb control system.

4.2 Discussion
The successful implementation of the smart bulb control system indicates the feasibility of using
readily available components like the ESP8266-01 module and ESP-01 relay module to create a low-
cost, efficient, and user-friendly home automation solution. The use of EasyEDA for PCB design
streamlined the process, allowing for quick iteration and validation of the circuit layout. Additionally,
the HCl-H2O2 etching process for PCB fabrication proved to be an effective and accessible method,
resulting in a functional PCB.One key advantage of this system is its wireless connectivity through Wi-
Fi, enabling users to control the external device remotely from their mobile devices. The ESP8266-01
module's capability as an access point provided a direct and seamless connection between the mobile
device and the smart bulb control system.Despite its success, some challenges were encountered during
the project. One notable challenge was ensuring the stability of the Wi-Fi connection between the
mobile device and the ESP8266-01 module and also port forwarding which worked perfectly while
using the router but during the presentation we can only create a hotspot using a mobile device and port
forwarding was restricted by out ISP (safaricom).Factors such as signal interference and range
limitations may affect the reliability of the system, and further optimizations and signal strength
improvements could be explored to enhance the overall performance.

Conclusion
The project accomplished its goal of developing a smart bulb control system using Arduino, ESP8266-
01 Wi-Fi module, and ESP-01 relay module. EasyEDA facilitated efficient PCB design, and the HCl-
H2O2 etching process allowed for the creation of a functional and compact PCB. The system
successfully enabled remote control of an external device through a mobile device connected via Wi-Fi.
This project serves as a foundation for further exploration and enhancement of home automation
systems. The versatility of the ESP8266-01 module and the simplicity of the Arduino platform make it
possible to expand the system's capabilities by integrating additional sensors and devices. Future
improvements may include adding security features to protect against unauthorized access,
implementing a user-friendly mobile application, and enhancing the system's reliability and
performance. In conclusion, the smart bulb control system demonstrated in this project offers an
accessible and practical solution for automating home devices. With continuous advancements and
refinements, such systems have the potential to revolutionize the way we interact with our living
spaces, providing increased convenience, energy efficiency, and comfort.
Budget
Most products were acquired from Nerokas
PRODUCT QUANTITY COST
Arduino uno R3 1 1700
Esp8266-01 2 500
Esp-01 relay 1 550
Laser tone transfer paper 3 120
Copper clad board single sided 2 300
10x15
Soldering gun and wire 1 1500
HCL 1 250
H2O2 1 150
L7805CV 2 60
10uf capacitors 4 20
Bulb and bulb holder 1 200
Powder Free Nitrile Gloves 4 pairs 300
Miscellaneous 500
TOTAL 6150

You might also like