In this mini do-it-yourself (DIY) electronic project, we’ll design a multi-use level indicator that can measure multiple physical parameters like temperature, water, voltage, humidity, distance, and more. It consists of a bar-graph LED display that presents the measurements.
Four main types of sensors are used to measure the different physical parameters, including the following
- LM35 – senses ambient room temperature
- HC SR04 (UDM) – measures the distance of an object
- Soil moisture sensor – senses the soil moisture level
- Potentiometer (POT) – senses input analog voltage level
- The bar-graph LED display – indicates the different physical parameter levels as follows:
– Temperature : 0 – 100° C
– Analog voltage : 0 – 5 V
– Distance of an object : 0 – 100 cm
– Soil moisture : 0 – 100%
Two additional LEDs indicate the maximum and minimum values of physical measurements. These LEDs blink when a sensor value reaches its maximum or minimum limit. A buzzer also beeps when the maximum or sensor values are achieved.
The bar-graph LED displays the level of any one physical parameter at a time and can be selected by using the push button. A user can choose any sensor by pressing the push button, and the sensor will display its current value on the bar-graph LED.
This device uses simple components, including the LEDs, a bar graph, a push button, a buzzer, sensors, and an Arduino NANO board. Check out the block diagram below to view the setup.
Components required
Aside from an Arduino NANO board, here’s what you’ll need to build this project:
LM35: a temperature sensor that measures the ambient room temperature and gives an analog voltage output. This semiconductor-type sensor is based on the thermocouple principle. It provides a calibrated output of 10 mV /o C, measuring the temperature from 0 – 100° C, with an output of 0 – 1 V.
POT (potentiometer): a variable resistor that provides the Arduino board with the analog voltage (of 0 to 5 V) as input.
HC SR04 (ultrasonic distance measurement – UDM): measures the distance between any two objects and generates a pulse-width modulation (PWM) output. The width of the output pulse is proportional to the object’s distance.
Soil moisture sensor: measures the moisture level of the soil. The conductivity varies as per the soil moisture level. This sensor provides a 0 to 5V output as the resistance (conductivity) changes. When the soil is completely dry, the sensor’s resistance is at max, and the output is 5V. When the soil is completely wet, the sensor’s resistance is extremely low, and the output is 0 V.
LED indications: indicate the maximum or minimum level of any sensor value, such as the temperature, soil moisture, etc. The LEDs also indicate which sensor level is currently displayed on the bar graph.
Push button: used to select any one sensor at a time. There are four in total. The level measured is then displayed on the LED bar graph.
Buzzer: generates a beeping sound when any sensor level reaches its minimum/maximum value.
LED bar graph: an eight-LED bar graph used to indicate the level (from 10 – 90) of the selected sensor (or parameter) like temperature, distance, soil moisture, etc.
Arduino board: the main building block and CPU of the system. Arduino performs the following tasks:
- Reads or senses temperature, soil moisture, distance, etc., from the sensors
- Gives different indications on LEDs, like the maximum and minimum sensor levels reached
- Generates a beeping sound from the buzzer
- Displays the different sensor levels on the LED bar graph
- Reads the user input from the push button to select the correct sensor
Circuit diagram
Circuit description:
The circuit is built using an Arduino NANO board, an eight LED bar-graph display, the LM35 temperature sensor, an HC SR-04 ultrasonic distance measurement (UDM) sensor, a soil moisture sensor, a few LEDs, one buzzer, and one push button.
The LED bar graph:
- There are eight LEDs in it. All the cathode terminals are shorted together and connected to the ground.
- Eight anode terminals are connected with Arduino NANO’s digital pins D2 – D9.
The LED indicators:
- There are six LEDs. Their cathodes are connected to the ground.
- Max_LED (RED) is used to indicate the maximum value of the sensor, and it’s connected to digital pin D10.
- MIN_LED (BLUE) is used to indicate the minimum value of the sensor, and it’s connected to digital pin D11.
- Temp_LED (YELLOW) indicates the temperature level displayed on the bar graph. It’s connected to pin A0 (digital pin 14).
- Dist_LED (YELLOW) indicates distance is indicated on the bar graph. It’s connected to pin A1 (digital pin 15).
- SEN_LED (YELLOW) indicates the potentiometer level shown on the bar graph. It’s connected to pin A2 (digital pin 16).
- Soil_most_LED (YELLOW) indicates the soil moisture level as indicated on the bar graph. It’s connected to pin A3 (digital pin 17).
Buzzer: generates a beeping sound when the sensor’s level has reached the minimum or maximum. It’s connected to digital pin D12.
Push button: used to select different sensors, and is connected to digital pin D13.
LM35 temperature sensor: has three pins: (1) Vcc (2) GND (3) Op. The Vcc pin is connected to 5 V, and the GND pin is connected to the ground. The Op pin is connected to the analog input pin A7.
Soil moisture sensor: has three pins: (1) Vcc (2) GND (3) Op. The Vcc pin is connected to 5 V, and the GND pin is connected to the ground. The Op pin is connected to the analog input pin A5.
Potentiometer: has three terminals. Two end terminals are connected to 5 V and the ground. The center terminal is connected to the analog input pin A6.
HC SR04 UDM: has four pins: (1) Vcc (2) GND (3) Trig (4) Echo. The Vcc pin is connected to 5 V, and the GND pin is connected to the ground. The Trig and Echo pins are connected with the digital pins D1 and D0, respectively.
Circuit operation:
There are four sensors used in this circuit. Their levels are indicated on the bar graph based on the user’s selection, which is conducted by pressing a push button. The sensors can be selected cyclically, as per Table I.
Potentiometer (POT): provides the analog voltage (0 to 5 V) as an input to pin A6. This analog voltage is then converted into a digital value of 0 to 1023 by Arduino. This range is further converted into 0 to 100 and displayed on the bar graph as per Table 2.
LM35 temperature sensor: measures the temperature between 0 – 100° C and provides the analog output of 0 to 1V. It has a 10 mV/° C resolution. The analog voltage of 0 – 1V is given to input pin A7. Arduino converts this analog voltage input into a digital value in the range of 0 – 100, which is displayed on the LED bar graph (as per Table 2).
Soil moisture sensor: measures the moisture level in the soil and provides the analog voltage 0 – 5 V as output. The output is 5 V when the soil is fully dry, and 0 V when the soil is completely wet. This analog voltage output is given to input pin A5, which is converted into a digital value of 0 to 1023 by Arduino. This range is further converted into 0 to 100 and displayed on the LED bar graph (as per Table 2).
HC SR-04 UDM: measures the distance of any object in front of it, generating a PWM output on the Echo pin. Arduino measures the width of this output pulse from the Echo pin and calculates the object’s distance in centimeters. The distance of the object (between 0 – 100 cm) is displayed on the LED bar graph.
When any sensor value reaches above 90, the MAX_LED starts blinking and the buzzer beeps. Similarly, when any sensor value is less than 10, the MIN_LED starts blinking and the buzzer beeps.
The user can select the:
- Temperature level
- Soil moisture level
- Object distance
- Potentiometer level
By pressing the push button, that sensor’s level is displayed on the LED bar graph. It’s also possible to connect with any other analog or digital sensor (like DHT, DS18B20) and its level will be displayed. That is why this device is truly a multipurpose level indicator.
You may also like:
Filed Under: Arduino Projects, Electronic Projects
Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.