Documente Academic
Documente Profesional
Documente Cultură
7 DB0
8 DB1
9 DB2
10 DB3
11 DB4
8-bit data pins
12 DB5
13 DB6
14 DB7
15 Backlight VCC (5V) LED+
16 Backlight Ground (0V) LED-
SIMULATION
Using PROTEUS software, now it is possible to draw a
complete circuit for a arduino based system and then tests
it.
With PCB layout the software now also offering automatic
of both component placement and track routing, getting
the design into the computer can often be the most time
consuming element of the exercise.
So when we simulate our program which had written in
arduino C language, and as we wrote before that will show
the water level on the LCD and will turn - on and off- the
pump unit according to this value
USING PROTEUS SOFTWARE
ARDUINO NANO CHIP
MOTOR
CODING
#include<LiquidCrystal.h> // include
the library code for lcd
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); //
#define echopin 9 // echo pin
#define trigpin 8 // Trigger pin
int maximumRange = 50;
long duration, distance;
void setup()
{
lcd.begin(16,2);
Serial.begin (9600);
pinMode (trigpin, OUTPUT);
pinMode (echopin, INPUT );
pinMode (7, OUTPUT);// buzzer
pinMode (10,OUTPUT);// pump
}
void loop ()
{
{
digitalWrite(trigpin,LOW);
delayMicroseconds(2);
digitalWrite(trigpin,HIGH);
delayMicroseconds(10);
duration=pulseIn (echopin,HIGH);
distance = ((duration/2) / 29.1);
delay (50);
Serial.println(distance);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("level in cm :");
lcd.print(distance);
delay(100);
}
if (distance >= 15 )
{
digitalWrite (10,HIGH);// Pump
lcd.setCursor(0,1);
lcd.print( "Tank Empty");
delay(100);
}
if (distance <13 && distance > 11 )
{
lcd.setCursor(0,1);
lcd.print( "1/4 th ");
delay(100);
}
if (distance <10 && distance >9) {
lcd.setCursor(0,1);
lcd.print("1/2 th");
delay(100);
}
if (distance <7 && distance > 5 )
{
lcd.setCursor(0,1);
lcd.print( "3/4 th ");
delay(100);
}
if (distance <= 3 )
{
lcd.setCursor(0,1);
lcd.print( "TANK FULL");
delay(100);
digitalWrite(10,LOW); // pump
digitalWrite (7,HIGH); // buzzer
delay(5000);
digitalWrite (7,LOW);
}
OUTPUT
CONCLUSION