DIY Garden Robot Project

Having spend a lot of time researching how to best integrate a robotic lawn mower with my contextual smart home, I started to look at the best model to buy and the integration and maintenance issues that come with these devices. This got me thinking about whether it would be better to build one and this project is my on-going experiment to see what is possible.

My reason for taking this approach is that the robotic lawn mower I was looking at cost over £1200 and even the smallest models seem a bit too big for my relatively small rear lawn area. I'm looking at a robot that is around 45cm long and about 35cm wide but, I'm going to try and make it as compact as is possible. My target budget for my initial build is just £150.

The main advantages of building my own though are:

Like all my smart home projects, this one aims to improve our quality of life.

Design

I initially started this project with a robotic lawn mower in mind but this got me thinking about what else it could do? Cutting my grass is the primary goal though. Building my own garden robot / lawn mower opens up a whole new set of opportunities to try out new things around adding more context to my contextual smart home and also adding some mobile security features to my smart home.

Networking

It simply makes a low of sense for my garden robot to connect to my home Wi-Fi network. A mesh Wi-Fi system ensures excellent coverage around my garden, with enough speed to easily support high quality video streaming.

Power

Robotic mowers are typically powered using a Lithium-ion battery which is recharged at a docking station. Initially, I'm using an old Yuasa lead-acid 12V 7aH battery I have to hand to enable me to test.

The motors and motor controllers will use the batteries 12V supply but, the Arduino will be powered via a dc-dc convertor, which will step the 12V down to 5V.

Control

The assumption is that my garden robot will interface to my contextual smart home using my unified communications protocol. This will allow both query and control, along with regular reporting from the robot.

At the heart of my garden robot, I plan to use an Arduino Mega 2560 Pro. This cheap open-source hardware is extremely powerful, uses very little power and has loads of I/O capability.

Navigation

Compass

There is a readily available and cheap GY-511 module for the Arduino that includes a 3-axis accelerometer and a 3-axis magnetometer. This will allow my robot to know which direction it is pointing and whether it has fallen over.

The module uses I2C for communication and requires just 4 connections to the Arduino. The Arduino IDE library manager allowed me to install the compass LSM303 library by Pololu and I followed this tutorial to calibrate the compass.

GPS

I happen to have a spare MakerHawk GPS module 51 available for Arduino too. This should provide some reasonably accurate positioning data.

Boundary Wire

Most robotic lawn mowers use a boundary wire to define the cutting area. This is a closed loop wire that emits a specific frequency and the strength of signal detected provides an indication of how close the robot is to the boundary wire and on which side of the robot it is.

Guide Wire

A guide wire is used to help the robot return to the docking station. It works on the same principle as the boundary wire but uses a different frequency.

Smart Home Slave

My robot is a slave processor and uses my extensive library to send 'heart beats' to my Home Control System.

Sensors

A sensor will be used to measure the 'Garden Robot Battery Voltage' and this will be converted into a virtual sensor called, 'Garden Robot Battery Level', a percentage between 0% and 100%.

A binary sensors called 'Garden Robot Docked' will signal when the robot is docked and can detect charging power.

A binary virtual sensor called 'Garden Robot Network' will be used to track when the robot is connected to my home network.

The garden robot reports changes in 'Numeric' sensors called 'Garden Robot Altitude', 'Garden Robot Latitude', 'Garden Robot Longitude' and 'Garden Robot Speed'.

I plan to use these long micro-switches to provide sensing bumpers at the front and rear of the robot. These will be mounted using 3D printed mounts and be used for collision detection. The long arms on the switches allow me to fix longer 'bumpers' to my robot.

Appliances & Devices

The actual grass cutting / mowing module will be modelled as an appliances called 'Garden Robot mower'. This can be switched on or off by the robot and is used to report status. The reason for this is that the robot will sometimes move without trying to cut the grass.

I plan to add two 12V 50mm LED bulbs to the front of this robot, to light up the garden in front of it at night.

I plan to put a loud, 12V sounder on the robot, so that it can signal an alarm if need be.

Grass Cutting

My research shows that all the mainstream robotic lawn mowers use a similar technique to cut the grass. A rotating disc has a number of 'floating' (pivoted) blades (typically 3) and spins at high speed (typically around 2300rpm). The use of floating blades means that the cutting 'disk' is less likely to be stopped spinning by obstacles.

It makes no sense to re-invent the wheel (or cutting disk) and I'm using readily available spares for this function. A typical cutting disk is around 22cm in diameter and my robot should be able to accommodate something around this size too. This means that my smaller robot should be able to cut the grass much closer to the edge of my lawn.

I picked up 30 high-quality robotic lawn mower blades for not a lot of money, complete with the fixing screws. These blades are fixed such that they pivot and are usually fixed to the edge of a spinning disk. Most robotic lawn mowers seem to use three blades.

Wheels

Typically, robotic lawn mowers have two drive wheels and two smaller castor wheels at the front. This allows the robot to rotate on the spot, reverse and maintain good drive, whilst maintaining a consistent height for the cutting blades. I see no reason not to adopt a similar approach.

