Patience's Project

Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

MUHABURA INTEGRATED POLYTECHNIC COLLEGE

FACULTY OF ENGINEERING TECHNOLOGY


DEPARTMENT OF ELECTRICAL TECHNOLOGY

DESIGN AND IMPLEMENTATION OF ILLUMINATION


CONTROL WITH PRECISION USING ARDUINO WITH
BLUETOOTH

An Advanced Diploma Project Submitted to Muhabura Integrated Polytechnic


College in Partial Fulfillment of the Requirements for the Award of Advanced
Diploma in Electrical Technology.

Prepared by: Patience UWAYEZU


Reg.No: MIPC 19/1716

Supervised by: Eng. Marie Grâce BERWA

Musanze, March 2023


DECLARATION AND AUTHORITY TO SUBMIT THE PROJECT

Name of student: Patience UWAYEZU

Title of the project: Design and implementation of illumination control with precision
using Arduino with Bluetooth

a. Declaration by the student

―I do hereby declare that this project submitted in partial fulfillment of the requirement for
the Advanced Diploma in Electrical Technology at Muhabura Integrated Polytechnic
College, is my original work and has not previously been submitted elsewhere. Also, I do
declare that a complete list of references is provided indicating all the sources of information
quoted or cited.

Date and signature of the student

……………………………………………

i
b. Authority to submit the project

Name of supervisor: Eng. Marie Grâce BERWA

In my capacity as supervisor, I hereby authorize the student to submit the project to the department
ready for presentation

Date and signature of the supervisor

………………………………………………………….

ii
DEDICATION

I dedicate this work to:


My family
My lectures
My supervisor
Muhabura Integrated Polytechnic College Staff
My colleagues
My friends

iii
ACKNOWLEDGEMENT

Let me take this opportunity to thank Almighty God for this achievement and people who
helped me.

I am going to start by thanking my supervisor Eng. Marie Grâce BERWA for assisting me in
conducting this project all advice she gave helped me and thanks to all Muhabura Integrated
Polytechnic College Staff for all effort done to increase my knowledge.

I would like to thank particularly my family for their financial contribution for carrying out
my studies. I would like to appreciate all colleagues of my class, who had helped me in
whatever I was doing in Muhabura Integrated Polytechnic College and also all effort
provided by every one of you, according to his/her capacities for helping me, to achieve this
work.

iv
ABSTRACT

This project presents the development of illumination control with precision using a Triac
control circuitry. Lighting is the biggest use of electricity, extending worldwide and to almost
everyone. Lighting is crucial to activities after sunset, indoors activities, experimentation
convenience and so on. The vast use of lighting calls upon the need to control the amount of
illumination according to preference or activity. Too much or too little illumination has seen
the increase into various eye conditions and headaches. Also adequate lighting ensures safety
and efficient operations. In this project I will design and implement an illumination control
system based on Arduino and Bluetooth. This system can be handy for multipurpose halls,
experimentations, workplaces, and homes. I will use proteus to simulate my circuit, visual
data collection of illumination in relation to inputs. The Arduino program will be key in
linking inputs to triac. At the end of my project after designing, building the prototype; I
tested the system and I could be able to control the illumination simply by using my
Smartphone.

v
TABLE OF CONTENTS

DECLARATION AND AUTHORITY TO SUBMIT THE PROJECT ................................... i

DEDICATION.............................................................................................................................. iii

ACKNOWLEDGEMENT ........................................................................................................... iv

ABSTRACT ................................................................................................................................... v

TABLE OF CONTENTS ............................................................................................................ vi

LIST OF SYMBOLS, AND ABBREVIATIONS/ACRONYMS ............................................. ix

LIST OF TABLES ........................................................................................................................ x

LIST OF FIGURES ..................................................................................................................... xi

CHAPTER ONE: GENERAL INTRODUCTION .................................................................... 1

1.1 Background of the study .................................................................................................... 1

1.2. Problem statement ............................................................................................................. 1

1.3. Objectives............................................................................................................................ 2

1.3.1. Main objective ...................................................................................................................... 2

1.3.2. Specific objectives................................................................................................................. 2

1.4. Scope of project .................................................................................................................. 2

1.5. Significance of study .......................................................................................................... 2

Households ..................................................................................................................................... 2

Working places ............................................................................................................................... 2

Entertainment................................................................................................................................. 2

1.6. Organization of study ........................................................................................................ 3

CHAPTER TWO: LITERATURE REVIEW ............................................................................ 4

2.0. INTRODUCTION.............................................................................................................. 4

2.1. Resistors .............................................................................................................................. 4

2.2. Capacitors ........................................................................................................................... 5

2.3. Triac .................................................................................................................................... 6

Triac applications ........................................................................................................................... 7

vi
2.4. Cables and Connectors ...................................................................................................... 8

2.5. Diodes .................................................................................................................................. 8

2.6. PCB and Breadboards ....................................................................................................... 9

2.7. Bluetooth module ............................................................................................................. 10

2.8. Arduino ............................................................................................................................. 12

2.9. Optocouplers Integrated circuits .................................................................................... 13

2.10. Lamp ............................................................................................................................... 14

CHAPTER THREE: METHODOLOGY ................................................................................ 15

3.1. Introduction ...................................................................................................................... 16

3.2. Study Design ..................................................................................................................... 16

3.2.1. Tools and components........................................................................................................ 16

