Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Last summer it was brought to my attention that you could buy nearly everything you needed for automated lawn care but a seed spreading robot. This intrigued me. For starters, why on Earth would anyone make lawn care robots in the first place? There are countless reasons this seems like a bad idea. Secondly, a seed spreading robot sounded like a bizarre robotic cross between Wall-E, and Johnny Appleseed. The idea clearly had potential.

So, when asked if I wanted to actually take on the challenge of building one, I obviously responded with a definitive yes. Even though I personally don't own a lawn (my backyard is concrete and weeds), it seemed like an opportunity too good to pass up. In terms of actually using it, I found a willing victim in Glenn Derene of Popular Mechanics. He was more than happy to let this thing loose on his lawn (along with a slew of other robotic lawn care contraptions). So one fateful day last summer, I tightened the last bolt, wrote the last line of code, packed it up safely, and shipped it cross country to meet whatever fate lie in store.

Albeit I only later saw a video of it in action, it is my understanding that it performed about as well as you would expect an experimental DIY seed spreading robot to perform on its initial run; in short, not very. Rather than a cross between Wall-E and Johnny Appleseed, it is more of a cross between Johnny 5, and the groundskeeper in Caddyshack.

Nonetheless, I think the structural design of the robot is solid. If the code is tweaked a bit, and the rangefinder repositioned, I think this robot could spread seed like a champ.

Step 1: Go Get Stuff

Seed Spreading Robot
You will need:

(x1) Lynxmotion Tri-Track Chassis Kit
(x1) Earthway EV-M-Spred Seed Hopper (or similar)
(x1) Arduino Uno
(x1) Arduino Motor Shield
(x1) Parallax Ping Rangefinder Sensor
(x1) 1/4 Scale Servo
(x1) Lynxmotion 12v battery
(x1) Vex battery charger
(x1) M-type plug
(x2) Multipurpose Prototype Circuit Board
(x1) Dual Mini Prototype Circuit Board
(x1) 7805 voltage regulator
(x1) Heat sink
(x1) Thermal transfer paste
(x1) 10 uF capacitor
(x4) 0.1uF capacitor
(x1) 1K resistor
(x20) Header pins
(x1) ATS177 hall effect sensor
(x2) 1/8" rare earth magnet
(x4) 1-1/4" aluminum spacers
(x4) 1-1/2" x 6-32 nuts and bolts
(x1) 12" x 24" x 1/8" acrylic
(x1) 6" x 6" x 1/4" plywood
(x12) 1/4" nylon spacers
(x12) 1" x 6-32 nuts and bolts
(x4) 1-1/2" x 4-40 nuts and bolts
(x8) 1/4" nylon spacers
(x6) pens
(x6) 1/4 x 6" nuts and bolts
(x4) 1-1/4" aluminum spacers
(x4) 2" x 6-32 nuts and bolts
(x1) Assorted zip ties
(x1) Assorted shrink tube
(x1) Krazy Glue (gel)
(x1) Thread lock
(x1) 24" x 24" cardboard sheet


You will also need to download and cut out the following files:

SensorHolder.eps -- cut out of 1/8" acrylic and etch away the black square 1/16" down
HopperDrillBracket.eps -- cut out of cardboard
TopBracket.eps -- cut out of 1/8" acrylic
ServoBracket.eps -- cut out of 1/8" acrylic
ServoConnector.eps -- cut out of 1/4" plywood
BottomDrillBracket.eps -- cut out of cardboard
PingBracket.eps -- cut out of 1/8" acrylic
Seed Spreading Robot
BottomDrillBracket.eps327 KB
Seed Spreading Robot
HopperDrillBracket.eps63 KB
Seed Spreading Robot
PingBracket.eps45 KB
Seed Spreading Robot
SensorHolder.eps37 KB
Seed Spreading Robot
ServoBracket.eps227 KB
Seed Spreading Robot
servoConnector.eps39 KB
Seed Spreading Robot
TopBracket.eps327 KB

