3D Printed Lawn Mower - WiFi & APP
To gain WIFI connectivity to the mower we are going to connect the mower to the home WIFI network. This means of course that your mower needs be able to receive WIFI in your garden. If the mower looses the WIFI connection the APP won't be able to communicate with it until it has WIFI signal again
To do this we will use a NodeMCU board and the BLYNK APP.
NodeMCU Connections and Arduino IDE
The NodeMCU board is added to the mower with a few simple connections
To allow the Arduino IDE to upload code to the NodeMCU board we need to add the ESP functionality to the Arduino IDE.
In the settings menu add this URL address to the additional boards manager box, then press OK. This will let Arduino download the necessary software to communicate with the NodeMCU board.
In the boards menu now select boards and type ESP in the search field.
Install the latest version of the ESP board software.
You should now have NodeMCU 1.0 as an option in the boards menu.
Open the NodeMCU code from my GITHUB site in the Arduino IDE. Now update the "WLAN Name" network (name of your WiFi network take care with case sensitivity) "password" and "App Key Code" (Auth Code- see below about the BLYNK APP to get that code)
Download the BLYNK libraries from the BLYNK website or from my GITHUB site if you want to ensure you are using the same libraries as I am.
Then upload the Arduino code to your NodeMCU board using the Arduino IDE
The Nodemcu board should now connect to your WiFi network and to the BLYNK server using the Auth Code.
You can check that the NodeMCU is connecting properly by viewing the serial monitor of the NodeMCU.
How to Create the Blynk App
To have access to the ReP_AL Lawn Mower via a smartphone we are going to use the Blynk App. With this we can quickly create a smartphone app to talk to the NODEMCU board in the mower:
1. Download and install the Blynk App on your smartphone from the Googe Play or Apple Store. Search for 'Blynk App'. Once installed create an account.
2. The Blynk App works by buying credits for the different types of functional buttons/widgets you use in the APP. In the Blank App we are going to need roughly 3000 credits. Check how many credits you have. An additonal package of 5000 credits costs €4.99.
We will use the following widgets in the APP
8 Buttons : 200 credits each = 1600 Credits
2 Value Displays : 200 credits each = 400 Credits
6 LED's : 100 credits each = 600 Credits
1 Segmented Switch : 400 credits
Total = 3000 Credits.
3. Create a new project in you smartphone BLYNK app: Call this ReP_AL Mower (or whatever you want), select NodeMCU as the device and WIFI as the connection type.
Once the APP is created the APP auth token will be sent to you email account address.
You will need this code for the NodeMCU arduino code. This code links the NodeMCU board to this APP.
(If you have more than 1 ReP_AL Mower to control then you will need to create an APP per mower so that each mower has a seperate Auth Token. Once the APP is created it can be duplicated.).
Make sure you have enough credits to buy the buttons/widgets we need (about 3000), then we can start to assemble the APP. This will take around 15-20mins
4. Add 4 buttons to the screen and then resize and position them as shown below. You can add features by pressing the + button on the menu bar. This brings up the 'Widget Box.
Once the widget is added to the APP desktop you can move and resize the buttons by long pressing it and using the frame options provided.
5. We will now label the buttons and assign them 'Virtual Pins'. By tapping on the button you will be presented with the buttons attributes.
- In OUTPUT select 'Virtual Pin' by scrolling the menu, then select the correct Virtual Pin number for each button.
- For all buttons keep the button Type as Push
- Select the button colour as in the pictures below
- For all buttons remove the word Button by adding a space to the box.
- The buttons can be labelled by changing the text in the ON/OFF Labels box
The 4 buttons should have the following attributes.
|Button Position||Virtual Pin||Colour||Label|
|Top Left||V2||Red||Pause / Stop|
|Top Right||V0||Orange/Yellow||Quick Start|
|Bottom Left||V10||White||Exit Dock|
|Bottom Right||V1||Blue||Go to Dock|
It is important that the virtual pins are assigned correctly to each APP button otherwise the APP will not work correctly or behave strange.
(Colour and Text is up to you, but it's best to stick to the instructions here before you start to customise it)
6. Now add 2 Value Display and 6 LED features/widgets to the APP and arrange them as in the screenshots below:
Give the new widgets the following attributes by clicking on the widget and modifying the settings.
|Button Type||Virtual Pin||Label (OFF)|
7. Add 4 more buttons to the APP and position them as shown. These buttons will allow the mower to be steered manually..! :)
Give these 4 buttons the following attributes:
|Button||Virtual Pin||Label (OFF)|
10. Finally we need to add a segmented switch to the APP. Again position the switch as shown in the screenshot and give it the following attributes.
Option 1 - Automatic
Option 2 - Manuel
The APP is now complete and should look exactly like this when running.
Pressing the play button in the BLYNK menu will start the APP. The APP will now start to look for the connection to the NodeMCU. The APP works through the BLYNK server, so it can be controlled from your smartphone anywhere you have a data connection (WIFI or Cell phone provider data). Yes that means you can control your mower from anywhere.....! :)
Basic APP Features:
The APP will give you access to the mower anywhere you have a cell phone data or wifi connection.
Please be patient with the buttons. You will need to give the mower time to execute the command. Pressing many buttons at once will just confuse it :)
In Automatic Mode these features can be used.
Quick Start - Will start the mower (cant be used if the mower is docked)
Pause/Stop - Parks the mower and can be restarted with Qucik Start
Exit Dock - Reverses the mower out of the docking station and tracks the garden to Zone 1.
Go To Dock - Stops the mowing and sends the mower back to the dock using the perimeter tracking feature.
(In Manuel mode none of the above buttons will work)
Show the current status of the mower.
Volts and Loops
Shows the current battery voltage and loops progress to let you know that the mower is actually moving
Enables the direction keypad where you can manually steer the lawn mower. Tap the keys to steer.
There is not button to start the blades cutting. I thought about this then decided against it for safety.