You are on page 1of 38

CHAPTER 1

INTRODUCTION
1.1 INTRODUCTION:
The purpose of this project is to use it as the multi storage device using the
microcontroller. This system provides ease in the opening and closing of the long
horizontal and heavy racks by interfacing microcontroller with DC motor and the
keypad (4X4). The old traditional type of racks use a manual pull and push for opening
and closing of the racks, but here in our project we open these racks using a latest idea
of interfacing microcontroller with motor driver and operated using keypad. The system
can be used for residential, industrial and other various purposes.
In this project the microcontroller is programmed depending on which using the
specific key on keypad the appropriate rack opens and closed after specific amount of
time automatically. The motor is arranged to a rack which helps in easy movement of
the rack. It is designed in such a way that if one rack is opened the other cannot be
opened using instruction commands. For instance, for opening a first rack among three
racks the key which is allocated for it is used and while operating this rack the other
racks cannot be opened. When a person selects a key on a keypad to open rack the
instruction is sent to the microcontroller by using instruction it checks the rack and
according to it instruction is passed to the motor driver to open that particular rack.
By this way we can use racks in different manner in different fields for storing
different particles securely. The application program for the microcontroller will be
written in Arduino IDE 1.0.6 will be dumped in the Arduino microcontroller. The
program can be changed according to our requirement.
The major features of this project are:
1.
2.
3.
4.
5.

Provides comfortable usage of racks.


Fast response.
Smooth and reliable.
Can be used for multi purposes in industry, shopping malls etc.
User friendly.
1

1.2 Project Overview:


An embedded system is a combination of software and hardware to
perform a dedicated task. Some of the main devices used in embedded products
are Microprocessors and Microcontrollers.
Microprocessors are commonly referred to as general purpose processors
as they simply accept the inputs, process it and give the output. In contrast, a
microcontroller not only accepts the data as inputs but also manipulates it,
interfaces the data with various devices, controls the data and thus finally gives
the result.
The project Automated multi storage device using keypad uses arduino
microcontroller which provides automated operation of the cupboards by giving
instructions to the arduino.

1.3 Required Components:


1. Microcontroller :We have used Arduino Duemilanove as micro controller in our Project.
2. Keypad : We have used 4X4 Matrix Keypad as input source in our Project.
3. Motor Driver :We have used L293D as a motor driver with a feature of in built heat sink.
4. DC Motor :We are using couple of DC motors with 300 RPM.
5. Power Supply :(i). Arduino power supply of 5V DC is taken from Laptop using USB cable.
(ii).Power supply of 12V DC is obtained through transformer by rectification
Process .
6. Storage Device :We built a wooden storage device with 3 racks freely moving with the help of side
channels.

1.4 Thesis Organization:

The thesis explains the implementation of Automated multi storage device using
keypad using arduino microcontroller. The organization of the thesis is explained here:

Chapter 1: Presents introduction to the overall thesis and the overview of the project.
Chapter 2: Presents about Embedded systems in brief and its applications.
Chapter 3: Presents hardware description. It deals with block diagram and circuit
diagram of the project and explains the purpose of each block. In the same chapter the
explanation of microcontroller, power supply, motor driver, dc motor and keypad are
considered.
Chapter 4: Presents software description. It explains the implementation of the project
using aurdino 1.0.6 software open source.
Chapter 5: Presents the advantages and disadvantages including applications of the
system.
Chapter 6: Presents the results, conclusion and future scope of the project.

CHAPTER 2
LITERATURE SURVEY

Traditionally, cupboards are made up of wood and different low weighted


materials used as storage cabinets. It has a wide range of applications in various sectors
like house hold, Industrials, Offices and so forth.

Fig 2.1 Old wooden racks

Fig 2.2 An updated storage racks