Step 2: Assemble the Treads

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Show All 7 Items
Assemble the treads by lining them up side-by-side, inserting a clear tube between the aligned rings, and pressing in the plastic pins until they snap in place.

You should be left with two long strips. Set aside the hardware necessary for closing the loops for later.

Step 3: Attach Spacers

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Find the two triangular lexan panels with interior mounting slots and holes. Attach the aluminum spacers using 4-40 x 3/8" bolts, such that they mirror each other, and are not identical copies.

Step 4: Attach the Motor

Seed Spreading Robot
Seed Spreading Robot
On one of the triangular lexan panels, insert a motor shaft through the largest mounting hole such that it is pointing in the same direction as the aluminum standoffs.

If you have not done so already, cut out a 1/8" acrylic sensor holder using the attached pattern. Where the pattern has a black square, etch halfway into the acrylic to make a channel to mount the sensor.

Align the acrylic sensor holder with the motor mounting holes. Fasten the motor and the acrylic sensor holder in place with 3mm x 8mm steel screws.
Seed Spreading Robot
SensorHolder.eps37 KB

Step 5: Attach the Other Motor

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Attach the other motor in a similar manner to the previous one. However, do not worry about mounting an acrylic sensor holder on this side.

Step 6: Drill Holes

Seed Spreading Robot
Seed Spreading Robot
Drill a 1/16" hole directly above the acrylic sensor holder that is centered along the width of the etched square. Drill two more holes that are aligned with the corners of the etched square.

Step 7: Rotational Counter

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Bend the hall effect sensor leads to a right angle (away from the text). Insert the hall effect sensor leads through the three holes that you just drilled and position it snugly in place. When you have managed to get it flush with the surface of the acrylic sensor holder, glue the sensor in place.

Step 8: Hub Counter

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Show All 7 Items
Find one of the hubs that slides on the motor shaft.

Cover the threads of two 4-40 x 3/8" bolts and thread them all the way down into the hub such that they are opposite from each other.

Now is time to place magnets upon the head of each bolt and glue them in place. However, before gluing, it is important that the magnets are facing in the correct polar direction.

Here is some basic code for checking the hall effect sensor and making sure that you put the side of the magnet that triggers the sensor facing up atop the bolt.

/* Hall Effect Example Code * Connect a 1K resistor from 5V to pin 2. * Connect a 0.1uF capacitor between pin 2 and ground. * Connect the hall effect output pin to pin 2. * Connect power and ground from the Arduino to the appropriate hall effect sensor pins. This example code is in the public domain. */ int sensorPin1 = 2; // sensor on pin 2 int sensorState1; // variable for reading the sensor void setup() { //set pin 2 as an input pinMode(sensorPin1, INPUT); //begin communication to the serial monitor Serial.begin(9600); } void loop(){ // read the sensor pin sensorState1 = digitalRead(sensorPin1); // check if the sensor is activated. // if it is, the sensor goes LOW: if (buttonState1 == LOW) { // print to the serial monitor: Serial.println("magnet present"); } }

Step 9: Attach the Hubs

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Attach the hub with the magnets to the motor shaft of the assembly with the hall effect sensor such that the top of the hub is flush with the top of the motor shaft.

Repeat this process for the other hub and motor shaft.

Step 10: Attach a Sprocket

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Place together two sprocket halves and bolt them to the hub without the hall effect sensor using 4x40 x 5/8" bolts.

Step 11: Trim a Sprocket

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Take one of the sprockets and cut away the outer rim with a saw such that the teeth are flush with the edge.

This sprocket will be used on the inside edge of the motor hub with the magnets attached. This will allow it to rotate without rubbing against the hall effect sensor bracket.

Step 12: Attach Trimmed Sprocket

Seed Spreading Robot
Attach the trimmed sprocket facing in towards the hall effect sensor, and an unaltered socket facing outwards.

Fasten them both in place with 4-40 x 5/8" bolts.

Step 13: Roller Sprockets

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Put together a roller sprocket by inserting an idler hub through the center holes of two sprocket halves. Fasten the assembly with 3mm x 8mm steel bolts.

