一区二区三区三上|欧美在线视频五区|国产午夜无码在线观看视频|亚洲国产裸体网站|无码成年人影视|亚洲AV亚洲AV|成人开心激情五月|欧美性爱内射视频|超碰人人干人人上|一区二区无码三区亚洲人区久久精品

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評(píng)論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線(xiàn)課程
  • 觀(guān)看技術(shù)視頻
  • 寫(xiě)文章/發(fā)帖/加入社區(qū)
會(huì)員中心
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識(shí)你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

供水警報(bào)系統(tǒng)設(shè)計(jì)方案

科技觀(guān)察員 ? 來(lái)源:homemade-circuits ? 作者:homemade-circuits ? 2023-07-27 10:40 ? 次閱讀

在這篇文章中,我們將構(gòu)建一個(gè)電路,如果開(kāi)始向您的區(qū)域/家庭供水,它將通過(guò)短信通知用戶(hù)。它可以顯示水開(kāi)始供應(yīng)和結(jié)束的時(shí)間,平均水流速(以升/分鐘為單位)和輸送到水箱的總水量(以升為單位)。

介紹

我們都知道,沒(méi)有水,地球上的生活是不可能的,因?yàn)槿祟?lèi)使用的水比地球上任何其他物種消耗的水都多,這不僅是為了我們的生存,也是為了滿(mǎn)足我們的奢侈需求。

我們不僅消耗水,還污染水體。未來(lái)幾十年,水的消耗和需求將猛增。

作為世界公民,節(jié)約用水是我們的責(zé)任,但作為個(gè)人,我們可能無(wú)法通過(guò)節(jié)約用水來(lái)滿(mǎn)足整個(gè)世界的口渴,但我們絕對(duì)可以滿(mǎn)足家人的口渴,因?yàn)槲覀兛赡茉诙虝r(shí)間內(nèi)擁有健康的水量,即使我們周?chē)鷽](méi)有人為將來(lái)保存水。

印度和其他快速發(fā)展的國(guó)家的供水有限,需求量也很大,而且供水可以在沒(méi)有當(dāng)?shù)卣魏喂俜酵ㄖ那闆r下開(kāi)始。這個(gè)項(xiàng)目將為我們解決這個(gè)問(wèn)題。

現(xiàn)在讓我們深入了解該項(xiàng)目的技術(shù)細(xì)節(jié)。

電路:

該電路由水流量傳感器YF-S201,作為項(xiàng)目大腦的Arduino板,用于接收供水短信警報(bào)的GSM模塊(SIM 800或SIM
900)和用于跟蹤供水啟動(dòng)和終止供水的正確時(shí)間的實(shí)時(shí)時(shí)鐘模塊組成。

9 伏電源是為 Arduino 板和 GSM 模塊供電的理想選擇,建議從 9V 適配器或自制的、基于變壓器的精心構(gòu)建的 (LM 7809)
電源供電。

基于短信的供水警報(bào)電路

Arduino和GSM模塊之間的連接如下:

Arduino TX 到 RX GSM 模塊

Arduino RX 到 TX GSM 模塊

Arduino GND to GND GSM 模塊

切勿嘗試從 Arduino 的 5V 輸出引腳為 GSM 模塊的 5V 輸入為 GSM 模塊供電。

RTC或?qū)崟r(shí)時(shí)鐘模塊將跟蹤水的到達(dá)時(shí)間和供水的終止。

硬件到此結(jié)束。

要在 RTC 上設(shè)置時(shí)間,我們需要將時(shí)間設(shè)置程序上傳到 RTC 并完成硬件設(shè)置。這會(huì)將計(jì)算機(jī)上的時(shí)間同步到 RTC。

下載 RTC 庫(kù)文件:github.com/PaulStoffregen/DS1307RTC

在 RTC 上設(shè)置時(shí)間的程序:

//-----------------------------------------------------------//

#include 《Wire.h》

#include 《TimeLib.h》

#include 《DS1307RTC.h》

int P = A3; //Assign power pins for RTC

int N = A2;

const char *monthName[12] = {

“Jan”, “Feb”, “Mar”, “Apr”, “May”, “Jun”,

“Jul”, “Aug”, “Sep”, “Oct”, “Nov”, “Dec”

};

tmElements_t tm;

