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

Integrating the Phantom YoYo High‑Sensitivity Water Sensor with the MCP3008 ADC on Raspberry Pi

In this guide we walk through connecting the Phantom YoYo high‑sensitivity water sensor to the MCP3008 8‑channel 10‑bit ADC, then reading the data with a Raspberry Pi 2 running Windows 10 IoT Core and C#. The MCP3008 converts analog signals to 10‑bit digital values (0–1023) that can be scaled to any reference voltage.

Why Use the MCP3008?

The MCP3008 is a compact, low‑cost ADC with SPI interface. Its 10‑bit resolution gives 1024 discrete levels, allowing fine voltage discrimination. With a 3.3 V reference, the sensor output can be converted to voltage using:

voltage = (reading / 1023.0) * Vref

For example, a raw reading of 523 corresponds to:

523 / 1023 * 3.3 ≈ 1.687 V

Always measure the actual supply voltage (e.g., 3.301 V on my Pi) and use that value for Vref to improve accuracy.

Hardware Overview

Wiring Diagram

Refer to the included schematic for pin mapping. Key connections:

Software Setup

Project type: Universal Windows Platform. Two gauges display:

Initializing the MCP3008

private Mcp3008 _mcp3008;

protected override async void OnNavigatedTo(NavigationEventArgs e)
{
    _mcp3008 = new Mcp3008(0); // SPI bus 0
    await _mcp3008.InitializeAsync();
}

Reading a Channel

float voltage = _mcp3008.Read(Mcp3008.Channels.Single0).AsScaledValue(3.3f);

For differential measurement, replace Single0 with Differential0. Dispose the object on navigation away:

_mcp3008.Dispose();
_mcp3008 = null;

Calibration & Measurement

Use a multimeter to verify the potentiometer voltage against the MCP3008 reading. Set the meter to DC voltage; compare the two values to validate accuracy.

Running the App

  1. Build in ARM configuration, choose Remote Machine.
  2. Set the Pi’s IP address in the project properties and disable authentication.
  3. Press F5 to deploy and launch.

The app displays a 360° gauge for water level. Note: the sensor’s output is not strictly linear; higher values correspond to more water but the relationship is empirical. The gauge is for illustrative purposes.

Source code and additional documentation are available on the project page.

Manufacturing process

  1. How Water Flow Sensors Work and Their Key Applications
  2. How to Connect a DS18B20 One‑Wire Digital Thermometer to a Raspberry Pi – A Step‑by‑Step Guide
  3. Integrating the Phantom YoYo High‑Sensitivity Water Sensor with the MCP3008 ADC on Raspberry Pi
  4. Smart Motion-Activated Water Gun Built with Arduino Nano
  5. Smart IR-Activated Water Tap Controlled by Arduino UNO – Efficient & Eco-Friendly
  6. WaterPi: Intelligent Remote Watering & Monitoring for Houseplants
  7. IoT Water Quality Sensor System - Arduino Based Real-Time Monitoring
  8. Getting Started with a 6‑DOF IMU Motion Sensor (MPU‑6050)
  9. Industrial-Grade High-Pressure Pumps for Reliable Irrigation Systems
  10. Automatic Water Pumps: How They Operate & Why They Matter