In the above figures 2.1 & 2.2 we can feel the difficulty in opening and closing
the racks which involve human effort. It is not much difficulty in pulling and pushing the
drawers which are in light weight but if the weight in the drawer increases it requires
more strain for the people who are using it. Furthermore, In industrial applications
manual pulling is a big deal.
Seeing the difficulties like wooden expansion and contraction in various seasons
we really face lot of problems in opening and closing them, we have designed automation
in storage devices which involves less human efforts by interfacing the drawers to the
electronic and electrical components like Micro Controller, Keypad, Regulated power
supply and Motor driver as well as mechanical components like DC motors, sliders. The
below figure 2.3 illustrates the example of advanced storage racks

Fig 2.3 example of Updated storage racks with advanced sliders

The system can be effective and low cost design, the usage of components in this
project are designed for low power consumption and less manual attention is required, no
extra training is required for the user and is user friendly and get the fast response with no
maintenance cost.
Using this, the racks are opened and closed according to the instruction provided
by the user by pressing the required rack number in the keypad.

CHAPTER 3
HARDWARE DESCRIPTION:
3.1 INTRODUCTION:
In this chapter the block diagram of the project and design aspect of independent
modules are considered. Block diagram is shown in fig: (i):

FIG 3.1: Block diagram of Automated multipurpose storage device using keypad

The main blocks of this project : The following are the main blocks used in this
project, they are
1. Regulated power supply (RPS)
2. Micro controller - Arduino
3. Keypad
4. DC motor driver
5. DC motor
6. Storage rack
6

3.2 MICROCONTROLLER ARDUINO


Arduino is an open-source computer hardware and software company.we have
many different types of arduino boards but we are using arduino duemilanove based on
ATmega 168.
It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6
analog inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP
header, and a reset button.It contains everything needed to support the microcontroller;
simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or
battery to get started.
The arduino is interfaced with motor driver and keypad.it is operated at 5v dc and
recommended input voltage is 7-12 v dc.
3.3 DC Motor Driver:
We are using L293D which is a quadruple high-current half-H drivers. The
L293D is designed to provide bidirectional drive currents of up to 600-mA at voltages
from 4.5 V to 36 V. It is designed to drive inductive loads such as relays, solenoids, dc
and bipolar stepping motors, as well as other high-current/high-voltage loads in positivesupply applications.
All inputs are TTL compatible. Drivers are enabled in pairs, with drivers 1 and 2
enabled by 1,2 EN and drivers 3 and 4 enabled by 3,4EN.When an enable input is high,
the associated drivers are enabled and their outputs are active and in phase with their
inputs.
When the enable input is low, those drivers are disabled and their outputs are off
and in the high-impedance state. With the proper data inputs, each pair of drivers forms a
full-H (or bridge) reversible drive suitable for solenoid or motor applications. On the
L293D, external high-speed output clamp diodes should be used for inductive transient
suppression. A VCC1 terminal, separate from VCC2, is provided for the logic inputs to
minimize device power dissipation. The L293D is characterized for operation from 0C
to 70C.

Fig 3.2: L293D IC

In addition to it, we assigned an heat sink to the IC to reduce the temperature and
also to protect from over heat and prevent the physical damage.

Features of L293D:

600mA Output current capability per channel


1.2A Peak output current (non repetitive) per channel
Enable facility
Over temperature protection
Logical 0input voltage up to 1.5 v
High noise immunity
Internal clamp diodes

3.4 D.C. Motor


A dc motor uses electrical energy to produce mechanical energy, very typically
through the interaction of magnetic fields and current-carrying conductors
We are using dc motors rather than going for other kind of motors because of its
low power consumption and low cost.
The dc motor rotates in both the directions. when the instruction is 1,0 to the pins
it rotates in clockwise direction results in opening of the rack. The instruction with 0,1 at
the terminal pins will make the motor to rotate in anti-clock wise direction results in
closing of the rack.
8