void setup() {

pinMode(P, OUTPUT);

pinMode(N, OUTPUT);

digitalWrite(P, HIGH);

digitalWrite(N, LOW);

bool parse = false;

bool config = false;

// get the date and time the compiler was run

if (getDate( DATE ) && getTime( TIME )) {

parse = true;

// and configure the RTC with this info

if (RTC.write(tm)) {

config = true;

}

}

Serial.begin(9600);

while (!Serial) ; // wait for Arduino Serial Monitor

delay(200);

if (parse && config) {

Serial.print(“DS1307 configured Time=”);

Serial.print( TIME );

Serial.print(“, Date=”);

Serial.println( DATE );

} else if (parse) {

Serial.println(“DS1307 Communication Error :-{”);

Serial.println(“Please check your circuitry”);

} else {

Serial.print(“Could not parse info from the compiler, Time=”“);

Serial.print( TIME );

Serial.print(”“, Date=”“);

Serial.print( DATE );

Serial.println(”“”);

}

}

void loop() {

}

bool getTime(const char *str)

{

int Hour, Min, Sec;

if (sscanf(str, “%d:%d:%d”, &Hour, &Min, &Sec) != 3) return
false;

tm.Hour = Hour;

tm.Minute = Min;

tm.Second = Sec;

return true;

}

bool getDate(const char *str)

{

char Month[12];

int Day, Year;

uint8_t monthIndex;

if (sscanf(str, “%s %d %d”, Month, &Day, &Year) != 3) return
false;

for (monthIndex = 0; monthIndex 《 12; monthIndex++) {

if (strcmp(Month, monthName[monthIndex]) == 0) break;

}

if (monthIndex 》= 12) return false;

tm.Day = Day;

tm.Month = monthIndex + 1;

tm.Year = CalendarYrToTm(Year);

return true;

}

//-----------------------------------------------------------//

·使用已完成的硬件上傳上述代碼。

·打開(kāi)串行監(jiān)視器,顯示時(shí)間已設(shè)置。

·現(xiàn)在,您已準(zhǔn)備好進(jìn)行下一步。

您已成功將時(shí)間設(shè)置為 RTC 模塊。

現(xiàn)在,讓我們上傳將通過(guò)短信通知我們的主程序。

主程序:

//-----Program Developed by R.Girish-----//

#include 《Wire.h》

#include 《TimeLib.h》

#include 《DS1307RTC.h》

int X;

int Y;

int sec = 50;

int t = 0;

int i = 0;

int check = 1;

int chk = 0;

int P = A3;

int N = A2;

int tim = 0;

float Time = 0;

float frequency = 0;

float waterFlow = 0;

float total = 0;

float LS = 0;

float average = 0;

const int input = A0;

const int test = 9;

void setup()

{

Serial.begin(9600);

pinMode(input, INPUT);

pinMode(test, OUTPUT);

analogWrite(test, 100);

pinMode(P, OUTPUT);

pinMode(N, OUTPUT);

digitalWrite(P, HIGH);

digitalWrite(N, LOW);

for (i = 0; i 《 sec; i++)

{

delay(1000);

}

Serial.println(“AT+CNMI=2,2,0,0,0”);

delay(1000);

Serial.println(“AT+CMGF=1”);

delay(500);

Serial.println(“AT+CMGS=”+91xxxxxxxxxx“r”); // Replace x with mobile
number

delay(1000);

Serial.println(“Your water supply notification system is ready.”);// The
SMS text you want to send

delay(100);

Serial.println((char)26); // ASCII code of CTRL+Z

delay(1000);

}

void loop()

{

tmElements_t tm;

if (RTC.read(tm))

{

if (tm.Hour 》 12) //24Hrs to 12 Hrs conversion//

{

if (tm.Hour == 13) tim = 1;

if (tm.Hour == 14) tim = 2;

if (tm.Hour == 15) tim = 3;

if (tm.Hour == 16) tim = 4;

if (tm.Hour == 17) tim = 5;

if (tm.Hour == 18) tim = 6;

if (tm.Hour == 19) tim = 7;

if (tm.Hour == 20) tim = 8;

if (tm.Hour == 21) tim = 9;

if (tm.Hour == 22) tim = 10;

if (tm.Hour == 23) tim = 11;

}

else

{

tim = tm.Hour;

}

X = pulseIn(input, HIGH);

Y = pulseIn(input, LOW);

Time = X + Y;

frequency = 1000000 / Time;

waterFlow = frequency / 7.5;

LS = waterFlow / 60;

if (frequency 》= 0)

{

if (isinf(frequency))

{

if (chk == 1)

{

Serial.println(“AT+CNMI=2,2,0,0,0”);

delay(1000);

Serial.println(“AT+CMGF=1”);

delay(500);

Serial.println(“AT+CMGS=”+91xxxxxxxxxx“r”); // Replace x with mobile
number

delay(1000);

Serial.print(“Time: ”);

delay(10);

Serial.print(tim);

delay(10);

Serial.print(“:”);

delay(10);

Serial.print(tm.Minute);

delay(10);

if (tm.Hour 》= 12)

{

Serial.println(“ PM”);

}

if (tm.Hour 《 12)

{

Serial.println(“ AM”);

}

delay(10);

Serial.println(“Water Supply is Ended.”);// The SMS text you want to
send

delay(100);

Serial.print(“Average Water Flow (Litre/Min): ”);

delay(100);

Serial.println(average);

delay(100);

Serial.print(“Total Water Delivered: ”);

delay(100);

Serial.print(total);

delay(100);

Serial.println(“ Litre”);

delay(100);

Serial.println((char)26); // ASCII code of CTRL+Z

delay(5000);

t = 0;

total = 0;

average = 0;

chk = 0;

check = 1;

}

}

else

{

if (check == 1)

{

Serial.println(“AT+CNMI=2,2,0,0,0”);

delay(1000);

Serial.println(“AT+CMGF=1”);

delay(500);

Serial.println(“AT+CMGS=”+91xxxxxxxxxx“r”); // Replace x with mobile
number

delay(1000);

Serial.print(“Time: ”);

delay(10);

Serial.print(tim);

delay(10);

Serial.print(“:”);

delay(10);

Serial.print(tm.Minute);

delay(10);

if (tm.Hour 》= 12)

{

Serial.println(“ PM”);

}

if (tm.Hour 《 12)

{

Serial.println(“ AM”);

}

delay(10);

Serial.println(“The water is being supplied now.”);// The SMS text you want
to send

delay(100);

Serial.println((char)26); // ASCII code of CTRL+Z

delay(1000);

check = 0;

chk = 1;

}

t = t + 1;

total = total + LS;

average = total / t;

average = average * 60;

}

}

delay(1000);

}

}

//-----Program Developed by R.Girish-----//

注意:您必須首先將RTC時(shí)間設(shè)置程序上傳到Arduino,然后上傳主程序(完成硬件設(shè)置),反之,項(xiàng)目將不起作用。

聲明:本文內(nèi)容及配圖由入駐作者撰寫(xiě)或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀(guān)點(diǎn)僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場(chǎng)。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問(wèn)題,請(qǐng)聯(lián)系本站處理。 舉報(bào)投訴
收藏 人收藏

    評(píng)論

    相關(guān)推薦

    警報(bào)系統(tǒng)開(kāi)源分享

    電子發(fā)燒友網(wǎng)站提供《警報(bào)系統(tǒng)開(kāi)源分享.zip》資料免費(fèi)下載
    發(fā)表于 11-11 10:01 ?0次下載
    <b class='flag-5'>警報(bào)系統(tǒng)</b>開(kāi)源分享

    家庭安全警報(bào)系統(tǒng)

    電子發(fā)燒友網(wǎng)站提供《家庭安全警報(bào)系統(tǒng).zip》資料免費(fèi)下載
    發(fā)表于 11-11 09:48 ?0次下載
    家庭安全<b class='flag-5'>警報(bào)系統(tǒng)</b>

    比特幣警報(bào)系統(tǒng)開(kāi)源分享

    電子發(fā)燒友網(wǎng)站提供《比特幣警報(bào)系統(tǒng)開(kāi)源分享.zip》資料免費(fèi)下載
    發(fā)表于 11-16 15:04 ?0次下載
    比特幣<b class='flag-5'>警報(bào)系統(tǒng)</b>開(kāi)源分享

    喚醒警報(bào)系統(tǒng)

    電子發(fā)燒友網(wǎng)站提供《喚醒警報(bào)系統(tǒng).zip》資料免費(fèi)下載
    發(fā)表于 11-24 09:57 ?0次下載
    喚醒<b class='flag-5'>警報(bào)系統(tǒng)</b>

    燒傷預(yù)防警報(bào)系統(tǒng)

    電子發(fā)燒友網(wǎng)站提供《燒傷預(yù)防警報(bào)系統(tǒng).zip》資料免費(fèi)下載
    發(fā)表于 12-05 10:56 ?0次下載
    燒傷預(yù)防<b class='flag-5'>警報(bào)系統(tǒng)</b>

    使用Arduino構(gòu)建警報(bào)系統(tǒng)

    電子發(fā)燒友網(wǎng)站提供《使用Arduino構(gòu)建警報(bào)系統(tǒng).zip》資料免費(fèi)下載
    發(fā)表于 12-05 15:06 ?0次下載
    使用Arduino構(gòu)建<b class='flag-5'>警報(bào)系統(tǒng)</b>

    煙囪粉塵警報(bào)系統(tǒng)開(kāi)源分享

    電子發(fā)燒友網(wǎng)站提供《煙囪粉塵警報(bào)系統(tǒng)開(kāi)源分享.zip》資料免費(fèi)下載
    發(fā)表于 12-07 15:13 ?0次下載
    煙囪粉塵<b class='flag-5'>警報(bào)系統(tǒng)</b>開(kāi)源分享

    交貨警報(bào)系統(tǒng)開(kāi)源分享

    電子發(fā)燒友網(wǎng)站提供《交貨警報(bào)系統(tǒng)開(kāi)源分享.zip》資料免費(fèi)下載
    發(fā)表于 12-13 09:35 ?0次下載
    交貨<b class='flag-5'>警報(bào)系統(tǒng)</b>開(kāi)源分享

    緊急警報(bào)系統(tǒng)開(kāi)源分享

    電子發(fā)燒友網(wǎng)站提供《緊急警報(bào)系統(tǒng)開(kāi)源分享.zip》資料免費(fèi)下載
    發(fā)表于 12-15 10:28 ?0次下載
    緊急<b class='flag-5'>警報(bào)系統(tǒng)</b>開(kāi)源分享

    自動(dòng)發(fā)燒檢測(cè)和警報(bào)系統(tǒng)

    電子發(fā)燒友網(wǎng)站提供《自動(dòng)發(fā)燒檢測(cè)和警報(bào)系統(tǒng).zip》資料免費(fèi)下載
    發(fā)表于 12-15 09:16 ?0次下載
    自動(dòng)發(fā)燒檢測(cè)和<b class='flag-5'>警報(bào)系統(tǒng)</b>

    不速之客警報(bào)系統(tǒng)

    電子發(fā)燒友網(wǎng)站提供《不速之客警報(bào)系統(tǒng).zip》資料免費(fèi)下載
    發(fā)表于 12-20 09:54 ?1次下載
    不速之客<b class='flag-5'>警報(bào)系統(tǒng)</b>

    使用Google Assistant的警報(bào)系統(tǒng)

    電子發(fā)燒友網(wǎng)站提供《使用Google Assistant的警報(bào)系統(tǒng).zip》資料免費(fèi)下載
    發(fā)表于 12-22 16:55 ?0次下載
    使用Google Assistant的<b class='flag-5'>警報(bào)系統(tǒng)</b>

    如何構(gòu)建靈敏的晨間警報(bào)系統(tǒng)

    電子發(fā)燒友網(wǎng)站提供《如何構(gòu)建靈敏的晨間警報(bào)系統(tǒng).zip》資料免費(fèi)下載
    發(fā)表于 06-12 16:03 ?0次下載
    如何構(gòu)建靈敏的晨間<b class='flag-5'>警報(bào)系統(tǒng)</b>

    比特幣價(jià)格警報(bào)系統(tǒng)開(kāi)源分享

    電子發(fā)燒友網(wǎng)站提供《比特幣價(jià)格警報(bào)系統(tǒng)開(kāi)源分享.zip》資料免費(fèi)下載
    發(fā)表于 06-28 11:56 ?0次下載
    比特幣價(jià)格<b class='flag-5'>警報(bào)系統(tǒng)</b>開(kāi)源分享

    多功能汽車(chē)警報(bào)系統(tǒng)

    電子發(fā)燒友網(wǎng)站提供《多功能汽車(chē)警報(bào)系統(tǒng).pdf》資料免費(fèi)下載
    發(fā)表于 11-06 14:16 ?1次下載
    多功能汽車(chē)<b class='flag-5'>警報(bào)系統(tǒng)</b>