🎩 Mod-HAT


📦 Libraries

Install the libraries to use the on-board modules:





🔌 Connections

  1. The board communicates with the controlling device through I²C:

    • Attach the HAT to the Raspberry Pi's header, turn it on and boot. The HAT uses the standard GPIO2 for SDA and GPIO2 for SCL, referred to as /dev/i2c-1 within Raspberry Pi OS.
    • Confirm the device is connected properly and working by typing i2cdetect -y 1 in a terminal and looking for the following addresses: 0x0A for the Mod-EC module, 0x0B for Mod-pH, and 0x0E for Mod-ORP.
  2. The probes connect to the board through U.FL to BNC wires. The modules are labeled 1, 2, and 3 in large numerals on the board.

    Label Probe
    1 EC
    2 pH
    3 ORP

    U.FL connectors are fragile and not intended for repeated connections.

    • Avoid unnecessary stress on the connector by not allowing the cable to hang loosely. One possible solution would be to use a small zip-tie and pass it through a nearby mounting hole with the cable as a form of strain relief. Tape can also be used. Ideally, the BNC end would be mounted on an enclosure wall and the board would be securely mounted inside which is the intended use of the board.
    • When making a connection, make sure the cable is even and flat on top of the connector before pressing down. This will avoid damaging the connector or cable and ensure they are seated properly.
    • To remove the cable, use a purpose-built tool, or pull the cable up using steady pressure while ensuring the cable remains flat. Prying will cause damage.
  3. The temperature probe connects to the board through the 3 pin screw-terminal near the EC probe connector.

    Temp Wire Terminal Lablel
    black GND
    red VCC
    yellow SIG


🥧 Raspberry Pi Python Code

import uFire_Mod_EC
import uFire_Mod_pH
import uFire_Mod_ORP

ec = uFire_Mod_EC.i2c()
ph = uFire_Mod_pH.i2c()
orp = uFire_Mod_ORP.i2c()
Import and initialize the libraries
::begin() for each instance

print("{:.3f}".format(ec.mS) + "mS/cm")
print("{:.3f}".format(ph.pH) + "  pH")
print("{:.3f}".format(orp.mV) + " ORP mV")
print("{:.3f}".format(ec.tempC) + " °C")
Take all the measurements and print them