0% found this document useful (0 votes)
216 views46 pages

Design and Implementation of Solar Coin Based Mobile Charger

The document discusses the design and implementation of a coin-based mobile phone charger that uses solar power. It operates similarly to a vending machine where users insert coins to charge their phones for a set period of time. It is intended for use in rural areas that often lack reliable electricity. The system includes components for coin detection, microcontroller-based timing, a charging circuit, and phone connectors. It aims to provide mobile charging access when and where it is needed most.

Uploaded by

sujatha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
216 views46 pages

Design and Implementation of Solar Coin Based Mobile Charger

The document discusses the design and implementation of a coin-based mobile phone charger that uses solar power. It operates similarly to a vending machine where users insert coins to charge their phones for a set period of time. It is intended for use in rural areas that often lack reliable electricity. The system includes components for coin detection, microcontroller-based timing, a charging circuit, and phone connectors. It aims to provide mobile charging access when and where it is needed most.

Uploaded by

sujatha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Design and implementation of solar coin based mobile charger

CHAPTER 1
Introduction
1.1 Introduction
The growth of mobile phone market is phenomenal in recent years and the
need for charging the mobile battery is required anytime and anywhere. In many
developing countries the grid power is not available for few hours to several hours
on daily basis especially in semi urban and rural areas where the mobile phones are
the essential communication device. While the urban population use more
sophisticated mobiles with good power batteries lasting for few days, the rur al
population buy the pre owned mobile phones that require charging frequently even
two or three times a day. A coin based universal mobile battery charger is designed
and developed in this paper. This device is like a vending machine for mobile
battery charging and the user has to plug the phone into one of the adapters and
insert a coin for charging at a constant current for a definite duration. In this paper,
the design and development of a coin based universal mobile battery charger based
on main power is discussed and this is primarily for rural areas where the mobiles
are basic needs for communication and the main power is not available all the
time.
In many developing countries the current supply is not available for several
hours on daily basis especially in semi urban and rural areas were the cell phones
are the essential communication device. In the event of unpredictable current
supply and availability of abundant solar power, this project is designed with coin
detecting mechanism, microcontroller, and real time clock, charging circuit and
different phone socket. This coin based charger is similar like a vending machine
for charging the cell phone, the user has to plug the phone into one of the adapters
and insert the coin for the charging at constant current for a definite time period.
Coin detecting mechanism is used to detect the coin. When the user inserts the
coin, this will detect the coin and send a corresponding signal to the signal
conditioning unit in which the incoming signal is converted into square pulse and
then given to microcontroller.

Department of ECE Page 1


Design and implementation of solar coin based mobile charger

1.2 Goal
In the absence of power, it is difficult to charge the mobile phones
especially in rural areas where most of the times power will be cut and many a
times during the times of emergencies power will be absent. Sometimes it may
lead to life and death situations. So maintaining full battery power is essential
everywhere and every time. That is why we want to design a system which would
consume solar battery and can charge the mobile phone up on inserting the coins.
1.3 Motivation
These days everyone are using mobile phones and many applications were
developed and being developed every day. As a result the use of smart phones is
also increasing day by day. It is equivalent to a wallet. We are implementing many
tasks with mobile phones. But the problem is with the battery which drains
frequently. And many smart phone batteries need charging at least once in a day.
And the worst thing is that the battery becomes flat during any emergency situation
or during any important conversation with others. And especially in rural areas
most of the times the power will not be present and those people suffer with lack
of charging. So some mechanism should be developed to charge the mobile phones
always, even if power is available or not. And that the developed charging system
should not depend on the grid power to operate. If such a system is developed then
there will not be any problem with battery draining. By this system we can save
main power supply. As we are using solar panel it is also eco friendly. It is also
cost effective and easily to install and maintain. We can also implement them in
public places like parks, bus stops, rail way stations and in hospitals etc.

Department of ECE Page 2


Design and implementation of solar coin based mobile charger

CHAPTER 2
Literature Survey

In the paper published by S.Banu Prathap, R.Priyanka, G.Gunal, Dr.Sujatha,


under the title Coin Based Cell Phone Charger, it was written as a novel type of
coin based cell phone charger has been designed. A new type of charger is
designed for public people utilities. This type of charger will be very useful for the
public people; many times the battery becomes flat in the middle of the
conversation in particularly at inconvenient times when access to a standard
charger isnt possible. The main advantage of this charger is, power supply for the
charger is determined from solar power and current supply.

In the paper published by Mr. Vinod J Thomas (Asst. Prof VJEC), Nimisha M
Joy, Thejasree V P, Babitha.M, under the title Coin-Based Mobile Battery
Charger Using Solar Panel, it was written : The coin-based mobile battery
charger developed in this paper is providing a unique service to the rural public
where grid power is not available for partial/full daytime and a source of revenue
for site providers. The coin-based mobile battery charger can be quickly and easily
installed outside any business premises. The mobile phone market is a vast
industry, and has spread into rural areas as an essential means of communication.
While the urban population uses more sophisticated mobiles with good power
batteries lasting for several days, the rural population buys the pre owned mobile
phones that require charging frequently.

In this paper, the design and development of a coin based universal mobile
battery charger based on main power and solar power is discussed and this is
primarily for rural areas where the mobiles are basic needs for communication and
the main power is not available all the time. The motivation for this research came
from the paper.

Department of ECE Page 3


Design and implementation of solar coin based mobile charger

In the paper published by A.H.Tirmare, V.V.Khandare, P.S.Mali Assistant


