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. Robotic lawn mower supervisor

Robotic lawn mower supervisor

Scheduled Pinned Locked Moved My Project
9 Posts 4 Posters 14.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.
  • S Offline
    S Offline
    sundberg84
    Hardware Contributor
    wrote on last edited by sundberg84
    #1

    Just dropping a small project i made here for the upcoming season.

    Its a motion and distance combined sensor sitting besides my robotic lawn mower. Whenever there is a movement it measures the distance, and therefore I can see if my mower is out or charging.

    0_1460478573291_1.jpg

    Why not only a motion detector - well I have alot of other things happening in the shed as well (cats, children, rabbits) and i also wants to know if the mower is charging or out cutting gras.

    0_1460478679125_2.JPG

    With a small lua script in Domoticz i hope to achieve a push notise whenever its trapped outside for to long.

    Its made of my EasyPCB, a Arduino Pro mini 5v, Nrf24l01+ radio, HC-SR04 distance sensor and HC-SR501 motion sensor.

    0_1460478780523_3.JPG

    Code for 2.0

    // Enable debug prints
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    // #define MY_NODE_ID 12
    
    #include <SPI.h>
    #include <MySensors.h>
    #include <NewPing.h>
      
    #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
    #define CHILD_ID 1   // Id of the sensor child
    #define CHILD_ID_DIST 2
    #define TRIGGER_PIN  6  // Arduino pin tied to trigger pin on the ultrasonic sensor.
    #define ECHO_PIN     5  // Arduino pin tied to echo pin on the ultrasonic sensor.
    #define MAX_DISTANCE 300 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
    
    // Initialize motion message
    MyMessage msg(CHILD_ID, V_TRIPPED);
    
    // Initialize distance message
    NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
    MyMessage msgdist(CHILD_ID_DIST, V_DISTANCE);
    int lastDist;
    boolean metric = true;
    int oldTripped = 0;
    int tripped = 0; 
    unsigned long lastRequest = 0;
    
    void setup()  
    {  
      pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
      metric = getConfig().isMetric;
    }
    
    void presentation()  {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Distance and Motion", "1.3");
    
      // Register all sensors to gw (they will be created as child devices)
      present(CHILD_ID, S_MOTION);
      delay(100);
      present(CHILD_ID_DIST, S_DISTANCE);
    }
    
    void loop(){     
    
    unsigned long now = millis();
    
    //Read digital motion value
    tripped = digitalRead(DIGITAL_INPUT_SENSOR);
    if (tripped != oldTripped){
      lastRequest = now;
      
      // Distance?
      int dist = metric?sonar.ping_cm():sonar.ping_in();
      Serial.print("Ping: ");
      Serial.print(dist); // Convert ping time to distance in cm and print result (0 = outside set distance range)
      Serial.println(metric?" cm":" in");
      if (dist == 0){
        return; //read again if 0, because 0 is error!
      }
    
      if (dist != lastDist) {
          send(msgdist.set(dist));
          lastDist = dist;
      }
       // Motion?
      send(msg.set(tripped?"1":"0"));  // Send tripped value to gw 
      oldTripped = tripped;
    }
    
    if ((now - lastRequest) > (60UL * 1000UL * 60UL)){
    lastRequest = now;
    Serial.print("Heartbeat");
    sendHeartbeat();}
    }
    

    Controller: Proxmox VM - Home Assistant
    MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
    MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
    RFLink GW - Arduino Mega + RFLink Shield, 433mhz

    1 Reply Last reply
    6
    • K Offline
      K Offline
      korttoma
      Hero Member
      wrote on last edited by
      #2

      Nice sensor on a stick @sundberg84 . I have ordered a robotic lawn mower to and was thinking I would monitor this exact same thing but with a sensbender and a microswitch.

      • Tomas
      1 Reply Last reply
      1
      • S Offline
        S Offline
        sundberg84
        Hardware Contributor
        wrote on last edited by
        #3

        Thanks @korttoma! I was thinking about some switch, either mechanical or magnetic but the robot is not gentle at all when it enters the charging station so i descided to go with this that do not have any parts that needs to be close to eachother.

        Controller: Proxmox VM - Home Assistant
        MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
        MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
        RFLink GW - Arduino Mega + RFLink Shield, 433mhz

        1 Reply Last reply
        0
        • Mark SwiftM Offline
          Mark SwiftM Offline
          Mark Swift
          wrote on last edited by
          #4

          It's the same model I'm trying to fix the crappy rain detector, remember, we spoke about having a node on the mower that wakes and checks an external soil / rain sensor... I never did figure out the V_TEXT stuff ;-)

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sundberg84
            Hardware Contributor
            wrote on last edited by sundberg84
            #5

            @Mark-Swift oh, strange - my rain sensors works just fine.
            Have you talked with the support? It can just be a software issue - look at robot-forums and get the support to send you a updated software version. Its easy to just download to a USB stick and connect to the robot.

            Controller: Proxmox VM - Home Assistant
            MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
            MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
            RFLink GW - Arduino Mega + RFLink Shield, 433mhz

            1 Reply Last reply
            0
            • Mark SwiftM Offline
              Mark SwiftM Offline
              Mark Swift
              wrote on last edited by
              #6

              @sundberg84 I sure have, in fact it's been replaced already, but has made little difference - looking around, it seems a fairly common issue. I've come to the conclusion Landroid just likes to take a shower :-)

              1 Reply Last reply
              0
              • S Offline
                S Offline
                sundberg84
                Hardware Contributor
                wrote on last edited by
                #7

                @Mark-Swift Haha ;) Yes - that can be the reason - its great you dont have to wash it that often then.
                I have heard the issue as well before... I hope you find a good sollution to your problem!

                Controller: Proxmox VM - Home Assistant
                MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
                MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
                RFLink GW - Arduino Mega + RFLink Shield, 433mhz

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  korttoma
                  Hero Member
                  wrote on last edited by
                  #8

                  I finally got my mower yesterday an as soon as I got home from work I just had to MySensor it.
                  It is simply a Sensebender micro on a stick with a microswitch. So far it seems to work as expected.

                  0_1463714877428_WP_20160519_18_47_14.jpg

                  • Tomas
                  1 Reply Last reply
                  1
                  • Danielo RodríguezD Offline
                    Danielo RodríguezD Offline
                    Danielo Rodríguez
                    wrote on last edited by
                    #9

                    Can you provide more details on wiring and more close ups of the circuit and the sensor itself?
                    Thanks

                    1 Reply Last reply
                    0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    13

                    Online

                    12.0k

                    Users

                    11.2k

                    Topics

                    113.4k

                    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