Connect Liquid Sensor With Arduino Mega 2560

Introduction

  • In this article, I will explain about connecting the liquid Sensor With Arduino Mega 2560.
  • It can generally be used to get the measure of the liquid. 
Parts Of Lists
  • Arduino Mega 2560
  • Liquid Sensor.
  • Hook Wires.
Liquid Sensor
  • Liquid level sensors are used for all types of applications.
  • They are extensively used within automobiles.
  • Which rely on a substantial amount of different fluids in order to operate to check.
  • How much gas in the car, windshield washer fluid, oil levels.
     
     
    Figure 1: Liquid Sensor
Connection
 
Sensor Board
Vcc 5V
Gnd Gnd
 Vin A1
 
Programming
  1. const int sensorPin = 1; //sensor pin connected to analog pin A1    
  2. int liquid_level;  
  3. void setup()  
  4. {  
  5.     Serial.begin(9600); //sets the baud rate for data transfer in bits/second    
  6.     pinMode(sensorPin, INPUT); //the liquid level sensor will be an input to the arduino    
  7. }  
  8. void loop()  
  9. {  
  10.     liquid_level = analogRead(sensorPin); //arduino reads the value from the liquid level sensor    
  11.     Serial.println(liquid_level); //prints out liquid level sensor reading    
  12.     delay(1000); //delays 1000ms    
  13. }   
Explanation
  • In this Article I explained about the Liquid Sensor
  • It can be used to find the quality of the liquid which we have.
  • It can easily print the value in the Serial monitor. 
 Output
 
 
Figure 2: Output