3.2.2. Programming ..................................................................................................................... 17

3.3. Data collection methods and procedures to be used ..................................................... 17

3.4. Data analysis ..................................................................................................................... 17

3.5. Problems and Limitations of the project ....................................................................... 18

3.6. Ethical Considerations .................................................................................................... 18

CHAPTER FOUR: DESIGN AND IMPLEMENTATION OF ILLUMINATION


CONTROL WITH PRECISION USING ARDUINO WITH BLUETOOTH ...................... 19

4.1. Introduction ...................................................................................................................... 19

4.2. Design of the study ........................................................................................................... 19

4.2.1 Block diagram of the study ................................................................................................. 19

4.2.2. Circuit diagram of the study .............................................................................................. 20

4.2.3. Specifications and calculation ........................................................................................... 21

4.3. Implementation of the study ........................................................................................... 22

4.3.1. Working principle of the study .......................................................................................... 22

4.3.2. Results and interpretation .................................................................................................. 24

4.3.3. Cost estimation ................................................................................................................... 25

CHAP 5: SUMMARY, CONCLUSION AND RECOMMENDATIONS ............................. 26

vii
5.0 Summary ............................................................................................................................ 26

5.1 Conclusion ......................................................................................................................... 26

5.2. Recommendations ............................................................................................................ 26

APPENDIX .................................................................................................................................. 28

viii
LIST OF SYMBOLS, AND ABBREVIATIONS/ACRONYMS

AC: Alternating Current


DC: Direct Current
IEEE: Institute of Electrical and Electronics Engineers
LED: Light Emitting Diode
MT: Main Terminal
OSHA: Occupational Safety and Health association
PC: Personal computer
PCB: Printed Circuit Board
SCR: Silicon Controlled Rectifier
UART: Universal Asynchronous Receiver Transmitter
USB: Universal serial Bus

ix
LIST OF TABLES

Table 1: component specifications........................................................................................... 21


Table 2: cost estimation ........................................................................................................... 25

x
LIST OF FIGURES

Figure 1: Resistor ....................................................................................................................... 5


Figure 2: Capacitor .................................................................................................................... 6
Figure 3: Triac............................................................................................................................ 7
Figure 4: Wires/connectors ........................................................................................................ 8
Figure 5: Diodes ......................................................................................................................... 9
Figure 6: Printed circuit board ................................................................................................. 10
Figure 7:bluetooth module ....................................................................................................... 12
Figure 8: arduinouno ................................................................................................................ 13
Figure 9: integrated circuits ..................................................................................................... 14
Figure 10: Lamp ....................................................................................................................... 15
Figure 11: Block diagram of circuit ......................................................................................... 19
Figure 12: circuit diagram ........................................................................................................ 20
Figure 13: implementation of project ...................................................................................... 24

xi
CHAPTER ONE: GENERAL INTRODUCTION

1.1 Background of the study


Light is a form of radiant energy from natural sources- the sun and artificial sources such as a
candle and electric lamps. An intelligent lighting system is the combination of light sources,
sensors, communication networks, and information systems whose purpose is to meet the
users‘ visual and non-visual experiences while minimizing the environmental footprint.
Light plays a huge role in today‘s world and it goes far beyond the limits of simple
illumination. However, it seems rather difficult to control such miracles as multifunctional
illumination or light atmosphere changes in accordance with the situation. This problem
could be solved by implementation of an illumination control system.
Illumination control system unites all the light sources in the building and gives an
opportunity to control each of them individually from any location. Such system allows
controlling illumination as much as possible, starting from illumination control in one room
and extending to its control in as many premises as necessary, even having difficult
configurations. Illumination control system could be integrated into the general control
scheme of other components, such as an alarm system, media etc., in such way improving the
efficiency of service.

1.2. Problem statement


Most lighting systems today are based on traditional means. The lighting fixtures are
connected to a full standard voltage supply. The control of lighting for these fixtures is only
based on an off /on switch. However, the luminance of these lights needs to be controlled
beyond that.
Some people prefer less or more luminance with respect to their vision conditions. In offices
and working places illumination levels are recommended by the occupational safety and
health standard. Illumination levels need to vary according to preference, standards, type of
work, or physical conditions. People around the globe suffer from different vision conditions
due to eyestrain due to low illumination levels and fatigue caused by low or high illumination
levels.
Constant full illumination levels full time means a high and damaging consumption of
electrical energy. Electrical expenses increase that they outgrow the demand, there is no
efficient use of the available electrical energy.

1
1.3. Objectives
1.3.1. Main objective
The main objective is to design and implement a lamp illumination control with precision
using Arduino.

1.3.2. Specific objectives


 To design an Arduino - based lamp illumination control system.
 To build the prototype
 To test the circuit.

1.4. Scope of project


This study focuses on controlling the illumination level of light bulbs manually by turning a
knob and automatically by programming and sensing. This is enabled by the use of power
electronics, Arduino and light dependent resistor as the sensor. The power electronics control
the firing angle of an ac sine wave, thus altering the voltage available to the light bulb.
Programming the Arduino improve the automation part of the project.

1.5. Significance of study


Here are the beneficiaries of this project.

Households
At home people need to vary illumination level according to their preferences, work,
or physical conditions. A home shelters a number of people has several rooms hence
plenty of light bulbs. People may move out and a different family moves in.

