You are on page 1of 12

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/335219738

A BIDIRECTIONAL AUTOMATIC ROOM LIGHT CONTROLLER USING VISITOR


COUNTER

Article · January 2018

CITATIONS READS

0 3,632

1 author:

Jangfa Timothy
University of Jos
10 PUBLICATIONS   2 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Analysis of scattering parameters affecting satellite communication system in Plateau State Nigeria View project

All content following this page was uploaded by Jangfa Timothy on 17 August 2019.

The user has requested enhancement of the downloaded file.


Nigerian Journal of Physics 2018: Volume 27(S)

A BIDIRECTIONAL AUTOMATIC ROOM LIGHT CONTROLLER USING VISITOR


COUNTER

1
Ogherohwo E.P., 2Igbekele O. J., 3Jangfa T. Zhimwang, 4Zumji J.J

Department of Physics, University of Jos, Jos Plateau State, Nigeria.

jangfatimothy@gmail.com; enohpius@yahoo.com

Abstract

This work bidirectional automatic room light controller using visitor counter, is a reliable circuit
that takes over the task of controlling the room light as well as counting number of persons in the
room very accurately. The counting and turning ON and OFF of light is sensor dependent, as
light sensor placed at a particular location gets a pulse and the light comes ON and when the
person goes out, the same sensor gets another pulse and the light goes OFF. The block diagram
of the circuit was achieved by the use of a methodological approach known as “TO DOWN”
approach of the development process of microcontroller-base system Crisp (2004). The system
circuit was designed with DIPTRACE The microcontoller was programmed using hex file. The
soldering procession was done and after completion of the soldering process, the circuit was
tested. The phase voltage of 220v ac was stepped down to 12v ac at 50Hz using a step down
transformer.

Key words: Bidirectional, Counter, Sensor, Microcontroller and ASEM51 Aembler.

1.0 INTRODUCTION

A bidirectional automatic room light controller using visitor counter and 8051 microcontroller is
a reliable circuit that takes over the task of controlling the room light as well as counting number
of persons visiting the room very accurately (Rakesh 2015). When somebody enters into the
room the counter is incremented by one and the light in the room will be switched ON whenever.
any one leaves the room then the counter is decremented by one and so on. The light will only be
switched OFF when all the persons in the room goes out. The total number of persons inside the
room is also displayed on the seven segment displays. The microcontroller does the above job, it
Nigerian Journal of Physics 2018: Volume 27(S)

receives the signals from the sensors and the signal is operated under the control of a program
which is stored in the ROM.

Electricity has become a necessity for all, without which day-to-day life chores and daily
activities become stand still. Due to the depletion of non-renewable resources, conservation of
energy has become mandatory and by doing so we can reduce electricity bills as well. We know
that energies like wind energy, solar energy and hydro energy are called renewable energy
sources for power supply is the possible way of producing, conserving and renewing energy
which is advantageous as it is pollution free, affordable and free from environmental impacts. On
the other hand, the energy resources like petroleum, coal, natural gas, uranium and propane are
called non-renewable resources because their supplies are limited. Many environmental effects
and day-by-day depletion of energy resources isa signal for us to save energy hence the need for
an automatic system for energy conservation (Rasedu 2012).

In today‟s world, there is a continuous need for automatic appliances. With the increase in
standard of living, there is a sense of urgency for developing circuits that would ease the
complexity of life. Also, if at all one wants to know the number of persons present in a room so
as not to prevent congestion, this circuit proves to be helpful (Adamu and Paul 2012).

Electricity has always remained a prime necessity of life as it is impossible to image our life as
far as electricity is concerned,

2.0 Analytical Model of Bidirectional Automatic Room Light Controller Using Visitor
Counter and Materials

A block diagram of the envisaged circuit was achieved by the use of a methodological approach
known as “TO DOWN” approach of the development process of microcontroller-based systems.
This phase constitutes an essential step of the development process and one of the critical issues
that determines the quality of the final product. The analysis phase sets the stage for the whole
project. The necessary groundwork for understanding what the project is all about is completed
in this phase. However, the total design and development of any microcontroller based system
typically involves three phases. These are as follows:
i. Hardware design and development.
ii. Software design and development.
Nigerian Journal of Physics 2018: Volume 27(S)

iii. Prototype implementation and diagnostic tested

The hardware design (part) consisst of the biscuit details, design and calculation of various
components used in the work including the values of the ones assumed Akande (2001). While
the software part is mainly programming implementation on the Programmable Integrated
Circuit (PIC).The block diagram is shown in figure (1)

Enter sensor Signal 8 Relay drive


Conditioning

Microcontroller
Exit sensor Signal Light
5
Conditioning

Power Supply Seven Segment


Display

Fig 1. Block diagram of an automatic room light controller with digital counter
Nigerian Journal of Physics 2018: Volume 27(S)

