1

member

Easy Basics: Project 008i Water level sensor, RGB LED module, LCD 1602 I2C module, piezo buzzer, 5V relay

of Acoptex.com in UNO

Basics: Project 008i

Project name: Water level sensor, RGB LED module, LCD 1602 I2C module, piezo buzzer, 5V relay module - Water leak detection system

Tags: Arduino Uno, Water level sensor, RGB LED module, LCD 1602 I2C module, active piezo buzzer, 5V relay module, Water leak detection system, water sensor, water sensor module

Attachments: libraries and sketch

WARNING – THIS PROJECT INVOLVES HIGH VOLTAGES THAT CAN CAUSE SERIOUS INJURY OR DEATH. PLEASE TAKE ALL NECESSARY PRECAUTIONS, AND TURN OFF ALL POWER TO A CIRCUIT BEFORE WORKING ON IT. WE ARE NOT RESPONSIBLE FOR ANY DAMAGE, INJURY, DEATH AND OTHER THINGS CAUSED BY THIS PROJECT IMPLEMENTATION. 

In this project, you needed these parts (Dear visitors. You can support our project buy clicking on the links of parts and buying them or donate us to keep this website alive. Thank you):

1.Arduino Uno R3 (you can also use the other version of Arduino)

2.Water level sensor module 1 pc

3.Arduino IDE ( you can download it from here  )

4.Jumper cables F-M, M-M

5. RGB LED module 1 pc

6. Resistor 1 pc (150 Om for piezo buzzer/optional/)

7. Breadboard half size 1pc

8. LCD 1602 I2C Module 1pc

9. Active Piezo buzzer 1pc

10. 5V relay module 1pc

General

We will make a Water leak detection system.

Understanding the water level sensor module

More information you can find here.

Understanding LCD 1602 I2C module

More information you can find here.

Understanding the piezo buzzer

More information you can find here.

Understanding the 5V relay module 

More information you can find here.

Signals and connections of the piezo buzzer

We will use active piezo buzzer in this project. Piezo buzzer has one leg with (+) marking so that output we connect to on leg of resistor 150 Om and another leg og resistor we connect to Arduino Uno. Another piezo buzzer leg we connect to GND.

Signals and connections  of the 5V relay module

The SRD-05 VDC-SL-C relay has three high voltage terminals (NC, C, and NO) which connect to the device you want to control. The other side has three low voltage pins (Ground, Vcc, and Signal) which connect to the Arduino.

NC: Normally closed 120-240V terminal

NO: Normally open 120-240V terminal

C: Common terminal

Signals and connections  of the LCD 1602 I2C module

As you can see on the back of LCD 1602 module there 4 connections: GND (-), VCC (+5V), Serial Data Line (SDA) and Serial Clock Line (SCL)

Signals and connections of the water level sensor, RGB LED module

"S" stand for signal input (analog)

"+" stand for power supply (+5V)

"-" stand for GND

If you do not have marking on the back of water level sensor module - not a problem. You can print this marking

attach and cover it with silicon to the back of sensor. Just make sure that silicon is dry andbe careful do not use silicon on other side as it will damage the sensor.

RGB LED module has 4 outputs: R (Red diode), G (Green diode), B (Blue diode) and GND (-). R, G,B are connected to Arduino Uno board digital pins. GND connected to Arduino Uno board GND pin. You do not need resistors for LEDs as they are already soldered in PGB LED module. See pictures about RGB LED module connections here.

Wiring

WARNING – THIS PROJECT INVOLVES HIGH VOLTAGES THAT CAN CAUSE SERIOUS INJURY OR DEATH. PLEASE TAKE ALL NECESSARY PRECAUTIONS, AND TURN OFF ALL POWER TO A CIRCUIT BEFORE WORKING ON IT. WE ARE NOT RESPONSIBLE FOR ANY DAMAGE, INJURY, DEATH AND OTHER THINGS CAUSED BY THIS PROJECT IMPLEMENTATION. 

Let us build a water level sensor controlled relay circuit that will turn on a pump when the water level will be high. The relay has two different types of electrical contacts inside – normally open (NO) and normally closed (NC). The one you use will depend on whether you want the 5V signal to turn the switch on or turn the switch off. The 120-240V supply current enters the relay at the common (C) terminal in both configurations. To use the normally open contacts, use the NO terminal. To use the normally closed contacts, use the NC terminal.We will use NO (Normally open)configuration, when the relay receives a LOW signal the 120-240V switch closes and allows current to flow from the C terminal to the NO terminal. A HIGH signal deactivates the relay and stops the current. So if you want the HIGH signal to turn ON the relay, use the normally open terminal.

Make sure that the high voltage connections to the 5V relay module are very well secured. Identify the hot power wire (red wire in the diagram above) in the cord leading to the PUMP and make a cut. Connect the side leading to the PUMP to the NO terminal of the 5V relay, and the side leading to the plug to the C terminal. This way the relay is on the hot side, and current is switched before it reaches the PUMP. It’s dangerous to put the relay on the neutral wire, since if the device fails current can still fault to ground when the relay is off.

The following picture shows the needed connections with the Arduino Uno 

Step by Step instruction

  1. Do wiring.
  2. Open Arduino IDE.
  3. Plug your Adruino Uno board into your PC and select the correct board and com port
  4. Open up serial monitor and set your baud to 9600 baud
  5. Find your I2C address. Each device has an I2C address that it uses to  accept commands or send messages. Load the sketch over at http://playground.arduino.cc/Main/I2cScanner and follow the instructions to use it.  By opening up the Serial monitor window after you upload the sketch, Arduino will scan the address range looking for a reply.  Even though the documentation said it was 0x27, this scanner can detect different (in our case 0x3F)
  6. Modify the sketch: the line LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE) (See part marked bold)
  7. Do calibration. Take a paper and write down readings of the sensor and the water level in mm or inch  (for example, 0mm -0, 5mm - 223, 10mm - 251, 20mm - 294, 30mm - 314, 40mm - 333)
  8. Verify and upload the the sketch to your Adruino Uno.

Libraries:

  • See attachments on the begining of this project description - all libraries included.
  • We have used the library - NewliquidCrystal_1.3.4.zip which I downloaded, unzipped, changed the name of folder to LiquidCristal and added to libraries in my PC, for example C:\Users\toshiba\Documents\Arduino\libraries. This link you can find in Preferences of Adruino IDE program which installed in your PC. If you have LiquidCristal folder in this location already - delete this folder and copy folder, which was made by you, to this location. 

Sketch:

  • See attachments on the beginning of this project description

Code:

Measuring water level; sending  status about the water level to serial monitor, RGB LED module and LCD screen;  activating piezo buzzer and pump connected to 5V relay module when the level reach 35-40mm.

 If water level is between:

  10-15mm the green LED will be on till level 20-25mm

  20-25mm the green LED will be off and the blue LED will be on till level 35-40mm

  35-40mm the blue LED will be off and the red LED will be on

  35-40mm the piezo buzzer and pump connected to 5V relay module will be activated too

  and  switch off when sensor is out of water and dry.

The output can be a digital signal LOW or HIGH, depending on the water level. If the water level exceeds a certain predefined threshold value, the module outputs LOW, otherwise it outputs HIGH. 

The output can be a analog signal and so you’ll get a value between 0 and 1023.



Other projects of Acoptex.com
Easy Merry Xmas to everyone of Acoptex.com, Not selected 24-12-2019

Published at 20-11-2017
Viewed: 2050 times