Professor, E &TC, Bharati vidyapeeths College of Engineering. Kolhapur,
Maharashtra, it was given that In coin based mobile charger, solar energy is used
for the generation of voltage required to charge the mobile batteries. Concept of
coin box is used for initiating charging, that is to start the charging coin is inserted.
Time for charging depends upon value of coin inserted.
For this verification of coin is done by checking weight of inserted coin. The
weight of inserted coin is compared with the defined weight, if the inserted coin is
correct then one micro pulse is generated by the microcontroller. This will start
charging the mobile battery, which is connected at a port.
List of countries which have least access to the electricity are given
below
Tanzania (15.3% of population),
Niger (14.4% of population),
Sierra Leone (14.2% of population)
Burkina Faso (13.1% of population),
Central African Republic (10.8% of population),
Liberia (9.8% of population),
Malawi (9.8% of population),
Burundi (6.5% of population),
Chad (6.4% of population),
South Sudan (5.1% of population)

Department of ECE Page 4


Design and implementation of solar coin based mobile charger

CHAPTER 3

IMPLEMENTATION
3.1 Introduction
In todays life, each and every person is using mobile. The chargers of mobile
phone can carry everywhere, but we cant say that everywhere there is availability
of electricity. During summer days this problem occurs usually more times. To
overcome this problem of charging mobile phones in public places and especially
for rural people this system is designed. Also now a days, there is no any such
type of facilities available at the public places and at rural areas.
3.2 Proposed Work
In coin based mobile charger, solar energy is used for the generation of voltage
required to charge the mobile batteries. Concept of coin box is used for initiating
charging, that is to start the charging coin is inserted. Time for charging depends
upon value of coin inserted. For this verification of coin is done by checking
weight of inserted coin. The weight of inserted coin is compared with the defined
weight, if the inserted coin is correct then one micro pulse is generated by the
microcontroller. This will start the charging of mobile battery, which is connected
at a port. For generation of voltage from sun solar panel is used.
This is designed based on 8051, a 40-pin micro controller that does the
countdown timings for a period of 3 minutes with LCD displays showing the
actual time left. During the timing period a relay output is latched and finishing
timing in progress. Usually ordinary solar panel is always faces only in one
direction. Because of this reason the solar panel may not get sufficient sun rays to
work.
In this work solar panel controller and power optimization is done in order to
overcome this defect.

Department of ECE Page 5


Design and implementation of solar coin based mobile charger

3.3 Block Diagram

Fig 3.3: Block diagram of coin based mobile charging system using solar

The circuit uses solar panel for charging the battery. The battery provides the
power supply to the micro controller. The micro controller is the heart of the
circuit. It consists of an IR sensor which acts as a coin detector. When coin is
inserted as it gets an obstacle, it will sense it and will send the information to the
controller which starts the timer. The timer is on and simultaneously the relay is
also on and it gives power supply to the multi pin socket. As different chargers
have different chargers a multi pin socket is provided. Till the timer runs down, the
relay will be on and power supple will be given to the mobile through the multi pin
socket. When the timer reading becomes zero, the relay will be closed and power
supply to the mobile will be stopped. To give power supply again, we need to
insert another coin and the process continues. This is very much useful when the
main power supply is absent especially in the rural areas and is also eco friendly.

Department of ECE Page 6


Design and implementation of solar coin based mobile charger

CHAPTER 4

DESCRIPTION OF HARDWARE COMPONENTS

4.1 8051 Micro Controller

4.1.1 Introduction to 8051 Micro Controller


The system requirements and control specifications clearly rule out the use
of 16, 32 or 64 bit micro controllers or microprocessors. Systems using these may
be earlier to implement due to large number of internal features. They are also
faster and more reliable but, the above application is satisfactorily served by 8-bit
micro controller. Using an inexpensive 8-bit Microcontroller will doom the 32-bit
product failure in any competitive market place. Coming to the question of why to
use 89S52 of all the 8-bit Microcontroller available in the market the main answer
would be because it has 8kB Flash and 256 bytes of data RAM32 I/O lines, three
16-bit timer/counters, a Eight-vector two-level interrupt architecture, a full duplex
serial port, on-chip oscillator, and clock circuitry.

In addition, the 8051 is designed with static logic for operation down to
zero frequency and supports two software selectable power saving modes. The Idle
Mode stops the CPU while allowing the RAM, timer/counters, serial port, and
interrupt system to continue functioning. The Power down Mode saves the RAM
contents but freezes the oscillator, disabling all other chip functions until the next
hardware reset. The Flash program memory supports both parallel programming
and in Serial In-System Programming (ISP). The 8051 is also In-Application
Programmable (IAP), allowing the Flash program memory to be reconfigured even
while the application is running.

Department of ECE Page 7


Design and implementation of solar coin based mobile charger

4.1.2 Features

Compatible with MCS-51 Products

8K Bytes of In-System Programmable (ISP) Flash Memory

Endurance: 1000 Write/Erase Cycles

4.0V to 5.5V Operating Range

Fully Static Operation: 0 Hz to 33 MHz

Three-level Program Memory Lock

256 x 8-bit Internal RAM

32 Programmable I/O Lines

Three 16-bit Timer/Counters

Eight Interrupt Sources

Full Duplex UART Serial Channel

Low-power Idle and Power-down Modes

Interrupt Recovery from Power-down Mode

Watchdog Timer

Dual Data Pointer

Department of ECE Page 8


