Tank Motor Controller


The microcontroller(AT89C2051) used here is the brain of the circuit controlles all the desired function.It receives the signal of water sensing at pin no. 8(P3.4) from the IC 4049.Power supply is provided through a 12V/500mA transformer regulated for 5V by using IC7805.

Tank motor controller using MCU

Whenever the switch(SW) is pressed,buzzor produces sounds for 2 seconds & the relay energizes makes the whole circuit to a closed loop system until the water in the tank is not filled fully.During water filling LED blinks continuously.At last when water reaches to the top full level,the buzzor produces frequently generated sound about 20 times & motor goes switch-off.Vary the preset 470kΩ for better sensitivity of water.Two NPN transistors(BC548) are stand;one to drive the relay & another for buzzor.


Tank motor controller


The program is written as follows :

 Project : Tank Motor Controller
 Writer : Sameer Gupta
 Date : June 2012
 MCU : AT89C2051, XL : 12MHz */
sbit motor at P1.B7;
sbit buzzor at P1.B5;
sbit LED at P1.B3;
sbit signal at P3.B4;
unsigned short i;

void main()
{
P3=255;
P1=255;
motor=1;
buzzor=1;
LED=0;
delay_ms(2200);
buzzor=0;
LED=1;

while(1){
if(signal==1)
{
for(i=0;i<3;i++)
{
LED=0;
delay_ms(100);
LED=1;
delay_ms(2000);
}
}
if(signal==0)
{
LED=0;
delay_ms(3500); //3.5 Seconds signal receiving delay
for(i=0;i<20;i++)
{
buzzor=1;
LED=0;
delay_ms(150);
buzzor=0;
LED=1;
delay_ms(80);
}
motor=0;
delay_ms(5000);
}
}
}        //End

Download the code.