WATER LEVEL INDICATOR USING ARDUINO

Intro: 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

    • Tiny Home Contest

      Tiny Home Contest
    • Metalworking Contest

      Metalworking Contest
    • Audio Contest 2018

      Audio Contest 2018

    23 Discussions

    0
    None
    KlausM5

    2 years ago

    additional comment. You can add a 1 kilo-ohm resistor in series with the 5V 'common' wire to protect the transistor against damage from accidently touching the wire ends directly.

    1 reply
    0
    None
    ijulh

    1 year ago

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

    can you explain function of this code???

    1 reply
    0
    None
    Devika 1125

    1 year ago

    can u explain the working process?

    0
    None
    ankesh4040

    1 year ago

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

    0
    None
    VipinG2

    1 year ago

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

    0
    None
    NishantT11

    1 year ago

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

    const byte sensors = 3;

    0
    None
    ArifSaeshibil

    Reply 1 year ago

    download what, copy the code. rightclick save mage

    0
    None
    JonasK3

    2 years ago

    What changes to the schematic needs to be made if i have a 3.3 V micro controller and a 55 gallon tank?

    1 reply
    0
    None
    ArifSaeJonasK3

    Reply 1 year ago

    only supply voltage and test resistor values if they work

    0
    None
    Sufyan1234

    2 years ago

    I implemented this circuit but all three pins are showing HIGH LEVEL .. not average , not low level.. plz help me.

    1 reply
    0
    None
    ArifSaeSufyan1234

    Reply 1 year ago

    always give full details when asking question, and images of your setup, there can be a million thing wrong.

    0
    None
    ArifSae

    1 year ago

    It will cause electrolysis and the + will disintegrate.

    (done it) i have this idea to periodically scan sensors for change in level. like after 10 20 sec

    0
    None
    HabiburO

    2 years ago

    I didn't get any output . I didn't use any Register . Is it mandatory to use Register ..

    0
    None
    KlausM5

    2 years ago

    Hi, I think the values for the resistors R1, R2 and R3 are specified too low. They should be at least 220Kohm. I used 470Kohm since the water 'resistance' is about 1-2Mohm. Also omit unspecified resistor in the 5V line that goes into water. Resistors R4, R5 and R6 will adjust the collector current, so choose higher than 470ohm if you want less than 10mA, like 1Kokm ->5mA. Logic levels with this circuit are 'high' for no water contact and 'low' for water contact. I used a 2SC945 standard bipolar NPN transistor and it works reliably. Good luck.

    0
    None
    nelson jeffrey

    2 years ago

    hi. what software do you used to compile the circuit?