|
06.03.2023., 22:05 | #1 |
Premium
Datum registracije: Nov 2005
Lokacija: Bjelovar
Postovi: 470
|
Protokomjer
Znam da je long shot, ali forum vrvi znalcima, pa da vidimo. Trebao bih mjerač protoka fluida, nazovimo ga pametnim, koji je sposoban slati podatke o protoku (volumenu u jedinici vremena) u nekom prihvatljivom nekodiranom obliku, a koji bih onda uzimao i obrađivao dalje. Sve što sam našao su gotova rješenja koja koriste property cloud i slično, a ja bih htio DIY. Pa ako je netko upoznat, vidio, čuo, radio, puno bi mi pomoglo. Zadnje izmijenjeno od: Inovator. 06.03.2023. u 23:59. |
07.03.2023., 00:20 | #2 |
Premium
Datum registracije: Sep 2006
Lokacija: zaDAR
Postovi: 810
|
Ja sam pribavio sve potrebno za vodomjer iz videa, kad uhvatim vremena moram to sklepati i vidjeti kako radi.
__________________
ORIGIN: CR0_VandaL | STEAM: vandalzd | TDU2: VaandaL | R* Social Club: vandal_zd | DayZ: VandaL | battle.net: VandaL #2220 |
|
|
Oglas
|
|
07.03.2023., 11:30 | #3 |
Member
Datum registracije: Jul 2005
Lokacija: Kutina
Postovi: 979
|
Pogledaj Yokogawa stranicu, možda budeš pametniji. |
07.03.2023., 12:07 | #4 |
Premium
Datum registracije: Feb 2007
Lokacija: Dalmacija
Postovi: 5,513
|
https://www.instructables.com/How-to...uino-Tutorial/ To? A na šta bi sla, di bi sprema, smart home, mqtt? jeli treba bit instant ili pamtiti, vjerojatno i ovo gore sto je vandal snimio, ja sam bas mislio preporucit ESP32, jeftin a ima wifi. |
10.03.2023., 01:11 | #5 | |
Premium
Datum registracije: Nov 2005
Lokacija: Bjelovar
Postovi: 470
|
Pregledavam, čini se obećavajuće. Citiraj:
Ne mora ništa pamtiti, već mi mora dati podatke koje ću spremati u bazu i raditi analitiku. |
|
10.03.2023., 20:36 | #6 |
Adrenaline junkie
Datum registracije: Apr 2006
Lokacija: Doboj - Banja Luka / Republika Srpska
Postovi: 3,582
|
__________________
Lenovo ThinkPad W530 - Core i7 3840QM, 32 GB RAM, SSD Samsung 512 GB, nVidia Quadro K1000M 2 GB, 15.6" 1920x1080 IPS, baterija 9 ćelija |
10.03.2023., 22:20 | #7 |
Premium
Datum registracije: Feb 2007
Lokacija: Dalmacija
Postovi: 5,513
|
Malo sam se zaigra sa chatGPTjem, tako da nezz jel ovo radi, koliko znam chatGPT nece radit ali malo tweekanja ce riješiti. Znaci esp32 i YF-S201 senzor protoka prva verzija je sa webhookom na neki server, druga verzija je spremanje u sql server bazu. HTML:
#include <WiFi.h> #include <WiFiClient.h> #include <WebServer.h> #include <ESPmDNS.h> #include <WiFiUdp.h> // Replace with your network credentials const char* ssid = "your_SSID"; const char* password = "your_PASSWORD"; // Create a web server object WebServer server(80); // YF-S201 Sensor volatile int flow_frequency; // Measures flow sensor pulses unsigned int l_hour; // Calculated liters/hour unsigned int total_litres; // Total liters consumed unsigned long old_time; // Webhook URL const char* webhookUrl = "http://your-webhook-url.com"; void handleRoot() { server.send(200, "text/html", "<html><body><h1>Water Flow Monitor</h1><p>Current flow: " + String(l_hour) + " L/hr</p><p>Last minute flow: " + String(l_hour*60) + " L/min</p><p>Last hour flow: " + String(l_hour*3600) + " L/hr</p><p>Last day flow: " + String(l_hour*3600*24) + " L/day</p></body></html>"); } void handleNotFound(){ server.send(404, "text/plain", "Not found"); } void setup() { Serial.begin(115200); // Connect to Wi-Fi network WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); // Wait for connection while (WiFi.status() != WL_CONNECTED) { delay(1000); Serial.println("Connecting to WiFi..."); } // Print ESP32 Local IP Address Serial.println(WiFi.localIP()); // Initialize YF-S201 Sensor pinMode(34, INPUT); attachInterrupt(34, flow, RISING); // Initialize total litres and old time total_litres = 0; old_time = millis(); // Start web server if (MDNS.begin("esp32")) { Serial.println("MDNS responder started"); } server.on("/", handleRoot); server.onNotFound(handleNotFound); server.begin(); Serial.println("HTTP server started"); } void loop() { server.handleClient(); // Calculate water flow unsigned long now = millis(); unsigned long delta_time = now - old_time; float flow_rate = (float)flow_frequency / (float)delta_time; old_time = now; flow_frequency = 0; l_hour = (int)(flow_rate * 3600 / 7.5); // Update total litres consumed total_litres += (flow_rate / 60 / 7.5); // Send updates to webhook URL if (WiFi.status() == WL_CONNECTED) { WiFiClient client; HTTPClient http; String payload = "{"; payload += "\"litres\":"; payload += String(total_litres); payload += "}"; Serial.println(payload); http.begin(client, webhookUrl); http.addHeader("Content-Type", "application/json"); int httpCode = http.POST(payload); http.end(); Serial.println("HTTP POST code: " + String(httpCode)); } else { // If no network connection, start hotspot WiFi.softAP("ESP32AP", "password"); Serial.println("AP started"); Serial.print("AP IP address: "); Serial.println(WiFi.softAPIP()); server.handleClient(); } } void flow() { flow_frequency++; } HTML:
#include <WiFi.h> #include <WebServer.h> #include <HTTPClient.h> #include <WiFiClientSecure.h> #include <esp_wifi.h> #include <esp_wps.h> #include <esp_event_loop.h> #include <freertos/FreeRTOS.h> #include <freertos/task.h> #include <freertos/event_groups.h> #include <WiFi.h> #include <esp_log.h> #include <esp_system.h> #include <nvs_flash.h> #include <driver/gpio.h> #include <esp_http_client.h> #include <Wire.h> #include <LiquidCrystal_I2C.h> #include <WiFiClient.h> #include <WiFiServer.h> #include <WiFiUdp.h> #include <PubSubClient.h> #include <OneWire.h> #include <DallasTemperature.h> #include <time.h> #include <Preferences.h> #include <string> // Replace with your network credentials const char* ssid = "your_SSID"; const char* password = "your_PASSWORD"; // Replace with your SQL Server credentials const char* server = "your_SQL_Server"; const char* user = "your_SQL_User"; const char* password_sql = "your_SQL_Password"; const char* database = "your_SQL_Database"; // Create a web server object WebServer server(80); // YF-S201 Sensor volatile int flow_frequency; // Measures flow sensor pulses unsigned int l_hour; // Calculated liters/hour unsigned int total_litres; // Total liters consumed unsigned long old_time; // SQL Server SQLClient client; String query; void handleRoot() { server.send(200, "text/html", "<html><body><h1>Water Flow Monitor</h1><p>Current flow: " + String(l_hour) + " L/hr</p><p>Last minute flow: " + String(l_hour*60) + " L/min</p><p>Last hour flow: " + String(l_hour*3600) + " L/hr</p><p>Last day flow: " + String(l_hour*3600*24) + " L/day</p></body></html>"); } void handleNotFound(){ server.send(404, "text/plain", "Not found"); } void setup() { Serial.begin(115200); // Connect to Wi-Fi network WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); // Wait for connection while (WiFi.status() != WL_CONNECTED) { delay(1000); Serial.println("Connecting to WiFi..."); } // Print ESP32 Local IP Address Serial.println(WiFi.localIP()); // Initialize YF-S201 Sensor pinMode(34, INPUT); attachInterrupt(34, flow, RISING); // Initialize total litres and old time total_litres = 0; old_time = millis(); // Initialize SQL Server connection client.begin(server, user, password_sql, database); Serial.println("SQL Server connection established"); // Start web server server.on("/", handleRoot); server.onNotFound(handleNotFound); server.begin(); Serial.println("HTTP server started"); } void loop() { server.handleClient(); // Calculate water flow unsigned long now = millis(); unsigned long delta_time = now - old_time; float flow_rate = (float)flow_frequency / (float)delta_time; old_time = now; flow_frequency =0; // Convert flow rate to liters per hour l_hour = (flow_rate / 7.5) * 1000 * 60 * 60; // Add to total litres total_litres += l_hour / 1000; // Reset flow frequency flow_frequency = 0; // Log water flow to SQL Server if (client.connected()) { query = "INSERT INTO dbo.Flow (LitersPerHour, TotalLiters) VALUES ('" + String(l_hour) + "', '" + String(total_litres) + "')"; client.execute(query.c_str()); } // Wait for 1 second delay(1000); } |
12.03.2023., 21:47 | #8 | |
Premium
Datum registracije: Oct 2008
Lokacija: osijek
Postovi: 1,880
|
Citiraj:
https://how2electronics.com/arduino-...w-rate-volume/ Ako vec imas nesto od pametnih stvari iskoristi to, znaci ako imas arduino googlaj "flow sensor for arduino" Antratek mi je bio dobar za neke stvari pa evo brzinski sam samo uletio u grubo di je voda, probaj malo pretraziti stranicu. Isto vrijedi i za www.tindie.com https://www.antratek.com/lora/sensor-nodes/water-leak
__________________
Ako Vam je život tužan, ne brinite! Barem Vam je plaća smiješna |
|
21.12.2023., 21:24 | #10 |
Premium
Datum registracije: Aug 2006
Lokacija: Valbandon-blizu Pule
Postovi: 972
|
Bok, da li je netko slozio neko rjesenje za ocitavanje sata od vode na daljinu ? imam neki sat u nekoj sumi na livadi koji moram minimalno 1x mjesecno ocitati... iako bi volio svakih 1h ili 1 dan dobiti stanje - za slucaj da dodje do puknuca i da se na vrijeme zasutavi gubitak vode... zagledao sam se na ovaj projekt : https://github.com/jomjol/AI-on-the-edge-device narucio sam esp32cam i 800L modul za sim ... pa cim stigne mozda se zaigram s tim... jednostavnije bi mi bilo nesto sto bi mogao staviti na sat od vodovoda a da ne blokiram njima ocitanje ... u slucaju ovog s esp32cam bi morao kupiti jos jedan sat i ubaciti ga nakon ovog od vodovoda... |
|
|
Oglas
|
|
Uređivanje | |
|
|