You are on page 1of 95

ISO-9001-2015 NIRF 92 RANK CPE NAAC ‘A’ GRADE

KAKARAPARTHI BHAVANARAYANA COLLEGE


(AUTONOMOUS)
[An Autonomous college in the jurisdiction of Krishna University, Machilipatnam -521001]

KOTHAPET, VIJAYAWADA - 520 001

www.kbncollege.ac.in

A PROJECT REPORT ON

“SOLAR PIEZO HYBRID POWER GENERATING SYSTEM”


Submitted in partial fulfilment of the requirement for the award of
BACHELOR OF SCIENCE
IN

ELECTRONIC AND COMPUTER SCIENCE


By
P.V.HARSHA VARDHAN (163412)
S.VINAY KUMAR (163415)
A.RAGHAVENDRA RAO (163432)
G.PRUDHVI SAI KUMAR REDDY (163456)
P.CHAITANYA (163457)

Under the Guidance of

R.UDYA KUMAR M.Sc, M.Sc(TECH)


LECTURER IN ELECTRONICS

1
KAKARAPARTHI BHAVANARAYANA COLLEGE
(AUTONOMOUS)
[An Autonomous college in the jurisdiction of Krishna University, Machilipatnam-521001]
KOTHAPET, VIJAYAWADA - 520 001

www.kbncollege.ac.in

CERTIFICATE

This is to certify that the project entitled

“SOLAR PIEZO HYBRID POWER GENERATING SYSTEM”


The bonafide report of the work done
BY
P.CHAITANYA (K160357)
In partial fulfilment of the requirement for the award of degree of Bachelor of
Science in Electronics and Computer Science by Krishna University , Machillipatanam during the
year 2018 – 2019.

INTERNAL GUIDE HEAD OF THE DEPARTMENT

EXTERNAL EXAMINER PRINCIPAL

2
ACKNOWLEDGEMENT

First and foremost, we sincerely salute our esteemed institution KBN COLLEGE for giving us
this opportunity of fulfilling our dream of becoming engineers. We would like to express our sincere
thanks to The Principle SRI Dr. V. NARAYANA RAO, for his inspiration, intensive help and valuable
support in every step of our project.

I articulate my gratitude from the depths of my hearts to Sri. R.UDAY KUMAR, in charge of the
department and guide who is a source of simulation and continuous encouragement. I indeed ever indebted
to him for his able supervision and indispensable help.

I have immense pleasure in expressing my thanks and deep sense of gratitude to

Our guide faculty members Sri. D.PREM KUMAR, Smt. N.BHAVANA, Sri. P. VISHNU VARDHAN,
for the support and encouragement.

I have immense pleasure in expressing my thanks and deep sense of gratitude to my

Sri. Mr. P. PRAVEEN BABU for his technical support in completing my project.

I am also expressing my heartfelt gratitude to all the non-teaching staff who have definitely
Contributed in the successful completion my project.

I owe a deep respect of gratitude to my family members and friends for their loving
encouragement, timely suggestions and constant support in finishing this project with in the stipulated
time.

3
ABSTRACT

In last few years low power electronic devices have been increased rapidly. The devices are used in a large
number to comfort our daily lives. With the increase in energy consumption of these portable electronic
devices, the concept of harvesting alternative renewable energy in human surroundings arises a new
interest among us. In this project we try to develop a piezoelectric generator. That can produce energy from
vibration and pressure available on some other term (Like people walking).
This project describes the use of piezoelectric materials in order to harvest energy from people walking
vibration for generating and accumulating the energy. This concept is also applicable to some large
vibration sources which can find from nature. This project also represents a footstep of piezoelectric energy
harvesting model which is cost effective and easy to implement.
Such devices are commonly referred to as energy harvesters and can be used in applications
where outside power is unavailable and batteries are not a feasible option. While recent experiments have
shown that these materials could be used as power generators, the amount of energy produced is still very
low, hence the necessity to optimize them.

4
TABLE OF CONTENTS
S.NO CHAPTER NAME PG.NO

1. INTRODUCTION 8

ABSTRACT 9

DATA SHEET FOR ARDUINO UNO 11-12

ARDUINO UNO 13-16

1.1Pin Descriptions 18

1.1.1 VCC 18

1.1.2 GND 18

1.1.3 PORT B(PB7:0) 18

1.1.4 Port C (PC5:0) 18

1.1.5 PC6/RESET 18

1.1.6 Port D (PD7:0) 18

1.1.7 AVCC 19

1.1.8 AREF 19

1.1.9 ADC7:6 (TQFP and QFN/MLF Package Only) 19

2. Overview 19

2.1 Block Diagram 20

2.2 Comparison Between ATmega48PA, ATmega88PA, 21


ATmega168PA and ATmega328P

3. Resources 22

4. Data Retention 22

5. Register Summary 23-27

6. Instruction Set Summary 28-30

7. Ordering Information 30

7.1 ATmega48PA 30

5
7.2 ATmega88PA 31-32

7.3 ATmega168PA 32-33

7.4 ATmega328P 33

8. Packaging Information……. 34

8.1 32A 34

8.2 28M1 35-36

8.3 32M1-A 36-37

9 Errata 38

9.1 Errata ATmega48PA 38

9.1.1 Rev. D 38

9.2 Errata ATmega88PA 38

9.2.1 Rev. F 38

9.3Errata Atmega168PA 38

9.3.1 Rev E 38

9.4 Errata AT mega328P 38

9.4.1 Rev D 38

9.4.2 Rev C 39

9.4.3 Rev B 39

9.4.4 Rev A 39

10 Data sheet revision History 40

10.1 Rev.8161c -05/09 40

10.2 Rev. 8161B – 01/09 40-41

10.3 Rev. 8161A – 11/09 41-42

Data sheet of Light Dependent Resistor 43

11. Light Dependent Resistor 44-49

11.1 Characteristics of LDR: 50

6
11.2 LDR Applications 50

11.3 Testing circuit of LDR 51

12. Piezo electric sensor 50-54

12.1 Sensor design 56-57

13. LCD (Liquid Cristal Display) 58-59

13.1 Description Of 16x2 59

13.2 Schematic Diagram 59-60

13.3 16 x 2 Alphanumeric LCD Module Features 60

13.4 16 x 2 Alphanumeric LCD Module Specifications 61-62

13.5 Power supply for LCD driving 63

13.6 PIN DESCRIPTION 63-69

14. FLOWCHART 70

15. POWER SUPPLY 71

15.1 Block diagram 71

15.1.1 Circuit diagram 71

16. Transformer 72

16.1 Basic Principle 73

16.2 Transformer Working 74

16.3 Classification of Transformer 75-82

17. Voltage Regulator 83

18. LED 84-88

19. Code 89-90

20. Output 91-93

21. Future Scope 94

22. Bibliography 95

7
INTRODUCTION

The use of renewable resources like the solar energy and various other clean sources of energy has been on
an increase in demand in the recent years due to their ease in availability and low and cost. This project
demonstrates how to use the solar energy and the kinetic energy from footsteps of people walking over
Piezo based footboard. The Solar Panel is used to harness the solar power. It converts the solar power into
voltage, which when more than the voltage in the battery is able to charge the battery.

The power available through the solar panel is sensed by an AT-Mega family microcontroller which it
displays on the LCD. Similarly, the power generated through footsteps over Piezo Footboard is shown on
the LCD. In this case, the footstep count is also displayed on the LCD along with the voltage generated by
that particular footstep. In this way one can charge the battery through solar and footstep energies while
simultaneously also monitoring of how much is getting generated with the use of Solar Piezo Hybrid Power
Generating System

This day most of the research in the energy field is to develop sources of energy for future. It is
time to find renewable surceases of energy for the future. Piezoelectric materials are being more and more
studied as they turn out to be very unusual materials with very specific and interesting properties. In fact,
there materials have the ability to produce electrical energy from mechanical energy for example they can
convert mechanical behaviour like vibrations in to electricity.

Such devices are commonly referred to as energy harvesters and can be used in applications where
outside power is unavailable and batteries are not a feasible option. While recent experiments have shown
that these materials could be used as power generators, the amount of energy produced is still very low,
hence the necessity to optimize them.

8
POWER GENERATION USING PIEZOELECTRIC MATERIAL&SOLAR CELL

In last few years low power electronic devices have been increased rapidly. The devices are used in a large
number to comfort our daily lives. With the increase in energy consumption of these portable electronic
devices, the concept of harvesting alternative renewable energy in human surroundings arises a new
interest among us. In this project we try to develop a piezoelectric generator. That can produce energy from
vibration and pressure available on some other term (Like people walking).

This project describes the use of piezoelectric materials in order to harvest energy from people walking
vibration for generating and accumulating the energy. This concept is also applicable to some large
vibration sources which can find from nature. This project also represents a footstep of piezoelectric energy
harvesting model which is cost effective and easy to implement.

