Water resources is one of the most important part of every one's live not only to human but for plants animal and every one on the planet Earth. But in few decades unrestricted human behavior this natural resource is in great danger. The fresh lakes water, rivers, ponds, ground water are getting contaminated day by day by human activity and release of waste in these resources like ponds , lakes and river. As the increasing population cause the a huge depletion in the fresh water reserves like ground water, fresh lakes and rivers and at same time due to irresponsible and immature behavior we are contaminating these water resources day bay and their quality becoming worst day by and we have not converted it into unusable water. But we have to take step we need a technology that monitors the quality of these naturally fresh water resources and a technology that can monitor the quality , amount and tracks the use and waste ratio and rise and fall in the amount of present fresh water resources around the city and country side so that gov and manage and protest these natural water sources and protect them from getting further polluted and contaminated .
Due to unavailability of helium network in INDIA and facing problem in setting network This project basic and not tested one . We simply take the data from flow sensor and send to helium meter but this project can be extended with TDS Sensor , WATER LEVEL SENSOR meter and other sensor to beter monitor the water resource .
First of all we have setup the Helium console to do so sign up to helium and then click on add a new device and then name the device
Now we can see the device name.
Next add the STM32 boards to Arduino IDE and then install all the libraries for STM32 .Then include the Lora wan liberary in code and set the intrruot pin for sensor and other variables for storing values
#include "LoRaWAN.h"
const char *devEui = "0F45C2FEEBCF80XXX";
const char *appEui = "47D1CD72A2A7B2XXX";
const char *appKey = "4BA427C7DBB36C826317D71DEABCXXXX";
//////////////////////
volatile int flow_frequency; // Measures flow sensor pulses
unsigned int l_hour; // Calculated litres/hour
unsigned char flowsensor = 2; // Sensor Input
unsigned long currentTime;
unsigned long cloopTime;
int flows =0;
String str;
///////////////////////////
// Max Payload 53 Bytes for DR 1
//////////////////////////////////////
String payload[] = "Hello, World!";
char cstr[16];
////////////////////////////////
void flow () // Interrupt function
{
flow_frequency++;
}
Now go tho the devices in helium console and copy the device EUI , APP EUI and paste them in the code respectively where it is asked .
You can copy the full code and then upload it the STM board by sending the right board and Port after uploading the thing the device start sending the water resource data to helium network.
You ca see them in helium console.
Comments