Introduction: WATER LEVEL INDICATOR USING ARDUINO

Water-level indicator is used to indicate the level of water in over head tank,by using this we can avoid the overflow of water ,and at any time we can know the level of water in tank, it has a simple circuit .

Step 1: HARDWARE SETUP

HARDWARE REQUIRED :

ARDUINO UNO:

BC548: BC548 is a general purpose NPN bipolar junction transistor,it is used for amplification and switching purposes,it has three terminals collector-base-emitter.

RESISTORS:Resistor is a current limiting passive two terminal electrical component-resistor act to reduce current flow to led.

RESISTOR VALUES

470OHMS220 OHMS22K

INTERFACING CIRCUIT:

the above circuit have three level low,average,high and when level of water increase transistor base get conducted and due to conduction switching process occurs and micro-controller get interrupted and it shows the level based on the respective transistor conduction.

Step 2: PROJECT CODE

byte sensorPin[] = {8, 9, 10};

byte ledPin[] = {11, 12, 13}; // number of leds = numbers of sensors

const byte sensors = 3;

int level = 0;

void setup()

{

Serial.begin(9600);

for(int i = 0; i < sensors; i++)

{

pinMode(sensorPin[i], INPUT);

pinMode(ledPin[i], OUTPUT);

}

}

void loop()

{

level = 0;

for(int i = 0; i < sensors; i++)

{

if(digitalRead(sensorPin[i]) == LOW)

{

digitalWrite(ledPin[i], HIGH);

level = sensors - i;

}

else

{

digitalWrite(ledPin[i], LOW);

}

}

Serial.println("Water level");

switch(level)

{

case 1:

Serial.println("HIGH");

break;

case 2:

Serial.println("AVERAGE");

break;

case 3:

Serial.println("LOW");

break;

default:

Serial.println("NO WATER");

break;

}

delay(50);

}

Step 3: OUTPUT