Skip to content

ncolomer/WaterTankMonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Water Tank Monitor

This repo contains all the necessary assets to build a module monitoring and displaying the level of water in a water tank. The PCB layout was designed to fit in a Legrand Mosaic obturateur, hence compatible with any Mosaic Support.

The project is hosted on Hackaday.io. See this blogpost for more details about the designing and building process.

Features

  • get distance readings from an A02 ultrasonic sensor (UART)
  • display water level percentage on a 0.91" SSD1306 OLED screen (I2C)
  • onboard push button to turn on display (incl. off timer)
  • report readings to a Zigbee PTVO firmware (UART) for integration with home automation software

PCB

The PCB was designed using Kicad. Project files can be found in the /Schematics directory.

It includes JLCPCB's production files if you want to make your own.

Parts

  • onboard
    • refer to the attached Kicad project BOM
    • special part: SMT Dual Entry low profile 1x04 header (aliexpress)
  • external
  • programming
    • 2x03 (3P Double) 1.27" pogo pin clamp (aliexpress)
    • Atmel-ICE for bootloader upload via ICSP (an Arduino can be used too, doc)
    • FT232RL module for serial programming via FTDI (aliexpress)
  • (optional) zigbee connectivity
    • Zigbee module with PTVO firmware, eg. CC2530

Documentation (datasheets, footprints) can be found in the /Documentation directory.

Programming

ICSP (bootloader upload)

FTDI (serial programming)

Firmware

The firmware was developed using PlatformIO. Project files can be found in /Firmware directory.

Host PTVO firmware characteristics

To report measured values via Zigbee, the board need a host PTVO firmware connected on pins PD3(RX) PD4(TX). The following infos should help you generate your own custom PTVO firmware:

Board type: CC2530
Device type: Router
Model ID: water.monitor
Disable periodic On/Off reports for GPIO outputs: Yes
Status LED: P01, Sending reports
Set default reporting interval (s): 0

Output pins:
P02: Output 2, UART (UART: 115200 8N1, Packet end: 0x0D, Byte: 239)
     => PTVO UART pins are P02(RX) P03(TX)
P30: Output 3, UART sensor (Mode: On/Off, : Read/Write, Units: None), Remember state
     => oled display on/off state
P31: Output 4, UART sensor (Mode: Analog value, : Read, Units: None)
     => water level value in percentage
P32: Output 5, UART sensor (Mode: Analog value, : Read, Units: None)
     => measure distance to water in cm
P33: Output 6, UART sensor (Mode: Analog value, : Read/Write, Units: None), Remember state
     => configurable min measurable distance in cm
P34: Output 7, UART sensor (Mode: Analog value, : Read/Write, Units: None), Remember state
     => configurable max measurable distance in cm

Input pins:
P00: Input 1, External wake-up, Pull-up
     => onboard push button, if any