Design and implementation of solar coin based mobile charger

4.1.3 Pin Description

Fig 4.1.3: Pin diagram of 8051 Micro controller

Department of ECE Page 9


Design and implementation of solar coin based mobile charger

Port 0
Port 0 is an 8 bit bi directional input output port. As an output port, each pin
can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used
as high-impedance inputs. Port 0 can also be configured to be the multiplexed low
order address/data bus during accesses to external program and data memory. In
this mode, P0 has internal pull ups

Port 0 also receives the code bytes during flash programming and outputs
the code bytes during program verification. External pull ups are required program
verification

Port 1

Port 1 is an 8-bit bi-directional I/O port with internal pull ups. The Port 1
output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins,
they are pulled high by the internal pull ups and can be used as inputs. As inputs,
Port 1 pins that are externally being pulled low will source current (IIL) because of
the internal pull ups. In addition, P1.0 and P1.1 can be configured to be the
timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input
(P1.1/T2EX), respectively, as shown in the following table.

Port 1 also receives the low order address bytes during flash programming and
verification

Port Pins Alternate Functions

P1.0 T2 (external count input to


Timer/Counter 2), clock-out

P1.1 T2EX (Timer/Counter 2 capture/reload


trigger and direction control)

Table 1: Functions of pins 1.0 and 1.1

Department of ECE Page 10


Design and implementation of solar coin based mobile charger

Port 2

Port 1 is an 8-bit bi-directional I/O port with internal pull ups. The Port 1
output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins,
they are pulled high by the internal pull ups and can be used as inputs. As inputs,
Port 2 pins that are externally being pulled low will source current (IIL) because of
the internal pull ups. Port 2 emits the high order address byte during fetches from
external program memory and during accesses to external data memory that use
16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal
pull ups when emitting 1s.

Port 3

Port 3 is an 8-bit bi-directional I/O port with internal pull ups. The Port 3 output
buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they
are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 3
pins that are externally being pulled low will source current (IIL) because of the
internal pull ups. Port 3 also serves the functions of various special features of the
8051 , as shown in the following table.

Port Pin Alternate Functions


P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)
Table 2: Functions of Port 3 pins

RST

Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device.

Department of ECE Page 11


Design and implementation of solar coin based mobile charger

ALE/PROG

Address latch Enable is an output pulse for latching the low byte of the
address during accesses to external memory. This pin is also the program pulse
(PROG) during Flash programming.

In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator


frequency and may be used for external timing or clocking Note, however, that one
ALE pulse is skipped during each access to external data memory. If desired, ALE
operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set,
ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is
weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller
is in external execution mode.

4.1.4 Functional Diagram

Fig 4.1.4: Functional Diagram of 8051

Department of ECE Page 12


Design and implementation of solar coin based mobile charger

The 8051 Oscillator and Clock:

The heart of the 8051 circuitry that generates the clock pulses by which
all the internal all internal operations are synchronized. Pins XTAL1 And XTAL2
is provided for connecting a resonant network to form an oscillator. Typically a
quartz crystal and capacitors are employed. The crystal frequency is the basic
internal clock frequency of the microcontroller. The manufacturers make 8051
designs that run at specific minimum and maximum frequencies typically 1 to 16
MHz.

Fig 4.1.4: Oscillator and timing circuit

Department of ECE Page 13


Design and implementation of solar coin based mobile charger

MEMORIES
Types of memory:

The 8052 have three general types of memory. They are on-chip memory, external
Code memory and external Ram. On-Chip memory refers to physically existing
memory on the micro controller itself. External code memory is the code memory
that resides off chip. This is often in the form of an external EPROM. External
RAM is the Ram that resides off chip. This often is in the form of standard static
RAM or flash RAM.

a) Code memory

Code memory is the memory that holds the actual 8052 programs that is to be run.
This memory is limited to 64K. Code memory may be found on-chip or off-chip. It
is possible to have 8K of code memory on-chip and 60K off chip memory
simultaneously. If only off-chip memory is available then there can be 64K of off
chip ROM. This is controlled by pin provided as EA

b) Internal RAM

The 8052 have a bank of 256 bytes of internal RAM. The internal RAM is
found on-chip. So it is the fastest Ram available. And also it is most flexible in
terms of reading and writing. Internal Ram is volatile, so when 8051 is reset, this
memory is cleared. 256 bytes of internal memory are subdivided. The first 32 bytes
are divided into 4 register banks. Each bank contains 8 registers. Internal RAM
also contains 256 bits, which are addressed from 20h to 2Fh. These bits are bit
addressed i.e. each individual bit of a byte can be addressed by the user. They are
numbered 00h to FFh. The user may make use of these variables with commands
such as SETB and CLR[5].

Department of ECE Page 14


Design and implementation of solar coin based mobile charger

Special Function registered memory:

Special function registers are the areas of memory that control specific
functionality of the 8052 micro controller.

a) Accumulator (0E0h)

As its name suggests, it is used to accumulate the results of large no of


instructions. It can hold 8 bit values.

b) B registers (0F0h)

The B register is very similar to accumulator. It may hold 8-bit value. The b
register is only used by MUL AB and DIV AB instructions. In MUL AB the
higher byte of the product gets stored in B register. In div AB the quotient gets
stored in B with the remainder in A.

c) Stack pointer (81h)

