CHAPTER 1
INTRODUCTION
1
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
In this software one can make the hardware design. Generally these
simulation designs are made to test the proposed model with results before
the actual implementation on hardware. This software is having its own
various tools (inbuilt) in it. So by using these tools simulation model for
Automated Pantry Order System is designed.
2
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
3
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
4
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
The heart of the microcontroller is the CPU core. In the past this has
traditionally been based on an 8-bit microprocessor unit. Figure above Shows a
typical microcontroller device and its different subunits
CHAPTER 2
LITERATURE SURVEY
5
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
6
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
And finally the most wide area of the pie chart is showing the
population of India or the people using the train as the source of travelling. So,
conclusion is that the train is the most important source of travelling used by
the people, for long as well as short journey trains. So, it is most probable that
our proposed Automated Pantry Order System can be implemented in the long
destinations trains or non suburban trains.
To Receiver
2.2.2 Receiver section:
From Transmitter
7
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
STOP
CHAPTER 3
HARDWARE IMPLEMENTATION:
BLOCK DIAGRAM:
8
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
LCD
POWER SUPPLY
ATMEGA8
Micro controller
Encoder
Key pad
RF
Tx
9
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
LCD
POWER SUPPLY
ATMEGA8
Decoder
Micro controller
Buzzer
RF
Rx
PC
the help of decoder.and then the user seat number and his selected items are
displayed on
LCD screen or PC.the order reached to this system or screen at that time
buzzer will
3.2 ATMEGA8:
10
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
11
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
12
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
13
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Fig 3.2.1
14
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
15
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Status Register:
The Status Register is not automatically stored when entering an interrupt
routine and restored when returning from an interrupt. This must be handled
by software
Fig 3.2.3
Global Interrupt Enable:
The Global Interrupt Enable bit must be set for the interrupts to be
enabled. The individual interrupt enable control is then performed in separate
control registers. If the Global Interrupt Enable Register is cleared, none of
the interrupts are enabled independent of the individual interrupt enable
settings. The I-bit is cleared by hardware after an interrupt has occurred, and
is set by the RETI instruction to enable subsequent interrupts. The I-bit can
16
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
also be set and cleared by the application with the SEI and CLI instructions,
as described in the Instruction Set Reference.
17
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
18
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
registers, and most of them are single cycle instructions As shown in Figure ,
each
register is also assigned a Data memory address, mapping them directly into
the first 32
locations of the user Data Space. Although not being physically implemented
as SRAM
as the X-pointer, Y-pointer, and Z-pointer Registers can be set to index any
register in the file
19
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
MEMORY:
This section describes the different memories in the Atmel AVR
ATmega8. The AVR architecture has two main memory spaces, the Data
memory and the Program Memory space. In addition, the ATmega8 features
an EEPROM Memory for data storage. All three memory spaces are linear and
regular.
Most of the instructions operating on the Register File have direct access to
all registers, and most of them are single cycle instructions As shown in
Figure, each register is also assigned a Data memory address, mapping them
directly into the first 32 locations of the user Data Space. Although not being
physically implemented as SRAM locations, this memory organization
provides great flexibility in access of the registers, as the X-pointer, Y-pointer,
and Z-pointer Registers can be set to index any register in the file.
In-System Reprogrammable Flash memory:
20
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
SRAM DATA
MEMORY:
The lower 1120 Data memory locations address the Register File,
the I/O Memory, and the internal data SRAM. The first 96 locations address
the Register File and I/O Memory, and the next 1024 locations address the
internal data SRAM.
The five different addressing modes for the Data memory cover:
Direct, Indirect with Displacement, Indirect, Indirect with Pre-decrement,
and Indirect with Post-increment. In the Register File, registers R26 to R31
feature the indirect addressing pointer registers.
The direct addressing reaches the
entire data space.
The Indirect with Displacement mode reaches 63 address locations
from the base address given by the Y-register or Z-register.
When using registers indirect addressing modes with automatic pre-
decrement and post-increment, the address registers X, Y and Z are
decremented or incremented.
Features
10-bit Resolution
0.5 LSB Integral Non- Linearity.
2 LSB
Absolute
Accuracy
13s -
21
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
260s
Conversio
n
Up to 15 kSPS at
Maximum
Resolution
6 Multiplexed Single
Ended Input Channels
Additional Multiplexed Single Ended Input Channels (TQFP
and QFN/MLF Package only)
Optional Left Adjustment
for ADC Result Readout
0 - VCC ADC Input
Voltage Range
Selectable 2.56V
ADC Reference
Voltage
Free Running or
Single Conversion
Mode
Interrupt on ADC
Conversion
Complete
Sleep
Mode
Noise
Canceler
22
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
not differ more than 0.3V from VCC. See the paragraph ADC Noise
Canceller how to connect this pin. Internal reference voltages of nominally
23
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Fig 3.2.5
The ADC converts an analog input voltage to a 10-bit digital value
through successive approximation. The minimum value represents GND and
the maximum value represents the voltage on the AREF pin minus 1 LSB.
Optionally, AVCC or an internal 2.56V reference voltage may be connected
to the AREF pin by writing to the REFSn bits in the ADMUX Register.
The internal voltage reference may thus be decoupled by an external
capacitor at the AREF pin to improve noise immunity.
24
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
conversion is lost. When ADCH is read, ADC access to the ADCH and
ADCL Registers is re-enabled.
The ADC has its own interrupt which can be triggered when a conversion
completes. When ADC access to the Data Registers is prohibited between
reading of ADCH and ADCL, the interrupt will trigger even if the result is
lost.
In Free Running mode, the ADC is constantly sampling and updating the
ADC Data Register.
25
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
26
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
The actual sample-and-hold takes place 1.5 ADC clock cycles after
the start of a normal conversion and 13.5 ADC clock cycles after the start
of a first conversion. When a conversion is complete, the result is written
to the ADC Data Registers, and ADIF is set. In single conversion mode,
ADSC is cleared simultaneously. The software may then set ADSC again,
and a new conversion will be initiated on the first rising ADC clock edge.
These bits select the voltage reference for the ADC, as shown in Table
74. If these bits are changed during a conversion, the change will not go in
effect until this conversion is complete (ADIF in ADCSRA is set). The
internal voltage reference options may not be used if an external reference
voltage is being applied to the AREF pin.
27
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
The ADLAR bit affects the presentation of the ADC conversion result in
the ADC Data Register. Write one to ADLAR to left adjust the result.
Otherwise, the result is right adjusted. Changing the ADLAR bit will affect
the ADC Data Register immediately, regardless of any ongoing
conversions. For a complete description of this bit, see The ADC Data
Register ADCL and ADCH on page 201.
Bits 3:0 MUX3:0: Analog
Channel Selection Bits
The value of these bits selects which analog inputs are connected to the
ADC. See Table 75 for details. If these bits are changed during a conversion,
the change will not go in effect until this conversion is complete (ADIF in
ADCSRA is set).
28
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
0011 ADC3
0100 ADC4
0101 ADC5
29
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Fig 3.2.8
Bit 7 ADEN:
ADC Enable
Writing this bit to one enables the ADC. By writing it to zero, the
ADC is turned off. Turning the ADC off while a conversion is in progress,
will terminate this conversion.
30
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
When this bit is set (one) the ADC operates in Free Running mode. In
this mode, the ADC samples and updates the Data Registers continuously.
Clearing this bit (zero) will terminate Free Running mode.
This bit is set when an ADC conversion completes and the Data
Registers are updated. The ADC Conversion Complete Interrupt is
executed if the ADIE bit and the I-bit in SREG are set. ADIF is cleared by
hardware when executing the corresponding interrupt Handling Vector.
Alter- natively, ADIF is cleared by writing a logical one to the flag. Beware
that if doing a Read-Modify- Write on ADCSRA, a pending interrupt can be
disabled. This also applies if the SBI and CBI instructions are used.
When this bit is written to one and the I-bit in SREG is set, the ADC
Conversion Complete Interrupt is activated.
Bits 2:0 ADPS2:0: ADC Prescaler Select Bits
These bits determine the division factor between the XTAL frequency
and the input clock to the adc.
31
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
0 1 0 4
0 1 1 8
1 0 0 16
1 0 1 32
1 1 0 64
1 1 1 128
Fig 3.2.9
32
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
The input to the circuit is applied from the regulated power supply. The
ac input i.e., 230V from the mains supply is step down by the transformer to
12V and is fed to a rectifier. The output obtained from the rectifier is a
pulsating dc voltage. So in order to get a pure dc voltage, the output voltage
from the rectifier is fed to a filter to remove any ac components present even
after rectification. Now, this voltage is given to a voltage regulator to obtain a
pure constant dc voltage. The block diagram of regulated power supply is
shown in the figure 3.2
Rectifier:
The output from the transformer is fed to the rectifier. It converts A.C.
into pulsating D.C. The rectifier may be a half wave or a full wave rectifier. In
this project, a bridge rectifier is used because of its merits like good stability
and full wave rectification.
33
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Filter:
Capacitive filter is used in this project. It removes the ripples from the
output of rectifier and smoothens the D.C. Output received from this filter is
constant until the mains voltage and load is maintained constant. However, if
either of the two is varied, D.C. voltage received at this point changes.
Therefore a regulator is applied at the output stage.
Voltage regulator:
As the name itself implies, it regulates the input applied to it. A voltage
regulator is an electrical regulator designed to automatically maintain a
constant voltage level. In this project, power supply of 5V and 12V are
required. In order to obtain these voltage levels, 7805 and 7812 voltage
regulators are to be used. The first number 78 represents positive supply and
the numbers 05, 12 represent the required output voltage levels.
A 16x2 LCD means it can display 16 characters per line and there are 2
such lines. In this LCD each character is displayed in 5x7 pixel matrix. This
LCD has two registers, namely, Command and Data. The command register
34
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
instruction given to LCD to do a predefined task like initializing it, clearing its
screen, setting the cursor position, controlling display etc. The data register
stores the data to be displayed on the LCD. The data is the ASCII value of the
35
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Fig 3.4.1
36
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
No
1 Ground (0V) Ground
2 Supply voltage; 5V (4.7V 5.3V) Vcc
3 Contrast adjustment; through a variable resistor VEE
electronic lock, etc., keypad is used to take input from the user for further
processing. In
this article we are interfacing keypad with the MCU AT89C51 and displaying
the
37
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
understand.
controller. Port P2 of the microcontroller is used to send the data for displaying
38
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
on the LCD. P1^1, P1^2, P1^3 pins of microcontroller is connected to RS, RW,
EN pins of LCD respectively. Port P0 is used to scan input from the keypad
The concept of interfacing keypad with the MCU is simple. Every number is
assigned two unique parameters, i.e., row and column number (n(R, C) for
example 6 (2, 3)). Hence every time a key is pressed the number is identified
Initially all the rows are set to zero by the controller and the columns
are scanned to check if any key is pressed. In case no key is pressed the output
39
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Whenever a key is pressed the row and column corresponding to the key
will get short, resulting in the output of the corresponding column goes to go
low (since we have
made all the rows zero). This gives the column number of the pressed key.
3.6 RF MODULE:
The RF module, as the name suggests, operates at Radio
Frequency. The corresponding frequency range varies between 30 kHz & 300
GHz. In this RF system, the digital data is represented as variations in the
amplitude of carrier wave. This kind of modulation is known as Amplitude
Shift Keying (ASK).
40
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Pin Diagram:
41
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Fig 3.6.1
Pin Description:
RF Transmitter
Pin
Function Name
No
1 Ground (0V) Ground
2 Serial data input pin Data
3 Supply voltage; 5V Vcc
4 Antenna output pin ANT
42
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
RF Receiver
Pin
Function Name
No
1 Ground (0V) Ground
2 Serial data output pin Data
3 Linear output pin; not connected NC
4 Supply voltage; 5V Vcc
5 Supply voltage; 5V Vcc
6 Ground (0V) Ground
7 Ground (0V) Ground
8 Antenna input pin ANT
3.7 BUZZER:
43
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Fig 3.7.2
The
piezo
buzzer
produces
sound
based on
reverse of
the
44
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Fig 3.7.3
The buzzer
produces a same
noisy sound
irrespective of the
push on one conductor and pull on the other. This, push and pull action,
to 4 kHz.
The Red lead is connected to the Input and the Black lead
is connected to Ground.
45
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Pin diagram:
46
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
CHAPTER 4
FIRMWARE IMPLEMENTATION
47
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
48
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Selecting the compiler and creating the project name and click on the next
button
49
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Choose AVR simulator from the left list and controller from the right list and
press finish.
50
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Fig 4.1.1
51
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Fig 4.1.2
Save the program by pressing ctrl + S or choosing save from the file menu
Fig 4.1.3
ASSEMBLING:
52
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Fig 4.1.4
See the Build window. The window shows if your program has syntax
error or not. By looking at the window, you can see the amount of memory
which is used by your program.
4.2 PROGISP:
53
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
PROGISP ver1.68 supports for nearly 110 CPUs with on board by default fuse
bits selection for every controller. Friendly user interface with required
graphics.
Step 1:
Open the tool
Step 2:
54
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
55
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
56
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Step 3:
Click on Erase
57
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Step 4:
Click on load flash
58
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Step 5:
Clink on write flash and verify flash in command mode
59
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
CHAPTER 5
SOURCE CODE
#include <avr/io.h>
#define F_CPU 8000000ul
#include "lcd.h"
#include <avr/interrupt.h>
#include <util/delay.h>
//char s1[20],card1[]="3E006855F0F3",s2[50];
//int i=0,m1=0,fuel=100,f1=0;
void Init_USART()
{
UBRRL= 0x33; // Initializing the Baud Rate
UCSRB = (1<<RXEN)|(1<<TXEN); // Enabling transmitting and
Receiving bits
UCSRC = (3<<UCSZ0)|(1<<URSEL); // 8-bit data, unlocking UCSRC
register using URSEL
}
unsigned char UART_receive(void )
{
while ( !(UCSRA & (1<<RXC)) ); // set the rx flag
UCSRA=(0<<RXC); // CLEAR THE rx flag
return UDR; // Get and return received data from buffer
}
int keypad()
{
while(1)
{
LCDWriteStringXY(0,0,"1.c.drink 2.samosa ");
_delay_ms(100);
LCDWriteStringXY(0,1,"3.pop carn 4.cake ");
_delay_ms(100);
PORTB=0x7f; //selecting first column and first row
_delay_ms(100);
if((PINB & (0x01))==0x00)
60
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
{
LCDWriteStringXY(0,0," 2.samosa ");
_delay_ms(100);
PORTD|=(1<<PD0);
while((PINB & (0x01))==0x00);
PORTD&=~(1<<PD0);
}
if((PINB & (0x02))==0x00)
{
LCDWriteStringXY(0,0,"1.c.drink ");
_delay_ms(100);
PORTD|=(1<<PD1);
while((PINB & (0x02))==0x00);
PORTD&=~(1<<PD1);
}
PORTB=0xbf; //selecting second column and second row
_delay_ms(100); //delay in milliseconds
int main(void)
{
DDRB=0xf0;
DDRC=0xff;
DDRD=0xff;
InitLCD(0);
61
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
_delay_ms(100);
LCDWriteStringXY(0,0,"Initiliazing........ ");
_delay_ms(5000);
_delay_ms(100);
LCDClear();
LCDWriteStringXY(0,0,"Welcome to ");
_delay_ms(100);
LCDWriteStringXY(0,1,"PANTRY SYSTEM ");
_delay_ms(100);
LCDClear();
PORTD&=~(1<<PD0);
PORTD&=~(1<<PD1);
PORTD&=~(1<<PD2);
PORTD&=~(1<<PD3);
LCDClear();
while(1)
{
keypad();
}
}
#include <avr/io.h>
#define F_CPU 8000000ul
#include <avr/interrupt.h>
#include <util/delay.h>
void Init_USART()
{
UBRRL=0x33;
UCSRB=(1<<TXEN)|(1<<RXEN)|(1<<RXCIE);
UCSRC=(1<<URSEL)|(0<<UMSEL)|(0<<UPM1)|(0<<UPM0)|
(0<<USBS)|(3<<UCSZ0);
}
62
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
_delay_ms(50);
return(0);
}
int main(void)
{
DDRC=0xff;
DDRB=0x00;
Init_USART();
_delay_ms(100);
tx_string("Please Find the ordered list: \r");
while(1)
{
if((PINB&0x01)==0x01)
{
tx_string("seat no 1: c.drink\r");
buzzer_on;
_delay_ms(5000);
buzzer_of;
}
if((PINB&0x02)==0x02)
{
tx_string("seat no 1: samosa\r");
buzzer_on;
_delay_ms(5000);
buzzer_of;
}
if((PINB&0x04)==0x04)
{
tx_string("seat no 1: pop carn\r");
63
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
buzzer_on;
_delay_ms(5000);
buzzer_of;
}
if((PINB&0x08)==0x08)
{
tx_string("seat no 1: cake\r");
buzzer_on;
_delay_ms(5000);
buzzer_of;
}
}}
CONCLUSION:
FUTURE SCOPE:
64
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
We can insert order cancel option on the screen to cancel the order.
ADVANTAGES:
65
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
Easy to handle
Easy to manage
Secure transactions all the way
Customer Satisfaction-key factor
APPLICATIONS:
In cinema theatres
In restaurants
In college canteens
In company canteens
In aeroplanes
REFERENCES
4. www.ijert.org
5. www.edaboard.com
66
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
6. www.electrotech.com
7. www.developershome.com
8. www.scribd.com
9. www.wikipedia.com
67
DEPT OF ECE
PANTRY SYSTEM IN THEATERS
68
DEPT OF ECE