Such devices are commonly referred to as energy harvesters and can be used in applications
where outside power is unavailable and batteries are not a feasible option. While recent experiments have
shown that these materials could be used as power generators, the amount of energy produced is still very
low, hence the necessity to optimize them.

9
BLOCK-DIAGRAM

10
DATA SHEET OF ARDUINO

ARDUINO NANO

SPECIFICATION

 Microcontroller ATMEL ATmega328


 Operating voltage 5V
 Input Voltage 7-12V
 Input voltage 6-20V
 Digital I/O Pins 14
 Analog Input Pins 8
 Flash Memory 32KB
 SRAM 2KB
 EEPROM 1KB
 Clock Speed 16MHZ

11
FEATURES

 Automatic reset during program download


 Power OK Blue LED
 Green (TD),red (RX) and Orange (L) LED
 Auto sensing /switching power input
 Small mini-B USB for Programming and serial monitor
 ICSP header for direct program download
 Manual reset switch
 High Performance, Low Power AVR .8- bit Microcontroller
 Advanced RISC Architecture
 131 Power Instruction- Most Single Clock Cycle Execution
 32*8 General purpose working Register
 Fully Static Operation
 Up to 20 MIPS Throughput at 20 MHZ
 On-chip 2- cycle Multiplier
 High Endurance Non-Volatile Memory Segments
 4/8/16/32K Bytes of In-System Self- Programmable Flash program memory
 Data retention : 20 year at 85o c/100 years at 25o c.
 True Read-While-Write Operation
 Peripheral Features

PHOTO CREDITS

 Arduino Uno Board by adafruit


 Arduino Uno with Digital Input /Output by c-programming
 ATmega168/328-Arduino Pin Mapping by arduino
 Pin Diagram of Arduino Uno by cmb
 Arduino starter kit by generation robots

12
ARDUINO UNO

What is Arduino

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and
software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects
or environments.
Arduino can sense the environment by receiving input from a variety of sensors and can affect
its surroundings by controlling lights, motors, and other actuators. The microcontroller on the board is
programmed using the Arduino programming language (based on Wiring) and the Arduino development
environment (based on Processing). Arduino projects can be stand-alone or they can communicate with
software on running on a computer (e.g. Flash, Processing, MaxMSP). Arduino received an Honory
Mention in the Digital Communities section of the 2006 Ars Electronica Prix.

OVERVIEW

Arduino Nano is a surface mount breadboard embedded version with integrated USB. It is a smallest,
complete, and breadboard friendly. It has everything that Decimal / Duemilanove has (electrically) with
more analog input pins and onboard +5V AREF jumper. Physically, it is missing power jack. The Nano is
automatically sense and switch to the higher potential source of power, there is no need for the power
select jumper.
Nano’s got the breadboard-ability of the Board UNO and the Mini+ USB with smaller footprint
than either, so users have more breadboard space. It’s got a pin layout that works well with the Mini or the
Basic Stamp (TX, RX, ATN, GND) on one top, power and ground on the other. This new version 3.0
comes with ATMEGA328 which offer more programming and data memory space. It is two layers. That
make it easier to hack and more affordable. You end up paying less with Nano than Mini and USB
combined!

13
Specifications

 Microcontroller ATMEL ATmega328


 Operating Voltage (logic level) 5V
 Input Voltage (recommended) 7-12 V
 Input Voltage (limits) 6-20 V
 Digital I/O Pins 14 (of which 6 provide PWM output)
 Analog Input Pins 8
 DC Current per I/O Pin 40 mA
 Flash Memory 32 KB (of which 2KB used by boot-loader)
 SRAM 2 KB
 EEPROM 1 KB
 Clock Speed 16 MHz
 Dimensions 0.70” x 1.70”

Features
• Automatic reset during program download
• Power OK blue LED
• Green (TX), red (RX) and orange (L) LED
• Auto sensing/switching power input
• Small mini-B USB for programming and serial monitor
• ICSP header for direct program download
• Standard 0.1” spacing DIP (breadboard friendly)
• Manual reset switch

14
Power

The Adriano Nano can be powered via the mini-B USB connection, 6-20V unregulated external power
supply (pin 30), or 5V regulated external power supply (pin 27). The power source is automatically
selected to the highest voltage source.

Features

• High Performance, Low Power AVR® 8-Bit Microcontroller


• Advanced RISC Architecture
– 131 Powerful Instructions – Most Single Clock Cycle Execution
– 32 x 8 General Purpose Working Registers
– Fully Static Operation
– Up to 20 MIPS Throughput at 20 MHz
– On-chip 2-cycle Multiplier
• High Endurance Non-volatile Memory Segments
– 4/8/16/32K Bytes of In-System Self-Programmable Fla-Real sh program memory
– 256/512/512/1K Bytes EEPROM
– 512/1K/1K/2K Bytes Internal SRAM
– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
– Data retention: 20 years at 85°C/100 years at 25°C (1)
– Optional Boot Code Section with Independent Lock Bits In-System Programming by On-chip Boot
Program True Read-While-Write Operation
– Programming Lock for Software Security
• Peripheral Features
– Two 8-bit Timer/Counters with Separate Pre-scalar and Compare Mode
– One 16-bit Timer/Counter with Separate Pre-scalar, Compare Mode, and Capture Mode
– Real Time Counter with Separate Oscillator

15
– Six PWM Channels
– 8-channel 10-bit ADC in TQFP and QFN/MLF package Temperature Measurement
– 6-channel 10-bit ADC in PDIP Package Temperature Measurement
– Programmable Serial USART
– Master/Slave SPI Serial Interface
– Byte-oriented 2-wire Serial Interface (Philips I2C compatible)
– Programmable Watchdog Timer with Separate On-chip Oscillator
– On-chip Analog Comparator
– Interrupt and Wake-up on Pin Change
• Special Microcontroller Features
– Power-on Reset and Programmable Brown-out Detection
– Internal Calibrated Oscillator
– External and Internal Interrupt Sources
– Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby, and Extended
Standby
• I/O and Packages
– 23 Programmable I/O Lines
– 28-pin PDIP, 32-lead TQFP, 28-pad QFN/MLF and 32-pad QFN/MLF
• Operating Voltage:
– 1.8 - 5.5V for ATmega48PA/88PA/168PA/328P
• Temperature Range:
– -40°C to 85°C
• Speed Grade:
– 0 - 20 MHz @ 1.8 - 5.5V
• Low Power Consumption at 1 MHz, 1.8V, 25°C for ATmega48PA/88PA/168PA/328P:
– Active Mode: 0.2 mA
– Power-down Mode: 0.1 μA
– Power-save Mode: 0.75 μA (Including 32 kHz RTC)

16
PIN CONFIGURATION

Pinout ATmega48pA/88PA/168PA/328P

17
Pinout ATmega48pA/88PA/168PA/328P

18
1.1 PIN DESCRIPTIONS
1.1.1 VCC
Digital supply voltage.
1.1.2 GND Ground.
1.1.3 Port B (PB7:0)
Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit).
The Port B output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port B pins are tri-stated when a reset condition becomes active,
even if the clock is not running. Depending on the clock selection fuse settings, PB6 can be used as input to
the inverting Oscillator amplifier and input to the internal clock operating circuit. Depending on the clock
selection fuse settings, PB7 can be used as output from the inverting Oscillator amplifier. If the Internal
Calibrated RC Oscillator is used as chip clock source, PB7.6 is used as TOSC2.1 input for the
Asynchronous Timer/Counter2 if the AS2 bit in ASSR is set.
The various special features of Port B are elaborated in “Alternate Functions of Port B” and System Clock
and Clock Options.
1.1.4 Port C (PC5:0)
Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The
PC5.0 output buffers have symmetrical drive characteristics with both high sink and source capability. As
inputs, Port C pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port C pins are tri-stated when a reset condition becomes active,
even if the clock is not running.
1.1.5 PC6/RESET
If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the electrical characteristics of
PC6 differ from those of the other pins of Port C. If the RSTDISBL Fuse is un-programmed, PC6 is used as
a Reset input. A low level on this pin for longer than the minimum pulse length will generate a Reset, even
if the clock is not running. Shorter pulses are not guaranteed to generate a Reset. The various special
features of Port ’C’ are elaborated in “Alternate Functions of Port C”

19
1.1.6 Port D (PD7:0)
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port D
output buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port D pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port D pins are tri-stated when a reset condition becomes active,
even if the clock is not running.
The various special features of Port D are elaborated in”Alternate Functions of Port D”

1.1.7 AVCC
AVCC is the supply voltage pin for the A/D Converter, PC3:0, and ADC7:6. It should be externally
connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC
through a low-pass filter. Note that PC6. 4 use digital supply voltage, VCC.