The stack pointer holds 8-bit value. This is used to indicate where the next value
to be removed from the stack should be taken from. When a value is to be pushed
onto the stack, the 8051 first store the value of SP and then store the value at the
resulting memory location. When a value is to be popped from the stack, the 8051
returns the value from the memory location indicated by SP and then decrements
the value of SP.

d) Data pointer

The SFRs DPL and DPH work together work together to represent a 16-bit value
called the data pointer. The data pointer is used in operations regarding external
RAM and some instructions code memory. It is a 16-bit SFR and also an
addressable SFR.

Department of ECE Page 15


Design and implementation of solar coin based mobile charger

e) Program counter

The program counter is a 16 bit register, which contains the 2 byte address, which
tells the 8051 where the next instruction to execute to be found in memory. When
the 8051 is initialized PC starts at 0000h. And is incremented each time an
instruction is executes. It is not addressable SFR.

f) PCON (power control, 87h)

The power control SFR is used to control the 8051s power control modes.
Certain operation modes of the 8051 allow the 8051 to go into a type of sleep
mode which consumes much lee power.

g) TCON (timer control, 88h)

The timer control SFR is used to configure and modify the way in which the
8051s two timers operate. This SFR controls whether each of the two timers is
running or stopped and contains a flag to indicate that each timer has overflowed.
Additionally, some non-timer related bits are located in TCON SFR. These bits are
used to configure the way in which the external interrupt flags are activated, which
are set when an external interrupt occurs.

h) TMOD (Timer Mode, 89h)

The timer mode SFR is used to configure the mode of operation of each of the two
timers. Using this SFR your program may configure each timer to be a 16 -bit
timer, or 13 bit timer, 8-bit auto reload timer, or two separate timers. Additionally

Department of ECE Page 16


Design and implementation of solar coin based mobile charger

you may configure the timers to only count when an external pin is activated or to
count events that are indicated on an external pin.

i) T0 (Timer 0 low/high, address 8A/8C h)

These two SFRs taken together represent timer 0. Their exact behavior
depends on how the timer is configured in the TMOD SFR; however, these timers
always count up. What is configurable is how and when they increment in value.

j) T1 (Timer 1 Low/High, address 8B/ 8D h)

These two SFRs, taken together, represent timer 1. Their exact behavior
depends on how the timer is configured in the TMOD SFR; however, these timers
always count up.

k) P0 (Port 0, address 90h, bit addressable)

This is port 0 latch. Each bit of this SFR corresponds to one of the pins on a micro
controller. Any data to be outputted to port 0 is first written on P0 register. For
e.g., bit 0 of port 0 is pin P0.0, bit 7 is pin p0.7. Writing a value of 1 to a bit of this
SFR will send a high level on the corresponding I/O pin whereas a value of 0 will
bring it to low level.

l) P1 (port 1, address 90h, bit addressable)

This is port latch1. Each bit of this SFR corresponds to one of the pins on a
micro controller. Any data to be outputted to port 0 is first written on P0 register.
For e.g., bit 0 of port 0 is pin P1.0, bit 7 is pin P1.7. Writing a value of 1 to a bit of
this SFR will send a high level on the corresponding I/O pin whereas a value of 0
will bring it to low level

Department of ECE Page 17


Design and implementation of solar coin based mobile charger

m) P2 (port 2, address 0A0h, bit addressable):

This is a port latch2. Each bit of this SFR corresponds to one of the pins
on a micro controller. Any data to be outputted to port 0 is first written on P0
register. For e.g., bit 0 of port 0 is pin P2.0, bit 7 is pin P2.7. Writing a value of 1
to a bit of this SFR will send a high level on the corresponding I/O pin whereas a
value of 0 will bring it to low level.

n) P3 (port 3, address B0h, bit addressable):

This is a port latch 3. Each bit of this SFR corresponds to one of the pins on
a micro controller. Any data to be outputted to port 0 is first written on P0 register.
For e.g., bit 0 of port 0 is pin P3.0, bit 7 is pin P3.7. Writing a value of 1 to a bit of
this SFR will send a high level on the corresponding I/O pin whereas a value of 0
will bring it to low level.

o) IE (interrupt enable, 0A8h):


The Interrupt Enable SFR is used to enable and disable specific interrupts.
The low 7 bits of the SFR are used to enable/disable the specific interrupts, where
the MSB bit is used to enable or disable all the interrupts. Thus, if the high bit of
IE is 0 all interrupts are disabled regardless of whether an individual interrupt is
enabled by setting a lower bit.

p) IP (Interrupt Priority, 0B8h):


The interrupt priority SFR is used to specify the relative priority of each
interrupt. On 8051, an interrupt maybe either low or high priority. An interrupt
may interrupt interrupts. For e.g., if we configure all interrupts as low priority
other than serial interrupt. The serial interrupt always interrupts the system, even
if another interrupt is currently executing. However, if a serial interrupt is

Department of ECE Page 18


Design and implementation of solar coin based mobile charger

executing no other interrupt will be able to interrupt the serial interrupt routine
since the serial interrupt routine has the highest priority.

q) PSW (Program Status Word, 0D0h):


The program Status Word is used to store a number of important bits that
are set and cleared by 8051 instructions. The PSW SFR contains the carry flag,
the auxiliary carry flag, the parity flag and the overflow flag. Additionally, it also
contains the register bank select flags, which are used to select, which of the R
register banks currently in use.

r) SBUF (Serial Buffer, 99h):


