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. General Discussion
  3. Combined sketch PH meter and Temp Sensor

Combined sketch PH meter and Temp Sensor

Scheduled Pinned Locked Moved General Discussion
3 Posts 2 Posters 1.4k 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
    stingone
    wrote on last edited by
    #1

    Hi everyone,

    I just got a compiled sketch with a ph sensor and temp sensor however i push the values to pimatic. however i have the ph meter as child id 0, and the temp as child id 1. however it seems that both values are on child 1.

    Can anyone have a look at my sketch to see where the error is?
    0_1460752368057_PH_Probe_v1.1.ino.ino

    1 Reply Last reply
    0
    • mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      You have set numSensors to 0 which means you will never present any temperature sensors. I think you need to change

      int numSensors=0;
      

      to

      int numSensors=1;
      

      and

          for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {   
          gw.present(i, S_TEMP);
          }
      

      to

          for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {   
          gw.present(i+CHILD_ID_TEMP, S_TEMP);
          }
      

      Also use the auto-formatting (Ctrl/Cmd+T) in Arduino IDE, it makes it easier to follow the code and spot mistakes.

      1 Reply Last reply
      1
      • S Offline
        S Offline
        stingone
        wrote on last edited by stingone
        #3

        These are the reading i got.

        send: 2-2-0-0 s=255,c=3,t=15,pt=2,l=2,sg=0,st=ok:0
        send: 2-2-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,st=ok:1.5.3
        send: 2-2-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
        read: 0-0-2 s=255,c=3,t=6,pt=0,l=1,sg=0:M
        sensor started, id=2, parent=0, distance=1
        send: 2-2-0-0 s=255,c=3,t=11,pt=0,l=7,sg=0,st=ok:pHmeter
        send: 2-2-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0
        send: 2-2-0-0 s=0,c=0,t=21,pt=0,l=0,sg=0,st=ok:
        send: 2-2-0-0 s=0,c=0,t=6,pt=0,l=0,sg=0,st=ok:
        pH:3.36
        send: 2-2-0-0 s=0,c=1,t=24,pt=7,l=5,sg=0,st=ok:3.36
        send: 2-2-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:21.3
        send: 2-2-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:21.1
        send: 2-2-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:21.0
        send: 2-2-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:20.8
        pH:3.86
        send: 2-2-0-0 s=0,c=1,t=24,pt=7,l=5,sg=0,st=ok:3.86

        The 14.79 is from the PH the rest the temp sensor.

        as you can see both values are on parent 0. is it possible to get the ph on parent 0 and the temp on 1?

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


        8

        Online

        11.7k

        Users

        11.2k

        Topics

        113.0k

        Posts


        Copyright 2019 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