1.1.8 AREF
AREF is the analogy reference pin for the A/D Converter.

1.1.9 ADC7:6
In the TQFP and QFN/MLF package, ADC7:6 serve as analogy inputs to the A/D converter.
These pins are powered from the analogy supply and serve as 10-bit ADC channels.
2. Overview
The ATmega48PA/88PA/168PA/328P is a low-power CMOS 8-bit microcontroller based on the
AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the
ATmega48PA/88PA/168PA/328P achieves throughputs approaching 1 MIPS per MHz allowing the system
designer to optimize power consumption versus processing speed.

20
The AVR core combines a rich instruction set with 32 general purpose working registers. All
the
32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registers
to be accessed in one single instruction executed in one clock cycle. The resulting architecture is more code
efficient while achieving throughputs up to ten times faster than conventional CISC microcontrollers. The
ATmega48PA/88PA/168PA/328P provides the following features: 4/8/16/32K bytes of In-system
Programmable Flash with Read-While-Write capabilities, 256/512/512/1K bytes EEPROM, 512/1K/1K/2K
bytes SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible
Timer/Counters with compare modes, internal and external interrupts, a serial programmable USART, a
byte-oriented 2-wire Serial Interface, an SPI serial port, a 6-channel 10-bit ADC (8 channels in TQFP and

21
QFN/MLF packages), a programmable Watchdog Timer with internal Oscillator, and five software
selectable power saving modes. The Idle mode stops the CPU while allowing the SRAM, Timer/Counters,
USART, 2-wire Serial Interface, SPI port, and interrupt system to continue functioning. The Power-down
mode saves the register contents but freezes the Oscillator, disabling all other chip functions until the next
interrupt or hardware reset. In Power-save mode, the asynchronous timer continues to run, allowing the
user to maintain a timer base while the rest of the device is sleeping. The ADC Noise Reduction mode
stops the CPU and all I/O modules except asynchronous timer and ADC, to minimize switching noise
during ADC conversions. In Standby mode, the crystal/resonator Oscillator is running while the rest of the
device is sleeping. This allows very fast start-up combined with low power consumption. The device is
manufactured using ATMEL’s high density non-volatile memory technology. The On-chip ISP Flash
allows the program memory to be reprogrammed In-System through an SPI serial interface, by a
conventional non-volatile memory programmer, or by an On-chip Boot program running on the AVR core.
The Boot program can use any interface to download the application program in the Application Flash
memory. Software in the Boot Flash section will continue to run while the Application Flash section is
updated, providing true Read-While-Write operation. By combining an 8-bit RISC CPU with In-System
Self-Programmable Flash on a monolithic chip, the ATMEL ATmega48PA/88PA/168PA/328P is a
powerful microcontroller that provides a highly flexible and cost effective solution to many embedded
control applications.
The ATmega48PA/88PA/168PA/328P AVR is supported with a full suite of program and system
Development tools including: C Compilers, Macro Assemblers, Program Debugger/Simulators,
In-Circuit Emulators and Evaluation kits.
2.2 Comparison Between ATmega48PA, ATmega88PA, ATmega168PA and ATmega328P
The ATmega48PA, ATmega88PA, ATmega168PA and ATmega328P differ only in memory
Sizes, boot loader support, and interrupt vector sizes. Table 2-1 summarizes the different memory
and interrupt vector sizes for the three devices.

22
ATmega88PA, ATmega168PA and ATmega328P support a real Read-While-Write Self-Programming
Mechanism. There is a separate Boot Loader Section, and the SPM instruction can
Only execute from there. In ATmega48PA, there is no Read-While-Write support and no separate Boot
Loader Section. The SPM instruction can execute from the entire Flash.
3. Resources
A comprehensive set of development tools, application notes and datasheets are available.
Note: 1.
4. Data Retention
Reliability Qualification results show that the projected data retention failure rate is much less
than 1 PPM over 20 years at 85°C or 100 years at 25°C.

23
24
25
26
27
Note: 1. For compatibility with future devices, reserved bits should be written to zero if accessed. Reserved
I/O memory addresses should never be written.
2. I/O Registers within the address range 0x00 - 0x1F are directly bit-accessible using the SBI and CBI
instructions. In these registers, the value of single bits can be checked by using the SBIS and SBIC
instructions.
3. Some of the Status Flags are cleared by writing a logical one to them. Note that, unlike most other
AVRs, the CBI and SBI instructions will only operate on the specified bit, and can therefore be used on
registers containing such Status Flags. The CBI and SBI instructions work with registers 0x00 to 0x1F
only.
4. When using the I/O specific commands IN and OUT, the I/O addresses 0x00 - 0x3F must be used. When
addressing I/O Registers as data space using LD and ST instructions, 0x20 must be added to these
addresses. The ATmega48PA/88PA/168PA/328P is a complex microcontroller with more peripheral units
than can be supported within the 64 location reserved in Op-code for the IN and OUT instructions. For the
Extended I/O space from 0x60 - 0xFF in SRAM, only
the ST/STS/STD and LD/LDS/LDD instructions can be used.
5. Only valid for ATmega88PA.

28
29
30
7. Ordering Information

7.1 ATmega48PA

Note: 1.This device can also be supplied in wafer form. Please contact your local ATMEL sales office for
detailed ordering information and minimum quantities.
2.Pb-free packaging complies to the European Directive for Restriction of Hazardous Substances (RoHS
directive).Also Halide free and fully Green.
3 See Speed “Grades”.
4.NiPdAu Lead Finish.

31
7.2 ATmega88PA

Note: 1. This device can also be supplied in wafer form. Please contact your local ATMEL sales office for
detailed ordering information and minimum quantities.
2. Pb-free packaging complies to the European Directive for Restriction of Hazardous Substances (RoHS
directive).Also Halide free and fully Green.
3. See ”Speed Grades”.
4. NiPdAu Lead Finish.

32
Note: 1. This device can also be supplied in wafer form. Please contact your local ATMEL sales office for
detailed ordering information and minimum quantities.
2. Pb-free packaging complies to the European Directive for Restriction of Hazardous Substances (RoHS
directive).Also Halide free and fully Green.
3. See ”Speed Grades”.
4. NiPdAu Lead Finish

33
34
8. Packaging Information

8.1 32A

35
Notes: 1. This package conforms to JEDEC reference MS-026, Variation ABA.
2. Dimensions D1 and E1 do not include mold protrusion. Allowable protrusion is 0.25 mm perside.
Dimensions D1 and E1 are maximum plastic body size dimensions including mold mismatch.
3. Lead coplanarity is 0.10 mm maximum.

8.2 28M1

36
8.3 32M1-A