SBUF is used to hold data in serial communication. It is physically two
registers. One is writing only and is used to hold data to be transmitted out of
8051 via TXD. The other is read only and holds received data from external
sources via RXD. Both mutually exclusive registers use address 99h.
I/O ports:
One major feature of a microcontroller is the versatility built into the
input/output (I/O) circuits that connect the 8051 to the outside world. The main
constraint that limits numerous functions is the number of pins available in the
8051 circuit. The DIP had 40 pins and the success of the design depends on the
flexibility incorporated into use of these pins. For this reason, 24 of the pins may
each used for one of the two entirely different functions which depend, first, on
what is physically connected to it and, then, on what software programs are used
to program the pins.

Department of ECE Page 19


Design and implementation of solar coin based mobile charger

PORT 0
Port 0 pins may serve as inputs, outputs, or, when used together, as a bi
directional low-order address and data bus for external memory. To configure a
pin as input, 1 must be written into the corresponding port 0 latch by the program.
When used for interfacing with the external memory, the lower byte of address is
first sent via PORT0, latched using Address latch enable (ALE) pulse and then the
bus is turned around to become the data bus for external memory.
PORT 1
Port 1 is exclusively used for input/output operations. PORTS 1 pin have
no dual function. When a pin is to be configured as input, 1 is to be written into
the corresponding Port 1 latch.
PORT 2
Port 2 may be used as an input/output port. It may also be used to supply
a high order address byte in conjunction with Port 0 low-order byte to address
external memory. Port 2 pins are momentarily changed by the address control
signals when supplying the high byte a 16-bit address. Port 2 latches remain stable
when external memory is addressed, as they do not have to be turned around (set
to 1) for data input as in the case for Port 0[5].
PORT 3
Port 3 may be used to input /output port. The input and output functions
can be programmed under the control of the P3 latches or under the control of
various special function registers. Unlike Port 0 and Port 2, which can have
external addressing functions and change all eight-port b se, each pin of port 3
maybe individually programmed to be used as I/O or as one of the alternate
functions. The Port 3 alternate uses are:

Department of ECE Page 20


Design and implementation of solar coin based mobile charger

Pin (SFR) Alternate Use


P3.0-RXD (SBUF) Serial data input
P3.1-TXD (SBUF) Serial data output
P3.2-INTO 0 (TCON.1) External interrupt 0
P3.3 - INTO 1 (TCON.3) External interrupt 1
P3.4 - T0 (TMOD) External Timer 0 input
P3.5 T1 (TMOD) External timer 1 input

P3.6-WR External memory write pulse

P3.7-RD External memory read pulse

Table 3: Alternate usage of Port 3 pins

INTERRUPTS:
The 8051 has a total of six interrupt vectors: two external interrupts (INT0 and
INT1), three timers interrupts (Timers0, 1, and 2), and the serial port interrupt.
These interrupts are all shown in Figure 10. Each of these interrupt sources can be
individually enabled or disabled by setting or clearing a bit in Special Function
Register IE. IE also contains a global disable bit, EA, which disables all interrupts
at once. Note that Table 5 shows that bit position IE.6 is unimplemented. In the
8051, bit position IE.5 is also unimplemented. User software should not write 1s to
these bit positions, since they may be used in future AT89 products.
Timer 2 interrupt is generated by the logical OR of bits TF2 and EXF2 in register
T2CON. Neither of these flags is cleared by hardware when the service routine is
vectored
In fact, the service routine may have to determine whether it was TF2 or
EXF2 that generated the interrupt, and that bit will have to be cleared in software.
The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which
the timers overflow. The values

Department of ECE Page 21


Design and implementation of solar coin based mobile charger

are then polled by the circuitry in the next cycle. However, the Timer 2 flag, TF2,
is set at S2P2 and is polled in the same cycle in which the timer overflows.

4.2 LIQUID CRYSTAL DISPLAY (LCD)


To display interactive messages we are using LCD Module. We examine
an intelligent LCD display of two lines,16 characters per line that is interfaced to
the controllers. The protocol (handshaking) for the display is as shown. Whereas
D0 to D7th bit is the Data lines, RS, RW and EN pins are the control pins and
remaining pins are +5V, -5V and GND to provide supply. Where RS is the
Register Select, RW is the Read Write and EN is the Enable pin.

The display contains two internal byte-wide registers, one for commands
(RS=0) and the second for characters to be displayed (RS=1). It also contains a
user-programmed RAM area (the character RAM) that can be programmed to
generate any desired character that can be formed using a dot matrix. To
distinguish between these two data areas, the hex command byte 80 will be used to
signify that the display RAM address 00h will be chosen.Port1 is used to furnish
the command or data type, and ports 3.2 to3.4 furnish register select and read/write
levels.

Fig 4.2: 2x16 Line Alphanumeric LCD Display

The most commonly used ALPHANUMERIC displays are 1x16 (Single Line & 16
characters), 2x16 (Double Line & 16 character per line) & 4x20 (four lines &
Twenty characters per line).
The LCD requires 3 control lines (RS, R/W & EN) & 8 (or 4) data lines. The
number on data lines depends on the mode of operation. If operated in 8-bit mode
then 8 data lines + 3 control lines i.e. total 11 lines are required. And if operated in
4-bit mode then 4 data lines + 3 control lines i.e. 7 lines are required. How do we

Department of ECE Page 22


Design and implementation of solar coin based mobile charger