Repeat another 3 times.

Step 14: Mounting Blocks

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Attach the mounting blocks to the triangular lexan panel on the same side as the motor body using 4-40 x 3/8" bolts.

Step 15: Assemble

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Put the roller sprockets in place.

Cover each of the aluminum spacers with a nylon roller.

Finally, finish the assembly by aligning the unsused triangular lexan panels over the spacers and locking them in place with 4-40 x 3/8" bolts.

Step 16: Wrap the Treads

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Wrap the treads around the motorized sprocket assembly.

Make sure they are aligned properly over the sprockets, and then close the final linkage to complete the loop.

Step 17: Remove the Lever

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Remove the crank lever from the seed spreader.

Step 18: Remove Screws

Seed Spreading Robot
Seed Spreading Robot
Remove the screws holding the gear box cover in place.

Step 19: Drill Holes

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Show All 7 Items
Open up the seed spreader's gear box and remove the large gear.

Print out the attached template and use it as a guide to make marks for drilling.

Drill through those four marks with 1/8" drill bits.
Seed Spreading Robot
HopperDrillBracket.eps63 KB

Step 20: Bolt Together

Seed Spreading Robot
Seed Spreading Robot
Insert 1" x 6-32 bolts through the four holes that were just drilled from the inside on out.

Cut out the top 1/8" acrylic bracket if you have not done so already using the attached template.

Slide the top acrylic bracket onto these bolts and fasten it into place.
Seed Spreading Robot
TopBracket.eps327 KB

Step 21: Seed Spreader Brackets

Seed Spreading Robot
Cut two acrylic servo brackets to affix the servo motor to the seed spreader using the attached files.
Seed Spreading Robot
ServoBracket.eps227 KB

Step 22: Close it Up

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Insert the large gear back into place, put the gear box cover back on, and place the acrylic servo bracket with the large center hole over the cover so that the outer mounting holes lines up with the spreader's bolt holes.

Use the gear box mounting screws to firmly close the case and hold the bracket in place.

Step 23: Insert Servo

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Insert the servo into the other acrylic servo bracket with the large rectangular hole. Bolt the servo into place with 6-32 x 1" nuts and bolts.

Step 24: Servo Connector

Seed Spreading Robot
Cut two servo connectors out of 1/4" plywood using the attached template.
Seed Spreading Robot
servoConnector.eps39 KB

Step 25: Drill

Seed Spreading Robot
Seed Spreading Robot
Drill holes in the servo's horn using a 3/16" drill bit.

Step 26: Affix

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Zip tie the servo horn to the wooden servo connector. Trim away any excess zip tie tails.

Push this assembly onto the servo shaft.

Step 27: Servo Assembly

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Connect the two acrylic servo brackets together with 2" nuts and bolts, using 1-1/4" spacers in between. Also, while doing so, insert the seed spreader's crank shaft into the center of the wooden servo connector. In this way, when the servo rotates, the crank shaft should turn.

Step 28: Drill the Base

Seed Spreading Robot
Seed Spreading Robot
Download the attached drilling guide and use it to drill six 1/4" holes along the outside edges of the bottom lexan panel.
Seed Spreading Robot
BottomDrillBracket.eps327 KB

Step 29: Attach Base Spacers

Seed Spreading Robot
Seed Spreading Robot
Attach aluminum spacers along the two center rows of holes of the bottom lexan panel (the one without the large rectangular hole) using 4-40 x 3/8" bolts.

Step 30: Mark and Drill

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Place the Arduino and one half of the dual mini circuit boards onto the back center of the bottom lexan panel (the side that narrows).

Make marks for drilling.

Drill all of these holes with a 1/8" drill bit.

Step 31: Heat Sink

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Apply thermal compound to the back of the 7805 voltage regulator, and then bolt it to the heat sink.

Step 32: Start the Power Board

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Solder the 7805 regulator to the square circuit board.

Solder a 10uF / 50v capacitor between Vin and ground, making sure the negative lead goes to ground.