Working places
OSHA has put forth the necessary standards pertaining to workplaces. Control of
illumination levels is crucial to match the work being done. An office clerk may
require particular lighting needs that help their vision.

Entertainment
Illumination control is not only a scientific interest but also an art interest. With the
help of an automated illumination control, one can develop an artful display for
performance stages, bars, and more.

2
1.6. Organization of study
Chapter 1 is introduction and consists of 6 parts. They are background to study, problem
statement, project objectives, scope of study, significance of the study and the organization of
the study.
Chapter 2 is literature review. It emphasizes on defining main terms and concepts pertaining
to the study. It will talk about similar projects.
Chapter 3 is research methodology. I will discuss ways and techniques that I used to make me
researches. They are methods used to collect the data.
Chapter 4 is presentation and analysis of Results of the data collected during research.
Chapter 5 is the summary, conclusion and Recommendations of my research.

3
CHAPTER TWO: LITERATURE REVIEW

2.0. INTRODUCTION
This chapter discussed on other related or similar works, and then defined related terms and
ideas on the topic. It discusses basic concepts and the basic components used and their
function.

2.1. Resistors
If there wasn‘t such a thing as resistance, the subject of electronics wouldn‘t exist; only
infinite currents would flow and voltages wouldn‘t exist either! We need to reduce the flow
of current if we are to make current do something useful for us. Components that resist the
flow of current are called resistors, and they are said to have a resistance which is measured
in ohms (), named after Georg Ohm, who formulated the law (also named after him) by
which the voltage and current through a conductor are related (Scherz, 2000).
Some substances, such as carbon, conduct electricity fairly well but not really well. The
conductivity can be changed by adding impurities like clay to a carbon paste, or by winding a
thin wire into a coil. Electrical components made in this way are called resistors. They are
important in electronic circuits because they allow for the control of current flow. Resistors
can be manufactured to have exact characteristics. Imagine telling each person in the line that
they must pass a certain number of balls per minute. This is analogous to creating a resistor
with a certain value of electrical resistance. The better a resistor conducts, the lower its
resistance; the worse it conducts, higher the resistance (Gibilsco, 2002).
Resistors are manufactured in several sizes and varieties. They come in ‗fixed‘ and ‗variable‘
versions. The most commonly used are the ‗fixed‘ carbon ‗E12‘ range. This is a range of
values which has 12 resistor values which repeat: 10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82
and then: 100, 120, 150, 180, 220, 270, 330, 390, 470, 560, 680, 820 and then: 1000, 1200,
1500, 1800, 2200, 2700, 3300, 3900, 4700, 5600, 6800, 8200, etc.
Nowadays, circuits often carry very little power and so the resistors can, and are, made in
very small physical sizes. The higher the resistance value of a resistor, the less current will
flow through it when a voltage is placed across it. As it can be difficult to see printing on
small resistors clustered together on a circuit board and surrounded by other larger
components, the resistor values are not written on the resistors, instead, the resistors are
color-coded. The unit of measurement for resistors is the ‗ohm‘ which has a very small size.

4
Most resistors which you encounter will be in the range 100 ohms to 1,000,000 ohms. The
higher the resistance of any resistor, the smaller the current which will flow through it.

The color code used on resistors is:


0 Black
1 Brown
2 Red
3 Orange
4 Yellow
5 Green
6 Blue
7 Purple
8 Grey
9 White
Each resistor has typically, three color bands to indicate its value. The first two bands are the
numbers and the third band is the number of zeros.

Figure 1: Resistor

2.2. Capacitors
A capacitor is a device that stores energy in the form of electricity. The simplest form of
capacitor takes the form of two flat metal sheets separated by air; connections are made to
each plate, as Figure 1 shows. If you imagine a pair of these plates, 30 cm square and
separated from each other in air by 1 mm, the capacitance of this device would be almost
exactly 80 Pico farads (pF), i.e. 80 million-millionths of the unit of capacitance, the farad.
Now this is quite a small value, you will agree, and it comes about because the farad is such a
large unit. Nevertheless, as you will probably know, we may have capacitors of value 10 000

5
microfarads (F) in our radio equipment, and they can be smaller than your little finger, so
they are obviously not made the same way! (Scherz, 2000)
But two sheets, or strips, of foil can be placed one on top of the other, separated by a thin, no
conducting sheet such as paper, and then the whole assembly can be rolled up to get a large
effective surface area. When this is done, the electric flux becomes great enough so that the
device exhibits significant capacitance. In fact, two sets of several plates each can be meshed
together, with air in between them, and the resulting capacitance will be significant at high ac
frequencies.
In a capacitor, the electric flux concentration is multiplied when a dielectric of a certain type
is placed between the plates. Plastics work very well for this purpose. This increases the
effective surface area of the plates, so that a physically small component can be made to have
a large capacitance. The voltage that a capacitor can handle depends on the thickness of the
metal sheets or strips, on the spacing between them, and on the type of dielectric used
(Gibilsco, 2002).
There are many types of capacitors depending on materials used or dielectric material. These
are ceramic, electrolytic, paper, plastic -film, semiconductor, tantalum, and mica capacitors.

Figure 2: Capacitor
Applications of capacitors range from energy storage as temporary battery, power
conditioning by removing DC noise, pulsed power, power factor correction, sensors, tuning
and many more. They are versatile electronic components because of their extended
applications.

