<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[sonda PH]]></title><description><![CDATA[<p dir="auto">Hello, I'm sorry for my Anglish.<br />
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.</p>
<p dir="auto">#include &lt;Average.h&gt;<br />
Average&lt;float&gt; sredniaPH(100);             //średnia ze 100 pomiarów<br />
void setup()<br />
{<br />
Serial.begin(9600);<br />
}<br />
void loop()<br />
{<br />
int Volty = analogRead(A7);<br />
float V =(float) Volty * 5.0 / 1024.0;<br />
float peha =(float) V*3.5;<br />
sredniaPH.push(peha);<br />
sredniaPH.mean();<br />
float pH =((float) sredniaPH.mean());<br />
Serial.println(pH);</p>
<pre><code>  delay(1000)
</code></pre>
<p dir="auto">}</p>
]]></description><link>https://forum.mysensors.org/topic/9886/sonda-ph</link><generator>RSS for Node</generator><lastBuildDate>Mon, 12 Oct 2026 06:22:51 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/9886.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 16 Nov 2018 16:12:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to sonda PH on Fri, 30 Nov 2018 03:46:55 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/szybki946" aria-label="Profile: szybki946">@<bdi>szybki946</bdi></a> !<br />
Code in your post is working or not?<br />
If yes - you  want to someone modify it, so it will send your <code>pH</code> to domoticz from MySensors node?<br />
If yes - if you use nrf24l01+ radio - maybe you want this code:</p>
<pre><code>#include &lt;Average.h&gt;

#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 &lt;MySensors.h&gt;  

#define PH_CHILD_ID 0

MyMessage ph_msg(PH_CHILD_ID, V_PH);

Average&lt;float&gt; 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()
}

</code></pre>
<p dir="auto">(change IDs, texts and numbers of digits after comma as you want)</p>
]]></description><link>https://forum.mysensors.org/post/95468</link><guid isPermaLink="true">https://forum.mysensors.org/post/95468</guid><dc:creator><![CDATA[nekitoss]]></dc:creator><pubDate>Fri, 30 Nov 2018 03:46:55 GMT</pubDate></item></channel></rss>