We are operating the dc motor to rotate based on the time rather than considering
the number of rotations. When the key is pressed the motor starts rotating for specific
duration and stops. similarly which closing the motor rotates for same duration but in
reverse direction.
The input of a DC motor is current/voltage and its output is torque (speed).The dc
motor we are using is of 300 rpm which is operated at 12v dc which is obtained from
regulated power supply containing step down transformers and few components for
rectification process.

3.5 KEYPAD
A keypad is a set of buttons arranged in a block or "pad" which usually bear
digits, symbols and usually a complete set of alphabetical letters. If it mostly contains
numbers then it can also be called a numeric keypad. Keypads are found on many
alphanumeric keyboards and on other devices such as calculators, push-button
telephones, combination locks, and digital door locks, which require mainly numeric
input. we are using matrix keypad of 4x4 size. It consists of 8 pins which are directly
connected to arduino and it has no external power supply specially.keypad is the only
means of input in this project for controlling.

Figure3.3: Matrix Keypad Connections

Features

Ultra-thin design

Adhesive backing

Excellent price/performance ratio

Easy interface to any microcontroller

Example programs provided for the BASIC Stamp 2 and Propeller P8X32A
microcontrollers

Key Specifications

Maximum Rating: 24 VDC, 30 mA

Interface: 8-pin access to 4x4 matrix

Operating temperature: 32 to 122 F (0 to 50C)

Dimensions: Keypad, 2.7 x 3.0 in (6.9 x 7.6 cm)


Cable: 0.78 x 3.5 in (2.0 x 8.8 cm)

10

Application Ideas

Security systems

Menu selection

Data entry for embedded systems

3. REGULATED POWER SUPPLY (RPS)


The process of converting an alternating current to a pulsating direct current is
called as rectification. For rectification purpose we use rectifiers.

Rectifiers:
A rectifier is an electrical device that converts alternating current (AC) to direct
current (DC), a process known as rectification. Rectifiers have many uses including as
components of power supplies and as detectors of radio signals. Rectifiers may be made
of solid-state diodes, vacuum tube diodes, mercury arc valves, and other components.
A device that it can perform the opposite function (converting DC to AC) is
known as an inverter.
When only one diode is used to rectify AC (by blocking the negative or positive
portion of the waveform), the difference between the term diode and the term rectifier is
merely one of usage, i.e., the term rectifier describes a diode that is being used to convert
AC to DC. Almost all rectifiers comprise a number of diodes in a specific arrangement
for more efficiently converting AC to DC than is possible with only one diode. Before the
development of silicon semiconductor rectifiers, vacuum tube diodes and copper (I) oxide
or selenium rectifier stacks were used.

Bridge full wave rectifier:


The Bridge rectifier circuit is shown in fig: 3.3.7, which converts an ac voltage
to dc voltage using both half cycles of the input ac voltage. The Bridge rectifier circuit is
shown in the figure. The circuit has four diodes connected to form a bridge. The ac input

11

voltage is applied to the diagonally opposite ends of the bridge. The load resistance is
connected between the other two ends of the bridge.
For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct,
whereas diodes D2 and D4 remain in the OFF state. The conducting diodes will be in
series with the load resistance RL and hence the load current flows through RL.
For the negative half cycle of the input ac voltage, diodes D2 and D4 conduct
whereas, D1 and D3 remain OFF. The conducting diodes D2 and D4 will be in series
with the load resistance RL and hence the current flows through R L in the same direction
as in the previous half cycle. Thus a bi-directional wave is converted into a unidirectional
wave.
Input

Output

Fig 3.4: Bridge rectifier: a full-wave rectifier using 4 diodes

Fig 3.5 Regulated Power Supply

12

The basic circuit diagram of a regulated power supply (DC O/P) with led connected
as load is shown in fig: 3.6

Fig 3.6 Circuit diagram of Regulated Power Supply with Led

Connection:
The components mainly used in above figure are

230v ac mains

Transformer

Bridge rectifier(diodes)

Capacitor

Voltage regulator(ic 7805)