2.3. Triac
TRIAC is an acronym that has been coined to identify the triode AC semiconductor switch
which is triggered into conduction by agate signal in a manner similar to the action of a SCR.
The triac, generally called a bidirectional triode thyristor, first developed by general electric,
differs from the SCR in that it can conduct in both directions of current flow in response to a
positive or negative gate signal.

6
The primary objective underlying development of the triac was to provide a means for
producing improved controls for AC power. The use of SCR has proven the technical
feasibility and benefits of the basic functions of solid state switching and phase control. The
triac is able to conduct in a number of ways - more than the thyristor. It can conduct current
irrespective of the voltage polarity of terminals MT1 and MT2. It can also be triggered by
either positive or negative gate currents, irrespective of the polarity of the MT2 current. This
means that there are four triggering modes or quadrants:

I+ Mode MT2 current is +ve, gate current is +ve


I- Mode MT2 current is +ve, gate current is -ve
III+ Mode: MT2 current is -ve, gate current is +ve
III- Mode: MT2 current is -ve, gate current is -ve
It is found that the triac trigger current sensitivity is greatest when the MT2 and gate currents
are both of the same polarity, i.e. both positive or both negative. If the gate and MT2 currents
are of the opposite polarity, then the sensitivity is typically about half the value of when they
are the same.

Triac applications
Triacs are used in many applications. These electronic components are often used in low to
medium power AC switching requirements. Where large levels of power need to be switched,
two thyristors / SCRs tend to be used as they can be controlled more easily.
Nevertheless, triacs are widely used in many applications:
Lighting control - especially domestic dimmers.
Control of fans and small motors.
Electronic switches for general AC switching and control.
There are naturally many other triac applications, but these are some of the most common.
(poole, n.d.)

Figure 3: Triac

7
2.4. Cables and Connectors
Wires and cables provide low-resistance pathways for electric currents. Most electrical wires
are made from copper or silver and typically are protected by an insulating coating of plastic,
rubber, or lacquer. Cables consist of a number of individually insulated wires bound together
to form a multiconductor transmission line. Connectors, such as plugs, jacks, and adapters,
are used as mating fasteners to join wires and cable with other electrical devices (Scherz,
2000).
These are male male jumper wires.

Figure 4: Wires/connectors

2.5. Diodes
A diode is a two-lead semiconductor device that acts as a one-way gate to electric current
flow. When a diode‘s anode lead is made more positive in voltage than its cathode lead—a
condition referred to as forward biasing—current is permitted to flow through the device.
However, if the polarities are reversed (the anode is made more negative in voltage than the
cathode)—a condition referred to as reversed biasing—the diode acts to block current flow.
Diodes are used most commonly in circuits that convert ac voltages and current into dc
voltages and currents (e.g., ac/dc power supply). Diodes are also used in voltage-multiplier
circuits, voltage-shifting circuits, voltage-limiting circuits, and voltage-regulator circuits.
A pn-junction diode (rectifier diode) is formed by sandwiching together n-type and p-type
silicon. In practice, manufacturers grow an n-type silicon crystal and then abruptly change it
to a p-type crystal. Then either a glass or plastic coating is placed around the joined crystals.
The n side is the cathode end, and the p side is the anode end (Scherz, 2000).
Some dopants will create a type N structure in which there are some extra electrons simply
hanging out with nowhere to go. Other dopants will create a type P structure in which there
are missing electrons, also called holes. So, we have one type N that will conduct negative
charges with a little effort. We have another type that not only does not conduct but actually
has holes that need filling. A cool thing happens when we smash these two types together.

8
Due to the interaction of the holes and the free electrons, a diode allows current to flow in
only one direction. A perfect diode would conduct electricity in one direction without any
effect on the signal. In actuality, a diode has two important characteristics to consider: the
forward voltage drop and the reverse breakdown voltage (Ashby, 2012)
Here are some uses of diodes: Rectification, detection, Frequency multiplication, mixing,
Switching, Voltage regulation, Amplitude limiting, Frequency control, oscillation and
amplification, and energy emission.

Figure 5: Diodes

2.6. PCB and Breadboards


Once one finishes making a successful prototype, the next step is to construct a more
permanent circuit. At this point, one must choose the type of mounting board on which to
place the circuit. Choices include a perforated board, a wire-wrap board, a preetched board,
or a custom-etched PC board. Let‘s take a closer look at each of these boards.
If one is looking to build a circuit with a professional appearance, designing a custom etched
circuit board, or PC board (printed circuit board), is the ticket. Custom etching involves using
graphic and chemical techniques to convert a copper-covered board into a custom-etched one
(Scherz, 2000).
The printed circuit board is not a specific component like the rest, but the part that carries all
the other parts. It is a combination of Surface Mount Technology and Through Hole
technology. The parts connect the other parts together using things called traces (the lines that
are really copper wires), and bias (holes that connect layers of traces together) solder to
connect the parts to the PCB. One key item to remember is that these traces have all of the
three basic components, that is, resistance, inductance, and capacitance (Ashby, 2012).

9
Figure 6: Printed circuit board

2.7. Bluetooth module