decide which mode to use? Its simple if you have sufficient data lines you can go
for 8 bit mode & if there is a time constrain i.e. display should be faster then we
have to use 8-bit mode because basically 4-bit mode takes twice as more time as
compared to 8-bit mode.
Pin Symbol Function
1 Vss Ground
2 Vdd Supply Voltage
3 Vo Contrast Setting
4 RS Register Select
5 R/W Read/Write Select
6 En Chip Enable Select
7-14 DB0 to DB7 Data Lines
15 A/Vee Ground for the backlight

16 K Vcc for the backlight


Table 4 : LCD pin configuration

When RS is low (0), the data is to be treated as a command. When RS is high (1),
the data being sent is considered as text data which should be displayed on the
screen.
When R/W is low (0), the information on the data bus is being written to the LCD.
When RW is high (1), the program is effectively reading from the LCD. Most of
the times there is no need to read from the LCD so this line can directly be
connected to Gnd thus saving one controller line.
The ENABLE pin is used to latch the data present on the data pins. A HIGH -
LOW signal is required to latch the data. The LCD interprets and executes our
command at the instant the EN line is brought low. If you never bring EN low,
your instruction will never be executed.

Department of ECE Page 23


Design and implementation of solar coin based mobile charger

CHAPTER 5
CIRCUITS DIAGRAMS

Fig 5.1: Circuit diagram of Design and implementation of solar coin based mobile
charger

Department of ECE Page 24


Design and implementation of solar coin based mobile charger

CHAPTER 6
SOFTWARE DEVELOPMENT

6.1 Introduction:

In this chapter the software used and the language in which the program
code is defined is mentioned and the program code dumping tools are explained.
The chapter also documents the development of the program for the application.
This program has been termed as Source code. Before we look at the source
code we define the two header files that we have used in the code.

6.2 Tools Used:

Fig 6.1: schematic diagram of Keil Software

Department of ECE Page 25


Design and implementation of solar coin based mobile charger

Keil development tools for the 8051 Microcontroller Architecture support


every level of software developer from the professional applications

6.3 C51 Compiler & A51 Macro Assembler:

Source files are created by the Vision IDE and are passed to the C51
Compiler or A51 Macro Assembler. The compiler and assembler process source
files and create replaceable object files.
The Keil C51 Compiler is a full ANSI implementation of the C
programming language that supports all standard features of the C language. In
addition, numerous features for direct support of the 8051 architecture have been
added.

6.4 VISION
What's New in Vision3?
Vision3 adds many new features to the Editor like Text Templates, Quick
Function Navigation, and Syntax Coloring with brace high lighting Configuration
Wizard for dialog based startup and debugger setup. Vision3 is fully compatible
to Vision2 and can be used in parallel with Vision2.

What is Vision3?
Vision3 is an IDE (Integrated Development Environment) that helps you write,
compile, and debug embedded programs. It encapsulates the following
components:

A project manager.
A make facility.
Tool configuration.Editor.
A powerful debugger.

Department of ECE Page 26


Design and implementation of solar coin based mobile charger

To help you get started, several example programs (located in the \C51\Examples,
\C251\Examples, \C166\Examples, and \ARM\...\Examples) are provided.

HELLO is a simple program that prints the string "Hello World" using the
Serial Interface.
MEASURE is a data acquisition system for analog and digital systems.
TRAFFIC is a traffic light controller with the RTX Tiny operating system.
SIEVE is the SIEVE Benchmark.
DHRY is the Dhrystone Benchmark.
WHETS is the Single-Precision Whetstone Benchmark.
Additional example programs not listed here are provided for each
device architecture.

6.5 BUILDING AN APPLICATION IN VISION

To build (compile, assemble, and link) an application in Vision2, you must:

Select Project -
(forexample,166\EXAMPLES\HELLO\HELLO.UV2).
Select Project - Rebuild all target files or Build target.
Vision2 compiles, assembles, and links the files in your project.

Creating Your Own Application in Vision2


To create a new project in Vision2, you must:

1. Select Project - New Project.


2. Select a directory and enter the name of the project file.
3. Select Project - Select Device and select an 8051, 251, or C16x/ST10 device from
the Device Database.
you select the target device from the Device Database all special options are set
automatically. You typically only need to configure the memory map of your
target hardware. Default memory model settings are optimal for most applications.
1. Select Project - Rebuild all target files or Build target.

Department of ECE Page 27


Design and implementation of solar coin based mobile charger

Debugging an Application in Vision2


To debug an application created using Vision2, you must:

1. Select Debug - Start/Stop Debug Session.


2. Use the Step toolbar buttons to single-step through your program. You may enter
G, main in the Output Window to execute to the main C function.
3. Open the Serial Window using the Serial #1 button on the toolbar.
Debug your program using standard options like Step, Go, Break, and so on.

Starting Vision2 and Creating a Project

Vision2 is a standard Windows application and started by clicking on the


program icon. To create a new project file select from the Vision2 menu

Project New Project. This opens a standard Windows dialog that asks you

for the new project file name.

We suggest that you use a separate folder for each project. You can simply use

the icon Create New Folder in this dialog to get a new empty folder. Then

select this folder and enter the file name for the new project, i.e. Project1.

Vision2 creates a new project file with the name PROJECT1.UV2 which contains

a default target and file group name. You can see these names in the Project

Window Files.

Now use from the menu Project Select Device for Target and select a CPU

for your project. The Select Device dialog box shows the Vision2 device

database. Just select the microcontroller you use. We are using for our examples
the Philips 80C51RD+ CPU. This selection sets necessary tool

options for the 80C51RD+ device and simplifies in this way the tool Configuration