37
Note: 1. Dimensions D and E1 do not include mold Flash or Protrusion.
Mold Flash or Protrusion shall not exceed 0.25 mm (0.010").

38
9. Errata

9.1 Errata ATmega48PA


The revision letter in this section refers to the revision of the ATmega48PA device.
9.1.1 Rev. D
No known errata.
9.2 Errata ATmega88PA
The revision letter in this section refers to the revision of the ATmega88PA device.
9.2.1 Rev. F
No known errata.
9.3 Errata ATmega168PA
The revision letter in this section refers to the revision of the ATmega168PA device.
9.3.1 Rev E
No known errata.
9.4 Errata ATmega328P
The revision letter in this section refers to the revision of the ATmega328P device.
9.4.1 Rev D
No known errata.
9.4.2 Rev C
Not sampled
9.4.3 Rev B
• Unstable 32 kHz Oscillator
1. Unstable 32 kHz Oscillator
The 32 kHz oscillator does not work as system clock.
The 32 kHz oscillator used as asynchronous timer is inaccurate.
Problem Fix/ Workaround
None

39
9.4.4 Rev A
• Unstable 32 kHz Oscillator

1. Unstable 32 kHz Oscillator

The 32 kHz oscillator does not work as system clock.


The 32 kHz oscillator used as asynchronous timer is inaccurate.

10. Datasheet Revision History

Please note that the referring page numbers in this section are referred to this document. The
referring revision in this section are referring to the document revision.

10.1 Rev. 8161C

10.2 Rev. 8161B

 Updated” Features”
 Updated” Overview”
 Updated” AVR Memories”
 Updated” Register Description”
 Updated” System Control and Reset
 Updated” Interrupts”.
 Updated” External Interrupts”.
 Updated” Boot Loader Support – Read-While-Write Self-Programming, ATmega88PA.
 Inserted” ATmega168PA DC Characteristics”.
 Inserted” ATmega328P DC Characteristics”.
 Inserted” ATmega168PA Typical Characteristics”.
 Inserted” ATmega328P Typical Characteristics”.
 Inserted Ordering Information for “ATmega168PA”.
 Inserted Ordering Information for “ATmega328P”.

40
 Inserted” Errata ATmega328P”.
 Editing updates.
 Updated” Features and updated the book accordingly.
 Updated” Overview”.
 Updated ”AVR Memories “ ”Register Description”
 Updated” Register Description”.

 Updated” System Control and Reset”.


 Updated” Interrupts”.
 Updated” External Interrupts”.
 Inserted Typical characteristics for”ATmega48PA Typical Characteristics.
 Updated figure names in typical characteristics for” ATmega88PA Typical Characteristics”.
 Inserted” ATmega48PA DC Characteristics”.

ATmega48PA/88PA/168PA/328P

10.3 Rev. 8161A – 11/08


 Accuracy, VREF = 4V, VCC = 4V, ADC clock = 200 kHz.
 Inserted Ordering Information for”ATmega48PA”.
 Initial revision (Based on the ATmega48P/88P/168P/328P datasheet 8025F-AVR-08/08).
 Changes done compared to ATmega48P/88P/168P/328P datasheet 8025F-AVR-08/08:
o Updated” DC Characteristics” with new typical values for ICC.
o Updated” Speed Grades”.
o New graphics in” Typical Characteristics”.
o New” Ordering Information”.

Disclaimer: The information in this document is provided in connection with ATMEL products. No
license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this
document or in connection with the sale of ATMEL products. except as set forth in ATMEL’s terms and

41
conditions of sale located on ATMEL’s web site, ATMEL assumes no liability whatsoever and disclaims
any express, implied or statutory warranty relating to its products including, but not limited to, the implied
warranty of merchantability, fitness for a particular purpose, or non-infringement. in no event shall
ATMEL be liable for any direct, indirect, consequential, punitive, special or incidental damages (including,
without limitation, damages for loss of profits, business interruption, or loss of information) arising out of
the use or inability to use this document, even if ATMEL has been advised of the possibility of such
damages. ATMEL makes no representations or warranties with respect to the accuracy or completeness of
the contents of this document and reserves the right to make changes to specifications and product
descriptions at any time without notice. ATMEL does not make any commitment to update the information
contained herein. Unless specifically provided otherwise, ATMEL products are not suitable for, and shall
not be used in, automotive applications. ATMEL’s products are not intended, authorized, or warranted for
use as components in applications intended to support or sustain life. © 2009 ATMEL Corporation. All
rights reserved. ATMEL®, ATMEL logo and combinations thereof, AVR® and others are registered
trademarks or trademarks of ATMEL Corporation or its subsidiaries. Other terms and product names may
be trademarks of others.

42
DATA SHEET FOR LDR(LIGHT DEPENDENT RESISTER)

Light dependent resistor – LDR Two cadmium sulphide(ods) photoconductive cell with spectral
respoonses similar to that of the human eye. The cell resistance falls with increaseing light intensity.
Application include smoke detection, automatic lighting control, batch counting and bugger alarm systems.

APPLICATIONS

Photoconductive cells are used in many different types of circuits and applications.

ANALOG APPLICATION
 Camers exposure control
 Auto side focus-dual cell
 Photocopy mechines-density of toner
 Colorimeteric test equipment-Densitometer
 Electronic scales-dual cell
 Automatic Gain control- modulated light source.
DIGITAL APPLICATIONS
 Automatic headlight dimmer
 Night light control
 Oil burner flame out
 Street light control
 Absence / presents (beam breaker)
 Position sensor

43
LDR

11. Light Dependent Resistor

A photo-resistor or light dependent resistor or cadmium sulfide (CdS) cell is


a resistor whose resistance decreases with increasing incident light intensity. It can also be referred to as
a photoconductor.

A photo resistor is made of a high resistance semiconductor. If light falling on the device is of high
enough frequency, photons absorbed by the semiconductor give bound electrons enough energy to jump
into the conduction band. The resulting free electron (and its hole partner) conduct electricity, thereby
lowering resistance.

A photoelectric device can be either intrinsic or extrinsic. An intrinsic semiconductor has its
own charge carriers and is not an efficient semiconductor, e.g. silicon. In intrinsic devices the only
available electrons are in the valence band, and hence the photon must have enough energy to excite the
electron across the entire band gap. Extrinsic devices have impurities, also called dopants, added whose
ground state energy is closer to the conduction band; since the electrons do not have as far to jump, lower
energy photons (i.e., longer wavelengths and lower frequencies) are sufficient to trigger the device. If a

44
sample of silicon has some of its atoms replaced by phosphorus atoms (impurities), there will be extra
electrons available for conduction. This is an example of an extrinsic semiconductor.

The symbol for a photo resistor

Applications

Photo resistors come in many different types. Inexpensive cadmium sulfide cells can be found in
many consumer items such as camera light meters, street lights, clock radios, alarms, and outdoor clocks.

They are also used in some dynamic compressors together with a small incandescent lamp or light
emitting diode to control gain reduction.

Lead sulfide (PbS) and indium antimonite (InSb) LDRs (light dependent resistor) are used for the
mid infrared spectral region. Ge Cu photoconductors are among the best far-infrared detectors available,
and are used for infrared astronomy and infrared spectroscopy.

Transducers are used for changing energy types.

45
A light dependent resistor

A light dependent resistor is a small, round semiconductor. Light dependent resistors are used to re-charge
a light during different changes in the light, or they are made to turn a light on during certain changes in
lights. One of the most common uses for light dependent resistors is in traffic lights. The light dependent
resistor controls a built in heater inside the traffic light, and causes it to recharge overnight so that the light
never dies. Other common places to find light dependent resistors are in: infrared detectors, clocks and
security alarms.

46
LDRs or Light Dependent Resistors are very useful especially in light/dark sensor circuits. Normally the
resistance of an LDR is very high, sometimes as high as 1000 000 ohms, but when they are illuminated
with light resistance drops dramatically.

The animation opposite shows that when the torch is turned on, the resistance of the LDR falls, allowing
current to pass through it.

Circuit Wizard software has been used to display, the range of values of a ORP12, LDR
When a light level of 1000 lux (bright light) is directed towards it, the resistance is 400R (ohms)
When a light level of 10 lux (very low light level) is directed towards it, the resistance has risen
dramatically to 10.43M (10430000 ohms).

47
This is an example of a light sensor circuit:

When the light level is low the resistance of the LDR is high. This prevents current from flowing to the
base of the transistors. Consequently the LED does not light. However, when light shines onto the LDR its
resistance falls and current flows into the base of the first transistor and then the second transistor. The
LED lights The preset resistor can be turned up or down to increase or decrease resistance, in this way it
can make the circuit more or less sensitive.

Fig 3.3.1: - Schematic Symbol of LDR


The photo resistor, or Light Dependent Resistor, finds many uses as a low cost photo sensitive element and
was used for many years in photographic light meters as well as other applications .such as flame, smoke,
and burglar detectors, card readers and lighting controls for street lamps Units for the light intensity are
Lux or Laurence.

48
Basic structure:
Although there are many ways in which LDR’s or photo resistors can be manufactured, ther are naturally a
few more common methods that are seen. Essentially the LDR or photo resistor consists of a resistive
material sensitive to light that is exposed to light. The photo resistive element comprises section of material
with contacts at either end. Although many of the material used for light dependent resistors are
semiconductors, when used as photo resistors, they are used only as a resistive element and there are no p-n
junctions Accordingly the devices purely passive.
A typical structure for a Light Dependent Resistor uses an active semiconductor layer that is
deposited on an insulating substrate. The semiconductor is normally lightly doped to enable it to have the
required level of conductivity. Contacts then placed either side of the exposed area. In many instances the
area between the contacts is in the form of zigzag, or inter digital pattern. This maximizes the exposed area
and by keeping the distance between the contacts small it enhances the gain.It also possible to use a poly
crystalline semiconductor that is deposited onto a substrate such as ceramic. This makes for a very low cost
light dependent resistor.

Operation
Light Dependent Resistor made of a high resistance semiconductor, if light falling on the is of high
enough efficiently, photon absorbed by the semiconductor give bound electrons enough energy to jump
into the conduction band. The resulting free electron (and it shole partner) conduct electricity, thereby
lowering resistance.
In intrinsic devices, the only available electrons are in the valence band, and hence the photon must
have enough energy to excite the electrons across the entire band gap. Extrinsic devices have impurities
added , which have a ground state energy closer to the conduction band, since the electrons don’t have so
far to jump, lower energy photons ( i.e. longer wavelengths and lower frequencies ) will suffice to trigger
the device.

49
11.1 Characteristics of LDR
The characteristics of LDR are shown below. Here the resistance variations are shown as a function of
illumination. The resistance of LDR decreases with increasing incident light intensity

1000

100

10

1.0

0.1
0.1 1.0 10 100
( Ftc )*
*1 Ftc = 10.764 lumens

Fig 3.3.2: - Characteristics of LDR

11.2 LDR Applications

LDR’s are very useful especially in light/dark sensor circuits. Normally the resistance of LDR is very high,
sometimes as high as 1000k ohms, but when they are illuminated with light, resistance drops immediately.

 Camera light meters.


 Clock radios.
 Security alarms.
 Optical switches.
 Far infrared detector.
 Streetlights.

50
11.3 Testing circuit of LDR
+5v

470K

Vout

LDR

Fig 11.3: - Testing Circuit of LDR

12. Piezo electric sensor

A piezoelectric sensor is a device that uses the piezoelectric effect, to measure changes
in pressure, acceleration, temperature, strain, (or) force by converting them to an electrical charge. The
prefix piezo - is Greek for 'press' or 'squeeze'.

Piezoelectric sensors are versatile tools for the measurement of various processes. They are used for quality
assurance, process control, and for research and development in many industries. Pierre Curie discovered
the piezoelectric effect in 1880, but only in the 1950s did manufacturers begin to use the piezoelectric
effect in industrial sensing applications. Since then, this measuring principle has been increasingly used,

51
and has become a mature technology with excellent inherent reliability. They have been successfully used
in various applications, such as in medical, aerospace, nuclear instrumentation, and as a tilt sensor in
consumer electronics or a pressure sensor in the touch pads of mobile phones. In the automotive industry,
piezoelectric elements are used to monitor combustion when developing internal combustion engines. The
sensors are either directly mounted into additional holes into the cylinder head or the spark/glow plug is
equipped with a built-in miniature piezoelectric sensor.

The rise of piezoelectric technology is directly related to a set of inherent advantages. The high modulus of
elasticity of many piezoelectric materials is comparable to that of many metals and goes up to 106 N/m².
Even though piezoelectric sensors are electromechanical systems that react to compression, the sensing
elements show almost zero deflection. This gives piezoelectric sensors ruggedness, an extremely high
natural frequency and an excellent linearity over a wide amplitude range. Additionally, piezoelectric
technology is insensitive to electromagnetic fields and radiation, enabling measurements under harsh
conditions. Some materials used (especially gallium phosphate or tourmaline) are extremely stable at high
temperatures, enabling sensors to have a working range of up to 1000 °C. Tourmaline shows pyro-
electricity in addition to the piezoelectric effect; this is the ability to generate an electrical signal when the
temperature of the crystal changes. This effect is also common to piezo ceramic materials. Gautschi
in Piezoelectric Sensor (2002) offers this comparison table of characteristics of piezo sensor materials vs
other types.

Strain Threshold Span to


Principle
Sensitivity [V/µε] [µε] threshold ratio

Piezoelectric 5.0 0.00001 100,000,000

Piezoresistive 0.0001 0.0001 2,500,000

Inductive 0.001 0.0005 2,000,000

52
Capacitive 0.005 0.0001 750,000

Resistive 0.000005 0.01 50,000

One disadvantage of piezoelectric sensors is that they cannot be used for truly static measurements. A static
force results in a fixed amount of charge on the piezoelectric material. In conventional readout electronics,
imperfect insulating materials and reduction in internal sensor resistance causes a constant loss
of electrons and yields a decreasing signal. Elevated temperatures cause an additional drop in internal
resistance and sensitivity. The main effect on the piezoelectric effect is that with increasing pressure loads
and temperature, the sensitivity reduces due to twin formation. While quartz sensors must be cooled during
measurements at temperatures above 300 °C, special types of crystals like GaPO4 gallium phosphate show
no twin formation up to the melting point of the material itself. However, it is not true that piezoelectric
sensors can only be used for very fast processes or at ambient conditions. In fact, numerous piezoelectric
applications produce quasi-static measurements, and other applications work in temperatures higher
than 500 °C. Piezoelectric sensors can also be used to determine aromas in the air by simultaneously
measuring resonance and capacitance. Computer controlled electronics vastly increase the range of
potential applications for piezoelectric sensors.

Piezoelectric sensors are also seen in nature. The collagen in bone is piezoelectric, and is
thought by some to act as a biological force sensor

PRINCIPLE OF OPERSTION

The way a piezoelectric material is cut produces three main operational modes:

 Transverse
 Longitudinal
 Shear.

A piezoelectric transducer has very high DC output impedance and can be modeled as a
proportional voltage source and filter network. The voltage V at the source is directly proportional to the

53
applied force, pressure, or strain. The output signal is then related to this mechanical force as if it had
passed through the equivalent circuit.

 Frequency response of a piezoelectric sensor; output voltage vs applied force.


 A detailed model includes the effects of the sensor's mechanical construction and other non-
idealities. The inductance Lm is due to the seismic mass and inertia of the sensor itself. Ce is
inversely proportional to the mechanical elasticity of the sensor. C0 represents the static capacitance
of the transducer, resulting from an inertial mass of infinite size. Ri is the insulation leakage
resistance of the transducer element. If the sensor is connected to a load resistance, this also acts in
parallel with the insulation resistance, both increasing the high-pass cutoff frequency.

54
 In the flat region, the sensor can be modeled as a voltage source in series with the sensor's
capacitance or a charge source in parallel with the capacitance
 For use as a sensor, the flat region of the frequency response plot is typically used, between the
high-pass cutoff and the resonant peak. The load and leakage resistance must be large enough that
low frequencies of interest are not lost. A simplified equivalent circuit model can be used in this
region, in which Cs represents the capacitance of the sensor surface itself, determined by the
standard formula for capacitance of parallel plates. It can also be modeled as a charge source in
parallel with the source capacitance, with the charge directly proportional to the applied force, as
above force as if it had passed through the equivalent circuit.

Frequency response of a piezoelectric sensor; output voltage vs applied force

A detailed model includes the effects of the sensor's mechanical construction and other non-idealities. The
inductance Lm is due to the seismic mass and inertia of the sensor itself. Ce is inversely proportional to the
mechanical elasticity of the sensor. C0 represents the static capacitance of the transducer, resulting from an
inertial mass of infinite size. Ri is the insulation leakage resistance of the transducer element. If the sensor
is connected to a load resistance, this also acts in parallel with the insulation resistance, both increasing the
high-pass cutoff frequency.

55
In the flat region, the sensor can be modeled as a voltage source in series with the sensor's capacitance or a
charge source in parallel with the capacitance. For use as a sensor, the flat region of the frequency response
plot is typically used, between the high-pass cutoff and the resonant peak. The load and leakage resistance
must be large enough that low frequencies of interest are not lost. A simplified equivalent circuit model can
be used in this region, in which Cs represents the capacitance of the sensor surface itself, determined by the
standard formula for capacitance of parallel plates. It can also be modeled as a charge source in parallel
with the source capacitance, with the charge directly proportional to the applied force, as above.

12.1 Sensor design

Metal disks with piezo material, used in buzzers or As contact microphones Based on piezoelectric
technology various physical quantities can be measured; the most common are pressure and acceleration.
For pressure sensors, a thin membrane and a massive base is used, ensuring that an applied pressure

56
specifically loads the elements in one direction. For accelerometers, a seismic mass is attached to the
crystal elements. When the accelerometer experiences a motion, the invariant seismic mass loads the
elements according to Newton's second law of motion .The main difference in working principle between
these two cases is the way they apply forces to the sensing elements. In a pressure sensor, a thin membrane
transfers the force to the elements, while in accelerometers an attached seismic mass applies the forces.

Sensors often tend to be sensitive to more than one physical quantity. Pressure sensors show false signal
when they are exposed to vibrations. Sophisticated pressure sensors therefore use acceleration
compensation elements in addition to the pressure sensing elements. By carefully matching those elements,
the acceleration signal (released from the compensation element) is subtracted from the combined signal of
pressure and acceleration to derive the true pressure information. Vibration sensors can also harvest
otherwise wasted energy from mechanical vibrations. This is accomplished by using piezoelectric materials
to convert mechanical strain into usable electrical energy.

Sensing materials

Two main groups of materials are used for piezoelectric sensors: piezoelectric ceramics and single crystal
materials. The ceramic materials (such as PZT ceramic) have a piezoelectric constant/sensitivity that is
roughly two orders of magnitude higher than those of the natural single crystal materials and can be
produced by inexpensive sintering processes. The piezo effect in piezo ceramics is "trained", so their high
sensitivity degrades over time. This degradation is highly correlated with increased temperature. The less-
sensitive, natural, single-crystal materials (gallium phosphate, quartz, tourna) have a higher – when
carefully handled, almost unlimited – long term stability. There are also new single-crystal materials
commercially available such as Lead Magnesium Neonate-Lead Titan ate (PMN-PT). These materials offer
improved sensitivity over PZT but have a lower maximum operating temperature and are currently more
expensive to manufacture.

57
13. LCD (Liquid Crystal Display):
A liquid crystal display (LCD) is a thin, flat display device made up of any number of color or
monochrome pixels arrayed in front of a light source or reflector. Each pixel consists of a column of liquid
crystal molecules suspended between two transparent electrodes, and two polarizing filters, the axes of
polarity of which are perpendicular to each other. Without the liquid crystals between them, light passing
through one would be blocked by the other. The liquid crystal twists the polarization of light entering one
filter to allow it to pass through the other.
A program must interact with the outside world using input and output devices that communicate
directly with a human being. One of the most common devices attached to an controller is an LCD display.
Some of the most common LCDs connected to the contollers are 16X1, 16x2 and 20x2 displays. This
means 16 characters per line by 1 line 16 characters per line by 2 lines and 20 characters per line by 2 lines,
respectively.

Many microcontroller devices use 'smart LCD' displays to output visual information. LCD displays
designed around LCD NT-C1611 module, are inexpensive, easy to use, and it is even possible to produce a
readout using the 5X7 dots plus cursor of the display. They have a standard ASCII set of characters and
mathematical symbols. For an 8-bit data bus, the display requires a +5V supply plus 10 I/O lines (RS RW
D7 D6 D5 D4 D3 D2 D1 D0). For a 4-bit data bus it only requires the supply lines plus 6 extra lines(RS
RW D7 D6 D5 D4). When the LCD display is not enabled, data lines are tri-state and they do not interfere
with the operation of the microcontroller.
FEATURES

(1) Interface with either 4-bit or 8-bit microprocessor.


(2) Display data RAM
(3) 80x 8 bits (80 characters).
(4) Character generator ROM
(5)160 different 5007 dot-matrix character patterns.
(6) 8 Character generator RAM
(7) 8 different user programmed 5007 dot-matrix patterns.
(8) Display data RAM and character generator RAM may be Accessed by the microprocessor.

58

Shapes and S
(9) Numerous instructions
(10) .Clear Display, Cursor Home, Display ON/OFF, Cursor ON/OFF, Blink Character, Cursor Shift,
Display Shift.
(11). Built-in reset circuit is triggered at power ON.
(12). Built-in oscillator.

13.1 Description Of 16x2

This is the first interfacing example for the Parallel Port. We will start with something simple. This
example doesn't use the Bi-directional feature found on newer ports, thus it should work with most, if no all
Parallel Ports. It however doesn't show the use of the Status Port as an input. So what are we interfacing? A
16 Character x 2 Line LCD Module to the Parallel Port. These LCD Modules are very common these days,
and are quite simple to work with, as all the logic required to run them is on board.

13.2 SCHEMATIC DIAGRAM

 Above is the quite simple schematic. The LCD panel's Enable and Register Select is connected to
the Control Port. The Control Port is an open collector / open drain output. While most Parallel
Ports have internal pull-up resistors, there are a few which don't. Therefore by incorporating the

59
two 10K external pull up resistors, the circuit is more portable for a wider range of computers,
some of which may have no internal pull up resistors.
 We make no effort to place the Data bus into reverse direction. Therefore we hard wire
the R/W line of the LCD panel, into write mode. This will cause no bus conflicts on the data lines.
As a result we cannot read back the LCD's internal Busy Flag which tells us if the LCD has
accepted and finished processing the last instruction. This problem is overcome by inserting
known delays into our program.
 The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy here. As with all
the examples, I've left the power supply out. You can use a bench power supply set to 5v or use a
onboard +5 regulator. Remember a few de-coupling capacitors, especially if you have trouble
with the circuit working properly.
 The 2 line x 16 character LCD modules are available from a wide range of
manufacturers and should all be compatible with the HD44780. The one I used to
test this circuit was a Power tip PC-1602F and an old Philips LTN211F-10 which
was extracted from a Poker Machine! The diagram to the right, shows the pin
numbers for these devices. When viewed from the front, the left pin is pin 14 and
the right pin is pin 1
.

13.3 16 x 2 Alphanumeric LCD Module Features

 Intelligent, with built-in Hitachi HD44780 compatible LCD controller and RAM providing simple
interfacing
 61 x 15.8 mm viewing area
 5 x 7 dot matrix format for 2.96 x 5.56 mm characters, plus cursor line
 Can display 224 different symbols
 Low power consumption (1 mA typical)
 Powerful command set and user-produced characters
 TTL and CMOS compatible
 Connector for standard 0.1-pitch pin headers

60
13.4 16 x 2 Alphanumeric LCD Module Specifications

Symbol Level Function


Pin
1 VSS - Power, GND
2 VDD - Power, 5V
3 Vo - Power, for LCD Drive
Register Select Signal
4 RS H/L H: Data Input
L: Instruction Input
H: Data Read (LCD->MPU)
5 R/W H/L
L: Data Write (MPU->LCD)
6 E H,H->L Enable
7-14 DB0-DB7 H/L Data Bus; Software selectable 4- or 8-bit mode
15 NC - NOT CONNECTED
16 NC - NOT CONNECTED

FEATURES

 5 x 8 dots with cursor


 Built-in controller (KS 0066 or Equivalent)
 + 5V power supply (Also available for + 3V)
 1/16 duty cycle
 B/L to be driven by pin 1, pin 2 or pin 15, pin 16 or A.K (LED)
 N.V. optional for + 3V power supply.

61
Data can be placed at any location on the LCD
For 16×1 LCD, the address locations are

Fig :15: Address locations for a 1x16 line LCD

Even limited to character based modules, there is still a wide variety of shapes and sizes available. Line
lengths of 8,16,20,24,32 and 40 characters are all standard, in one, two and four line versions. Several
different LC technologies exists. “supertwist” types, for example, offer Improved contrast and viewing
angle over the older “twisted nematic” types. Some modules are available with back lighting, so that they
can be viewed in dimly-lit conditions. The back lighting may be either “electro-luminescent”, requiring a
high voltage inverter circuit, or simple LED illumination.

Electrical Block Diagram

62
13.5 Power supply for LCD driving

Fig: 18:power supply for LCD

13.6 PIN DESCRIPTION

Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two pins are extra in
both for back-light LED connections).