A Bluetooth module is a circuit ensemble with integrated circuits, antenna, and software
protocol that is used in wireless communications.
Bluetooth module is divided into data, serial port, voice, and car Bluetooth modules.
Bluetooth Module HC-05 uses serial communication to communicate with the electronics.
It is used for many applications like wireless headset, game controllers, wireless mouse,
wireless keyboard, and many more consumer applications.
It has range up to <100m which depends upon transmitter and receiver, atmosphere,
geographic & urban conditions.
It is IEEE 802.15.1 standardized protocol, through which one can build wireless Personal
Area Network. It uses frequency-hopping spread spectrum radio technology to send data over
air.
It uses serial communication to communicate with devices. It communicates with
microcontroller using serial port.
HC-05 Bluetooth Module
HC-05 is a Bluetooth module which is designed for wireless communication. This module
can be used in a master or slave configuration.
This is the picture of HC-05 Bluetooth Module
HC-05 Bluetooth Module
Bluetooth serial modules allow all serial enabled devices to communicate with each other
using Bluetooth.
It has 6 pins,
1. Key/EN: It is used to bring Bluetooth module in AT commands mode. If Key/EN pin is
set to high, then this module will work in command mode. Otherwise by default it is in data

10
mode. The default baud rate of HC-05 in command mode is 38400bps and 9600 in data
mode.
HC-05 module has two modes,
1. Data mode: Exchange of data between devices.
2. Command mode: It uses AT commands which are used to change setting of HC-05.
To send these commands to module serial port is used.
2. VCC: Connect 5 V or 3.3 V to this Pin.
3. GND: Ground Pin of module.
4. TXD: Transmit Serial data (wirelessly received data by Bluetooth module transmitted out
serially on TXD pin)
5. RXD: Receive data serially (received data will be transmitted wirelessly by Bluetooth
module).
6. State: It tells whether module is connected or not.
HC-05 module Information
HC-05 has red LED which indicates connection status, whether the Bluetooth is connected or
not. Before connecting to HC-05 module this red LED blinks continuously in a periodic
manner. When it gets connected to any other Bluetooth device, its blinking slows down to
two seconds.
This module works on 3.3V. We can connect 5V supply voltage as well since the module has
on board 5 to 3.3 V regulator.
As HC-05 Bluetooth module has 3.3V level for RX/TX and microcontroller can detect 3.3 V
level, so, no need to shift transmit level of HC-05 module. But we need to shift the transmit
voltage level from microcontroller to RX of HC-05 module.
The data transfer rate of HC-05 module can vary up to 1Mbps is in the range of 10 meters.
Bluetooth communication between Devices
E.g. Send data from Smartphone terminal to HC-05 Bluetooth module and see this data on
PC serial terminal and vice versa.
To communicate smartphone with HC-05 Bluetooth module, smartphone requires Bluetooth
terminal application for transmitting and receiving data. Bluetooth terminal applications can
be found for android and windows in respective app. store.
So, when we want to communicate through smartphone with HC-05 Bluetooth module,
connect this HC-05 module to the PC via serial to USB converter.
Before establishing communication between two Bluetooth devices, 1st we need to pair HC-
05 module to smartphone for communication.
11
Pair HC-05 and smartphone:
search for new Bluetooth device from phone. You will find Bluetooth device with ―HC-05‖
name.
Click on connect/pair device option; default pin for HC-05 is 1234 or 0000. (Anon., 2023)

Figure 7:bluetooth module

2.8. Arduino
Arduino, an open-source electronics platform, has become the go-to option for anyone
working on interactive hardware and software projects. An Arduino board (such as the Uno)
connected to a breadboard with plugins such as inputs, sensors, lights, and displays can be
controlled by a code written in the Arduino development environment. How to achieve this is
by prototyping with Arduino. Prototyping with Arduino has grown in popularity with the
increased use of the Arduino platform (Kondaveeti, 2021).
There are many versions of this board; Arduino Uno is the simplest one to use and the best
one for learning on. The Arduino has a row of strips at the top and the bottom with lots of
labels. These strips are the connectors, which are used to attach to sensors and actuators.
Those connectors here is an explanation of the input and output pins. In fact, there are a
variety of Arduino boards, but the most common one by far is the Arduino Uno.
It has 14 Digital I/O pins (pins 0–13). These pins can be either inputs or outputs. Inputs are
used to read information from sensors, while outputs are used to control actuators. The

12
programmer needs to specify the direction (in or out) in the sketch he creates in the IDE.
Digital inputs can only read one of two values, and digital outputs can only output one of two
values (HIGH and LOW). it has 6 Analogue In pins (pins 0–5) The analogue input pins are
used for reading voltage measurements from analogue sensors. In contrast to digital inputs,
which can distinguish between only two different levels (HIGH and LOW), analogue inputs
can measure 1,024 different levels of voltage.
It has 6 Analogue Out pins (pins 3, 5, 6, 9, 10, and 11), These are actually six of the digital
pins that can perform a third function: they can provide analogue output. As with the digital
I/O pins, you specify what the pin should do in your sketch. The board can be powered from
your computer‘s USB port, most USB chargers, or an AC adapter (9 volts recommended, 2.1
mm barrel tip, and center positive). Whenever power is provided at the power socket,
Arduino will use that, and if there is no power at the power socket, Arduino will use power
from the USB socket. It‘s safe to have power at both the power socket and the USB socket.
(Banzi, 2015)

Figure 8: arduinouno

2.9. Optocouplers Integrated circuits


