3D Printed Mower Build Instructions - Wiring Details
For more detail on the wiring of the Lawn Mower please see the following diagrams:
At various stages I have written code to test your components are correctly installed. Most of these test sketches are now integrated into the latest full code version
1. Nearly all of the Arduino sensors and modules operate (or are powered) on 5V. The 5V for the sensors is generated by a step down module which steps down the 12V motor voltage to 5V for the sensors.
It makes sense to group all the 5V+ cables and GND cables from the modules together in parallel. These can be terminated at a wire blocks. Then have a single 5V+ lead going to the Arduino MEGA and a single GND cable going to the Arduino MEGA. This results in a much tidier wiring inside the mower and saves on unnecessary wires
2. It can become quite a mess of wire in the robot. Try and keep wiring colors to
- 5V red
- GND Black
- Communication wires to sensors Green/Yellow/Blue??
The mower uses 3 sonar sensors to detect objects around the mower. If an object is detected the mower stops and turns. The sonar modules require 5V+ VCC / GND / Trig / Echo cables. All the 5V+ wires can be ran in parallel and GND wires can be ran in parallel.
The Sonar modules are wired to the Arduino MEGA as follows:
1:200 GEARED DRIVE MOTORS:
(If you are using the higher powered motors please go to the next section)
The mower is powered by 2x 12V 1:200 Geared DC motors.
12V from the 18650 Lithium Ion battery's (3S) is sent through a switching relay (to turn off main power when docked) to a motor driver. The motor driver sends the pulse signals (PWM) to the drive motors to define the speed the drive motors shall turn at. The Motor driver is connected to the ARDUINO MEGA with 6 wires ENA/IN1/IN2/IN3/IN4/ENB as shown in the diagram.
In the same diagram the Step Down module is shown which is used to power the sensors and is connected to the VIn and GND pins on the ARDUINO Mega.
1:200 GEARED POWER MOTORS:
(If you are using the normal motors please ignore this section)
If you are installing the more powerful rear wheel drive motors you will need to dedicate 1 motor driver to each motor. To convert the motor driver from a double to a single driver the motor needs to be bridged. This is done by connecting the following parts of the motor driver together. With this you double the Amps available to power the motor but can now only power 1 motor instead of 2.
Bridge the following pads on the motor drivers
Out1 -> Out4 / Out2 -> Out 3 / IN1 -> IN4 / IN2 -> IN3
This modification needs to be done to both motor drivers. A new back plate which can locate both motor drivers is available on the Thingiverse site.
The motor signal wires from the Arduino are now simply split to the 2 drivers. 12V power is required at both motor drivers.
MOWER BLADE MOTOR:
The blade motor is also powered by the 12V Lithium Ion Cells. the 12V supply passes through the relay (...which turns off all power to the blade motors when docked) to the 43A motor controller. The motor controller is connected to the ARDUINO MEGA and to the blade motor as shown in the following diagram:
LCD Display, Compass & RTC:
The LCD Module needs to be configured by finding out the I2C address of the module. The I2C address of the module needs to be inputted into the Arduino software for the display to communicate with the ARDUINO MEGA board. Arduino programs to find out the I2C address of the LCD screen can be found in the internet.
The Real Time Clock (RTC) is used when the mower is programmed with start and stop mowing times and dates.
The compass module is used to orientate the mower when the mower is finding the perimeter wire after the mowing has finished. Please take care the compass is orientated correctly in the mower.
After the mow has been completed (due to batteries being empty) the mower needs to locate the boundary wire and follow it back to the charging station. depending on the end orientation of the mower it could follow the maximum length of the boundary wire around the garden which can be problematic. The compass angle (which can be set in the software for your garden) orientates the mower to the optimum angle to move off and find the wire.
The intention later is also to use the compass to smart mow the grass (not in a random turn direction).
The SDA and SGL wires are ran to the LCD display and the compass module from the same pins on the ARDUINO MEGA. A cable needs to be manufactured (soldered together) and ran to these components.
4 BUTTON MEMBRANE SWITCH:
The membrane switch is used to control the options menu on the LCD screen which starts and stops the mower. The membrane switch is connected as per the diagram below:
NANO SERIAL CONNECTION FOR VOLT and AMP Readings:
The Voltage and Amp readings are read by a separate Arduino Nano board. As the perimeter wire detection requires some special software, the normal Analog-read function in the Arduino software is not available. For this reason a separate Arduino Nano is used which then sends the data to the MEGA by serial communication.
The 12V supply from the Lithium-Ion batteries is measured by the Volt and Amp sensors. (the sensors operate on 5V but they are measuring the 12V supply)
For the Volt sensor the 12V +ve and GND lead is measured. the volt sensor measures when the battery is empty and the mower needs to re-charge
For the Amp sensor only the charge GND wire is used. The charge wire is required as we are only interested in the Amp reading when the mower is charging, or to detect when the mower has reached the charge station and should shut down (turn all motors off and turn the relay to off and cut the 12v supply to the motors).
The separate code for the Arduino nano needs to be loaded into the Nano.
The simple wiring for this setup is shown below:
If you are having problems with communications I recommend soldering the wires to the nano. I have found that any sort of loose connection can cause bad data to be sent from the Nano to the MEGA.
PERIMETER WIRE SENSOR:
The perimeter wire is detected by the mower using a Amplifier and a 11P Ferrite 150mH Inductor. A signal is passed through the boundary wire which is detected by this sensor. If the wire detection is erratic try adjusting the amplifier by turning the adjustment screw.
This setup is from the ARDUMOWER project and is not my design
If using a rain sensor the connections to the Nano now look like as below. Please remember to enable the rain sensor in the Arduino code in the Mower Settings section.
See the Main menu for further instructions