Real-Time Smart Water Level Indicator using Micro:bit and HC-SR04

Micro:bit 21-05-26
21 0

Tutorial plan

1- Objective of the project

2- Required Components

3- Circuit Connections of system

4- MicroPython code for Micro:bit board

 

Objective of the project

The objective of this project is to design a real-time smart water level indicator using the Micro:bit board, the HC-SR04 ultrasonic sensor, and an LCD I2C display.

This system measures the water level inside a glass and displays the results instantly on the LCD screen using graphical bars, allowing easy and continuous monitoring of the water level.

Functioning

When water is poured into a glass, the HC-SR04 ultrasonic sensor measures the distance between the sensor and the water surface.

The Micro:bit board processes the measured distance and calculates the corresponding water level.

Then, the calculated water level is displayed on the LCD I2C screen in real time using graphic bars and percentage values.

As the water level increases, the number of displayed bars increases. Similarly, when the water level decreases, the number of displayed bars also decreases.

This smart system provides a simple and efficient solution for real-time water level monitoring.

 

Required Components

1. Micro:bit board

Micro:bit board

The Micro:bit board is the main controller of the project. It processes the data received from the ultrasonic sensor and controls the LCD display to show the water level in real time.

2. Micro:bit GPIO Extension Board

The GPIO expansion card for the Micro:bit card

The Micro:bit GPIO extension board simplifies the connection between the Micro:bit board and external electronic components. It provides easy access to GPIO pins, power supply pins, and communication interfaces, making circuit assembly more convenient and reliable.

3. HC-SR04 sensor

HC-SR04

The HC-SR04 ultrasonic sensor is used to measure the distance between the sensor and the water surface inside the glass. It sends ultrasonic waves and calculates the distance according to the returned echo signal.

4. LCD Display with I2C Module

The LCD I2C display is used to show the water level information in real time. It can display percentage values and graphical bars representing the water level.

5. Jumper Wires

Jumper wires

Jumper wires are used to establish electrical connections between the Micro:bit, the sensor, and the LCD display.

6. Breadboard

The breadboard is used to connect the electronic components without soldering. It simplifies circuit assembly and testing.

 

Circuit Connections of system

 

1- Connection of HC-SR04 sensor to Micro:bit

HC-SR04 sensor Micro:bit board
VCC 5V (power supply)
GND GND
Trig P1
Echo P2

 

2- Connection of LCD I2C display to Micro:bit

LCD I2C display Micro:bit board
VCC 5V (power supply)
GND GND
SDA P20
SCL P19

 

MicroPython code for Micro:bit board

This MicroPython program is designed to implement a smart water level monitoring system using a Micro:bit board, an HC-SR04, and an LCD I2C display.

How it works ?

- The HC-SR04 sensor measures the distance between the sensor and the water surface.

- The Micro:bit calculates the actual water level based on this distance.

- The water level is converted into a percentage (0% to 100%).

- The LCD I2C displays: the water level percentage and a graphical bar representation of the water level

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

Pictures of the articles

Robotic site created by Mohamed Ali Haj Salah - Teacher info