Resistor

Led(light emitting diode)


The detailed explanation of each and every component mentioned above is as

follows:

Transformation: The process of transforming energy from one device to another is


called transformation. For transforming energy we use transformers.

13

Transformers:
A transformer is a device that transfers electrical energy from one circuit to
another through inductively coupled conductors without changing its frequency. 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.
If a load is connected to the secondary, an electric current will flow in the
secondary winding and electrical energy will be transferred from the primary circuit
through the transformer to the load. This field is made up from IR obstacles of force and
has the same shape as a bar magnet.
If the current is increased, the IR obstacles of force move outwards from the coil.
If the current is reduced, the IR obstacles of force move inwards.
If another coil is placed adjacent to the first coil then, as the field moves out or in,
the moving IR obstacles of force will "cut" the turns of the second coil. As it does this, a
voltage is induced in the second coil. With the 50 Hz AC mains supply, this will happen
50 times a second. This is called MUTUAL INDUCTION and forms the basis of the
transformer.
The input coil is called the primary winding; the output coil is the secondary
winding. Fig: 3.7 shows step-down transformer.

Fig 3.7: Step-Down Transformer

14

The voltage induced in the secondary is determined by the TURNS RATIO.

Here we are using Primary voltage as 240V AC and obtaining Secondary voltage
as 12V AC. The ratio of primary to secondary turns would be 20:1.
For example if the Primary turns is 5000, Secondary turns would be 250. Which
results in 230V to 12V AC.
To aid magnetic coupling between primary and secondary, the coils are wound on
a metal CORE. Since the primary would induce power, called EDDY CURRENTS, into
this core, the core is LAMINATED. This means that it is made up from metal sheets
insulated from each other. Transformers to work at higher frequencies have an iron dust
core or no core at all.
Note that the transformer only works on AC, which has a constantly changing
current and moving field. DC has a steady current and therefore a steady field and there
would be no induction.
Some transformers have an electrostatic screen between primary and secondary.
This is to prevent some types of interference being fed from the equipment down into the
mains supply, or in the other direction. Transformers are sometimes used for
IMPEDANCE MATCHING.
We can use the transformers as step up or step down.

Step Up transformer:
In case of step up transformer, primary windings are every less compared to
secondary winding.
Because of having more turns secondary winding accepts more energy, and it
releases more voltage at the output side.
15

Step down transformer:


Incase of step down transformer, Primary winding induces more flux than the
secondary winding, and secondary winding is having less number of turns because of that
it accepts less number of flux, and releases less amount of voltage.

16

CHAPTER 4
SOFTWARE DESCRIPTION
4.1 SOFTWARE DESCRIPTION:
The Arduino integrated development environment (IDE) is a cross-platform
application written in Java, and derives from the IDE for the Processing programming
language and the Wiring projects. It is designed to introduce programming to artists and
other newcomers unfamiliar with software development. It includes a code editor with
features such as syntax highlighting, brace matching, and automatic indentation, and is
also capable of compiling and uploading programs to the board with a single click. A
program or code written for Arduino is called a sketch.
Arduino programs are written in C or C++. The Arduino IDE comes with a
software library called "Wiring" from the original Wiring project, which makes many
common input/output operations much easier. Users only need define two functions to
make a runnable cyclic executive program:

setup(): a function run once at the start of a program that can initialize settings

loop(): a function called repeatedly until the board powers off


The Arduino Duemilanove can be programmed with the Arduino software

(download). Select "Arduino Diecimila or Duemilanove w/ ATmega168" or "Arduino


Duemilanove w/ ATmega328" from the Tools > Board menu (according to the
microcontroller on your board). For details, see the reference and tutorials.
The ATmega168 or ATmega328 on the Arduino Duemilanove comes preburned
with a bootloader that allows you to upload new code to it without the use of an external
hardware programmer. It communicates using the original STK500protocol (reference, C
header files).
You can also bypass the bootloader and program the microcontroller through the
ICSP (In-Circuit Serial Programming) header.
17