Fig 19: pin diagram of 1x16 lines LCD

63
Fig 17: Pin specifications

CONTROL LINES

EN:

Line is called "Enable." This control line is used to tell the LCD that you are sending it data. To send data
to the LCD, your program should make sure this line is low (0) and then set the other two control lines
and/or put data on the data bus. When the other lines are completely ready, bring EN high (1) and wait for
the minimum amount of time required by the LCD datasheet (this varies from LCD to LCD), and end by
bringing it low (0) again.

64
RS:

Line is the "Register Select" line. When RS is low (0), the data is to be treated as a command or special
instruction (such as clear screen, position cursor, etc.). When RS is high (1), the data being sent is text data
which sould be displayed on the screen. For example, to display the letter "T" on the screen you would set
RS high.

RW:

Line is the "Read/Write" control line. When RW is low (0), the information on the data bus is being written
to the LCD. When RW is high (1), the program is effectively querying (or reading) the LCD. Only one
instruction ("Get LCD status") is a read command. All others are write commands, so RW will almost
always be low.

Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected by the
user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2, DB3, DB4, DB5, DB6,
and DB7.

Logic status on control lines

 E - 0 Access to LCD disabled


 1 Access to LCD enabled
 R/W - 0 Writing data to LCD
 1 Reading data from LCD
 RS - 0 Instructions
 1 Character
