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
S

szybki946

@szybki946
About
Posts
10
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • sonda PH
    S szybki946

    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)
    

    }

    Domoticz

  • PH Probe code
    S szybki946

    I'm not a programmer, I can not fix it

    My Project

  • 💬 Floating Swimming Pool Sensor (Water Quality)
    S szybki946

    hello if he is going to send to domoticza PH

    OpenHardware.io contest2017 mysensors

  • PH Probe code
    S szybki946

    UWAGA: Błędny folder .ci w bibliotece 'MySensors'
    UWAGA: Błędny folder .mystools w bibliotece 'MySensors'
    1455210318534-ph_probe_v1.1.ino:8:22: error: MySensor.h: No such file or directory

    compilation terminated.

    exit status 1
    MySensor.h: No such file or directory

    My Project

  • MySensor PH
    S szybki946

    38/5000
    I am asking here because maybe there is a new project

    General Discussion

  • MySensor PH
    S szybki946

    did not work

    General Discussion

  • MySensor PH
    S szybki946

    I am looking for how to connect the PH probe

    General Discussion

  • Mysensors PH
    S szybki946

    how to fix this error

    Troubleshooting

  • Mysensors PH
    S szybki946

    /*
    Original code created by DFRobot for their probes,
    adapted by tony.dijksterhuis@gmail.com Mysensors for the project.
    */

    #include <SPI.h>
    #include <MySensors.h>
    #include <DallasTemperature.h>
    #include <OneWire.h>
    #include "Vcc.h" // https://github.com/Yveaux/Arduino_Vcc

    static const float VccMin = 0.0; // Minimum expected Vcc level, in Volts. (0.6V for 1 AA Alkaline)
    static const float VccMax = 3.3; // Maximum expected Vcc level, in Volts. (1.5V for 1 AA Alkaline)
    static const float VccCorrection = 3.29 / 3.31; // Measured Vcc by multimeter divided by reported Vcc
    Vcc vcc(VccCorrection);

    #define CHILD_ID_PH 0
    #define ArrayLenth 10 // times of collection
    #define PH_SENSOR_ANALOG_PIN A0 // pH meter Analog output to Arduino Analog Input 0
    #define LED_DIGITAL_PIN 13
    #define Offset 0.00 //deviation compensate

    #define CHILD_ID_TEMP 1
    #define COMPARE_TEMP 1 // Send temperature only if changed? 1 = Yes 0 = No
    #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected
    #define MAX_ATTACHED_DS18B20 16

    unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
    OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
    DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature.

    unsigned long lastSend = 0;
    static const unsigned long SEND_FREQUENCY = 30000; // Minimum time between send (in milliseconds)

    MySensor gw;

    float lastPhHValue;
    static const float deltaPhValue = 0.5;

    float lastTemperature[MAX_ATTACHED_DS18B20];
    int numSensors=0;
    boolean receivedConfig = false;
    boolean metric = true;

    MyMessage msgPH(CHILD_ID_PH, V_VAR1);
    MyMessage msg(CHILD_ID_TEMP,V_TEMP);

    void setup()
    {
    // Startup up the OneWire library
    sensors.begin();
    // requestTemperatures() will not block current thread
    sensors.setWaitForConversion(false);

    //gw.begin(NULL, 100, false); //deze gebruiken, 100 is de node_id, die weer gebruiken in pimatic
    gw.begin();
    //Serial.print("0;0;3;0;2;");Serial.print(LIBRARY_VERSION);
    
    pinMode(LED_DIGITAL_PIN, OUTPUT);
    numSensors = sensors.getDeviceCount();
    
    // Send the Sketch Version Information to the Gateway
    gw.sendSketchInfo("pHmeter", "1.0");
    
    // Register all sensors to gw (they will be created as child devices)
    gw.present(CHILD_ID_PH, S_WATER_QUALITY);
    
    // Present all sensors to controller
    for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {   
    gw.present(i, S_TEMP);
    }
    

    }

    void loop()
    {
    // By calling process() you route messages in the background
    gw.process();
    read_PH();
    read_TEMP();

    gw.sleep(SLEEP_TIME);
    

    }

    void read_PH(){
    unsigned long now = millis();
    bool sendTime = now - lastSend > SEND_FREQUENCY;
    if (sendTime)
    {
    lastSend = now;

        //    float v = vcc.Read_Volts();
        //    Serial.print("VCC = " );
        //    Serial.print(v);
        //    Serial.println(" Volts" );
        
        int batteryPcnt = (int)vcc.Read_Perc(VccMin, VccMax);
        //    Serial.print("VCC = " );
        //    Serial.print(batteryPcnt);
        //    Serial.println(" %" );
        
        gw.sendBatteryLevel(batteryPcnt);
    }
    
    // Read PH_SENSOR_ANALOG_PIN in phValue
    float voltage = analogReadAverage(PH_SENSOR_ANALOG_PIN, 10) * 5.0 / 1024;
    
    // convert the millivolt into pH value
    float PhValue = 3.5 * voltage+Offset;
    
    
    
    
    if (sendTime || abs(PhValue - lastPhHValue) > deltaPhValue)
    {
        Serial.print("    pH:");
        Serial.print(PhValue, 2);
        Serial.println(" ");
        
        gw.send(msgPH.set(PhValue, 2)); // envoi au reseau avec deux decimales
        
        digitalWrite(LED_DIGITAL_PIN, digitalRead(LED_DIGITAL_PIN) ^ 1);
        
        lastPhHValue = PhValue;
    }
    

    }

    void read_TEMP(){
    sensors.requestTemperatures();

    // query conversion time and sleep until conversion completed
    int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
    // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
    gw.sleep(conversionTime);

    // Read temperatures and send them to controller
    for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {

    // Fetch and round temperature to one decimal
    float temperature = static_cast<float>(static_cast<int>((gw.getConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
    
    // Only send data if temperature has changed and no error
    #if COMPARE_TEMP == 1
    if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) {
    #else
    if (temperature != -127.00 && temperature != 85.00) {
    #endif
    
      // Send in the new temperature
      gw.send(msg.setSensor(i).set(temperature,1));
      // Save new temperatures for next compare
      lastTemperature[i]=temperature;
    }
    

    }
    }

    double analogReadAverage(uint8_t pin, unsigned long ms)
    {
    double average = 0;
    int buffer[ArrayLenth];

    for (int i = 0; i < ArrayLenth; i++)
    {
        buffer[i] = analogRead(PH_SENSOR_ANALOG_PIN);
        delay(ms);
    }
    
    if (ArrayLenth < 5)
    {
        // less than 5, calculated directly statistics
        for (int i = 0; i < ArrayLenth; i++)
        {
            average += buffer[i];
        }
        average = average / ArrayLenth;
    }
    else
    {
        // Sort the values from small to large
        for (int i = 0; i < ArrayLenth; i++)
        {
            for (int j = i + 1; j < 10; j++)
            {
                if (buffer[i] > buffer[j])
                {
                    int temp = buffer[i];
                    buffer[i] = buffer[j];
                    buffer[j] = temp;
                }
            }
        }
        
        // take the average value of center sample
        for (int i = 2; i < ArrayLenth - 2; i++)
        {
            average += buffer[i];
        }
        
        average = average / (ArrayLenth - 4);
    }
    
    return average;
    

    }

    In file included from C:\Users\Przemek\AppData\Local\Temp\arduino_modified_sketch_990915\sketch_apr20a.ino:8:0:

    C:\Users\Przemek\Documents\Arduino\libraries\MySensors/MySensors.h:389:2: error: #error No forward link or gateway feature activated. This means nowhere to send messages! Pretty pointless.

    #error No forward link or gateway feature activated. This means nowhere to send messages! Pretty pointless.

    ^

    exit status 1

    Troubleshooting
  • Login

  • Don't have an account? Register

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