Friday, April 20, 2012

Rain Water Tank Level Monitor

This a work in progress.

Design Spec: To measure rainwater tank water level in a single tank. Two different measurement methods will be incorporated: pressure and sonic ranging. The data will be shown in height and volume. Using a battery backup realtime clock, data will be logged twice daily over the period of one year. An RS232 port will allow the data to be downloaded to a  computer for analysis. A large character LCD will provide continuous display of time and water level.

1) Two different RTC's are being tried: DS1307 and PCF8563.
2) A 24LC512 for memory storage.
3) PIC18F2520 with Tiny bootloader
4) 16x2 or 20x2 LCD: Vishay 016N002L or 020N002L

1) Basic Clock: Simple realtime clock using a RTC I2C chip. 12/24 function is included. Start time is set as part of the code.

                a) Clock_DS1307_LCD_2.bas
                b) Clock_PCF8563_LCD_2.bas

2) Menu Routine: This menu routine uses 3 buttons: Select, Up, Dwn. The menu items are shown on the bottom line of the display. Execution occurs on the leading edge of button press and, following execution, waits for the button to be released. The buttons are connected to the port pins with a 10K pullup.

                Clock_menu_4.bas              This code is not complete.

3) Clock with Menu:

In Process. Code written to date can be found here in files.

Notes 1)  The code is written using Oshonsoft Basic for the 18F2520. From this point on I wish to switch to the 18F25K22 and use either the Swordfish (preferred) or the Amicus (Proton) Basic compiler. The Swordfish would be preferred since it uses a linking loader, so that modules can be developed much like the Arduino. Unhappily OS Basic does not as yet support the 18F25K22.

Rain Water Monitor Shield Prototype.

No comments:

Post a Comment