Tag Archives: sensor

Twitter Water Sensor Hardware

Receiver Hardware

For the receiving module connected to the PC, we will just use the XBIB development board since it already has the serial interface that we need.

Transmitter Hardware

The end device module only needs a few pins to be wired up for power and the sensor input. For the power provide a 3.3V power supply to pin 1 and GND to pin 10.

Here a LM1117 voltage regulator was used to step down from a 5V A/C adapter. The other component shown is a temperature sensor LM35 attached to ADC1 analog input.

Makeshift Water Sensor

For the sensor, we will simply use two wires attached to bolts. One wire tied to DIO4 as the sensor input, that has an internal pull-up resistor. The second wire connected to GND. The bolts are placed on the floor near each other, but not touching. When water touches them both, it will make a circuit connection pulling the input low.

Twitter Water Sensor Wireless

The detector will be placed in the basement while an internet connected computer upstairs will be used to send the tweet. A pair of XBee wireless modules are used to communicate between the basement and computer.

Configuring the modules

X-CTU configuration interface

Download the X-CTU software from the digi.com website and use the XBIB development board, program and configure the modules.

For the PC connected module, select the Coordinator API firmware. Restore defaults settings. Set a PAN to ensure the sensor device pairs with this PC receiver module if running multiple networks. Check the box to Always Update Firmware and write the changes. Once programmed, remove module and insert the second device.

Select the End Device API firmware for the sensor module. Set the PAN to the same as the as the coordinator module. We will attach the sensor directly to the module inputs, so we configure the module to poll the input periodically and send the data to the coordinator. Set the DIO4 Configuration to be a Digital Input. Then under the I/O Sampling group, set the sample period IR to 0x1388 for a 5 second update rate. Write this firmware and settings to the module.

The modules are now programmed to read DIO4 from the end device module every 5 seconds and send that to the coordinator module.