Solder a 0.1uF capacitor between the regulated Vout and ground.

Step 33: Finish the Power Board

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Solder the heavy gauge red wire with the switch attached (part of track chassis kit) to Vin and the heavy gauge black wire to ground.

Solder two additional stranded wires to ground.

Solder another stranded wire to Vin, and a different wire to Vout (but you may not need this wire).

Step 34: Mod the Motor Controller

Seed Spreading Robot
Seed Spreading Robot
Cut off the Vin pin from the motor controller to separate the motor controller shield from the Arduino power source and help prevent potential short circuits.

Step 35: Insert

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Insert the modded motor controller shield into the Arduino.

Step 36: Attach the Arduino

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Attach the Arduino to the lexan base plate by putting it on 1/4" nylon spacers and bolting it in place with 4-40 x 2" nuts and bolts.

Step 37: Attach the Power Board

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Place the power board atop 1/4" nylon spacers and fasten it in place with 6-32 x 1" nuts and bolts.

Step 38: Pen Tubes

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Take apart six pens so that you can use the hollow tubes.

Step 39: Assemble the Base

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Pass 6" x 1/4 bolts up through the six 1/4" holes that were drilled earlier in the upper lexan base panel.

Place the upper lexan base panel atop the aluminum spacers attached to the bottom panel. Fasten the top panel in place using 4-40 x 3/8" bolts.

Step 40: Cover the Bolts

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Slide the pen tubes over the 6" bolts, such that they are working as spacers.

Step 41: Bottom to Top

Seed Spreading Robot
Seed Spreading Robot
Insert the tips of the 6" bolts through the mounting holes in the acrylic bracket connected to the seed spreader and fasten it firmly in place using 1/4 nuts.

Step 42: Capacitors

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Solder 0.1uF capacitors between the motor terminals in such a manner that you can still slide the motor wire connector cables onto the terminal.

Step 43: Put it All Together

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Slide the base lexan base into the the slots on the track assemblies.

Fasten the lexan base to the aluminum mounting blocks on the track assemblies using 4-40 x 3/8" bolts.

Step 44: Insert the Switch

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Pass the toggle switch that is connected to the thick battery cable through the remaining 1/4" hole in the upper lexan base assembly. Fasten it in place with its mounting nut.

Step 45: Wire the Plug

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Take one of the red wires soldered to 12v on the power board and another that is soldered to ground.

Screw apart the plug assembly and slide the cover onto the wires.

Solder the red wire to the center terminal and the black wire to the outer terminal, and trim any excess so that they don't bridge.

Screw the cover back on when you are done.

Step 46: Insert

Seed Spreading Robot
Insert the M-Type plug into the Vin socket on the Arduino.

Step 47: Trim

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Take a prototype circuit board and cut it down to be 1" by 3/4". I find a standard pair of scissors or a paper cutter work well for cutting up circuit boards.

Step 48: Range Finding Assembly

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
If you have not done so already, download the attached template and use it to cut a rangefinder bracket out of 1/8" acrylic.

Pass the rangefinder leads through the three small holes in the front of the bracket such that the rangefinder is roughly lined up with the edge of the bracket.

Slide the circuit board onto the rangefinder leads and solder it into place.

Respectively insert 6" red, black, and green wires through the three other small holes in the acrylic, and onward through holes in the PCB. Solder them in place as well.

Connect and solder the red wire to the 5v pin on the rangefinder.

Connect and solder the black wire to the ground pin on the rangefinder.

Connect and solder the green wire to the data pin on the rangefinder.
Seed Spreading Robot
PingBracket.eps45 KB

Step 49: Attach the Range Finder

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Mount the range finder to the front servo mounting holes in the upper lexan bracket atop 1/4" nylon spacers using 1" x 6-32 nuts and bolts.

Step 50: Header Pins

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Insert three header pins into the 5V power and two ground sockets on the Arduino. Insert another five header pins into the digital pin sockets 2 through 7.

Also, insert two headers into digital pins 9 and 10 (not pictured).