4.2 FLOW CHART:

18

4.3 STEPS OF USING ARDUINO 1.0.6


1. Click the arduino 1.0.6 software icon on the desktop.
2. The following picture will appear as in fig 4.1.

Fig 4.1 arduino IDE appearance

3. Type the program code in the editor and save the program from the file menu.
4. Click on tool menu and select the arduino board type as arduino duemilanove
atmega328.

19

Fig 4.2 selection of aurdino board

5.Click on sketch menu and click on compile.

Fig 4.3 compilation of code in arduino IDE

20

7. Now after compilation is done, a status at the bottom of the editor is shown as done
compiling.

Fig 4.4 compilation done status

8. After compilation click on the symbol shown in yellow color by interfacing arduino
board with personal computer using USB cable, as a result uploading is shown at the
bottom of the editor. Unplug the board after successful uploading of the code.

21

Fig 4.5 Dumping the code into the board

CHAPTER 5
RESULT
5.1 RESULT
22

The project Automated multi storage device using keypad is designed such that
the person who operates the heavy storage cupboards should feel comfortable while
performing transactions with them. By using keypad appropriate input is given to the
microcontroller according to it corresponding rack opens without any difficulty.
When we press the button number A in the keypad the corresponding rack no 2
is opened which is shown in fig 5.1. Here when we press the button the active high signal
is sent to Microcontroller which activates the enable pin of motor driver second port
which results in rotation of DC motor 2 in clock wise direction, till 40 seconds which is
pre calculated according to the length of the rack.

Fig 5.1 Opening of the rack

When we press the button number B in the keypad the corresponding rack no 2
is closed which is shown in fig 5.2. Here when we press the button the active high signal
is sent to Microcontroller which activates the enable pin of motor driver second port
which results in rotation of DC motor 2 in counter-clock wise direction and closed with
the help of sliding channels, till 40 seconds which is pre calculated according to the
length of the rack.

23

Fig 5.2 closing of the rack

For the flexible movement of the racks we are using sliding channels for all the
racks which gives a free movement for the rack opening and closing.

Fig 5.3 Sliders used as channels for racks

24

CHAPTER 6
CONCLUSION
6.1 ADVANTAGES, DISADVANTAGES& APPLICATIONS
ADVANTAGES:
1. Manual attention is not required
2. Efficient and low cost design.
3. Low power consumption.
4. No need for training.
DISADVANTAGES:
1. Slow response
APPLICATIONS:
This system can be practically implemented in real time by adding keypad and dc
motors for reducing the human efforts to pull and push the racks. It mainly used in the
industrial applications like lifting the shutters, opening the heavy racks containing heavy
loads and be easily maintained with proper motors for the respective loads.

6.2 CONCLUSION:
Integrating features of all the hardware components used have been developed in
it. Presence of every module has been reasoned out and placed carefully, thus
contributing to the best working of the unit. The observations clearly shows that the each
and minute movement of the objects can be precisely followed with the help of present
system. The accuracy level can be extended to the public level using this system. Thus,
the project has been successfully designed and tested.

25

6.3 FUTURE SCOPE:


Our project Automated multi storage device using keypad is mainly intended
for building multi storage device can be used in any field.

In this we used micro

controller and DC motor for automatic control of racks of specific size and weight by
using keys on keypad. By using the DC motor of the higher torque we can control
movement of more heavy racks. The system is designed with three racks if we want to
store more we can increase the number of racks according to its application. By using
more technology we can create the password for operation of the cupboards.
The system as many advantages as it consume less power and usage is efficient. It
can be used in kitchen to store grocery, in library for books, laboratories to store
instruments and for other applications. By implementing this project with other
technologies the fast movement of the cupboards can be obtained.

26

