FLOAT SWITCH or FLOAT SENSOR WITH ARDUINO

A float sensor or float switch is used to detect the level of liquid within a tank. It is also called as magnetic float sensor or float switch as its working is same as of switch. Magnetic float sensor is an electromagnetic ON/OFF switch. It senses the level of water present in the tank by making switching connection.

WORKING OF FLOAT SWITCH

To make a circuit closed/complete circuit float sensor use magnetic reed switch. Then what is reed switch?

Reed switch

It is an electrical switch which can operate/work by applying magnetic field. It consists of ferromagnetic flexible metal reeds contact isolated in hermetically sealed glass envelop.

The metal contact is normally open. But as we applied magnetic field or place a magnet near one metal end of the switch it attracts the other end of metal, which makes path for current to pass through. When the magnet moves far away the switch, the contacts demagnetize and will separate (breaking the circuit).

Reed switch

Float sensor is working on the same concept as reed switch, but one more question might be arising. In reed switch we are using magnet but how can we get magnet in water tank? Right! We don’t need to worry about it because float sensor is being designed in that manner magnet is already presents there.

float sensor

When we outfit sensor in an empty tank the switch position is at bottom but as water starts filling up switch position rises up which generates magnetic field for the reed switch. So simply, when water level goes down sensor break the circuit and series led connected will turned off, while when level goes up sensor make the circuit and series led connected will turned on.

REQUIRED HARDWARE

S.No. Item Quantity
1 Arduino Uno 1
2 Breadboard 1
3 Magnetic Float Sensor 1
4 LED 1
5 Resistor 220 ohm 1
6 Male to Male jumper 4

CIRCUIT DIAGRAM – INTERFACING OF FLOAT SWITCH WITH ARDUINO

Make the following connections with Arduino

float sensor with arduino

FLOAT SENSOR ARDUINO CODE

int FloatSensor = 2;
int led = 13;
int buttonState = 1; //reads pushbutton status

void setup() {
  Serial.begin(9600);
  pinMode(FloatSensor, INPUT_PULLUP); //Arduino Internal Resistor 10K
  pinMode (led, OUTPUT);
}

void loop() {
  buttonState = digitalRead(FloatSensor);

  if (buttonState == HIGH) {
    digitalWrite(led, HIGH);
    Serial.println("WATER LEVEL - HIGH");
  }
  else {
    digitalWrite(led, LOW);
    Serial.println("WATER LEVEL - LOW");
  }
  delay(1000);
}

OUTPUT

After uploading the code successfully, you can see when water level goes up led attached will get turn on and when water level goes down led will get turn off.

5
Leave a Reply

avatar
5 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
5 Comment authors
1xbetTinder Auto LikerSEO Harrisburgbest dentist in dickson tnMohamed Abul-Soud Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Mohamed Abul-Soud
Guest
Mohamed Abul-Soud

Thanks for your kind help

best dentist in dickson tn
Guest

760909 613044Hi. Cool write-up. There is really a difficulty with the web internet site in firefox, and you may want to test this The browser could be the marketplace leader and a huge portion of folks will miss your outstanding writing due to this issue. 624308

SEO Harrisburg
Guest

569844 612337Thanks for every other magnificent post. 38149

Tinder Auto Liker
Guest

999166 907888Some times its a discomfort in the ass to read what weblog owners wrote but this web site is very user friendly ! . 662577

1xbet
Guest

155163 233370When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get several e-mails with the same comment. Is there any way you can remove me from that service? Bless you! 490988

Arduino Tutorials with Basic Electronics: CONTENT

Translate »