Keep the headers in place, and press down a prototype circuit board onto them.

Solder the headers to the circuit board.

Step 51: Start the Circuit

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Solder a 3 pin header to the top side of the circuit board. Connect one of the outer pins to ground, the center pin to 5V, and the other outer pin to digital pin 10 (pictured incorrectly).

Solder a 1K resistor and 0.1uF capacitor in series on the circuit board. Connect their center point to digital pin 5.

Step 52: Wire Up the Hall Effect Sensor

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Attach a 6" red wire to the outer power pin on the hall effect sensor.

Attach a 6" black wire to the center ground pin on the hall effect sensor.

Attach a 6" green wire to the outer signal pin on the hall effect sensor.

Put heat shrink tubing over each of these connections individually, and zip tie them together for strain relief.

Step 53: Wire in the Hall Effect Sensor

Seed Spreading Robot
Attach the green wire to the central junction between the 1K resistor and 0.1uF capacitors (that is already also connected to digital pin 5).

Solder the black wire to the other leg of the 0.1uF capacitor.

Solder the red wire to the other leg of the 1K resistor.

Step 54: Solder the Rangefinder

Seed Spreading Robot
Solder the green wire from the rangefinder to digital pin 7 on the Arduino.

Solder the red wire to the Arduino's 5V pin, and the black wire to the Arduino's ground pins.

Step 55: Plug In the Servo

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Plug the servo into the header pins that were attached earlier. Make certain that the servo's yellow wire is going to digital pin 10 on the Arduino.

Step 56: Connect the Motors

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Attach the motor connector wires to the motors by sliding them onto the motor terminals such that both yellow wires go to the plus terminal and both green wires go to ground.

Step 57: Wire the Motor Shield

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Insert the red wire from the motor on the right to the negative terminal of channel "A" on the motor shield. Insert the yellow wire from the right motor into the positive terminal of channel "A".

Insert the red wire from the motor on the left to the negative terminal of channel "B" on the motor shield. Insert the yellow wire from the right motor into the positive terminal of channel "B".

Insert the remaining 12v wire from the power board into the Vin terminal, and the ground wire into the ground terminal.

Step 58: Attach the Battery

Seed Spreading Robot
Seed Spreading Robot
Place the battery between the two motors and zip tie it into place.

Step 59: Connect

Seed Spreading Robot
Plug the battery connector into the socket coming from the switch / power board.

Step 60: Program

Seed Spreading Robot
Program the Arduino with the following code:

