Professional Documents
Culture Documents
Electronicsprojects
* This is a blog for elec… search
Classic
Flipcard
Magazine
Mosaic
Sidebar
Snapshot
Timeslide
Automatic Dam … 2
Automatic Dam Monitoring & Alert System :
SPEAKING MIC… 70
MINIPROJECT
INTRODUCTION
Programmable L… 16
Embedded
systems have already improved our lives in numerous
ways. Due to the
breathtaking developments in micro electronics,
processor speeds are increasing
tremendously and memory costs are
dropping rapidly. As a result, we are
witnessing revolutionary changes in
embedded systems.
Our
project is to design and develop an automatic dam monitoring
and alert system.
In the present system we have no any automated system
for monitoring the water
level of dams. The major drawback of the system
is the lack of security. Here
we present a system in which the level of
water in the dam is monitoring
continuously. The main advantage of the
system is higher security, i.e., when
the level of the water is increased
from a limited range (say 100cm), it alerts
the officials and nearby people
about the danger.
The major features of
the system are:-
:- Provides high
security.
:- Reduce labour cost.
:- Fully automated
system.
The
project is implemented by using Microchip’s PIC
microcontroller, an Ultrasonic
transmitter-receiver module and an LCD
display.
BLOCK DIAGRAM
[http://1.bp.blogspot.com/-
YC78bVUYuxk/UxqchVPcUOI/AAAAAAAAALM/NZ6HHUtugLQ/s1600/PROJECT.jpg]
CIRCUIT DIAGRAM
Electronicsprojects
* This is a blog for elec… search
Classic
Flipcard
Magazine
Mosaic
Sidebar
Snapshot
Timeslide
Automatic Dam … 2
SPEAKING MIC… 70
Programmable L… 16
[http://1.bp.blogspot.com/-
jXXZsW6IZT0/Uxqb8roO7hI/AAAAAAAAALE/QbVEZoFxoEQ/s1600/PROJECT.jpg]
PROPOSED
SYSTEM FEATURES
Step1:Start
Step2: Configure port B as output
Step3: Clear port B
Step4: Configure port D as output.
Step5: Clear port D
Step6: Configure port C as output
Step7: Clear port C
Step8: Initialize LCD.
Step9:Display “dam monitor” on lcd.
Step10:Call ping function
Step11:Port Rc2 high for 20µs.
Step12:Enable
interrupt.
Dynamic Views theme. Powered by Blogger.
electronicsminiprojects4u.blogspot.com/2014/03/automatic-dam-monitoring-alert-system.html 2/7
9/21/21, 10:43 AM Automatic Dam Monitoring & Alert System : MINIPROJECT | Electronicsprojects
interruptTimeslide
level.
Step17 : When high to low ,interrupt
Automatic Dam … 2 Occur, go to step 19
Step18: Wait until k=1.
SPEAKING MIC… 70 Step19:Timer stop.
Step20:Calculate he distance.
Programmable L… 16
Step21:Distance<100,then go to step 22,else
go to step 25.
Step22:Display on LCD.
Step23: Set RD1 high
Step24: Set RD2 high, go to step, then go to step
10.
Step25: Display on LCD.
Step26:Set RD1 low.
Step27: Set RD2 low, go to step, then go to step 10.
Step28: Stop
[http://4.bp.blogspot.com/-7ndWQYLqQN0/UxqaX2tSUBI/AAAAAAAAAKw/p31Kk3tLj
Zg/s1600/PROJECT.jpg]
Electronicsprojects
* This is a blog for elec… search
Classic
Flipcard
Magazine
Mosaic
Sidebar
Snapshot
Timeslide
Automatic Dam … 2
SPEAKING MIC… 70
Programmable L… 16
[http://1.bp.blogspot.com/-
bDgQPgxx6K0/UxqajHGiBMI/AAAAAAAAAK4/IfOWNyW32io/s1600/PROJECT.jpg]
PROGRAM
/////VARIABLE DECLARATIONS/////
char *text="DAM";
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D4 at RB6_bit;
sbit LCD_D7_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB6_bit;
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
unsigned short int k=0;
unsigned long double dist;
unsigned long int CM=0;
/////FUNCTION DECLARATIONS/////
void ping();
void IntToStr(int input, char *output);
/////MAIN
PROGRAM /////
void main()
{
BEGIN:
INTCON.GIE=0;
INTCON.INTE=0;
OPTION_REG.T0CS=1;
TRISC=0;
PORTC=0;
TRISD=0;
PORTD.RD2=0; //ALARM
PORTD.RD1=0; //LED
Dynamic Views theme. Powered by Blogger.
electronicsminiprojects4u.blogspot.com/2014/03/automatic-dam-monitoring-alert-system.html 4/7
9/21/21, 10:43 AM Automatic Dam Monitoring & Alert System : MINIPROJECT | Electronicsprojects
PORTD=0;
Electronicsprojects PORTB=0;
* This is a blog for elec… search
TRISB=0;
//PORTB O/P
TMR0=0;
Classic
Flipcard
Magazine
Mosaic
Sidebar
Snapshot
Timeslide
Lcd_Init();
Lcd_Cmd(_LCD_CLEAR);
Automatic Dam … 2
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Out(1,5,text);
SPEAKING MIC… 70 Delay_ms(1000);
Lcd_Out(2,2,"MONITORING");
Delay_ms(2000);
Programmable L… 16
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1,3,"DISTANCE (cm)");
OPTION_REG.PSA=0;
OPTION_REG.PS2=1;
OPTION_REG.PS1=1;
OPTION_REG.PS0=1;
OPTION_REG.INTEDG=1;
while(1)
{
Delay_ms(500);
ping();
dist=TMR0*4.41;
CM=dist;
if(CM<100)
{
Lcd_Cmd(_LCD_CLEAR);
IntToStr(CM,
text);
Lcd_Out(1,1,"WARNING!!!");
Lcd_Out(2,1,text);
PORTD.RD2=1; //ALARM ON
PORTD.RD1=1; //LED ON
}
else
{
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1,1,"DISTANCE (cm)");
IntToStr(CM, text);
Lcd_Out(2,1,text);
PORTD.RD2=0; //ALARM OFF
PORTD.RD1=0; //LED OFF
}
}
}
/////PING
FUNCTION/////
void ping()
{
PORTC.RC2=0;
Delay_us(20);
PORTC.RC2=1;
Delay_us(20);
PORTC.RC2=0;
INTCON.INTF=0;
Dynamic Views theme. Powered by Blogger.
electronicsminiprojects4u.blogspot.com/2014/03/automatic-dam-monitoring-alert-system.html 5/7
9/21/21, 10:43 AM Automatic Dam Monitoring & Alert System : MINIPROJECT | Electronicsprojects
INTCON.GIE=1;
Electronicsprojects
INTCON.INTE=1;
* This is a blog for elec… search
TRISB.RB0=1; /// RBO I/P PORT
OPTION_REG.INTEDG=1; //INTERRUPT ON LOW TO HIGH
Classic
Flipcard
Magazine
Mosaic
Sidebar
Snapshot
while(k==0) Timeslide
//waits here until
the first interrupt, LOW TO HIGH
ON PORTB occurs.
Automatic Dam … 2 {
if(TMR0>66)
SPEAKING MIC… 70
{
TMR0=0;
goto BEGIN;
Programmable L… 16
}
}
while(k==1) //waits here until
the second interrupt, HIGH TO LOW
ON PORTB occurs.
{
if(TMR0>66)
{
TMR0=0;
goto BEGIN;
}
}
}
//////INTERRUPT FUNCTION/////
void interrupt()
{
if
(INTCON.INTF)
{
INTCON.INTF=0;
if(k==0)
{
TMR0=0;
k=1;
OPTION_REG.T0CS=0;
OPTION_REG.INTEDG=0; //INTERRUPT EDGE ON HIGH TO
LOW
if(TMR0>66)
{
TMR0=0;
INTCON.GIE=0;
INTCON.INTE=0;
OPTION_REG.T0CS=1;
k=0;
goto BEGIN;
}
}
else
if(k==1)
{
INTCON.GIE=0;
INTCON.INTE=0;
OPTION_REG.T0CS=1;
k=0;
if(TMR0>66)
{
TMR0=0;
Dynamic Views theme. Powered by Blogger.
electronicsminiprojects4u.blogspot.com/2014/03/automatic-dam-monitoring-alert-system.html 6/7
9/21/21, 10:43 AM Automatic Dam Monitoring & Alert System : MINIPROJECT | Electronicsprojects
goto BEGIN;
Electronicsprojects }
}
* This is a blog for elec… search
}
Classic
Flipcard
Magazine
Mosaic
} Sidebar
Snapshot
Timeslide
Automatic Dam … 2
SPEAKING MIC… 70
Posted 8th March 2014 by Anonymous
16 2
View comments
Programmable L…
Comment as:
DK (Google) Sign out
Publish Preview
Notify me