Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. Domoticz
  4. sonda PH

sonda PH

Scheduled Pinned Locked Moved Domoticz
2 Posts 2 Posters 866 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    szybki946
    wrote on last edited by szybki946
    #1

    Hello, I'm sorry for my Anglish.
    I was looking for a connection of soda PH to domoticz. I found one project but it is old and it does not work. There is somebody able to do it, I'm sure it will not be useful to one.

    #include <Average.h>
    Average<float> sredniaPH(100); //średnia ze 100 pomiarów
    void setup()
    {
    Serial.begin(9600);
    }
    void loop()
    {
    int Volty = analogRead(A7);
    float V =(float) Volty * 5.0 / 1024.0;
    float peha =(float) V*3.5;
    sredniaPH.push(peha);
    sredniaPH.mean();
    float pH =((float) sredniaPH.mean());
    Serial.println(pH);

      delay(1000)
    

    }

    1 Reply Last reply
    0
    • N Offline
      N Offline
      nekitoss
      wrote on last edited by nekitoss
      #2

      Hi, @szybki946 !
      Code in your post is working or not?
      If yes - you want to someone modify it, so it will send your pH to domoticz from MySensors node?
      If yes - if you use nrf24l01+ radio - maybe you want this code:

      #include <Average.h>
      
      #define MY_NODE_ID 100 //set node fixed id
      #define MY_BAUD_RATE 9600 //set serial baud rate
      #define MY_RADIO_RF24 //if you use nrf24l01+
      
      #include <MySensors.h>  
      
      #define PH_CHILD_ID 0
      
      MyMessage ph_msg(PH_CHILD_ID, V_PH);
      
      Average<float> sredniaPH(100); //średnia ze 100 pomiarów
      
      void presentation() {
        sendSketchInfo("PH_meter", "1.0");  // Send the sketch version information to the gateway and Controller
      
        present(PH_CHILD_ID, S_WATER_QUALITY, "average_ph");
      }
      
      void setup()  
      { 
        //Serial.begin(9600); //don't need it because of #define MY_BAUD_RATE 9600
      }
      
      void loop()     
      {     
        int Volty = analogRead(A7);
        float V =(float) Volty * 5.0 / 1024.0;
        float peha =(float) V*3.5;
        sredniaPH.push(peha);
        sredniaPH.mean();
        float pH =((float) sredniaPH.mean());
        Serial.println(pH);
      
        send(ph_msg.set(pH, 2)); //2 = number of digits after comma
        wait(1000); //in mysensors do not use delay - use wait() or sleep()
      }
      
      

      (change IDs, texts and numbers of digits after comma as you want)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      16

      Online

      11.7k

      Users

      11.2k

      Topics

      113.1k

      Posts


      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • MySensors
      • OpenHardware.io
      • Categories
      • Recent
      • Tags
      • Popular