Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Manufacturing process

Build a Headless Raspberry Pi 2 Water Alarm with Adafruit T‑Cobbler Plus

Our first hands‑on project with the Raspberry Pi 2 was to create a headless water alarm. The goal was a compact, low‑power solution that could run unattended and alert us when water was detected.

Below is a detailed walkthrough of the hardware, software, and troubleshooting steps we followed.

Hardware Used

  1. Raspberry Pi 2 (BCM2836, 1 GHz, 1 GB RAM)
  2. Funduino digital water sensor (3 V, 1 kΩ resistor, Red LED)
  3. Adafruit T‑Cobbler Plus (provides 3.3 V/5 V GPIO and power rails)
  4. Large breadboard (for prototyping and wiring)

Step 1: Setting Up the Pi 2

With only one monitor for six team members, we opted for a headless setup using SSH. We connected the Pi to a legacy monitor via an HDMI‑to‑VGA converter; the first OS installation ran fine, but the screen failed after the first reboot. Fortunately, we could still access the Pi over the network with PuTTY and transfer files with FileZilla.

During the OS install we accidentally installed an outdated RPI.GPIO library, which caused compatibility issues. We re‑flashed the OS, installed the latest RPi.GPIO, and verified the basic “Hello, world” blink test to ensure the GPIO subsystem was working.

Step 2: Choosing a Sensor

We needed a digital sensor that operates at 3 V and can reliably signal a wet condition. After evaluating a few options, we selected the Funduino water sensor because of its simple 2‑pin interface and integrated 1 kΩ resistor.

The sensor was wired to a GPIO pin and the red LED was connected to another pin. When the sensor submerged in water, the LED would illuminate.

Step 3: Final Prototype

The working circuit was minimal: one GPIO pin to the sensor’s output, another to the LED, and the power rails from the T‑Cobbler. The accompanying Python script (wet.py) reads the sensor state and toggles the LED accordingly. Run it with:

sudo python wet.py

We also experimented with WebIOPi for a web interface, but the Pi 2 could not support it reliably, so we stuck with the local script.

Step 4: Integrating the Adafruit T‑Cobbler Plus

After soldering the T‑Cobbler, we discovered that the connector orientation was reversed in our initial assembly. Adafruit’s documentation clarified that the cable should be flipped to match the Pi’s pin layout. Once corrected, all GPIO pins functioned as expected.

Step 5: Helpful Resources

For a deeper dive into the code and wiring, refer to the full project repository on GitHub.

Manufacturing process

  1. How to Read Temperature with a DS18B20 on Raspberry Pi 2
  2. Raspberry Pi–Controlled Aquaponics System: Build Guide & Code
  3. Measuring Temperature on Raspberry Pi with Maxim 1‑Wire Sensors and DS2482 I2C Bridge
  4. Home Energy Centre: Monitoring Solar PV, Thermal Panels, and Room Temperatures with Raspberry Pi and Moteino
  5. Accurate Temperature Monitoring in a Server Closet with Raspberry Pi
  6. Lightning Detection with Raspberry Pi and AS3935: A Practical Guide
  7. Capturing IR Remote Commands on Raspberry Pi without LIRC: A Python UART Approach
  8. Automated Plant Watering System with Raspberry Pi & Web Dashboard
  9. Installing a Raspberry Pi Camera in a Birdhouse – Step‑by‑Step Guide
  10. Build a Self‑Balancing Segway with Raspberry Pi