I am making a water tank monitor with rain gauge and water flow meter on inlet with ultrasonic level sensor in tank sent via xbee sx pro to base arduino to email.
Powered by battery/solar mppt
No gsm (except at base where WiFi anyhow)
First will be 10kms out with good UHF reception (send sstv now using androids, arducam instead of maybe) but some closer and further have poor reception so use digimesh.
The water flow 45lpm to 180lpm needs
a running over time then send alert ie water flowing 4hrs send alert
-daily total (use water medication as well so needs to be accurate as possible, eventually another ultrasonic sensor in this tank too)
Rain gauge tipping bucket misol? Spare part .
Daily total
Max per hr
If I have multiple interrupts running am I going to still get reliable totals. I will have enough other stuff running that I am worried about sketch size on uno before I start.
If the outputs are free of bounce they can drive an AVR timer / counter which reduces the interrupt rate by a factor of 256. The code is very similar to the code for millis. The significant change is Clock Select.
I am worried about the amount of interrupts I'll have ie say rain 100mm per hour peak / .2mm tip bucket measure / 60mins equals 9 per minute 180l min most seem 1litre pulse but even at 10litre pulse is 18 times a minute. I don't want to miss to many.
Clock select is the answer. I was going to interrupt on time to check pins.
I am worried about sketch size and processing speed as it is limited on uno so am getting a plan first, then byte by byte put it together.
Yoyogogo:
If I have multiple interrupts running am I going to still get reliable totals. I will have enough other stuff running that I am worried about sketch size on uno before I start.
How many interrupts per second will you need? I can't imagine that a water measuring system is going to be a challenge for an Arduino?
In fact I suspect everything will be slow enough that you may not need to use interrupts at all - just use polling to read the inputs.
The best way to make progress is to get part of the system working so that you have some practical experience.
How many pins do you need? If not too many look at the ESP8266 based nodemcu or WEMOS boards. Got built in WiFi as well as lots of memory. 11 digital and 1 analog pin, and runs at 80 MHz.
wvmarle:
Yes, can be programmed using the same IDE. Just install their libraries with it.
Be aware of the limitations, mostly in the fields of timing (PWM) and fewer pins.
I bought a few recently but I have not taken them out of their bags yet. One thing I have not seen any clear exposition about is how much CPU time is taken up with the WiFi stuff and whether (and by how much) that might impact on the ability to run programs requiring precise timing.
1 distance sensor
1 xbee sx digimesh
1 water flow meter
So just poll. What about when sending via xbee. Am I going to miss counts specially start sending jpegs.
Have solar mppt box etc
Future addition
Rain gauge
Camera replace sstv adafruit ir weatherproof motion TTL 54.95 *15=cost higher for 15 and distance not enough but inbuilt motion nice
Battery level? Easy...maybe sleep uno night
Base
WiFi to send emails daily and alarm
1 xbee sx pro
Future
Transfer of data reliability a issue. WiFi poor. $5 4g Telstra data sim on hill maybe in uno.
Bluetooth to android bulk data for app. Either that or app reads emails, sends "take picture" or "data now please", that is better for remote use.
1 anolog only wemos. Have to be certain its all I want.
Future addition
Water medication tank level nano, WiFi to tank uno for transmission to base.
Robin2:
One thing I have not seen any clear exposition about is how much CPU time is taken up with the WiFi stuff and whether (and by how much) that might impact on the ability to run programs requiring precise timing.
...R
Depends on how precise and what the WiFi has to do. You can even switch it off entirely if you want
I've noticed issues doing sub-microsecond timing. Solved it by using blocking code, which is safe as it has a 2 millisecond timeout.