Writing data to the LCD
 Set R/W bit to low
 Set RS bit to logic 0 or 1 (instruction or character)
 Set data to data lines (if it is writing)

65
 Set E line to high
 Set E line to low
Read data from data lines (if it is reading) on LCD

 Set R/W bit to high


 Set RS bit to logic 0 or 1 (instruction or character)
 Set data to data lines (if it is writing)
 Set E line to high
 Set E line to low
Entering Text

First, a little tip: it is manually a lot easier to enter characters and commands in hexadecimal rather than
binary (although, of course, you will need to translate commands from binary couple of sub-miniature
hexadecimal rotary switches is a simple matter, although a little bit into hex so that you know which bits you
are setting). Replacing the d.i.l. switch pack with a of re-wiring is necessary.

SWITCHES
The switches must be the type where On = 0, so that when they are turned to the zero position, all four
outputs are shorted to the common pin, and in position “F”, all four outputs are open circuit.
All the available characters that are built into the module are shown in Table 3. Studying the table, you will
see that codes associated with the characters are quoted in binary and hexadecimal, most significant bits
(“left-hand” four bits) across the top, and least significant bits (“right-hand” four bits) down the left.

Most of the characters conform to the ASCII standard, although the Japanese and Greek characters (and a
few other things) are obvious exceptions. Since these intelligent modules were designed in the “Land of the
Rising Sun,” it seems only fair that their Katakana phonetic symbols should also be incorporated. The more
extensive Kanji character set, which the Japanese share with the Chinese, consisting of several thousand
different characters, is not included!
Using the switches, of whatever type, and referring to Table 3, enter a few characters onto the display,
both letters and numbers. The RS switch (S10) must be “up” (logic 1) when sending the characters, and

