WATER LEVEL INDICATOR USING ARDUINO

81,401

63

24

Posted

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

Share

Recommendations

  • Epilog Challenge 9

    Epilog Challenge 9
  • Sew Warm Contest 2018

    Sew Warm Contest 2018
  • Gluten Free Challenge

    Gluten Free Challenge
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

22 Comments

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

can you explain function of this code???

it's a loop

can u explain the working process?

Does with require water with salt or pure water will work?

is the water still safe for drinking?

Is it safe for drinking?

Can you please explain the purpose of R1/R2/R3. TIA.

what is the use of the below line here ? confusing...

const byte sensors = 3;

how can we download this????

download what, copy the code. rightclick save mage