Arduino UNO Water Level Monitoring System with GSM Notification
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to monitor water levels using a water level sensor and an Arduino UNO. When the water level exceeds a certain threshold, an LED will light up. Additionally, the circuit includes a GSM SIM900 module for potential communication capabilities.
Component List
Water Level Sensor
- Description: Measures the water level and outputs an analog signal.
- Pins: SIG, VCC, GND
Arduino UNO
- Description: Microcontroller board used to read sensor data and control the LED.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
Resistor
- Description: Limits the current flowing through the LED.
- Pins: pin1, pin2
- Properties:
- Resistance: 220 Ohms
LED: Two Pin (red)
- Description: Lights up when the water level exceeds the threshold.
- Pins: cathode, anode
GSM SIM900
- Description: Module for GSM communication.
- Pins: A5, A4, A3, A2, A1, A0, 5V, GND, 3.3V, RESET, D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, AREF
Wiring Details
Water Level Sensor
- SIG connected to A0 on Arduino UNO
- VCC connected to 5V on Arduino UNO
- GND connected to GND on Arduino UNO
Arduino UNO
- A0 connected to SIG on Water Level Sensor
- 5V connected to VCC on Water Level Sensor
- GND connected to GND on Water Level Sensor
- D13 connected to anode on LED
- D9 connected to D9 on GSM SIM900
- D8 connected to D8 on GSM SIM900
- D7 connected to D7 on GSM SIM900
Resistor
- pin1 connected to GND on Water Level Sensor
- pin2 connected to cathode on LED
LED: Two Pin (red)
- anode connected to D13 on Arduino UNO
- cathode connected to pin2 on Resistor
GSM SIM900
- D9 connected to D9 on Arduino UNO
- D8 connected to D8 on Arduino UNO
- D7 connected to D7 on Arduino UNO
Documented Code
// Define the pins
int waterSensorPin = A0; // Water level sensor connected to analog pin A0
int ledPin = 13; // LED connected to digital pin 13
void setup() {
// Initialize serial communication at 9600 bits per second
Serial.begin(9600);
// Initialize the LED pin as an output
pinMode(ledPin, OUTPUT);
}
void loop() {
// Read the input on analog pin 0
int sensorValue = analogRead(waterSensorPin);
// Print out the value you read
Serial.print("Water Level: ");
Serial.println(sensorValue);
// Check if the water level is above a threshold
if (sensorValue > 300) { // Adjust the threshold as necessary
digitalWrite(ledPin, HIGH); // Turn the LED on
} else {
digitalWrite(ledPin, LOW); // Turn the LED off
}
// Wait for a second before taking the next reading
delay(1000);
}
This code initializes the Arduino UNO to read the water level sensor's analog input and control the LED based on the sensor's readings. The LED will turn on if the water level exceeds a specified threshold.