2.1 CIRCUIT DESCRIPTION


There are basically two main parts of the circuits. These are
1. Transmission circuit (Infrared LEDs)
2. Receiver circuit sensor)

Fig. 2.Transmission Circuit (Abara2014)

The circuit diagram shows how 555 timer IC is configured to function as a basic monostable
multivibrator. A monostable mutltivibrator is a timing circuit that changes state once triggered,
but returns to its original state after time delay Kularatna (2000).
In this circuit, a negative pulse applied at pin2 triggers an internal flip-flop that terms off pin7‟s
discharge transistor, allowing C1 to charge up through R1. At the same tune, the flip-flop brings
the output (pin3) level „high‟ when capacitor C1 is charged up to about 2/3 vcc, the flip-flop is
triggered once again, this time making the pin 3 output “Low” and turning on pin7‟s discharge
transistor, which discharges C1 to ground. This circuit, in effect, produces a pulse at pin3 whose
width t is the product of R1 and C1, i.e. t = R1C1. IR Transmission circuit is used to generate the
modulated 36KH3 112 signal. The IC 555 in the transmitter side is to generate 36KH3 square
wave. Adjust the preset in the transmitter to get a 38KH3 signal at the O/P around 1.4k we get a
38KH3 signal. Then you point it over the sensor and its O/P will go low when it senses the IR
signal OF 38KH3.
Nigerian Journal of Physics 2018: Volume 27(S)

Fig. 3. Receiver Circuit (Uchechukwu 2014)

The IR transmitter will emit modulated 38kh3 IR signal received byTSOP1738 (Infrared sensor).
The output goes high when there is an interruption and it returns back to low after the time
period determined by the capacitor and resistor in the circuit.. CL100 is to trigger the IC555
which is configured as monostable multivibrator. Input is given to the port 1 of microcontroller.
Port0 is used for the 7 segment display. And that time relay will get voltage and triggered so
light will get voltage and it will turn on. When counter will be 00, that time relay will be turned
off and Reset button will reset the microcontroller.

2.2 Microcontroller 8051


The 8051 is a low-power, high-performance COMOS 8-bit microcontroller with 8kbytes of in
system programmable flash memory Atmel (2006). Before the advancement in microelectronics
which introduced microcontrollers, microprocessors were mostly used in various applications. It
is a programmable device that takes in numbers as input, perform, arithmetic and logic
operations on them according to programs stored in memory and produces the result as output. It
is programmable in the sense that it performed given set of operation based on the sequence of
instructions given to it Austin (2005). In such a device, data is taken in through the use of input
devices like the mouse, keyboard, switches e.t.c. since numbers are seen by the microprocessor
only in binary digits, a microprocessor needs the following items connected to make it a
complete computing device (Crisp, 2004).

i. Instruction set
Nigerian Journal of Physics 2018: Volume 27(S)

ii. RAM
iii. ROM, PROM or EPROM
iv. Input/output ports
v. Clock generator
vi. Reset function
vii. Serial port
viii. Interrupts
ix. Timers
x. Analog-to-digital converters
xi. Digital-to-analog converters.

Hence, a device that contains the microprocessor and all the above units in a single package is
called a microcontroller.

2.3 8051 Memory Organization

The 8051 microcontrollers memory is divided into program memory and data memory. Program
memory (ROM) is used for permanent saving program being executed, while Data Memory
(RAM) is used for temporarily storing and keeping intermediate results and variables (Microchip
2010). Depending on the settings mode in compiler, program memory may also be used to store
a constant variables, the diagram for both program and data memory for 8051 microcontroller is
as shown below. The 8051 executes programs stored in program memory only. 8051 memory
organization allows external program memory to be added. How does the microcontroller handle
external memory depends on the pin EA logical state.
In the internal Data memory, up to 256 bytes of internal data memory are available depending on
the 8051 derivative. Locations available to the user occupy addressing space from 0 to 7Fh, i.e.
first 128registers and this part of RAM is divided in several blocks. The first 128 bytes of
internal data memory are both directly and indirectly addressable. The upper 128 bytes of data
memory from (0 x 80 to O x FF) can be addressed only indirectly.
Nigerian Journal of Physics 2018: Volume 27(S)

Fig 4.Memory organization of 8051 microcontroller Mc Lyman,(2004)

2.4 Resolution of a Microcontroller

The resolution of a microcontroller can be obtained using the design equation from
(Kularatna2000).

R = 2n – 1 (1)

Where n is the number of bit.

The high and low thresholds of the output signal from a micro-controller can be obtained using
the gain equation provided by Steyaert et al (2009).
Nigerian Journal of Physics 2018: Volume 27(S)

– (2)

Where Vin is the input signal of the microcontroller, Vout is the THRESHOULD OUTPUT
SIGNAL, Rin is the binary resolution corresponding to the input signal, Rout is the binary
resolution corresponding to the threshold output signal.
2.5 Pulse-Width-Modulation (PMW) and Switching Frequency of Microcontroller

