Home > Industry Application >Other Industry Circuits > Design of water management system based on Internet of Things

Design of water management system based on Internet of Things

Source: InternetPublisher:奥特man123 Keywords: Sensors Internet of Things Remote Control Updated: 2024/08/02

An IoT-based water management system designed to use remotely controlled water sensors for intelligent database and management.

Project Background:

The origin of this project is the use of smart smart water management.

By using automated water usage values ​​we can measure individual water usage. The amount displayed is measured on the website. If more water usage notifications are posted on the website, overuse is indicated.

Users can connect to the server through the website, or shut down the server.

If so, the traffic in the report is displayed for detection and the user is notified via the report.

This can be said that the amount of water in the house today can be measured because the students inside are not sure about the amount of water they use. Informed about their usage and wastage.

A leak is estimated to increase water consumption by 400 drops per year, equivalent to one liter of water.

0-45 minutes. For it, it is 30% of the amount of smart water connected per person.

It is a system that is customized for major cities or houses (with a large number of users) and customized for users, but it is created to facilitate user customization.

step

1: Connect the rudder to the terminal for data transmission 3, connect the sensor data to the terminal 4.

Step 2: After editing the SSID and password for the connection, it will be uploaded to the launchpad.

Step 3: Go to your web browser and browse the IP address for the first time.

Step 4: Pour water through the sensor and close the page to see if the flow value is changing. Click and open the button to move the server.

Further comments on the hardware used

CC3220

Application Subsystem An industry standard ARM Cortex core running at 80 MHz. MCU running service manager for Wi-Fi network credential processor package, Wi-Fi credentials and credential inclusion.

With the help of Wi-Fi and powerful security protocols, the speed of the magic ladder can be increased without any Wi-Fi hardware. CC3220MOD integrates all necessary system-level components (including clocks, SPI devices, and Internet devices) into the RF switch and passive device LGA packaging guidelines to achieve PCB design in components and programs. CC320MOD is provided as a complete platform solution, including software, sample applications, tools, user and programming, reference

The CC3200000 counter (CC320000) is called immediately on the output of (CC32000). This function then counts the total number of (detections).

Sensor

The actual measurement needs of these water are too important, so measuring water is very important in the process. There are many different types of water pipe measurement systems for water management technologies, but all involve water flow management, but all contain this article has presented a plot introduction of water sensing sensors and helped to create the heroes of water curtains in the development.

Hall static water sensor

From an economic point of view, the performance of the sensors is proven by the very systems used for measuring 2 and 0. Each sensor is easily connected to the water line and contains a wind sensor for the measured volume. There is an integrated antenna antenna, which turns the sensor and outputs a car current. The sensor "pulse" inputs the wires: red / VCC (5-24V DC) / GND (0V) and OUT (output), black / black / GND (black). By calculation / calculation

Based on the output of the sensor, we can easily calculate the water flow rate (liters per hour - L/) using the appropriate hour conversion formula.

The velocity of water can be predicted using a variety of different techniques. In this basic case, the water flow relationship is Q = V x A, where Q is the total, average flow rate of the water in the pipe and A is the flow rate of the pipe (viscosity, density and damping forces of the liquid in contact with the pipe affect the water).

• Frequency pulse (Hz) = 4.5Q, Q flow rate is in liters/minute

• (min liters/hour) Frequency Frequency x 6.5Q

people:

• Sensor frequency (Hz) = 4.5* Q (l/min)

• Time l = Q minutes * (seconds) / 60 (seconds)

• Frequency (pulse/second) 4.5) * time (time/second) / 60

• Liter = Pulse / (4.5 * 60)

Connect the water flow sensor to the CC (red) and 0 connections of the sensor. P03. Please note that the water flow sensor is not a power hungry type; it consumes a maximum of 15-20mA at 5V DC input!

Motor Servo

Futaba S3003 - Servo Standard

Specification

Production: Simulation