BIBLIOGRAPHY
THE SITES WHICH WERE USED WHILE DOING THIS PROJECT:
1. http://playground.arduino.cc/code/keypad
2.http://www.kjit.bme.hu/images/stories/targyak/jelfeldolgozas_a_kozlekedesben/keypap
_manual_v100.pdf
3. http://www.ti.com/lit/ds/symlink/l293.pdf
4. http://arduino.cc/en/Main/arduinoBoardDuemilanove
5. http://electrical4u.com/dc-motor-or-direct-current-motor/
BOOKS REFERRED:
1. Arduino programming notebook
written and compiled by BRIAN W. EVANS,
Published in august 2007
2. Electricity ac/dc motors,controls and maintenance
10th edition,written by JEFF KELJIK,
Published year 2013

27

REFERENCES

THE SITES WHICH WERE USED WHILE DOING THIS PROJECT:


1. http://arduino.cc
2. http://electrical4u.com
BOOKS REFERRED:
Arduino programming notebook
written and compiled by BRIAN W. EVANS,
Published in august 2007, page no. 23-29

28

APPENDIX-A
MICRO CONTROLLER ARDUINO

Arduino is an open-source computer hardware and software company, project and


user community that designs and manufactures kits for building digital devices and
interactive objects that can sense and control the physical world Arduino boards may be
purchased preassembled, or as do-it-yourself kits; at the same time, the hardware design
information is available for those who would like to assemble an Arduino from scratch.

The project is based on a family of microcontroller board designs manufactured


primarily by Smart Projects in Italy and also by several other vendors, using various 8-bit
Atmel AVR microcontrollers or 32-bit Atmel ARM processors. These systems provide
sets of digital and analog I/O pins that can be interfaced to various extension boards and
other circuits. The boards feature serial communications interfaces, including USB on
some models, for loading programs from personal computers. For programming the
microcontrollers, the Arduino platform provides an integrated development environment
(IDE) based on the Processing project, which includes support forC and C++
programming languages.

HARDWARE
An Arduino board consists of an Atmel 8-bit AVR microcontroller with
complementary components that facilitate programming and incorporation into other
circuits. An important aspect of the Arduino is its standard connectors, which lets users
connect the CPU board to a variety of interchangeable add-on modules known as shields.
Some shields communicate with the Arduino board directly over various pins, but many
shields are individually addressable via an IC serial busso many shields can be stacked
and used in parallel. Official Arduinos have used the mega AVR series of chips,
specifically the ATmega8, ATmega168, ATmega328, ATmega1280, and ATmega2560. A
handful of other processors have been used by Arduino compatibles. Most boards include
29

a 5 volt linear regulator and a 16 MHz crystal oscillator (or ceramic resonator in some
variants), although some designs such as the Lily Pad run at 8 MHz and dispense with the
onboard voltage regulator due to specific form-factor restrictions. An Arduino's
microcontroller is also pre-programmed with a boot loader that simplifies uploading of
programs to the on-chip flash memory, compared with other devices that typically need
an external programmer. This makes using an Arduino more straightforward by allowing
the use of an ordinary computer as the programmer.

OFFICIAL BOARDS
The original Arduino hardware is manufactured by the Italian company Smart
Projects. Some Arduino-branded boards have been designed by the American company
Spark Fun Electronics. Sixteen versions of the Arduino hardware have been
commercially produced to date.
Example Arduino boards
Arduino Diecimila in Stoicheia
Arduino Duemilanove (rev 2009b)
Arduino UNO
Arduino Leonardo
Arduino Mega
Arduino MEGA 2560 R3 (front side)
Arduino MEGA 2560 R3 (back side)
Arduino Nano
Arduino Due (ARM-based)
LilyPad Arduino (rev 2007)

OVERVIEW ON ARDUINO DUEMILANOVE


