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. My Project
  3. Raindrops Detection under v2

Raindrops Detection under v2

Scheduled Pinned Locked Moved My Project
raindropsrainsensor
5 Posts 2 Posters 2.1k Views 4 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.
  • D Offline
    D Offline
    davedeluxe
    wrote on last edited by
    #1

    Hi,
    I hope someone can help me.
    I used the example of Soil & Moist sensor v1.5.x to read a rain sensor.
    After I upgraded to v2 the setch no longer works. Does anyone have such a sensor already in use and has a sample code for me?
    I'm not so good at programming :(

    I use such a sensor: http://goo.gl/WywReQ

    Thank you!
    Dave

    1 Reply Last reply
    0
    • tlpeterT Offline
      tlpeterT Offline
      tlpeter
      wrote on last edited by tlpeter
      #2

      Hi Dave,

      Funny as i had the same problem.
      I tried using the digital pin with i could not get to work so i am using the A0 port now so have more than on and off.

      This is the sketch i am using and i use moisture as output to Domoticz:

      /**
       * The MySensors Arduino library handles the wireless radio link and protocol
       * between your home built sensors/actuators and HA controller of choice.
       * The sensors forms a self healing radio network with optional repeaters. Each
       * repeater and gateway builds a routing tables in EEPROM which keeps track of the
       * network topology allowing messages to be routed to nodes.
       *
       * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
       * Copyright (C) 2013-2015 Sensnology AB
       * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
       *
       * Documentation: http://www.mysensors.org
       * Support Forum: http://forum.mysensors.org
       *
       * This program is free software; you can redistribute it and/or
       * modify it under the terms of the GNU General Public License
       * version 2 as published by the Free Software Foundation.
       *
       *******************************
       *
       * REVISION HISTORY
       * Version 1.0 - Felix Haverkamp
       * 
       * DESCRIPTION
       * Example sketch sending soil moisture in percentage alarm to controller 
       * 
       */
      // Enable debug prints
      #define MY_DEBUG
      
      // Enable and select radio type attached 
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      //#define MY_RS485
      
      #include <SPI.h>
      #include <MySensors.h>  
       
      #define CHILD_ID 0   // Id of the sensor child
       
      int mostureSensor = 0;   // ANALOG Pin for Soil sensor, usally A0
      
      MyMessage msg(CHILD_ID, V_LEVEL);
      int lastSoilValue = -1;
       
      void presentation()  
      { 
        
       
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Regensensor", "1.0");
        // Register all sensors to gw (they will be created as child devices)  
        present(CHILD_ID, S_MOISTURE);
      }
       
      void loop()     
      {     
       
       
        int soilValue = map(analogRead(mostureSensor), 0, 1024, 100, 0);
       
        if (soilValue != lastSoilValue) {
          Serial.println(soilValue);
          send(msg.set(soilValue));
          lastSoilValue = soilValue;
        }
      sleep(3000);
      }
      
      1 Reply Last reply
      0
      • D Offline
        D Offline
        davedeluxe
        wrote on last edited by
        #3

        Hey,
        sounds great, I´ll test it as soon as possible.

        thank you!!!

        1 Reply Last reply
        0
        • D Offline
          D Offline
          davedeluxe
          wrote on last edited by
          #4

          It´s working and it´s better than before!
          Thank you so much, you´re the man of the day!

          1 Reply Last reply
          1
          • tlpeterT Offline
            tlpeterT Offline
            tlpeter
            wrote on last edited by
            #5

            You're welcome.
            It was for me also a struggle to get it working.

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


            25

            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