An integrated circuit (IC) is a miniaturized circuit that contains a number of resistors,
capacitors, diodes, and transistors stuffed together on a single chip of silicon no bigger than
your fingernail. The number of resistors, capacitors, diodes, and transistors within an IC may
vary from just a few to hundreds of thousands in number. The trick to cramming everything
into such a small package is to make all the components out of tiny n-type and p-type silicon
structures that get imbedded into the silicon chip during the production phase. To connect the
little transistors, resistors, capacitors, and diodes together, aluminum plating is applied along
the surface of the chip.

13
ICs come in analog, digital, or analog/digital form. Analog (or linear) ICs produce, amplify,
or respond to varying voltages. Digital (or logic) ICs respond to or produce signals having
only high and low voltage states, whereas analog/digital ICs share properties common with
both analog and digital ICs. Some common analog ICs include voltage regulators, operational
amplifiers, comparators, timers, and oscillators. Common digital ICs include logic gates (e.g.,
AND, OR, NOR, etc.), flip-flops, memories, processors, binary counters, shift registers,
multiplexers, encoders and decoders, etc. Analog/digital ICs may take on a number of
different forms (Scherz, 2000). Optocouplers ICs use optoelectronic coupling, are often used
to convey information from the secondary output circuits back to the input primary control
circuits without compromising the galvanic isolation between the two.
However, optocouplers have a number of parameter variations and limitations, which must be
considered at the design stage if problems are to be avoided. Of particular interest are
variations in transfer ratio with device type and operating temperature, stability problems
caused by the nonlinear current transfer ratio, and the considerable variations among devices
of the same family. Further, a particular optocoupler may change its parameters considerably
throughout its working life (aging). Finally, the inter electrode capacitance, although small,
can cause noise problems because of the high gain in the optotransistor. As a result of these
limitations, the optical coupler should not be used in an open-loop mode, where such changes
would have a direct effect on the performance (Billings, 2011).

Figure 9: integrated circuits

2.10. Lamp
Lamps are devices that convert electric current into light energy. One approach used in the
conversion process is to pass a current through a special kind of wire filament. As current
collides with the filament‘s atoms, the filament heats up, and photons are emitted (As it turns
out, this process produces a variety of different wavelength photons, so it appears that the
emitted light is white in color). Another approach used to produce light involves placing a
pair of electrodes a small distance apart within a glass gas-enclosed bulb. When a voltage is

14
set across the electrodes, the gas ionizes (electrons are striped from the gas atoms) emitting
photons in the process (Scherz, 2000).

Figure 10: Lamp

15
CHAPTER THREE: METHODOLOGY

3.1. Introduction
In this section I indicate in details the various procedures that will be followed during the
project implementation process. This section includes the following parts: study area, study
design, procedures and methods, data analysis, problems and limitations, and ethical
considerations.

3.2. Study Design


The study will be based on control of illumination to precision. It is quantitative experimental
type of study. The project is a system that uses Arduino to maintain the illumination of a
lamp by controlling a triac. The illumination is maintained by varying the voltage across tithe
system uses the concept of firing angle control of triac. A Bluetooth module is used to enter
the percentage of illumination required by user. This input is fed to an Arduino which
automatically initiates the firing angle control of triac, and adjusts the power supplied to the
lamp with the help of a solid-state switching mechanism.

3.2.1. Tools and components

During implementation, some important tools will be used. Here are some:
 Digital multi meter
 Screwdrivers
 Pliers
 Soldering iron and disordering wire

Components for implementation of illumination control with precision will be


 Arduino Uno
 Triac
 Bluetooth module
 Diodes
 Resistors
 Lamp
 PCB (Printed circuit board)
 Connector cables
 Integrated circuits

16
3.2.2. Programming
Programming allows us to set instructions that the processor will perform in order to
accomplish our desired task. for this project the program will output the illumination after
processing the input from Bluetooth module. This will be done by using software Arduino
IDE for designing the codes necessary to process inputs and for automatic operations. The
program will be uploaded to Arduino board this was by USB port through the specific USB
cable.
First the Arduino IDE should be installed on computer to get started. The IDE is a special
program running on your computer that allows writing sketches for the Arduino board in a
simple language modeled after the Processing language. The magic happens when you press
the button that uploads the sketch to the board. The code written is translated into the C
language (which is generally quite hard for a beginner to use), and is passed to the compiler,
an important piece of open source software that makes the final translation into the language
understood by the microcontroller. This last step is quite important, because it‘s where
Arduino makes your life simple by hiding away most of the complexities of programming
microcontrollers. The programming cycle on Arduino is basically as follows:
1. Plug your board into a USB port on your computer.
2. Write a sketch that will bring the board to life.
3. Upload this sketch to the board through the USB connection and wait a couple of seconds
for the board to restart.
4. The board executes (performs) the sketch that you wrote.

3.3. Data collection methods and procedures to be used


Show how the data will be collected. i.e. Laboratory diagnosis, Instruments to be used,
and Pre-testing of Instruments, Observation, different types of questionnaires etc.
Data collected is the input from a smartphone paired to the Bluetooth module to control the
firing angle of triac, and the illumination output of a lamp. Data will be collected by
experiment and Proteus simulator. Different inputs shall give different illumination values.
Proteus simulator will be used to measure voltage output.

3.4. Data analysis


Visual inspection upon the change in input will be used to analyze the data.
The relationship between Bluetooth input and luminance will be considered in the analysis
which can further influence the programming.

