Code Monkey home page Code Monkey logo

esp8266_lawnmower_automation's Introduction

Automation of any lawn mower robot using an ESP8266 / NodeMCU / Wimos D1 Mini using Home Assistant

What I want to achive

  • Ground the boundry wire in case of thunder bold lightning
  • Being able to disable the front lawn using relays and re-routing of the boundry wire
  • Knowing when the lawn mower got stuck (did not come back to charge)
  • Installing a "manual" button to control the front lawn zone

Pre-req´s

This build is based around the home automation system Home Assistant and uses a ESP8266 micro controller to communicate with Home Assistant via wifi. Further more you would also need a lawn mower shelter / house where you can install the system. So the list of pre-req´s before you jump into the build. :)

  • A robotic lawn mower (duuh!)
  • Preferably a shelter/house for the mower
  • Home Assistant installation (can be on a Raspberry Pi for instance)
  • A working MQTT server/broker installed and configured with Home Assistant
  • Some basic skills and know-how for Arduino IDE and programming of ESP8266 micro controllers
  • A wifi network with coverage at the charging base
  • Soldering iron and soldering skills
  • The components, spare cables, connectors and other "nice to have" things from your workshop

Features of this build includes

  • Grounding of the boundary wire in case of thunder bolt lightning
  • Disable from lawn in case of my kids playing there
  • A lever switch to detect if the robot is charging
  • A normal "button" to control if the front yard should be cut or not
  • Automations in Home Assistant to:
    • Timer to alert if the robot has been running for more than two hours (stuck)
    • Automation to turn on a LED strip light if the robot is out working (cutting grass)
    • Automation to turn on a LED strip light if the robot is charging (at home)
    • Automation to turn on a LED strip light + send a notification that the timer has expired and that the robot is now stuck
    • Automation that engages the boundary wire switches and ground the wire if the risk of thunder bold lightning is greater than 70%

The hardware used

The whole build is quite basic, I control two relays and uses to GPIOs for switch input.

  • ESP8266 with at least four GPIOs, I recommend a NodeMCU or a Wimos D1 (mini)
  • Relay board with at least two relays where the coil of the relays accept 3.3 V control
  • Switch filter - 2x 4k7 Resistor and 2x 20 – 100 nano farad capacitor to prevent “ghost switching”
  • DC-DC converter 32 VDC -> 12 VDC
  • DC-DC converter 12 VDC – 5VDC
  • Two 12 VDC car head light relays (alternating relays)
  • IP65 housing
  • Normal wall light switch (IP 44 or higher)
  • Rolling switch with arm
  • Cables of assorted sizes and water proofed connectors
  • Terminal screw block
  • PCB and headers
  • Solder, soldering iron
  • Heat shrink and a heater blower
  • Spare wood and screws to build the arm for the rolling switch
  • A day to spare for the build

Shopping list (Sweden), lawicel.se and kjell.com

(Please note that all components above can be sourced from anywhere. Most components are good bang for the bug except for the DC-DC converters that I find to be a bit expensive…)

The build

I source the power from the lawn mower, you do not have to do that, you can run a separate power to the micro controller and relays if you want. It would be preferred hence you could use one of the relays to turn on/off the power to lawn mower without losing power to your micro controller and relays. If you decide to source for example 12 VDC from another power source than the lawn mower charger then you can drop one DC-DC converter from the build. The built is quite straight forward. Adding the filter for the two buttons and connect in/out of the DC-DC converters.

The Arduino Code

I found this code on the Home Assistant homepage, credits to the HASS community, found the code on this thread: https://community.home-assistant.io/t/arduino-relay-switches-over-wifi-controlled-via-hass-mqtt-comes-with-ota-support/13439/10

The code compiles great in Arduino IDE, it requires the ESP8266 setup as well as the MQTT libs installed. Change the SSID, Password and MQTT details to fit your setup.

Home Assistant

For more details around HASS, please visit: http://www.home-assistant.io/ In the repository above you will see some example code for Home Assistant. Configuration.yaml MQTT server setup Timer Switches.yaml Sensors.yaml Automations.yaml

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.