The pulse-width-modulation (PWM) in micro-controller is used to control duty cycle of a motor


drive. Power is supplied to the motor in square wave of constant voltage but varying pulse-width
or duty cycle. The duty cycle, gives the amount of time the power switch is on, t on in relation to
the switching period,Tosc is expressed by (McLyman, 2004).

D = ton/Tosc x 100% (3)

Alternatively, the duty cycle, D is defined as (Malvino and Bates, 2007)

D = W/Tosc (4)

Where, ton is the switch-on time, W is the width of pulse and Tosc is the switching period. This
period of oscillation, Tosc of pulse with modulation is expressed by (Microchip, 2010).

Tosc = 2πRTG (5)

Where RT is the timing Resistor and G is the timing capacitor. Since the frequency is held
constant while the on-off time is varied, duty cycle of PWM is determined by the pulse width.

Fixed period

Variable Duty Cycle

Fig. 5. Pulse width – Modulation in Microcontroller. Crisp, (2004).


Nigerian Journal of Physics 2018: Volume 27(S)

The switching frequency on the other hand is known as oscillation frequency. Switching is
usually at a constant frequency. Switching is usually at a constant frequency. Although some ICs
use a variable frequency with changing line and load, with the Microcontroller Integrated
Circuits (ICs), it is possible to set the switching frequency “Fosc” with an external capacitor. The
microcontroller IC operates at a frequency which is programmed by one timing Resistor, R T and
one timing capacitor, CT.

The oscillator frequency, “Fosc”is expressed by the approximate formula (Microchip, 2010).

Fosc = = (6)

Practical values of RT fall between 3ohm and 100ohm, while those of CT fall between 10PF and
0.1μF.These values when selected results in oscillating frequency range of 2MHZ to 50MHZ
(Microchip, 2010).

3.0 Results and Discussion


The software structure was done using the assembly language where a set of program based on
security system was assembled using ASEM 51 assembler. The ASEM 51 assembler takes an
assemble language source file created with a text editor and translate it into a machine language
object file. This translation process was done in two passes over the source file. During the first
pass, the assembler builts a symbolic table and labels, that was used in the source file while in
the second pass, the assembler translate the source file into machine language object file.
Table 1. Design Parameters and values for a bidirectional automatic room light controller
Parameters values
Peak voltage (Vm) 16.97v
Dc value of rectifiered voltage (Vdc) 10.79v
Maximum load current (Im) 707.1Am
Average load current (Idc) 449.72Am
Filter Capacitor (Cf) 3500nf
Nigerian Journal of Physics 2018: Volume 27(S)

Table 2: No load test for power supply


Vin (v) Vout (v) Vdc(v) Regulated (v)
Expected values 220 12 14.1 5
Measured values 210 10.5 12.8 4.98

Table 3: Full load test for power supply


Vin (v) Vout (v) Vdc (v) Regulated (v)

Expected values 220 12 14.1 5


Measured values 210 10.00 9.00 3.00

Fig. 6. Complete circuit diagram of a bidirectionaql automatic room light controller (Kumar and
Jain. (2007).

References

Akande S.F.A (2001). PHY 561-Linear Circuit Design – A post-graduate Course in the
Department of Physics, University of Jos (unpublished).
ATMEL (2006). AVR Series 8017A-AVR-06/06. Retrieved 2ndJanuary, 2012 from
www.atmel.com/literature.
Nigerian Journal of Physics 2018: Volume 27(S)

Austin D. (2005). Generate stepper-motor speed profiles in real time, article in Embedded
Systems Programming. Retrieved 10th May, 2012 from http://www.embedded.com.
Crisp. J. (2004). Introduction to microprocessors and Microcontrollers. Second Edition. Jordan
Hill: Oxford.
Kularatna, N. (2000). Modern Component Families and Circuit Block Design. Butterworth-
Heinemann, Woburn, MA: USA.
Kumar B. and Jain, S.B. (2007). Electronic Devices and Circuits. Prentice-Hall of Indian Private
Ltd: New Delhi.
Malvino, A. and Bates, J.D. (2007). Electronic Principle. McGraw-Hill Companies Inc.: New
York, USA.
Maniktala, S. (2005). Sitching Power Supply Design and Optimization. McGraw-Hill
Companies, Inc.: USA.
Microchip (2010). PIC16F87XA Datasheet: www.microchip.com.
Rakesh R. (2012). Journal of magnetism and magnetic material Vol. 410, pg 248-256.

Rasedu Islam (2015). Automatic room light controller with bidirectional visitor counter.
https://www.youtube.com/watch.
Uchechukwu A. (2015). Design & Construction of a micro controller.
http://www.academia.edu/9436888.

View publication stats

You might also like