Dimensions: 4.8V: 44.00 oz-in (3.17 kg-cm); 6.0V: 57.00 oz-in (4.10 kg-cm)

Speed: 4.8V: 0.23 sec/60°; 6.0V: 0.19 sec/60°

Dimensions: Length: 1.57 in (39.9 mm)

Width: 0.79 in (20.1 mm)

Height: 1.42 in (36.1 mm)

Gear Type: Plastic

Rotation/Support: Bushing

Rotation range: 60°

Cycle time: 30 ms

Pulse pulse: 500-3000 µs

Connector type: J

Because the motor uses reflection to determine the position of light, you can reasonably use a servo motor whose position is very determined by the light, a rotating line of sight, or a mobile robot's sensors, legs, control position, etc. Servos are small, and because they have circuits that control their movement, they can be connected directly to the CC3220.

Motor servo with the following connections:

• Black/brown ground wire.

• Red power wire (approximately 5V).

• Yellow or white PWM wire.

Connect the power and ground to ground 20 to the CC32 5VPWM input will be connected to ground. One of the CC outputs.

Project List:

Code:

#ifndef _CC3200R1M1RGC_
// Exclude SPI for CC3200 LaunchPad
#include
#endif
#include

// Your network name also known as SSID
char ssid[] = "Nikhil";
// Your network password
char password[] = "m3ch4l1f3";

// Your network key index number (only needed for WEP)
int keyIndex = 0;
int servo = 3;
angle;
int pwm;
int tf = 0;
int water = 0;
volatile int flow_frequency; // Measured flow sensor pulse
unsigned int l_hour; // Calculated liters/hour
unsigned int flowsensor = 4; // Sensor input
unsigned long currentTime;
unsigned long cycle time;
int flag = 0; // Variable to keep track of current tap state (ON/OFF)
int leak = 0; // Calculate leakage

WiFi Server server(80); // Connect to server on port 80
void flow() // Interrupt function
{
flow_frequency++;
}
void setup() {
Serial.begin(115200); // Initialize serial communication
pinMode(RED_LED, OUTPUT); // Set LED pin mode
pinMode(servo, OUTPUT); // Set servo pin to output

// Try connecting to Wifi network:
Serial.print("Trying to connect to network named: ");
// Print network name (SSID);
Serial.println(ssid);
// Connect to WPA/WPA2 network. If using an open or WEP network, change this line:
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
 // Print dots while we wait for connection
 Serial.print("..");
 delay(300);


 pinMode(flowSensor, INPUT_PULLUP);
//digitalWrite(flowSensor, HIGH); // optional internal pull-up
attachInterrupt(digitalPinToInterrupt(4), flow, RISING); // setup interrupt
// enable interrupts

}

Serial.println(" You are connected to the network ");
Serial.println(" Waiting for IP address ");

while (WiFi.localIP() == INADDR_NONE) {
 // print a dot while we wait for IP address
 Serial.print(".");
 delay(300);
}

Serial.println("Getting IP Address");

// You are now connected, so print the status
printWifiStatus();

Serial.println("Starting web server on port 80");
server.begin(); // Start web server on port 80
Serial.println("Webserver started!");
}