/* Seed Spreading Robot Example Code For more information visit: http://www.instructables.com/id/Seed-Spreading-Robot/ This code is in the public domain. */ int motorRotateCounter = 0; // counter for the number of motor rotations int hallState = 0; // current state of hall effect sensor int lastHallState = 0; // previous state of the hall effect sensor // establish variables for duration of the ping, // and the distance result in inches and centimeters: long duration, inches, cm; // servo2 is connected to Arduino pin10 #define servo2control OCR1B //servo constants -- trim as needed #define servo2null 2980 ////////// const int pingPin = 7; ////////// int StoredMotorData = 0; //change this number to change the amount of left / right rotation - in milliseconds int LeftRotation = 900; int RightRotation = 1000; //how soon the robot will brake from obstacles - in inches int wallDistance = 15; //the tightness of stripes across the lawn int nextRow = 1000; void setup() { pinMode(5, INPUT); //hall effect pinMode(10,OUTPUT); //servo PWM pin TCCR1B = 0b00011010; // Fast PWM, top in ICR1, /8 prescale (.5 uSec) TCCR1A = 0b00100010; //clear on compare match, fast PWM // to use pin 9 as normal input or output, use TCCR1A = 0b00100010 // to use pin 10 as normal input or output, use TCCR1A = 0b10000010 ICR1 = 39999; // 40,000 clocks @ .5 uS = 20mS servo2control = servo2null; // controls chip pin 16 ARDUINO pin 10 //Setup Channel A pinMode(12, OUTPUT); //Initiates Motor Channel A pin pinMode(9, OUTPUT); //Initiates Brake Channel A pin //Setup Channel B pinMode(13, OUTPUT); //Initiates Motor Channel A pin pinMode(8, OUTPUT); //Initiates Brake Channel A pin //wait 5 seconds before going delay(5000); //set inches above one foot inches = 24; Serial.begin(9600); } void loop() { // disengageBrake(); //drive forward forward(); //Start the seed spreader servo servo2control = 2000; delay(10); checkForRotation(); PingRead(); //PING sensor test //Serial.println(inches); if(inches < wallDistance) { //stop driving engageBrake(); //stop the seed spreader servo2control = servo2null; //wait two seconds delay(2000); //check the distance again. //this is to account for things moving in front of it briefly //and false readings PingRead(); //if there is still something in front of it, it is probably the fence if(inches THEN STOP!!!!! // if(inches < wallDistance) { //wait two seconds delay(2000); //check the distance again. //this is to account for things moving in front of it briefly //and false readings PingRead(); //if there is still something in front of it, it is probably the fence if(inches motorRotateCounter){ forward(); delay(50); checkForRotation(); } motorRotateCounter = 0; StoredMotorData = 0; engageBrake(); servo2control = servo2null; // // TURN LEFT // delay(500); disengageBrake(); left(); delay(LeftRotation); engageBrake(); // // DRIVE FORWARD A LITTLE HERE // delay(100); disengageBrake(); forward(); delay(nextRow); engageBrake(); // // CHECK DISTANCE - IF WALL WITHIN DISTANCE --> THEN STOP!!!!! // if(inches < wallDistance) { //wait two seconds delay(2000); //check the distance again. //this is to account for things moving in front of it briefly //and false readings PingRead(); //if there is still something in front of it, it is probably the fence if(inches < wallDistance) { while(1) { }; } } // // left again // delay(500); disengageBrake(); left(); delay(LeftRotation); engageBrake(); //wait two seconds before driving back delay(2000); } } } void checkForRotation() { // read the hall effect input pin: hallState = digitalRead(5); // compare the hall effect state to its previous state if (hallState != lastHallState) { // if the state has changed, increment the counter if (hallState == HIGH) { // if the current state is HIGH then the sensor // wend from off to on: motorRotateCounter++; Serial.print("number of half rotations pushes: "); Serial.println(motorRotateCounter); } } // save the current state as the last state, //for next time through the loop lastHallState = hallState; } /////////////////////????//// // drive motor functions // ///////////////////////////// void engageBrake() { digitalWrite(8, HIGH); //Engage the Brake for Channel A digitalWrite(9, HIGH); //Engage the Brake for Channel B } void disengageBrake() { digitalWrite(8, LOW); //Engage the Brake for Channel A digitalWrite(9, LOW); //Engage the Brake for Channel B } void forward() { //Motor A forward @ full speed digitalWrite(12, LOW); //Establishes forward direction of Channel A digitalWrite(9, LOW); //Disengage the Brake for Channel A analogWrite(3, 255); //Spins the motor on Channel A at full speed //Motor B backward @ half speed digitalWrite(13, HIGH); //Establishes backward direction of Channel B digitalWrite(8, LOW); //Disengage the Brake for Channel B analogWrite(11, 255); //Spins the motor on Channel B at half speed } void backward() { //Motor A forward @ full speed digitalWrite(12, HIGH); //Establishes forward direction of Channel A digitalWrite(9, LOW); //Disengage the Brake for Channel A analogWrite(3, 255); //Spins the motor on Channel A at full speed //Motor B backward @ half speed digitalWrite(13, LOW); //Establishes backward direction of Channel B digitalWrite(8, LOW); //Disengage the Brake for Channel B analogWrite(11, 255); //Spins the motor on Channel B at half speed } void left() { //Motor A forward @ full speed digitalWrite(12, HIGH); //Establishes forward direction of Channel A digitalWrite(9, LOW); //Disengage the Brake for Channel A analogWrite(3, 255); //Spins the motor on Channel A at full speed //Motor B backward @ half speed digitalWrite(13, HIGH); //Establishes backward direction of Channel B digitalWrite(8, LOW); //Disengage the Brake for Channel B analogWrite(11, 255); //Spins the motor on Channel B at half speed } void right() { //Motor A forward @ full speed digitalWrite(12, LOW); //Establishes forward direction of Channel A digitalWrite(9, LOW); //Disengage the Brake for Channel A analogWrite(3, 255); //Spins the motor on Channel A at full speed //Motor B backward @ half speed digitalWrite(13, LOW); //Establishes backward direction of Channel B digitalWrite(8, LOW); //Disengage the Brake for Channel B analogWrite(11, 255); //Spins the motor on Channel B at half speed } ///////////////////////////////// // distance sensor functions // ///////////////////////////////// void PingRead() { // The PING))) is triggered by a HIGH pulse of 2 or more microseconds. // Give a short LOW pulse beforehand to ensure a clean HIGH pulse: pinMode(pingPin, OUTPUT); digitalWrite(pingPin, LOW); delayMicroseconds(2); digitalWrite(pingPin, HIGH); delayMicroseconds(5); digitalWrite(pingPin, LOW); // The same pin is used to read the signal from the PING))): a HIGH // pulse whose duration is the time (in microseconds) from the sending // of the ping to the reception of its echo off of an object. pinMode(pingPin, INPUT); duration = pulseIn(pingPin, HIGH); // convert the time into a distance inches = microsecondsToInches(duration); delay(100); } //for PING second to inch conversion long microsecondsToInches(long microseconds) { // According to Parallax's datasheet for the PING))), there are // 73.746 microseconds per inch (i.e. sound travels at 1130 feet per // second). This gives the distance travelled by the ping, outbound // and return, so we divide by 2 to get the distance of the obstacle. // See: http://www.parallax.com/dl/docs/prod/acc/28015-PING-v1.3.pdf return microseconds / 74 / 2; }