17
3.5. Problems and Limitations of the project
In this project I will not be able to cope with some technical problems. Electromagnetic
interferences. Important tools and devices ideal to optimum operation will be replaced with
the less sophisticated ones. The setup is likely to be bulky and cumbersome. The circuit will
operate only on normal residential supply voltage. There won‘t be a means to measure the
illumination of the lamp. Main problem for these limitations is financial.

3.6. Ethical Considerations


There is no harm that will be done in the implementation of this project. The prototype will
be built according to the standards and principles that guide the technical world. Proper
disposal and environmental preservation regulations will be kept.

18
CHAPTER FOUR: DESIGN AND IMPLEMENTATION OF
ILLUMINATION CONTROL WITH PRECISION USING ARDUINO
WITH BLUETOOTH

4.1. Introduction
This is chapter will explain how the illumination control using Arduino with Bluetooth
system will be done. The system itself has three important parts, the first one is input part that
includes a Bluetooth module and a smartphone. The smartphone is linked to the module
through Bluetooth and android application named Serial Bluetooth Terminal. The second is a
control part that contained by microcontrollers which are used to control all system. In this
project the main control device is ATmega microcontroller Arduino Uno.it processes the
input from Bluetooth and provides the output to the triac and communicates the output to
smartphone through Bluetooth. The last part is the output that is the Triac and the lamp. Triac
is a bidirectional semiconductor controlled rectifier which can be turned on in either of the
direction by providing triggering pulse at its gate. The lamp provides the illumination
according to amount of voltage getting through the triac.

4.2. Design of the study

4.2.1 Block diagram of the study


Input

Bluetooth module

Arduino

Triac Lamp

Figure 11: Block diagram of circuit

19
4.2.2. Circuit diagram of the study

Figure 12: circuit diagram

20
4.2.3. Specifications and calculation
Table 1: component specifications
NAME TYPE SUPPLY FREQUENCY OTHERS
VOLTAGE
1 Arduino uno ATMega328P 7-12V 32Kb Flash
memory , 2Kb
SRAM, 1kb
EEPROM
2 Bluetooth HC-05 1.8V 2.4GHz -80dBm
module Operation,3.3V sensitivity, up to
to 5V I/O +4dBm RF
transmit power
3 Triac BT 136 600V PGM=5W,
ITSM=25A,
IGM=2A,
IT(RMS)=4A
4 Lamp 220V
5 Optocoupler MOC3021 VDRM=400V, PD=330mW
Triac driver VR=3V,
VISO=7500Vac(
pk)
6 Zero EL817 VCEO= 35V max PD=100mW
crossing VISO= 5000Vrms
detector max
7 Resistors three
1kohm,two
100kohm,470
ohm, 10k ohm

8 Lamp 100W 220V


9 Diodes general purpose

21
4.3. Implementation of the study
4.3.1. Working principle of the study
To control the illumination, the circuit uses phase control technique and static switching
characteristics of a Triac, the Triac is used to switch the AC lamp, as this is a power
electronic fast switching device which is the best suited for these applications.
To control the AC voltage, the first thing I have to do is, to detect the zero crossing of the AC
signal Hence, every time the signal comes to Zero point, I have to detect that point and after
that trigger the Triac as per the power requirement. So, I have to detect when the voltage
passes from positive to negative or from negative to positive and synchronize our pulse with
that so it will fire always in the same spot. For that, I will use a full bridge rectifier. This will
give the output both the positive and negative curves of the AC wave.
First I have to detect the zero-cross since the pulse needs to be in phase with the AC voltage.
So, we have to detect when the voltage passes from positive to negative or from negative to
positive and synchronize our pulse with that so it will fire always in the same spot. For this
full-bridge rectifier is used which will give the output both the positive and negative curves
of the AC wave. The Triac is triggered at a firing angle of 90 degrees by applying a small
gate pulse signal to it. There is delay time which we have to give as per our dimming
requirement. For example, in this case as the firing angle is 90 percent, hence the power
output will also be halved and hence the lamp will also glow with half intensity.
Optocoupler is also known as Opto-isolator. It is used to maintain isolation between two
electrical circuits like DC and AC signals. Basically, it consists of an LED that emits infrared
light and the photo sensor which detects it. Here we are used a MOC3021 opt coupler to
control the AC lamp from microcontroller signals which is a DC signal.
All we have to do is to control the time between the zero-cross and when we fire the pulse at
the Triac gate in order to control power. l used UART Communication through Bluetooth
HC-05 to change the delay timing.

22
23
Figure 13: implementation of project

4.3.2. Results and interpretation


The illumination varies according to the input. Using smart phone, I can send the value of
illumination we desire, the smart phone needs to be connected to the Bluetooth module using
a serial Bluetooth application. The Arduino code helps process input fed to the Arduino. The
output of the Arduino is fed to the triac‘s gate at a measured phase. When the voltage reaches
zero the triac goes off and then the cycle repeats. This allows only a portion of the voltage to
be used that in turn reduces the overall illumination.

24
4.3.3. Cost estimation
Table 2: cost estimation
Name Quantity Price (RWF)
1 Arduino uno 1 15,000
2 Bluetooth module 1 7,000
3 Triac 1 1,000
4 MOC3021 1 1,000
Optocoupler
5 EL817 Optocoupler 1 1,000
6 PCB 1 2,000
7 Resistors 7 700
8 Diodes 4 400
9 Soldering iron 1 4000
10 Connector wires 20 1,000
11 Lamp 1 1,000
TOTAL 34,100

