Skip to content

Commit 8e410c9

Browse files
Initial Commit
0 parents  commit 8e410c9

File tree

6 files changed

+153
-0
lines changed

6 files changed

+153
-0
lines changed

.github/workflows/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
all:
2+
@echo "Build process initiated."
3+
4+
check:
5+
@echo "Run tests."
6+
7+
distcheck:
8+
@echo "Validate distribution."

.github/workflows/c-cpp.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: C/C++ CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Check out code
15+
uses: actions/checkout@v3
16+
- name: make
17+
run: make
18+
working-directory: .github/workflows
19+
- name: make check
20+
run: make check
21+
working-directory: .github/workflows
22+
- name: make distcheck
23+
run: make distcheck
24+
working-directory: .github/workflows

.github/workflows/configure

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
# No configuration needed for Arduino Uno code.
3+
exit 0

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Gerontius Rodrigues
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Water-Level-Indicator-Using-ArduinoUno
2+
3+
## Circuit Diagram:
4+
<div align="center">
5+
<img src="https://github.com/user-attachments/assets/85da967a-412f-4c1e-aaeb-318b213e4f7a" alt="Circuit" width="600" height="300">
6+
</div>
7+
8+
## Components Required:
9+
<table border="2" cellspacing="0" cellpadding="8" align="center">
10+
<thead>
11+
<tr>
12+
<th>Components</th>
13+
<th>Quantity</th>
14+
</tr>
15+
</thead>
16+
<tbody>
17+
<tr>
18+
<td><strong>Arduino Uno</strong></td>
19+
<td>1</td>
20+
</tr>
21+
<tr>
22+
<td><strong>Breadboard</strong></td>
23+
<td>1</td>
24+
</tr>
25+
<tr>
26+
<td><strong>LEDs</strong></td>
27+
<td>3</td>
28+
</tr>
29+
<tr>
30+
<td><strong>Buzzer</strong></td>
31+
<td>1</td>
32+
</tr>
33+
<tr>
34+
<td><strong>Jumper Wires</strong></td>
35+
<td>15+</td>
36+
</tr>
37+
<tr>
38+
<td><a href="https://robodo.in/products/water-level-sensor-depth-of-detection-water-sensor-for-arduino"><strong>Water Level Sensor</strong></a></td>
39+
<td>1</td>
40+
</tr>
41+
<tr>
42+
<td><strong>220&Omega; Resistors</strong></td>
43+
<td>3</td>
44+
</tr>
45+
</tbody>
46+
</table>
47+
48+
49+
## Working:
50+
This sensor works on the principle of variable resistance. The sensor consists of a series of parallel exposed conductors. Together this series acts as a variable resistor, whose resistance varies according to the water level in the water tank.
51+
52+
The more the water sensor is submerged in, the better is the conductivity and the lower the resistance. The less the water sensor is submerged, the poorer is the conductivity and the higher is the resistance.
53+
54+
The output of the water level sensor is according to the resistance of the water produced. i.e. it will produce a voltage proportional with resistance.
55+
When the water sensor is fully submerged, the sensor triggers the buzzer. The buzzer sounds an alert to prompt the user to take necessary action.

Waterindi.ino

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
int level;
2+
const int analog_0 = 0;
3+
int l1 = 13;
4+
int l2 = 12;
5+
int l3 = 11;
6+
int l4 = 10;
7+
8+
void setup() {
9+
Serial.begin(9600);
10+
pinMode(l1, OUTPUT);
11+
pinMode(l2, OUTPUT);
12+
pinMode(l3, OUTPUT);
13+
pinMode(l4, OUTPUT);
14+
pinMode(10, OUTPUT);
15+
}
16+
17+
void loop() {
18+
level = analogRead(analog_0);
19+
Serial.println(level);
20+
21+
if (level > 340 && level < 400) {
22+
digitalWrite(l1, HIGH);
23+
digitalWrite(l2, LOW);
24+
digitalWrite(l3, LOW);
25+
digitalWrite(l4, LOW);
26+
digitalWrite(10, LOW);
27+
}
28+
else if (level > 410 && level < 490) {
29+
digitalWrite(l1, LOW);
30+
digitalWrite(l2, LOW);
31+
digitalWrite(l3, HIGH);
32+
digitalWrite(l4, LOW);
33+
digitalWrite(10, LOW);
34+
}
35+
else if (level > 500 && level < 550) {
36+
digitalWrite(l1, LOW);
37+
digitalWrite(l2, LOW);
38+
digitalWrite(l3, LOW);
39+
digitalWrite(l4, HIGH);
40+
digitalWrite(10, HIGH);
41+
}
42+
}

0 commit comments

Comments
 (0)