Upload
others
View
8
Download
0
Embed Size (px)
Citation preview
Netaji Subhas Institute Of Technology
Microprocessors Lab EC-316
Automatic Controlled Cat Feeder Using
8085 uP
By: Jeeshan Ali (71/EC/13)
Laxman Verma (88/EC/13)
Aim
To design and construct an automatic controlled cat feeder using microprocessor 8085.
Synopsis
Pets, just like humans, need a regular supply of liquids throughout the day. However, giving
pet milk, especially cats, can be tedious, since if the supply of milk is unregulated, the pet may
overfeed itself.
This project aims at rectifying this issue by providing the pet a means to feed itself and at the
same time, keep the milk supply regulated.
Description:
This project is aimed at making a dispenser controller for pets that operates exclusively by
the pet’s actions and takes human involvement out of the equation. When the switch on the
Milk Dispenser Controller is pressed, the unit will interact with the milk dispenser and cause
the dispenser’s pump to start for a short duration, enabling the milk to seep down into a
container below.
This project uses an 8085 microcontroller to implement the controlling mechanism. The
Controller unit has, apart from the peripherals necessary for the 8085 microprocessor to
function, an external switch, acting as an input, and electromagnet, acting as an output.
When the switch is pressed by a user, the 8085, which is maintaining the timer, is
interrupted and the electromagnet is magnetized. After a specific duration has passed, the
electromagnet is demagnetized, while the timer continues to count down. The
microprocessor monitors this process so that it can be repeated (like 2 times within a 10min
time frame. After the switch is pressed 2 times, the microcontroller disables the interrupt.
And after 10min has passed by, the microcontroller repeats the whole process).
2. Using 8085 in Automatic Controlled Cat Feeder (ACCF)
Our project utilized the RST 7.5 interrupt facility and the SOD pin of the 8085.
A switch is connected at the interrupt pin that, when pressed by the pet, gives a high to the 8085 interrupt pin. The interrupt service routing of RST 7.5 makes the SOD pin high. This pin is connected to a relay that then connects an externally placed pump to its supply, prompting the pump to start and dispense milk.
The regulation function of the ACCF is carried internally by the microprocessor that maintains a timer for 5 min and allows for a maximum of 3 interrupts within this 5 min time frame, each interrupt opening the valve for 30sec.
The schematic, calculation and code are given below:
5. CALCULATIONS
The code we will be using for the delay will involve a register pair, and is as follows:
LXI B,0FFFFH
LOOP4: DCX B
MOV A,C
ORA B
JNZ LOOP4
The MPU runs on a 4MHz crystal and thus, the calculations are as follows:
Clock Frequency (F) = 2MHz
T states in loop (T)= 24
Value of Register Pair = (65535)10
Therefore: Time Delay (TL) = (T x 65535 / F)
=0.78642 sec
For a Time Delay of 30sec : Value of Register = 30/ TL
= (38)10
= (26)16
For a Time Delay of 5min: Value of Register = 300/TL
= (383)10
= (17F)16
the final code comes out as:
6.CODE
.ORG 0000H
JMP START
.ORG 003CH
JMP SERV
.ORG 0050H
SERV: NOP
MVI A,0CBH
SIM
CALL DELAY
MVI A,5BH
SIM
MVI A,4BH
SIM
DCR L
JZ DISINT
EI
DISINT: RET
DELAY: MVI H,026H
LOOP2: DCX B
MOV A,C
ORA B
JNZ L111OOP2
LXI B,0FFFFH
DCX D
DCR H
JNZ LOOP2
RET
.ORG 0100H
START: LXI SP, 83FFH
MVI A,0BH
SIM
MVI A,4BH
SIM
EI
MVI L,03H
LXI D,017FH
LOOP3: LXI B,0FFFFH
LOOP4: DCX B
MOV A,C
ORA B
JNZ LOOP4
DCX D
MOV A,E
ORA D
JNZ LOOP3
JMP START
Some observations on the code: 1. The register pairs BC and DE are used for the main 5min counter, while registers BC
and H are used for the 30sec counter. Reg L is used to maintain the number of interrupts
left for the 3 count mark.
2. The subroutine continues the same counter as that of the main progam, and at the
same time, decrements its 30sec counter.
3. The program also has provisions to continue the SOD high for a full 30sec, even if the
interrupt is given with a time of <30sec left on the 5min counter.
7.BIBILOGRAPHY
GAONKAR, R. S., & GAONKAR, R. S. (1996). Microprocessor architecture, programming, and applications with the 8085.
DATASHEETS
www.alldatasheet.com/datasheet-pdf/pdf/27996/TI/74LS139.html
http://www.datasheetarchive.com/8085%20opcode-datasheet.html
datasheet.octopart.com/REG1117-3.3-Texas-Instruments-datasheet-5435934.pdf