66
switch E (S9) must be pressed for each of them. Thus the operational order is: set RS high, enter character,
trigger E, leave RS high, enter another character, trigger E, and so on.

The first 16 codes in Table 3, 00000000 to 00001111, ($00 to $0F) refer to the CGRAM. This is the
Character Generator RAM (random access memory), which can be used to hold user-defined graphics
characters. This is where these modules really start to show their potential,
offering such capabilities as bar graphs, flashing symbols, even animated characters. Before the user-defined
characters are set up, these codes will just bring up strange looking symbols.
Codes 00010000 to 00011111 ($10 to $1F) are not used and just display blank characters. ASCII codes
“proper” start at 00100000 ($20) and end with 01111111 ($7F). Codes 10000000 to 10011111 ($80 to $9F)
are not used, and 10100000 to 11011111 ($A0 to $DF) are the Japanese characters.

67
Fig 20: character details in LCD

68
Initialization by Instructions

Fig 21: flow chart of LCD


If the power conditions for the normal operation of the internal reset circuit are not satisfied, then
executing a series of instructions must initialize LCD unit. The procedure for this initialization process is as
above show.

69
14.FLOW CHART

Copy Data in to Accumulator

Wait
Yes
Is LCD Free
No

Set RS Bit

Enable LCD

Send Data

Disable LCD

Is Data
Count Zero
No

STOP

Copy Data in to Accumulator

Wait
Yes
Is LCD Free
No

Set RS Bit

Enable LCD

Send Data

Disable LCD

Is Data
Count Zero
No

STOP

70
15.POWER SUPPLY

15.1 Block diagram:

Figure: Power Supply

15.1.1

Circuit diagram

71
DESCRIPTION

16. Transformer

A transformer is a device that transfers electrical energy from one circuit to another through inductively
coupled conductors—the transformer's coils. A varying current in the first or primary winding creates a
varying magnetic flux in the transformer's core, and thus a varying magnetic field through the secondary
winding. This varying magnetic field induces a varying electromotive force (EMF) or "voltage" in the
secondary winding. This effect is called mutual induction.

Figure: Transformer Symbol

(or)

Transformer is a device that converts the one form energy to another form of energy like a transducer.

72
Figure: Transformer

16.1 Basic Principle:

A transformer makes use of Faraday's law and the ferromagnetic properties of an iron core to efficiently
raise or lower AC voltages. It of course cannot increase power so that if the voltage is raised, the current is
proportionally lowered and vice versa.

Figure: Basic Principle

73
16.2 Transformer Working

A transformer consists of two coils (often called 'windings') linked by an iron core, as shown in figure
below. There is no electrical connection between the coils; instead they are linked by a magnetic field
created in the core.

Figure: Basic Transformer

Transformers are used to convert electricity from one voltage to another with minimal loss of power. They
only work with AC (alternating current) because they require a changing magnetic field to be created in
their core. Transformers can increase voltage (step-up) as well as reduce voltage (step-down).

Alternating current flowing in the primary (input) coil creates a continually changing magnetic field in the
iron core. This field also passes through the secondary (output) coil and the changing strength of the
magnetic field induces an alternating voltage in the secondary coil. If the secondary coil is connected to a
load the induced voltage will make an induced current flow.

The correct term for the induced voltage is 'induced electromotive force' which is usually abbreviated to
induce E.M.F. The iron core is laminated to prevent 'eddy currents' flowing in the core. These are currents

74
produced by the alternating magnetic field inducing a small voltage in the core, just like that induced in the
secondary coil. Eddy currents waste power by needlessly heating up the core but they are reduced to a
negligible amount by laminating the iron because this increases the electrical resistance of the core without
affecting its magnetic properties.

Transformers have two great advantages over other methods of changing voltage:

1. They provide total electrical isolation between the input and output, so they can be safely used to
reduce the high voltage of the mains supply.
2. Almost no power is wasted in a transformer. They have a high efficiency (power out / power in) of
95% or more.

16.3 Classification of Transformer

 Step-Up Transformer
 Step-Down Transformer

Step-Down Transformer:

Step down transformers are designed to reduce electrical voltage. Their primary voltage is greater than
their secondary voltage. This kind of transformer "steps down" the voltage applied to it. For instance, a step
down transformer is needed to use a 110v product in a country with a 220v supply.

Step down transformers convert electrical voltage from one level or phase configuration usually down to a
lower level. They can include features for electrical isolation, power distribution, and control and
instrumentation applications. Step down transformers typically rely on the principle of magnetic induction
between coils to convert voltage and/or current levels.

Step down transformers are made from two or more coils of insulated wire wound around a core made of
iron. When voltage is applied to one coil (frequently called the primary or input) it magnetizes the iron
core, which induces a voltage in the other coil, (frequently called the secondary or output). The turn’s ratio
of the two sets of windings determines the amount of voltage transformation.

75
Figure: Step-Down Transformer

An example of this would be: 100 turns on the primary and 50 turns on the secondary, a ratio of 2 to 1.

Step down transformers can be considered nothing more than a voltage ratio device.

With step down transformers the voltage ratio between primary and secondary will mirror the "turn’s ratio"
(except for single phase smaller than 1 KVA which have compensated secondary). A practical application
of this 2 to 1 turn’s ratio would be a 480 to 240 voltage step down. Note that if the input were 440 volts
then the output would be 220 volts. The ratio between input and output voltage will stay constant.
Transformers should not be operated at voltages higher than the nameplate rating, but may be operated at
lower voltages than rated. Because of this it is possible to do some non-standard applications using
standard transformers.

Single phase step down transformers 1 KVA and larger may also be reverse connected to step-down or
step-up voltages. (Note: single phase step up or step down transformers sized less than 1 KVA should not
be reverse connected because the secondary windings have additional turns to overcome a voltage drop
when the load is applied. If reverse connected, the output voltage will be less than desired.)

Step-Up Transformer

76
A step up transformer has more turns of wire on the secondary coil, which makes a larger induced voltage
in the secondary coil. It is called a step up transformer because the voltage output is larger than the voltage
input.

Step-up transformer 110v 220v design is one whose secondary voltage is greater than its primary voltage.
This kind of transformer "steps up" the voltage applied to it. For instance, a step up transformer is needed
to use a 220v product in a country with a 110v supply.A step up transformer 110v 220v converts
alternating current (AC) from one voltage to another voltage. It has no moving parts and works on a
magnetic induction principle; it can be designed to "step-up" or "step-down" voltage. So a step up
transformer increases the voltage and a step down transformer decreases the voltage.

The primary components for voltage transformation are the step up transformer core and coil. The
insulation is placed between the turns of wire to prevent shorting to one another or to ground. This is
typically comprised of Mylar, nomex, Kraft paper, varnish, or other materials. As a transformer has no
moving parts, it will typically have a life expectancy between 20 and 25 years.

Figure: Step-Up Transformer

77
APPLICATIONS

Generally these Step-Up Transformers are used in industries applications only.

Turns Ratio and Voltage

The ratio of the number of turns on the primary and secondary coils determines the ratio of the voltages...

...where Vp is the primary (input) voltage, Vs is the secondary (output) voltage, Np is the number of turns
on the primary coil, and Ns is the number of turns on the secondary coil.

Diodes

Diodes allow electricity to flow in only one direction. The arrow of the circuit symbol shows the direction
in which the current can flow. Diodes are the electrical version of a valve and early diodes were actually
called valves.

Figure: Diode Symbol

A diode is a device which only allows current to flow through it in one direction. In this direction, the
diode is said to be 'forward-biased' and the only effect on the signal is that there will be a voltage loss of

78
around 0.7V. In the opposite direction, the diode is said to be 'reverse-biased' and no current will flow
through it.

Rectifier

The purpose of a rectifier is to convert an AC waveform into a DC waveform (OR) Rectifier converts AC
current or voltages into DC current or voltage. There are two different rectification circuits, known as
'half-wave' and 'full-wave' rectifiers. Both use components called diodes to convert AC into DC.

The Half-wave Rectifier

The half-wave rectifier is the simplest type of rectifier since it only uses one diode, as shown in figure .

Figure: Half Wave Rectifier

Figure 2 shows the AC input waveform to this circuit and the resulting output. As you can see, when the
AC input is positive, the diode is forward-biased and lets the current through. When the AC input is
negative, the diode is reverse-biased and the diode does not let any current through, meaning the output is
0V. Because there is a 0.7V voltage loss across the diode, the peak output voltage will be 0.7V less than
Vs.