The Arduino Duemilanove ("2009") is a microcontroller board based on the
ATmega168 (datasheet) or ATmega328(datasheet). It has 14 digital input/output pins (of
which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz crystal oscillator, a
USB connection, a power jack, an ICSP header, and a reset button. It contains everything
30

needed to support the microcontroller; simply connect it to a computer with a USB cable
or power it with a AC-to-DC adapter or battery to get started.

"Duemilanove" means 2009 in Italian and is named after the year of its release.
The Duemilanove is the latest in a series of USB Arduino boards; for a comparison with
previous versions, see the index of Arduino boards.

Fig 1.Arduino Board


SUMMARY

Microcontroller
Operating Voltage
Input
Voltage
(recommended)
Input Voltage (limits)
Digital I/O Pins
Analog Input Pins
DC Current per I/O Pin
DC Current for 3.3V Pin
Flash Memory
SRAM

ATmega168
5V
7-12V
6-20V
14 (of which 6 provide PWM output)
6
40 Ma
50 Ma
16 KB (ATmega168) or 32 KB (ATmega328) of which 2
KB used by bootloader
1 KB (ATmega168) or 2 KB (ATmega328)
31

EEPROM
Clock Speed

512 bytes (ATmega168) or 1 KB (ATmega328)


16 MHz

POWER
The Arduino Duemilanove can be powered via the USB connection or with an external
power supply. The power source is selected automatically. External (non-USB) power can
come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be
connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads
from a battery can be inserted in the Gnd and Vin pin headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less than
7V, however, the 5V pin may supply less than five volts and the board may be unstable. If
using more than 12V, the voltage regulator may overheat and damage the board. The
recommended range is 7 to 12 volts.
The power pins are as follows:
VIN. The input voltage to the Arduino board when it's using an external power source
(as opposed to 5 volts from the USB connection or other regulated power source). You
can supply voltage through this pin, or, if supplying voltage via the power jack, access it
through this pin.
5V. The regulated power supply used to power the microcontroller and other components
on the board. This can come either from VIN via an on-board regulator, or be supplied by
USB or another regulated 5V supply.
3V3. A 3.3 volt supply generated by the on-board FTDI chip. Maximum current draw is
50 mA.
GND. Ground pins.

MEMORY
The ATmega168 has 16 KB of flash memory for storing code (of which 2 KB is
used for the bootloader); the ATmega328has 32 KB, (also with 2 KB used for the
bootloader). The ATmega168 has 1 KB of SRAM and 512 bytes of EEPROM (which can

32

be read and written with the EEPROM library); the ATmega328 has 2 KB of SRAM and
1 KB of EEPROM.

INPUT AND OUTPUT


Each of the 14 digital pins on the Duemilanove can be used as an input or output,
using pinMode(), digitalWrite(), anddigitalRead() functions. They operate at 5 volts. Each
pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor
(disconnected by default) of 20-50 kOhms. In addition, some pins have specialized
functions:
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
These pins are connected to the corresponding pins of the FTDI USB-to-TTL Serial chip.
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a
low value, a rising or falling edge, or a change in value. See the attachInterrupt() function
for details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite()
function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication
using the SPI library.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.
The Duemilanove has 6 analog inputs, each of which provide 10 bits of resolution (i.e.
1024 different values). By default they measure from ground to 5 volts, though is it
possible to change the upper end of their range using the AREF pin and the
analogReference() function. Additionally, some pins have specialized functionality:
I2C: analog input pins A4 (SDA) and A5 (SCL). Support I2C (TWI) communication
using the Wire library.
There are a couple of other pins on the board:
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset
button to shields which block the one on the board.

33

USB OVERCURRENT PROTECTION


The Arduino Duemilanove has a resettable polyfuse that protects your computer's
USB ports from shorts and overcurrent. Although most computers provide their own
internal protection, the fuse provides an extra layer of protection. If more than 500 mA is
applied to the USB port, the fuse will automatically break the connection until the short
or overload is removed.

PHYSICAL CHARACTERISTICS
The maximum length and width of the Duemilanove PCB are 2.7 and 2.1 inches
respectively, with the USB connector and power jack extending beyond the former
dimension. Three screw holes allow the board to be attached to a surface or case. Note
that the distance between digital pins 7 and 8 is 160 mil (0.16"), not an even multiple of
the 100 mil spacing of the other pins.

APPENDIX-B
Program Code:
The program code which is dumped in the microcontroller of our project is
shown below.
34

#include <Keypad.h>

//header file

const byte ROWS = 4;

// no.of rows

const byte COLS = 4;

//no. of columns
//define the symbols on the buttons of

the keypads
char Keys[ROWS][COLS] =
{
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};

// array representation of keypad

byte rowPins[ROWS] = {2,3,4,5};

// row pins assigned to arduino pins

byte colPins[COLS] = {6,7,8,9};

// row pins assigned to arduino pins


//initialize an instance of class

NewKeypad
Keypad key1 = Keypad(makeKeymap(Keys),rowPins,colPins,ROWS,COLS);
//assigning 10th pin of arduino to motor

int motorPin1=10;
pin 1

//assigning 11th pin of arduino to motor

int motorPin2=11;
pin 2

//assigning 12th pin of arduino to motor

int motorPin3=12;
pin 3

//assigning 13th pin of arduino to motor

int motorPin4=13;
pin 4
int count1=0;

// initialize count 1 to zero

int count2=0;

//initialize count 2 to zero

int enablePin=13;

//assign 13th pin as enable


// Define the Keymap
// Create the Keypad

void setup()

// setup block
35

{
Serial.begin(9600);
Serial.println("Please press the keyboard:");
pinMode(motorPin1,OUTPUT);

//setting motor pin 1 as output

pinMode(motorPin2,OUTPUT);

// setting motor pin 2 as output

pinMode(motorPin3,OUTPUT);

// setting motor pin 3 as output

pinMode(motorPin4,OUTPUT);

// setting motor pin 4 as output

pinMode(enablePin,OUTPUT);
}
void loop()

// loop function contains the code for

execution
{
char key = key1.getKey();

//return type of key1.getkey to key

if(key!=NO_KEY)

// checking key value as zero or one

{
Serial.print("Key Value : ");

//printing the key value

Serial.println(key);
if((key == '3') && (count1 == 0))
{
digitalWrite(motorPin1,HIGH);

//making motor pin 1 as high

digitalWrite(motorPin2,LOW);

//making motor pin 2 as low

delay(3000);

//calling delay function

count1=1;

//assigning count1 value as one

goto motorstop1;
}
if((key=='A')&&(count2==0))

//checking the condition with key and

count
{
digitalWrite(motorPin3,HIGH);

//making motorpin 3 as high

digitalWrite(motorPin4,LOW);

//making motorpin 4 as low

delay(3000);

//calling delay function


36

count2=1;

//assigning count2 value as one

goto motorstop2;
}
if((key == '6')&&(count1==1))

//checking the condition with key and

count
{
digitalWrite(motorPin1,LOW);

//making motorpin 1 as low

digitalWrite(motorPin2,HIGH);

//making motor pin 2 as high

delay(3000);

//calling delay function

count1=0;
goto motorstop1;
}
if((key=='B')&&(count2==1))

//checking the condition with key and

count
{
digitalWrite(motorPin3,LOW);

//making motorpin 3 as low

digitalWrite(motorPin4,HIGH);

//making motor pin 4 as high

delay(3000);

//calling delay function

count2=0;
goto motorstop2;
}
motorstop1:
digitalWrite(motorPin1,LOW);

//making motor pin 1 as low

digitalWrite(motorPin2,LOW);

//making motor pin 2 as low

delay(300); //calling delay function


motorstop2:
digitalWrite(motorPin3,LOW);

//making motor pin 3 as low

digitalWrite(motorPin4,LOW);

//making motor pin 4 as low

delay(300);

//calling delay function


37

}
}

38

You might also like