25
CHAP 5: SUMMARY, CONCLUSION AND RECOMMENDATIONS

5.0 Summary
The main objective of this project was to build an illumination control system using Arduino
with Bluetooth. First I designed the circuit for the system and then implemented the system.
The designed circuit was minimal in terms of components. The prototype was successfully
built on a through whole PCB and then soldered. Finally, I tested the prototype by my
smartphone as input to Bluetooth that in turn provides input to the Arduino to determine the
amount of illumination needed.
After testing, I would say the prototype run successfully as I was able to control the
illumination of an incandescent lamp according to inputs zero to nine that determines the
percentage of voltage getting through and hence the amount of illumination. The type of lamp
and its state determines the illumination that we get. Electronic lamps did not work for this
system.

5.1 Conclusion
The illumination control using Arduino with Bluetooth is done to precision in this project.
Users of this control can get desired control of the illumination conveniently, and quickly.
Illumination control is not given much importance in our society, but it is amazing how much
change it can bring to a better world. Think about difference in individual illumination
preferences, and work related illumination. Eye diseases are many in our society, and
illumination control is one factor that can help the prevention and alleviation of such
complexities.

5.2. Recommendations
I recommend this project to multipurpose hall owners in order to cater better to their
customers also indoors farmers, and generally all lighting as they at one moment need it.
I recommend to future researchers to improve the power dissipations and portability. Even
better would be rendered more programmable than circuitry. I think integrated circuits
developed for this sole purpose can solve its complexity and downsides.

26
REFERENCES

1. Anon., 2023. bluetooth module HC-05. [Online]


Available at: https://www.electronicwings.com/sensors-modules/bluetooth-module-hc-05-
2. Ashby, D., 2012. Electrical engineering 101: everything you should have learned in school.
WALTHAM: ELSEVIER.
3. Banzi, M., 2015. Getting Started with Arduino. Calfornia: Maker Media.
4. Billings, K., 2011. Switchmode Power Supply Handbook. THIRD ed. New York:
McGraw-Hill .
5. Gibilsco, S., 2002. TEACH YOURSELF ELECTRICITY AND ELECTRONICS. NEW
YORK: Mc GRAW-HILL.
6. Kondaveeti, H. K., 2021. A systematic literature review on prototyping with Arduino:
Applications, challenges, advantages, and limitations. Computer Science Review, May.
7. poole, i., n.d. What is a Triac. [Online]
Available at: https://www.electronics-notes.com/articles/electronic_components/scr/what-is-
a-
triac.php#:~:text=Triacs%20are%20electronic%20components%20that,where%20power%20
switching%20is%20needed.
8. Scherz, P., 2000. Practical Electronics for Inventors. New York: McGraw-Hill.

27
APPENDIX

The Arduino code


#include <TimerOne.h>
volatile int i=0; // Variable to use as a counter volatile as it is in an interrupt
volatile boolean zero_cross=0; // Boolean to store a "switch" to tell us if we have crossed
zero
int AC_pin = 11; // Output to Opto Triac
int dim = 128; // Dimming level (0-128) 0 = on, 128 = 0ff
int inc=1; // counting up or down, 1=up, -1=down

int freqStep = 75; // This is the delay-per-brightness step in microseconds.


// For 60 Hz it should be 65
int state = 0;
void setup() { // Begin setup
Serial.begin(9600);
pinMode(AC_pin, OUTPUT); // Set the Triac pin as output
attachInterrupt(0, zero_cross_detect, RISING); // Attach an Interupt to Pin 2 (interupt 0)
for Zero Cross Detection
Timer1.initialize(freqStep); // Initialize TimerOne library for the freq
Timer1.attachInterrupt(dim_check, freqStep);

void zero_cross_detect() {
zero_cross = true; // set the boolean to true to tell our dimming function that a zero
cross has occured
i=0;
digitalWrite(AC_pin, LOW); // turn off TRIAC (and AC)
}

void dim_check() {
if(zero_cross == true) {
if(i>=dim) {

28
digitalWrite(AC_pin, HIGH); // turn on light
i=0; // reset time step counter
zero_cross = false; //reset zero cross detection
}
else {
i++; // increment time step counter
}
}
}

void loop() {
if(Serial.available() > 0){ // Checks whether data is comming from the serial port
state = Serial.read(); // Reads the data from the serial port
}

if (state == '0') {
Serial.println("0%"); // Send back, to the phone, the String "LED: ON"
dim=128;
}
else if (state == '1') {
Serial.println("11%");;
dim = 112;
}
else if (state == '2') {
Serial.println("22%");;
dim = 98;
}
else if (state == '3') {
Serial.println("33%");;
dim = 84;
}
else if (state == '4') {
Serial.println("44%");;
dim = 70;
29
}
else if (state == '5') {
Serial.println("55%");;
dim = 56;
}
else if (state == '6') {
Serial.println("66%");;
dim = 42;
}
else if (state == '7') {
Serial.println("77%");;
dim = 28;
}
else if (state == '8') {
Serial.println("88%");;
dim = 14;
}
else if (state == '9') {
Serial.println("100%");;
dim = 0;
}

delay(60);
}

30

You might also like