Because my lawn is relatively small, I plan for my robot to travel at lower speeds than the commercial robot lawn mowers I've looked at. My calculations show that it will travel at a top speed of 6.1 m/min (0.1 m/s), which means it takes just under 10 seconds to travel 1 meter.

For the main drive wheels I'm using these nylon wheels with an aluminium flange boss. These wheels are 195mm in diameter and should enable the robot to traverse any lumps and bumps in my lawn.

Drive Motors

I'm using 12V dc drive motors with integrated gearboxes and these will use PWM to allow soft-start and speed control. The motors are geared for 12 rpm and are powerful. So far, these are the most expensive part of the robot having paid £90+ for these two motors.

The motor physical specification.

Drive Motor Controllers

For the drive motors, I'm using a dual H-bridge module with IRF3205 MOSFETs. This is rated at 15A per channel, 30A peak. It's over-kill for this application really.

Castors

With two driven wheels, the robot can spin and travel in either direction. To maintain balance though, two smaller castors are used at the rear. These help keep the cutting disk level and at a set height. The castors need to be big enough to handle bumps in the lawn though. I had a couple of heavy duty castors spare with a wheel diameter of 75mm.

Smart Home Control

The robot will respond to a range of commands and report back it's state. Valid states are currently:

Smart Home Integration

To enable this level of robotic lawn mower control, I have written a new Java class to model the mower and all its characteristics. This can then inherit all of the whole home context and have real-time access to the state information of everything else connected to my smart home.

My smart home will then communicate with my robot using my home network.

My contextual smart home does a regular check to see if all the conditions are met to run the mower (battery level, raining, etc.) and tracks when the mower was last deployed, recalled or completed a cut. From this it then decides whether the mower should be deployed or not. Some events (garden occupancy, rain sensor detecting rain, etc.) cause this check to happen instantly, in case the mower needs to be recalled.

Build

GPS Module

I started my testing with the GPS module as this was new to me and I wanted to check the viability of it. I used this tutorial and got it working in less than 5 minutes. My robot now has longitude, latitude, altitude, speed and a real-time clock :-) I could even get good GPS data from the module when it was indoors.

GY511 Compass Module

I tested my GY511 module and calibrated it. My robot now has accurate heading information.

Motor

To test the motor, I designed and 3D printed a mount for it. I then tested the output shaft speed at various voltages. I plan to use PWM, to enable speed control. At 12.0V, the shaft speed was 12rpm as specified, at 9.0V ir was 8.8rpm and at 6.0V it was 6rpm. The motor would run easily down to 3.0V.

I now have code written the left and right motors in either direction and with speed control using PWM.

Chassis

Having measured all the components, I want to trial fit them to a test chassis, to get a feel for the shape and size of my robot. My first test chassis was cut from 6mm thick MDF and painted. This results in a robot that is 48cm long × 34cm wide.

The cutting motor will sit between and slightly behind the drive motors. The cutting area will be 22cm in diameter.

At the rear of the robot are two castor wheels, slightly inboard, to give them room to fully rotate.

The castors are about 20mm too tall, so I need to find smaller ones or mount them differently.

Boundary Wire

This is a pretty good YouTube video that explains how best to install the boundary wire and kind of distances you need to leave from walls, trees, etc.

The boundary wire is quite thick and is both UV prptected and weatherproof. It made sense to buy wire specifically designed for this purpose and I bought a 50m roll of boundary wire for £19.

To fix the boundary and guide wire, I also bought some of these fixing pegs. They cost £12 for 100.

Boundary Wire Sensing

I thought about designing and building my own wire transmitter and boundary wire sensors but then I found this kit for just £8 which does exactly what I need. My intial testing will be done using this hardware.

I've soldered this kit up. The transmission module uses a 555 IC to generate a 34kHz signal in the wire. This ideally needs to be calibrated against the receiver though, to ensure maximum range.

Cutting Disk

I have designed the cutting disk to be 3D printed, to check my measurements and also to act as a template for the final aluminium version. It keeps the edge of the blades within the 22cm diameter circle on the robot that clears the wheels and other parts. It's mounted on a motor hub fixing.

Most robotic lawnmowers have adjustable height cutting and can cut the grass from about 2cm to 7cm, though a few go as low as 1cm. My design will allow adjustment from about 1cm to 6cm but I'm starting with 4cm.

This is the prototype cutting disk assembled with the three blades attached using the supplied 4mm pivot bolts.

Testing

Test 1 - Drive Test ✔

This was my first chassis and motor test, to check the basic layout work. The motors are running at 100% and I will use PWM to allow speed control.

Test 2 - Grass Cutting

This test involves checking the robot can cut grass whist moving.

Test 3 - Boundary Wire

My first planned test is to have my robot roam around the perimeter of the lawn area, following the boundary wire. This requires the boundary wire sensors to be working, the boundary wire to be installed and basic navigation skills programmed.

Summary

The goal with this project is to cheaply test out the feasibility of building my own garden robot, which has a primary function of being a robotic lawn mower. You can follow my progress here as I test out the various elements and bring them all together into a working robot. My initial design decisions are to get something working fairly quickly. I do expect to have to upgrade some elements as my testing progresses.