Wireless rain gauge

Nikola Kuzmanowski

Overview

This project is made up of two parts a transmitter and a receiver. The transmitter is the device that records the rainfall. It uses the rain gauge that is a part of this weather meter. The rain gauge is a tipping bucket rain gauge and the transmitter counts how many times the "bucket" has been tipped. Each bucket tip is equal to 0.011" of rain fall. After 10 bucket flips the transmitter send to the receiver that 10 buckets have been flipped. The receiver then updates the total rain fall based on this and displays it to an LCD.

Rain sensor

Hardware

Transmitter

It uses the Si106x-8x an 8 bit microcontroller from Silicon Labs. This microcontroller has an integrated 915 MHz EZRadioPRO Transceiver. The communication with the radio is done through SPI. The microcontroller detects a bucket flip by a falling edge interrupt that happens when the "bucket" is leveled equally on both side, in this situation a magnet pulls a Read switch. The software and hardware worked together however the signal that was sent with the radio was very low. I still don't know why this is. That that is why the Prototype was used to test the receiver. The prototype is an ARM microcontroller and communicates with the radio with SPI. If the green button is pressed on the prototype then a packet is sent that contains information that 100 flips have happened.

Schematic 1 Prototype
Schematic 2 Prototype

Receiver

It uses the Cypress CY8C4125PVI-482 microcontroller that has an ARM Cortex-M0 CPU. The chip is connected to a 915 MHz EZRadioPRO Transceiver via SPI in order to receive the data from the transmitter. The chip has LCD Direct Drive which makes the communication with the 7 segment LCD really easy. Finally we have the 7 segment LCD, Varitronix VI-201 that displays the total amount of rainfall so far.

Schematic Prototype

Software

Transmitter

Written in assembly using the silicon labs IDE. First the SPI, radio, falling edge interrupt and other hardware is configured. The radio is placed into TX mode and the microcontroller goes to sleep after all the hardware initializations. The microcontroller is wakes up every time the falling edge interrupt occurs. If it has counted 10 bucket flips it sends the flips back to zero and starts sending to the receiver. If it has not counted 10 flips then it counts a flip and goes back to sleep. A denouncing algorithm is used for the Read switch in order to prevent the microcontroller from reading multiple flips. When the microcontroller gets to a point where it needs to send it first sends a command to load the TX FIFO of the radio. After the FIFO is loaded a command to send the bytes from the FIFO is sent to the radio. When this is finished the radio goes back to sleep and waits for the next bucket flip.

Receiver

Written in C using PSoC Creator form Cypress. The configuration for the hardware is done using the PSoC creator GUI interface except for the radio. The receiver starts out by enabling interrupts and setting up the radio. After this the controller sends commands to the radio to clear the FIFOs, switch to RX state and start RX. It then keeps sending a request state command to the radio and doesn’t stop pooling until the radio is in RX mode. When this is done the controller sends a clear all interrupts command and goes to sleep. When the radio receives a package from the transmitter it sends an interrupt to the microcontroller and wakes it up from sleep. The microcontroller reads the number of flips from the radio and stores them in an int variable. It then proceeds to add the new rainfall to the total rainfall and displays the total rainfall on the LCD. Displaying to the LCD is done using the built in function for displaying a number on a 7 segment LCD. This function only takes in the position of the number on the LCD and the number itself and does all the work for you. When this is done the microcontroller goes back and repeats the described process again.

Downloads

Source codes:


Last modified:Mon, Jan 23, 2023.

01585