The Water Monitor Project builds on functionality in my nRF905 Transceiver Introduction.
The Water Monitor Project will provide remote information on the status of my basement sump pump and water conditions in the area of the mechanical area of my home. It will be developed in several stages, introducing additional capabilities and functionalities over time. This project will develop and install required sensors and related platforms in order to provide information required to support the data requirements. Information will be sent to a nearby server which will process the information and can be accessed from a smartphone or computer terminal to obtain information on the following:
- Level of water in the sump pump. Initially sensors will be installed to detect the following levels:
- Water at or below PUMP TURN OFF point
- Water over PUMP TURN ON point
- Water midway above pump
- Water near overflow
- Presence of water in the following floor/basin areas which may indicate a flooding condition:
- Water heater
- Sump Pump
- Power Supply Condition to Water Monitor
- House Power On/Off
- Backup Battery Condition
- Activity of the Primary sump pump
- Pump On/Off
- Activity of the Backup sump pump
- Pump On/Off
- Backup Battery Condition
Data will be collected and packaged along with local time and sent to the nearby server which will be able to provide more advanced processing and storage of data for presentation to the remote user over the internet.
Currently, Phase 1 of development shows that a DS3231 Real Time Clock (RTC), Arduino UNO, and nRF905 transceiver can be integrated. This integration includes 3 binary data sensor signals (represented by a DIP switch) which can represent any type of switch or circuit necessary to support some of the sensors above. Certainly there is not sufficient input/output to support all of the data sensors above without employment of external hardware. More advanced Arduino boards such as the Mega may be explored but more likely what I feel the next Phase will remove the nRF905 and replace it with a network card which may not require all of the connections we see for the nRF905. A network card could then more easily communicate with a server such as a Raspberry Pi which could act as a server to the outside world. Stay tuned.
The hardware setup includes both a Water Monitor Transmitter and a complementary Receiver. No changes have been made to the receiver setup however the transmitter setup now includes a “simulated sensor” DIP switch and DS3231 RTC. The updated Pin-Out Connections on the transmitter are listed below. A 3 volt, CR2016 lithium battery is used in the DS3231.
Detailed Eagle CAD schematics are shown below. Power is provided to the UNO via the USB connection which also is used to support the serial display to the local computer.
Transmitter Eagle Schematic
Receiver Eagle Schematic
No changes have been made to the receiver software used during the nRF905 Transceiver Introduction. A copy of the receiver code is provided here for convenience. Forward comments in this code version do not reflect the current development direction of the Water Monitor project and will be updated if required in subsequent releases.
Arduino Receiver Code
The transmitter code has been updated to incorporate introduction of the sensor DIP switch which has 3 connections to the Uno pins D4, D5, and D6. The code also includes language to support use of the DS3231 RTC and the supporting RTClib.h library written by jeelabs. The software is written to reset the time if the keep-alive battery has been disconnected for a lengthy period of time or the power connections with the DS3231 has been severed. Forward comments in this code version do not reflect the current development direction of the Water Monitor project and will be updated in subsequent releases.
Arduino Transmitter Code
Final Setup and Demonstration
- Setup the hardware and connect as discussed in the Hardware Setup section above.
- Connect a USB cable between each of the Arduino UNO’s and a computer which contains the Arduino IDE and software code.
- Upload the Arduino transmitter software code to the transmitter setup.
- Upload the Arduino receiver software code to the receiver hardware setup.
- Note port numbers for each connections if using only one computer.
- If using one computer open a window to view each serial port connection in two windows.
- The program should be running at this time. If not running, reload and repeat the procedure.
The following are example outputs. The Sensor Data Item binary outputs will be different and based on the position of the DIP switches on the transmitter setup. The time is based on the time setting from your local computer.
Transmitter Serial Display
Receiver Serial Display
Documentation and Reference
RTClib Library File in GITHUB
DS3231 RTC Adafruit discussion
DS3231 Data sheet
Zak Kemble nRF905 discussion
Zip file for all project posted documentation shown above
The next step will be to integrate a network card instead of the nRF905. Communications over Ethernet will be different and the receiver will definitely be different as it will become the Server section shown in the figure above. I feel this will be a major jump in the project and I will need to do some more reading and research to understand the specifics on how this will work. I also need to select a server which for now I think may be the Raspberry Pi B+.