// Agrinovo PH-110 industrial pH sensor // Prints pH every 5 seconds. // // Sensor cable // Red supply +, 12-24 V DC // Black supply ground, joined to the board's ground // Green RS485 A // Yellow RS485 B // // The board talks to the sensor through an RS485 transceiver (MAX485 or // similar). AgrinovoDefaultPort.h lists the serial pins used on each board. // // https://agrinovo.io/products/sensors/aqua/ph/ph-110-probe/ #include #include const int DE_PIN = 4; // transceiver DE and RE, tied together AgrinovoBus bus(AGRINOVO_PORT, DE_PIN); AgrinovoPH110 sensor(bus); // Modbus address 1 void setup() { Serial.begin(115200); agrinovoPortBegin(9600); bus.begin(); } void loop() { if (sensor.read()) { Serial.print("pH: "); Serial.print(sensor.ph(), 2); Serial.println(" pH"); } else { Serial.println(sensor.errorText()); } delay(5000); }