Hi gang, I am starting to put togther a project to monitor a domestic water treatment system at my house. I have a domestic well pump, a reverse osmosis system, a rainwater collection system, a number of storage tanks, and probably (while I’m at it) a sprinkler systrem to potentially control. I want to track 4-6 different flow rates (using cheap hall effect flow pulse’ers), monitor tank levels and salinity levels using standard 4-20ma sensors (basically individual ADC’s for each sensor), monitor water softener and RO operation using digital i/o (bascially on/off status), and display and store data about the system to a micro (Spider II) located at the house, about 100feet away from the water system. I’d like to also push the data up to the web. The water system is runing now, using manual float switches etc, so the purpose of the micro(s) is to provide information as to system status, to record water consumption (domestic and irrigation), and in the future I could add some kind of irrigation - sprinkler controller - as it would be useful to do, particularly as I can measure flows which the sprinklers are in operation.
I’d like advice from the group on putting this together conceptually. Here is my concept so far:
-
Flow measuring happens in real time (220 pulses/liter pumped x 4-6 individual flows). One way to do this is to task a picaxe micro to basically count the pulses, and increment a ‘counter’ that creates an interrupt for each liter pumped for each flow device. A Picaxe 20M2 micro has been demonstrated to do this nicely at the flows (5gpm +/- max) envisioned. The idea here is that the picaxe would braodcast an interrrupt for the main micro to update flow data when any of the flow chanels pumps cumulatively one liter of water.
-
4-20ma sensor data (4-6 sensors) and the couple of digital i/o’s would be polled at set intervals by the main micro (Spider II).
The main micro (Syder) would be located in the house, and would have an LCD, SD Card, provision for relay outputs for the sprinkler system, and an ethernet card for posting to the net.
The ‘water room’ is located about 100 feet away from the house, I have 2 CAT5 cables between the locations, one has an active ethernet connection runing on it (my house network), the other one is available for communications between the micros. So I have 4 pair of lines I can use between the micros for communication, in addition to ethernet comnnectivitny between the locations.
The picaxe can be set up to use I2C (but only if it’s operating in master mode), or I could use SPI, or I could use standard serial communications. I don’t think the picaxe supports CAN bus communications.
So, my first step is trying to decide which form of communication to use between the two micos. If the Spyder can be set up to function as an I2C slave (the picaxe would be the master), I could use I2c, or I could use SPI using the Syder as the master, or standard serial with an interrupt line. To save communication lines (I only have 8 I can use), I will probably add a second picaxe at the remote loaction to record the various sensors, and communicate with that as well - so two remote picaxe micros communicating with the Syder using one of the communication methods. I am leaning towards using SPI, with the Spyder acting as the master (providing the clock signal), with the one ‘flow measuring’ picaxe using an interrupt line if I need to do that. The Spyder would basically poll the sensor data picaxe once each second (using a timer), and let the flow picaxe generate interrupts to update flows, both using SPI.
The sypder would, on that 1 second timer, update sensor data, and update the LCD display and/or internet. It would do the same if it gets a flow interrupt. And a second timer woud fire at midnight to update daily flow readings etc, and woud write the daily data to the SD card and/or internet.
Anyone see any issues with this approach, or can suggest ways to make things a little simpler? I get the feeling that the flow measuring would be better not done using the Syder as it is event driven, and might not be able to handle the ‘real time’ nature of the measurments (about 200-400 pulses/second on all channels).
I could put the Spyder out at the water system, store the data out there, and publish to the web out there, but I wanted a nice LCD display in the house so I can see at a glance what is going on without logging on to a website or walking out there, and I am also not sure the Syder could do the real time stuff.
Thnaks in adcvance for your comments!
John