In this session, the specifications of the float sensor along with its interfacing with the Arduino is discussed. The float sensor is used to detect the level of the water, depth of the water and the occurrence of the floods.
The float sensor is an electromagnetic switch. It operates as the closed switch, as it comes into contact when the water applies the force on it. The stem consists of a permanent magnet and the reed switch consist of wiring. When the circuit is closed in the reed switch due to the closing of the reed switch vertically, by the water flow the magnet is activated and in this way, the float sensor detects the water presence.
- Maximum switch current of the float is 0.5A and the switch voltage of 100V DC.
- Temperature rating of the float sensor is about 10-85 degrees centigrade.
- The power rating of this sensor is about 10W.
- The entire body of this sensor is made up of plastic.
CONNECTING THE SENSOR WITH ARDUINO
The float sensor consists of two terminals. The connections of the float sensor are to be connected to the Arduino Board in such a way that one terminal, which is a GROUND terminal should be connected to the GND pin of the Arduino Board. Another terminal, of the sensor, is connected to the VIN pin of the Arduino Board.
Float sensor consists of two terminals VCC and GND. These terminals act like a normal polarity of the electronic components.
For the working of the Float sensor to be understood easily, one can connect the LED light to the Arduino Board or can use the built-in LED on the Arduino UNO Board.
ARDUINO PROGRAM OF FLOAT SENSOR
int buttonState = 1; //reads pushbutton status
pinMode(FloatSensor, INPUT_PULLUP); //Arduino Internal Resistor 10K
pinMode (led, OUTPUT);
buttonState = digitalRead(FloatSensor);
if (buttonState == HIGH)
Serial.println( “WATER LEVEL – HIGH”);
Serial.println( “WATER LEVEL – LOW” );
After successfully execution of the program, dump the code into the Arduino Board by selecting the port accordingly from Arduino IDE.
WORKING OF THE FLOAT SENSOR
After the successful execution and dumping of the code to the Arduino Board, the working of the float sensor can be understood. When the float SENSOR is activated, means the flow of water is detected, then the values of float sensor is displayed on the serial monitor. Moreover when the switch is closed, simultaneously the LED light which is programmed, will be in the ON position. In this way the working and the functioning of the sensor can be studied.
EXPLANATION OF THE PROGRAM
In this program two components are used by connecting them to the Arduino. They are LED and Float sensor. Three variables are used to run the program. The following steps explain the program completely.
• Initially Float sensor is connected to Pin 2 and LED is connected to Pin 3.
• Now the serial communication is written along with input and output pins.
• Now the digital values are read from the float sensor and stored in the variable.
• When the variable “buttonState” is HIGH then the float sensor detects the water level as HIGH and it is printed in the serial monitor and simultaneously the LED glows.
• Similarly the opposite case is achieved when the water level is LOW.
• In this way the program is executed continuously with a delay of 1 second.
The entire connections and the working of the Float Sensor are discussed along with the complete interfacing and programming of the Arduino and this knowledge will help to develop various applications of float sensors and can built the various projects as a solution to the problem statements that can be done by using the float sensor.