void loop(){

flow_frequency = 0;
interrupt();
delay(1000); //Wait 1 second
noInterrupts(); //Disable interrupts on the Arduino

//Begin math
l_hour = (flow_frequency * 2.25); //Multiply the number of pulses in the last second by 2.25mL
// l_hour = l_hour * 60; //Convert seconds to minutes to get mL/minute
//l_hour = l_hour / 1000; //Convert mL to liters to get liters/minute
total += l_hour; //Assuming the flow rate is equal to the average amount of water leaving the tap per second, we will add up the flow rates for each second and store them in this variable
water+=l_hour;
//Serial.println(flowRate); //Print variable flowRate to Serial
  Serial.print("The flow rate is: ");
  Serial.println(flow_frequency);

Serial.print("Flow rate: ");
  Serial.println(l_hour,DEC); // Print ml/hour
  Serial.print("Total: ");
  //Serial.println("L/hour
 
  ");
  if (flag==0 && l_hour>0){
leakage=1;
  }
  if(water>=2000){ //If the outflowing water exceeds the threshold, turn off the faucet
for(angle=60;angle>=0;angle-=5){
servoPulse(servo,angle);}
water=0;
flag=0;
  }
int i = 0;
WiFiClient client = server.available(); // Listen for incoming clients

if (client) { // If you have a client,
 Serial.println("new client"); // Print a message from the serial port
 char buffer[150] = {0}; // Create a buffer to hold incoming data
 while (client.connected()) { // Loop while a client is connected
  if (client.available()) { // If there are bytes to read from the client,
char c = client.read(); // Read a byte, then
Serial.write(c); // Print it to the serial monitor
if (c == ' ') { // If the byte is a newline character

// If the current line is empty, there are two newlines in a row.
// This is the end of the client's HTTP request, so send a response:
if (strlen(buffer) == 0) {
 // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
 // and content-type to let the client know what's coming next, followed by a blank line:
 client.println("HTTP/1.1 200 OK");
 client.println("Content-Type: text/html");
 client.println();

// The content of the HTTP response follows the header:
 /*client.println("

");
 client.println("

Welcome to CC3200 WiFi Web Server

");
 client.print("红色 LEDHIGH");
 client.println("LOW
");*/
 client.println(" ");

 client.println("");
 client.println("

Even though we are near the beach and surrounded by water, we are short on water in the summer, oh the irony. SW(a)mp offers some small solutions to these problems.

");
 client.println("

Control Click

Open

");
 client.println("

Leak detected: ");
 client.println(leak);
 client.println("

<



  client.println("

Please note: Overuse

");
 }
 client.println("

");

// The HTTP response ends with another blank line:
 client.println();
 // Break out of the while loop:
 break;
}
else { // If you got a newline, clear the buffer:
 memset(buffer, 0, 150);
 i = 0;
}
}
else if (c != ' ') { // If you got anything but a carriage return,
buffer[i++] = c; // Add it to the end of currentLine
}

// Check if client request is "GET /H" or "GET /L":
if (endsWith(buffer, "GET /H")) {
digitalWrite(RED_LED, HIGH); // GET /H turns LED on
for(angle=0;angle<=140;angle+=5){ // switch to
servoPulse(servo,angle);}
flag=1;

}
if (endsWith(buffer, "GET /L")) {
digitalWrite(RED_LED, LOW); // GET /L turns LED off
for(angle=140;angle>=0;angle-=5){ // switch to
servoPulse(servo,angle);
flag=0;


}
}
  }
 }
 // Close connection:
 client.Serial.println
 ("Client disconnected");
}
}

//
//A way to check if one array ends with another
//
boolean endsWith(char* inString, char* compString) {
int compLength = strlen(compString);
int strLength = strlen(inString); //Compare

the last "compLength" value of inString int i; for (i = 0; i < compLength; i++) { char a = inString[(strLength - 1) - i]; char b = compString[(compLength - 1) - i]; if (a != b) { return false; } } return true; }









void printWifiStatus() {
// Print the SSID of the network you are connected to:
Serial.print("SSID: ");
Serial.println(WiFi.SSID());

// Print your WiFi IP address:
IPAddress ip = WiFi.localIP();
Serial.print("IP address: ");
Serial.println(ip);

// Print received signal strength:
long rssi = WiFi.RSSI();
Serial.print("Signal Strength (RSSI):")
;
Serial.println("dBm");
// Print destination in browser:
Serial.print("To view this page, open your browser and visit http://");
Serial.println(ip);
}

void serverPulse(intservo, int angle){ //servo.h library is not running, so this function is used to control the servo using pwm
pwm=(angle*11)+500;
digitalWrite(servo,high);
delaymicroseconds(pwm);
digitalWrite(servo,low);
delay(50);
}

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号