Step 61: Engage the Seed Spreader

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Engage the seed spreader by zip tying the trigger down. It is not very high tech, but it gets the job done.

Step 62: Power

Seed Spreading Robot
Engage the robot by flicking the little lever switch.

Step 63: Pour Seed

Seed Spreading Robot
Fill the seed spreader about 3/4 of the way with grass seed.

Step 64: Positioning

Seed Spreading Robot
Assuming your lawn is square and has an L-shaped fence (or U-shaped fence... or you are a total weirdo and it is completely fenced in...), place the robot such that it is pointing in a straight line towards the end segment of the L, and will be turning right to move to the side wall. If this description makes little sense, check out the diagram.

Step 65: Go Use It

Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Seed Spreading Robot
Basically, the way that this is working is that it engages the seed spreader, travels towards the far fence, and counts the number of motor rotations it takes to get there. Once it is within a few inches of the wall, it turns right and travels about a foot and a half (disengaging the seed spreader). It then turns right again and travels back across the lawn (engaging the seed spreader). However, since there is no longer a wall to sense, the robot counts the number of motor rotations and travels back the same distance it traveled towards the wall. When it gets back to this side, it turns left, travels about a foot and a half (disengaging the seed spreader), turns left again (engaging the seed spreader), and then repeats the routine. The routine is repeated until it turns to the side and encounters the side wall within a foot's distance (or so).

In theory, the robot should perfectly cover the lawn with grass seed. In reality, it will draw probably draw a weird modernist zig zag pattern.

One major thing which still needs tweaking is that inserting grass seed makes the bot top heavy and forces the rangefinder sensor to point slightly downwards. As the robot bounces along the lawn, it sometimes senses the ground and stops short of the wall. I think this can be solved by angling the sensor upwards and adding some debouncing to the code.

This is still a work in progress and I welcome anyone who thinks that they can develop better solutions to this problem to take a stab at it.
 
 

Tag cloud

make build easy simple arduino making homemade solar laser printed portable cheap mini building custom cardboard wooden create super lego turn paracord chocolate your paper light intel