79
Figure: Half-Wave Rectification

While the output of the half-wave rectifier is DC (it is all positive), it would not be suitable as a power
supply for a circuit. Firstly, the output voltage continually varies between 0V and Vs-0.7V, and secondly,
for half the time there is no output at all.

The Full-wave Rectifier

The circuit in figure 3 addresses the second of these problems since at no time is the output voltage
0V. This time four diodes are arranged so that both the positive and negative parts of the AC waveform are
converted to DC. The resulting waveform is shown in figure 4.

80
Figure: Full-Wave Rectifier

Figure: Full-Wave Rectification

When the AC input is positive, diodes A and B are forward-biased, while diodes C and D are reverse-
biased. When the AC input is negative, the opposite is true - diodes C and D are forward-biased, while
diodes A and B are reverse-biased.

While the full-wave rectifier is an improvement on the half-wave rectifier, its output still isn't suitable as a
power supply for most circuits since the output voltage still varies between 0V and Vs-1.4V. So, if you put
12V AC in, you will 10.6V DC out.

81
Capacitor Filter

The capacitor-input filter, also called "Pi" filter due to its shape that looks like the Greek letter pi, is a
type of electronic filter. Filter circuits are used to remove unwanted or undesired frequencies from a signal.

Figure: Capacitor Filter

A typical capacitor input filter consists of a filter capacitor C1, connected across the rectifier output, an
inductor L, in series and another filter capacitor connected across the load.

1. The capacitor C1 offers low reactance to the AC component of the rectifier output while it offers
infinite reactance to the DC component. As a result the capacitor shunts an appreciable amount of
the AC component while the DC component continues its journey to the inductor L
2. The inductor L offers high reactance to the AC component but it offers almost zero reactance to the
DC component. As a result the DC component flows through the inductor while the AC component
is blocked.
3. The capacitor C2 bypasses the AC component which the inductor had failed to block. As a result
only the DC component appears across the load RL.

82
Figure: Centered Tapped Full-Wave Rectifier with a Capacitor Filter

17. Voltage Regulator

A voltage regulator is an electrical regulator designed to automatically maintain a constant voltage level.
It may use an electromechanical mechanism, or passive or active electronic components. Depending on the
design, it may be used to regulate one or more AC or DC voltages. There are two types of regulator are
they.

 Positive Voltage Series (78xx) and


 Negative Voltage Series (79xx)

78xx:’78’ indicate the positive series and ‘xx’ indicates the voltage rating. Suppose 7805 produces the
maximum 5V.’05’indicates the regulator output is 5V.

79xx:’78’ indicate the negative series and ‘xx’ indicates the voltage rating. Suppose 7905 produces the
maximum -5V.’05’indicates the regulator output is -5V.

These regulators consists the three pins there are

Pin1: It is used for input pin.

Pin2: This is ground pin for regulator

83
Pin3: It is used for output pin. Through this pin we get the output.

Figure: Regulator

18. LED

Introduction
A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator lamps in
many devices, and are increasingly used for lighting. Introduced as a practical electronic component in
1962, early LEDs emitted low-intensity red light, but modern versions are available across
the visible, ultraviolet and infrared wavelengths, with very high brightness. The LED is based on
the semiconductor diode. When a diode is forward biased, electrons are able
to recombine with holes within the device, releasing energy in the form of photons. This effect is
called electroluminescence and the color of the light (corresponding to the energy of the photon) is
determined by the energy gap of the semiconductor. An LED is usually small in area (less than 1 mm2),
and integrated optical components are used to shape its radiation pattern and assist in reflection. LEDs
present many advantages over incandescent light sources including lower energy consumption,
longer lifetime, improved robustness, smaller size, faster switching, and greater durability and
reliability. However, they are relatively expensive and require more precise current and heat
management than traditional light sources. Current LED products for general lighting are more
expensive to buy than fluorescent lamp sources of comparable output.

84
Working:
Charge-
carriers

electrons
and hole
s—flow
into the
junction
from ele
ctrodes
with
different
voltages.
When an
electron meets a hole, it falls into a lower energy level, and releases energy in the form of a photon.
The wavelength of the light emitted, and therefore its color, depends on the band gap energy of the
materials forming the p-n junction. In silicon or germanium diodes, the electrons and holes recombine
by a non-radioactive transition which produces no optical emission, because these are indirect band
gap materials. The materials used for the LED have a direct band gap with energies corresponding to
near-infrared,visible(or)near-ultraviolet-light.

85
THE INNER WORKING OF AN LED

86
Colors and materials :

s Color Wavelength (nm) Voltage (V) Semiconductor Material

Gallium-arsenide (GaAs)
Infrared λ > 760 ΔV < 1.9
Aluminum gallium arsenide (AlGaAs)

Aluminum gallium arsenide (AlGaAs)


1.63 < ΔV < Gallium arsenide phosphide (GaAsP)
Red 610 < λ < 760
2.03 Aluminum gallium indium phosphide (AlGaInP)
Gallium(III) phosphide (GaP)

Gallium arsenide phosphide (GaAsP)


2.03 < ΔV <
Orange 590 < λ < 610 Aluminum gallium indium phosphide (AlGaInP)
2.10
Gallium(III) phosphide (GaP)

Gallium arsenide phosphide (GaAsP)


2.10 < ΔV <
Yellow 570 < λ < 590 Aluminum gallium indium phosphide (AlGaInP)
2.18
Gallium(III) phosphide (GaP)

Indium gallium nitride (InGaN) / Gallium(III)


nitride (GaN)
1.9[42] < ΔV <
Green 500 < λ < 570 Gallium(III) phosphide (GaP)
4.0
Aluminum gallium indium phosphide (AlGaInP)
Aluminum gallium phosphide (AlGaP)

2.48 < ΔV < Zinc-selenide (ZnSe)


Blue 450 < λ < 500
3.7 Indium gallium nitride (InGaN)

87
Silicon carbide (SiC) as substrate
Silicon (Si) as substrate — (under development)

2.76 < ΔV <


Violet 400 < λ < 450 Indium gallium nitride (InGaN)
4.0

Dual blue/red LEDs,


2.48 < ΔV <
Purple multiple types blue with red phosphor,
3.7
or white with purple plastic

Diamond (235 nm)


Boron-nitride (215 nm)
3.1 < ΔV < Aluminium-nitride (AlN) (210 nm)
Ultraviolet λ < 400
4.4 Aluminium-gallium-nitride (AlGaN)
Aluminium0-gallium-indium-nitride (AlGaInN)
— (down to 210 nm)

White Broad spectrum ΔV = 3.5 Blue/UV diode with yellow phosphor

88
19. CODE

#include <LiquidCrystal.h>
const int rs = 2, en = 3, d4 = 4, d5 = 5, d6 = 6, d7 = 7;
Liquid Crystal lcd(rs, en, d4, d5, d6, d7);

#define sensor A0
#define solar A1
int s;
float piezo;
void setup()
{
lcd. begin(16, 2);
lcd. print("HYBRIDE POWER GEN");
lcd. Set Cursor(0,1);
lcd. print("SOLAR&PIEZO SENSR");
// pin Mode(sensor, INPUT);
delay(1000);
lcd. clear();
lcd. print("PIEZO:");
lcd. Set Cursor(0,5);
lcd. print("SOLAR:");

void loop()
{
piezo=analog Read(sensor);
float v=(piezo) * (5.0/1024.0);
s=analog Read(solar);

89
lcd. Set Cursor(7,0);
lcd. print(v);
lcd. Set Cursor(7,1);
lcd. print(s);
lcd. Set Cursor (8,1);
lcd. print (".");
lcd. set Cursor(11,0);
lcd .print("V");
lcd. Set Cursor(11,1);
lcd. print("V");
delay(1000);
}

90
20. OUT PUT

CIRCUIT BOARD & LCD DISPLAY

91
WORKING PROCESS OF SOLAR PIEZO HYBRID POWER GENERATING SYSTEM

92
PIEZO PLATES

93
21. FUTURE SCOPE
 It was used for house holding purposes if we increases (or) implements the capacity to be
increases we can used it as industry purposes.
 By using this we generated power and we store in dc battery it is used in daily usage.
 At present it is used in subways
 The system can be implemented in the few years with recent development in the technology, a
solar + Piezo power generating system.
 It was implemented in RIO OLYOMPIAD

94
 22.BIBLIOGRAPHY

The ARDUINO UNO


o Alex Turner
o Michael McRoberts

Electrical components

o D.V. Prasad

IR sensor

o Hall Gardner

Reference on the web

www.atmel.com

www.atmel.com/literature

www.geocities.com

www.national.com

95

You might also like