Department of ECE Page 28


Design and implementation of solar coin based mobile charger

Building Projects and Creating a HEX Files

Typical, the tool settings under Options Target are all you need to start a
new

application. You may translate all source files and line the application with a

click on the Build Target toolbar icon. When you build an application with

syntax errors, Vision2 will display errors and warning messages in the Output

Window Build page. A double click on a message line opens the source file

on the correct location in a Vision2 editor window. Once you have successfully
generated your application you can start debugging.

After you have tested your application, it is required to create an Intel HEX
file to download the software into an EPROM programmer or simulator. Vision2
creates HEX files with each build process when Create HEX files under Options
for Target Output is enabled. You may start your PROM programming utility
after the make process when you specify the program under the option Run User
Program #1.

CPU Simulation

Vision2 simulates up to 16 Mbytes of memory from which areas can be

mapped for read, write, or code execution access. The Vision2 simulator traps

and reports illegal memory accesses.

In addition to memory mapping, the simulator also provides support for the

integrated peripherals of the various 8051 derivatives. The on-chip peripherals

of the CPU you have selected are configured from the Device

Department of ECE Page 29


Design and implementation of solar coin based mobile charger

Database selection

You have made when you create your project target. Refer to page 58 for
more information about selecting a device. You may select and display the on-chip
peripheral components using the Debug menu. You can also change the aspects of
each peripheral using the controls in the dialog boxes.

Start Debugging

You start the debug mode of Vision2 with the Debug Start/Stop Debug

Session command. Depending on the Options for Target Debug

Configuration, Vision2 will load the application program and run the startup

code Vision2 saves the editor screen layout and restores the screen layout of the
last debug session. If the program execution stops, Vision2 opens an

editor window with the source text or shows CPU instructions in the disassembly
window. The next executable statement is marked with a yellow arrow. During
debugging, most editor features are still available.

For example, you can use the find command or correct program errors.
Program source text of your application is shown in the same windows. The
Vision2 debug mode differs from the edit mode in the following aspects:

The Debug Menu and Debug Commands described below are available. The
additional debug windows are discussed in the following.
The project structure or tool parameters cannot be modified. All build Commands
are disabled.
Disassembly Window

The Disassembly window shows your target program as mixed source and
assembly program or just assembly code. A trace history of previously executed
instructions may be displayed with Debug View Trace Records. To enable the
trace history, set Debug Enable/Disable Trace Recording.

Department of ECE Page 30


Design and implementation of solar coin based mobile charger

If you select the Disassembly Window as the active window all program
step commands work on CPU instruction level rather than program source lines.
You can select a text line and set or modify code breakpoints using toolbar buttons
or the context menu commands.

You may use the dialog Debug Inline Assembly to modify the CPU
instructions. That allows you to correct mistakes or to make temporary changes to
the target program you are debugging.

6.6 SOFTWARE DEVELOPMENT

1. Click on the Keil uVision Icon on Desktop


2. The following fig will appear

Department of ECE Page 31


Design and implementation of solar coin based mobile charger

3. Click on the Project menu from the title bar


4. Then Click on New Project

5. Save the Project by typing suitable project name with no extension in u r own
folder sited in either C:\ or D:\

Department of ECE Page 32


Design and implementation of solar coin based mobile charger

6. Then Click on Save button above.


7. Select the component for u r project. i.e. Atmel
8. Click on the + Symbol beside of Atmel

9. Select AT89C51 as shown below

Department of ECE Page 33


Design and implementation of solar coin based mobile charger

10. Then Click on OK


11. The Following fig will appear

12. Then Click either YES or NOmostly NO


13. Now your project is ready to USE
14. Now double click on the Target1, you would get another option Source group
1 as shown in next page.

Department of ECE Page 34


Design and implementation of solar coin based mobile charger

15. Click on the file option from menu bar and select new

16. The next screen will be as shown in next page, and just maximize it by double
clicking on its blue boarder.

Department of ECE Page 35


Design and implementation of solar coin based mobile charger

17. Now start writing program in either in C or ASM


18. For a program written in Assembly, then save it with extension . asm and
for C based program save it with extension .C

19. Now right click on Source group 1 and click on Add files to Group
Source

Department of ECE Page 36


Design and implementation of solar coin based mobile charger

20. Now you will get another window, on which by default C files will appear.

21. Now select as per your file extension given while saving the file
22. Click only one time on option ADD
23. Now Press function key F7 to compile. Any error will appear if so happen.

Department of ECE Page 37


Design and implementation of solar coin based mobile charger

24. If the file contains no error, then press Control+F5 simultaneously.


25. The new window is as follows

26. Then Click OK


27. Now Click on the Peripherals from menu bar, and check your required port
as shown in fig below

Department of ECE Page 38


Design and implementation of solar coin based mobile charger

28. Drag the port a side and click in the program file.

29. Now keep Pressing function key F11 slowly and observe.
You are running your program successfully

Department of ECE Page 39


Design and implementation of solar coin based mobile charger

6.7 Flash Magic:

Features:

Straightforward and intuitive user interface


Programs Intel Hex Files
Automatic verifying after programming
Fills unused flash to increase firmware security
Program security bits
Read the device signature
Read any section of Flash and save as an Intel Hex File
Displays the contents of Flash in ASCII and Hexadecimal formats
Command Line interface allowing Flash Magic to be used in IDEs and Batch File
Manual in PDF format
supports half-duplex communications
Verify Hex Files previously programmed
Save and open settings
Able to reset Rx2 and 66x devices (revision G or higher)
Powerful, flexible Just In Time Code feature. Write your own JIT Modules to
generate last minute code for programming. Uses include:

o Serial number generation

o Copy protection and copy authorization

o Storing program date and time - manufacture date

o Storing program operator and location

o Lookup table generation

o Language tables or language selection

o Centralized record keeping

Department of ECE Page 40


Design and implementation of solar coin based mobile charger

CHAPTER 7
ADVANTAGES AND APPLICATIONS
Advantages:
Simple and hand efficient
Less expensive
Reduced man power
Low power consumption
Easy to install
Easy to maintain
Fit and forget system
Reliable
Compact size

Applications
It can be implemented in hospitals.
It can be used in parks, bus stops, railway stations.
It can be extended to other household appliances like refrigerator, television, air
conditioners, lamps.
It is used to charger mobile phone even in the absence of power supply.

Department of ECE Page 41


Design and implementation of solar coin based mobile charger

CHAPTER 8
CONCLUSION
A novel method of charging mobile batteries of different manufacturers using solar

panel has been designed and developed for rural and remote areas, where the grid

power is not available all the times. We can conclude that this system is effectively

used for charging of mobile phones having low cost. We can use this system at any

public place. This system can be more useful in rural areas which are suffered

because of electricity problems.

FUTURE SCOPE

In future instead of using coins we can develop the same application using other

metals other than coins. This application must also be extended to other household

devices like air conditioners, televisions, refrigerators, laptops etc

Department of ECE Page 42


Design and implementation of solar coin based mobile charger

REFERENCES
Mr. Vinod J Thomas (Asst. Prof VJEC), Nimisha M Joy, Thejasree V P, Babitha.M,
Coin-Based Mobile Battery Charger Using Solar Panel.
S.Banu Prathap, R.Priyanka, G.Gunal, Dr.Sujatha, Coin Based Cell Phone Charger.
Pastre, M. Krummenacher, F. Robortella, R. Simon-Vermot, R. Kayal, M. Ecole Polytech.
Fed. de Lausanne, Lausanne, A fully integrated solar battery charger Circuits and Systems
and TAISA Conference, 2009. NEWCAS-TAISA '09. Joint IEEE North-East Workshop
M.S.Varadarajan.,Coin based Universal Mobile Battery Charger, ISSN: 2250-3021
Volume 2, Issue 6 (June 2012), PP 1433-1438
Kalyani U. Chafle, B. M. Faruk, R. S. Shrivas, N.S.SawarkarResearch Scholar,
Department of Electronics and Telecommunication Engineering, Jawaharlal Darda
Institute of Engineering & Technology, Yavatmal, INDIA Coin based mobile charger on
solar energy International Journal Of Research Granthaalayah
Vol.3(Iss.1):January,2015] ISSN- 2350-0530(O) ISSN- 2394-3629(P)
Muhammad Ali Mazidi, Janice GillispieMazidi, RolinD.McKinlay, The 8051
Microcontroller And Embedded Systems Using Assembly And C, 2/E, Pearson
Education India, 2007.

Department of ECE Page 43


Design and implementation of solar coin based mobile charger

APPENDIX
#include<reg51.h>

sfr LCD_DATA=0x90; // LCD 8-Bit Data Connected to Port 2

sbit RS=P2^6; // Register Select Pin to Port 0.0 (0 - Command


Mode, 1 - Data Display Mode)

// Read / Write Pin to Port 0.1 (0 - Write Mode, 1 - Read Mode)

sbit EN=P2^7; // Enable Pin to Port 0.2 (1 - Enable the LCD)

void lcd_init();

void lcd_cmd(unsigned char ch);

void lcd_disp(unsigned char ch);

void lcd_str(unsigned char ch[16]);

void delay(unsigned int val);

void main()

lcd_init(); // Initialize LCD

lcd_cmd(0x01);

lcd_cmd(0x80);

lcd_str(" Solar Based ");

lcd_cmd(0xC0);

lcd_str(" Mobile Charger ");

lcd_cmd(0x01);

lcd_cmd(0x80);

lcd_str(" TEMP: ");

while(1)

Department of ECE Page 44


Design and implementation of solar coin based mobile charger

adc_func();

/*** Initialize LCD ***/

void lcd_init()

lcd_cmd(0x38); // Initialize 2 line Display, 8-bit data input and 5x7 Dot
Matrix

lcd_cmd(0x0E); // Display ON & Cursor ON

lcd_cmd(0x01); // Clear the Screen

lcd_cmd(0x80); // Cursor forced to First Line First Position

/*** LCD Command Mode Function ***/

void lcd_cmd(unsigned char ch)

LCD_DATA=ch;

RS=0;

EN=1;

delay(5);

EN=0;

/*** LCD Display Mode Function ***/

void lcd_disp(unsigned char ch)

LCD_DATA=ch;

Department of ECE Page 45


Design and implementation of solar coin based mobile charger

RS=1;

EN=1;

delay(5);

EN=0;

RS=0;

/*** LCD String Function ***/

void lcd_str(unsigned char ch[16])

unsigned int i;

for(i=0;i<16;i++)

if(ch[i]=='\0')

break;

lcd_disp(ch[i]);

/*** Delay Function ***/

void delay(unsigned int val)

unsigned int i,j;

for(i=0;i<val;i++)

for(j=0;j<1275;j++);

Department of ECE Page 46

You might also like