What this is:

This instructable will show you how to make your Arduino into an R/C interface that you can use for just about anything requiring remote control. I will also show you how I built an R/C lawnmower using my Arduino, a cheap R/C transmitter and receiver pair, and a couple of electric-wheelchair motors from Ebay.  I have used this interface to control anything from basic LED's to Bipolar stepper motors, mini-robots, lifeless R/C cars from the thrift store, and even a 100lb lawnmower (all with appropriate motor controllers). It is very flexible and easy to change and very simple to set up.

See a slightly different version of the Lawnbot400 in my new book "Arduino Robotics" , as well as a DIY Segway and several other bots.

Check it out in MAKE magazine in the April 2010 issue (#22) or here:

UPDATE 3-24-10

New wheel-barrow bucket mounted on top with hinges so it can dump its contents.


And new video of the Lawnbot400 moving a bunch of dirt from my truck to the flower beds across the yard, also I updated the code again.


I added some new code to the project that is safer, including a manual kill-switch and a Failsafe switch.

To implement the Failsafe, I used another Atmega168 (or an Arduino), to control a normally-open 60amp power relay. The relay disconnects the power to the motor-controller unless receiving a "good" signal from the 2nd microcontroller. This signal is updated 2 times every second and is either ON or OFF. If the bot gets out of range, it loses power to the motors. If I flip the kill-switch on the Transmitter, it loses power to the motors. This is also a handy way to disable it remotely if anything were to go near it that wasn't supposed to. The updated code for both microcontrollers is on the CODE page.
In addition to the failsafe, I changed the way the code reads the PPM signals to make it more reliable. Also, I realized that I was only able to run the bot at 80% speed with the old code, so now it is quite a bit faster and has more power (it can carry me across the yard @ 155lb).

Check out this new video of me riding the Lawnbot400, my wife driving it over a bunch of branches, then me making do some wheelies. Don't worry, the mower was turned off this time since the grass didn't need cutting, we were just having fun.

DANGER!!! This is a VERY dangerous piece of equipment if not handled appropriately. Since all the electronics have been home-built and the Arduino code is new, you MUST be very careful while operating anything heavy with this code. I have had 1 or 2 times during testing - and before adding a secondary failsafe - that the main Arduino jammed up and I temporarily lost control of the mower for a few seconds!!!! Though I have added several filters to discard unwanted signals and I rarely have any issues, an un-manned lawnmower IS STILL A POTENTIAL DEATH TRAP and I assume no responsibility for anything that happens as a result of your use of this code or this tutorial. This is meant as a guide for people who not only have the ability to build such a contraption, but the responsibiltity to operate it safely as well. Any suggestions or ideas on how to make this a safer project is always gladly accepted. Having said that, it's also awesome.


Most R/C equipment comes packaged for a single specific use, which makes it easy to use but is very limited in what you can do with it. So using the Arduino as an interpreter between the R/C system and the motor driver, I can use any motor controller that I want (depending on the size of the motor and power required), reprogramming the Arduino to supply the required signals. 

What I ended up with:

After successfully hacking a few R/C cars from the thrift store, I got bored driving them around the driveway and I was having a hard time convincing my wife that there was any usefulness in the revived toy car. So I decided it was time to make my biggest chore at home, a whole lot easier and actually put my Arduino to work, and thats how I ended up building an R/C lawnmower.

While designing the lawnmower, I thought it would be cool to learn about the electronics that made it move, so I designed and built my own motor speed controller (or H-bridge) to power the lawnmower. I looked around at every H-bridge design I could find before deciding to go with a Mosfet h-bridge that uses both N-channel and P-channel Mosfets.

I built several different motor driver boards for this project, the first two were on Radio-Shack perf-board and the next 4 were designed using EagleCad and etched to a piece of copper-clad PCB, using the toner-transfer method. The most recent board is the one I use to mow the lawn as it has the ability to stay cool even while operating for long periods of time (30-40 mins straight) at 10-20amps and 24vdc. FWIW, I had to burn up a lot of Mosfets to find this out. If you want to see any of my other motor controllers, go to www.rediculouslygoodlooking.com and check out the Mosfet shield.

Here is what I bought already assembled:
FM R/C transmitter and receiver pair from ebay = $40
Arduino = $30
I already had a used push-mower = $60

Here is what I bought and assembled into the Lawnbot400 (as I call it):
(2) electric-wheelchair motors from ebay = $40 ea
(2) 12v marine deep cycle batteries - Walmart - $60 ea new (used batteries might work)
36" pieces of 2" angle-iron (2) and 1" square-tubing (2) from Home Depot = $8 ea
36" pieces of 1" angle-iron (2) and 1" flat steel bar (2) from Home Depot = $5 ea
(a lot) of nuts, bolts, washers, lock washers 3/8" or 1/2" with drill bit = $20
(2) caster wheels from Harbor Freight Tools = $14 ea
(2) drive wheels from Harbor Freight Tools = $8 ea
(36") 5/8" threaded rod with several 5/8" nuts and washers from Home Depot = $8
(2) sprockets from Allelectronics = $5 ea
#25 roller chain and a few universal links from Allelectronics = $10 for 3'
sprockets from Electronics Goldmine = $1.50 ea
(24) mosfets from Digikey = $1 ea
(there were quite a few small parts for building the H-bridge, they are listed later on)

Step 1: Setting Up

1. Get R/C transmitter and receiver (I have tested FM and AM systems and they both work)
2. Upload code to Arduino (it is on the last page)
3. Make sure you are getting a good signal

You will need an R/C radio transmitter(Tx) and receiver(Rx) pair, which is the most expensive part of the project, but can be used for every future project you might have involving R/C.  I went with a 6-channel FM system, but  I have tested a 27mHz AM transmitter/receiver and it works just as well. The beauty of the Arduino is that if you want to adjust the deadband or the motor-speed at turn-on, (unlike commercial ESC's) it is all easy changed in the Arduino IDE.

Once you have your radio, all you need to do is upload the code to your Arduino, plug in the 2 channels that you want to use from your radio receiver into Digital pins 2 and 3 of the Arduino (these are the 2 external interrupt pins on the Arduino) and you are ready to control whatever you want. If you don't have a batter pack for the receiver, you can run jumper wires from the Arduino +5v and GND to the R/C receiever for power, you only need to supply a single channel with GND and +5v (it is not necessary to power every channel).

Upload the code using the Aruino IDE (I am using version 0016 on Ubuntu).

I started by controlling 3 LED's with 1 channel on a breadboard. I wired a red LED to be Forward (digital pin 9), a yellow LED for Reverse(digital pin 5), and a green LED for Neutral (digital pin 12). This allows you to adjust the code to fit the needs of your radio system. You will have smooth 0-100% PWM control of both LED's and the neutral light will turn on when the control stick is centered. If needed, you can widen the deadband for Neutral, but doing so will increase the speed at turn-on (which starts at 0%, so that would likely be desirable). See pictures.


The code has 4 PWM outputs for motor control:

channel 1 Forward = Arduino digital pin 9
channel 1 Reverse = Arduino digital pin 5
channel 2 Forward = Arduino digital pin 10
channel 2 Reverse = Arduino digital pin 6

2 outputs for Neutral indicator lights:

channel 1 = digital pin 12
channel 2 = digital pin 13

The 2 INPUTS from the R/C receiver should go to:

channel 1 = digital pin 2
channel 2 = digital pin 3


If you are interested to see your readings, turn on your Serial Monitor in the Arduino IDE (set to 9600bps) and you can see the actual real-time pulse readings for each channel, they should read:

full forward = 2000 (2 milliseconds)
center = 1500 (1.5 ms)
full reverse = 1000 (1 ms)

These readings reflect the number of microseconds that the pulse signal from the R/C receiver stays HIGH (or at 5v). The typical Servo signal that comes from an R/C receiver is a pulse whose length varies from approximately 1 ms to 2 ms with 1.5 ms being Neutral (which should also be the position that the control stick returns to when you let it go). The transmitter reads the position of the control stick and sends that pulse length about once every 20milliseconds. So it is constantly updating for precise control (for more info, look up PPM on wikipedia).  If you push the transmitter control stick forward, the reading should go up to 2000, if you push it backward it should go down to 1000. You can also use a voltage meter at this point to see that Digital Pins 5, 6, 9, & 10 will be changing from 0-5v depending on the position of the control sticks on the R/C transmitter.

If you care to know, the code uses the Arduino's 2 external interrupts to capture when the Rx signal pin changes states (goes from HIGH to LOW or vice versa), when it does at the beginning of each signal, it calls the interrupt function which reads the digital state of the pin and if HIGH, it records the microseconds value on the Arduino system timer0. It then returns to the loop until the pin goes LOW, at which point it subtracts the previously recorded microsecond value from the new current microsecond value to determine how long the pulse stayed HIGH (which tells us the position of the Transmitter control stick). It then does that over and over really fast.

I have the values constrained from 600-2400 in the Arduino code to keep things simple. Once it receives the signal and constrains it, it maps that value to be proportionally between 0 and 511, where 255 will be Neutral. The code then determines when the value changes and uses a function to determine the appropriate 0-255 PWM value in the appropriate direction and each direction has it's own PWM output pin to control the H-bridge.

On a side note:

To make things easier, I built an Arduino-based breakout board using Radio-Shack perf-board, a 28pin DIP socket, a 16mhz oscillator, and a bit of wire. I also added a set of female-headers in such a way that I can plug my R/C receiver directly onto the breakout board. For secure connections while mowing grass, I added screw-terminals on each Output pin and each of the 6 channels from the receiver. It also has a built in 5v regulator to power both the Atmega168 from the Arduino and the R/C receiver (which gets power when you plug it onto the breakout board). So you just route jumper wires from the channels you want to use on the receiver, to the Atmega digital pins 2 and 3. I also added 2 LED lights that are hard wired to the digital pins 12 and 13 for the Neutral lights for each channel so I can easily see when I am in neutral.

Since this bot is a Tank steer setup with 1 drive motor on each wheel, the coding is very straightforward where the left stick controls the left motor and the right stick controls the right motor. Both sticks forward means lawnmower goes straight forward, both backward and it goes in reverse. If you push the left forward and the right backward, it does a zero-turn circle. As you can imagine, mowing the grass is really fun now.

Should we mount an umbrella on this?
Does anyone still have access to the schematic and eagle file?
<p> you considerer using software similar to that of Arduo-pilot to use GPS and allow the mower to autonomously mow the lawns?<br><br>alos how did you pront the boards for the H-Bridge did you print wiht your own printer or send the CAD drawings away to a third party to print for you?</p>
<p>Instead of h- bridge you can code for it. which will save your money .</p><p>H- bridge by coding Set pwm.</p><p>transmitter $ receiving bluetooth module 4.5$ only</p><p>Control by android app </p><p>Save , secure and efficient method </p>
<p>can you explain a bit more about the coding set PWM to control the motors? my mail is gabriel.badilla.alfaro@gmail.com</p>
<p>Kudos to you!! Brilliant!! You inspired to work on my own project. A newbie with no knowledge. Even if i do not get anywhere, i would like to start.Please help.</p><p>Do you have the .brd file or .sch file. i want to try making the R/C Landmower. I have never etched a pcb before. so looking for the drawing and try making one.. if not give it outside to get it made. </p>
Anyone who made this; where did you get the sprocket for the wheelchair motor shaft? My shaft is 17mm with a 6mm keyway.<br><br>Also, what gear ration did y'all go with?
Awesome project, thanks for the clear documentation too.
Awesome project, thanks for the clear documentation too.
<p>Here is a unit I built from scratch with a track drive and complete stainless construction. It is fully functional but I have yet to add the lawnmower accessory to the front of it. If you have questions...feel free to ask. It has tons of torque. Two wheelchair batteries and two wheelchair motors and a sabretooth controller. I am thinking I may want to sell it if anyone is interested.</p>
hi ed! i have some cuestions for you. do you have an email, facebook account or phone number where i can reach you.at?
<p>Up front, I don't have the money, but if I did, how much would it cost me? I really could use something like this being wheel chair bound and maybe I can save my pennies. Great job though. Semper Fi</p>
<p>Approx. $600 should get you there depending on how handy you are.</p>
That is awesome! Where did you get the tracks?
<p>Seems like your website is not working, can you link the .brd file?<br></p>
What would you charge to build the frame with all components except the mower? <br> <br>viperguy@suddenlink.net <br>
Hi Viper,<br><br>I would have to source the parts first and it would depend on that. Also, shipping would be expensive if I pack a box full of angle-iron and heavy duty motors to ship... what state do you live in?<br><br>Ballpark figure... I would probably have to charge around $600 or so to build the frame (sans mower and batteries), though for the next two months or so, time will be tight for me... so it would probably wouldn't be complete until around the first of next year.<br><br>On the other hand, I am happy to offer (free) help with building problems and parts sourcing, should you want to build it yourself.<br><br>Cheers,<br>JD
Hi I'm working on my capstone project for electronic engineering and I'm trying to build a very similar bot to yours. I'm getting your book for my bday in a month and that will probably answer any questions I have but I'm working on the hbridge now and was wondering if you could send me a schematic that could handle the load. My email is Carmichaeldaniel12@yahoo.com<br>Btw your bot is awesome!<br>Thanks man!
Very good, thanks for the info.
<p>This is truly awesome and will be a great help if I can get one together. Semper Fi</p>
What was the total cost into making this?
<p>Hey can you sent me the code, because it won't download on my iMac</p>
<p>Hey! Still Need The Code? Message Me If You Do.. </p><p>Shouldn't be too hard to replicate if you wanted to but I have the zip from above.</p>
<p>please, I want to make a car to carry 15 kg So :What are motors I need ?</p>
<p>please, I want to make a car to carry 15 kg So :What are motors I need ?</p>
That's cool :) nice build! Was thinking as another possible safety feature, perhaps you could buy a &quot;invisible fence&quot; that people use for dogs. You put the wire a few inches under the ground to create a boundary and hack what is normally on the dog. This works in 2 stages, a sound to warn the dog (use this output to change mower direction) if the dog/mower is ignored the second stage gives a shock. (Use this output for closing your &quot;lost signal&quot; relay.
<p>Can you provide a more detailed schematic of how everything is connected to the arduino?</p>
<p>I built your H-bridge for a project im working on. Not sure if i made a mistake or if its working as designed. I connect motors to the triple8 and when i apply power to the board the motors both start. was not sure if it should default to stopped or running. I am also curious how to connect this to a standard arduino. Most of the refrences I can find show 3 wires per motor and this obviously only has two. Any help would be greatly apprieciated.. thanks!</p>
<p>This is genius! A beautifully executed idea with so much potential for other applications. Very good instructable.</p>
<p>Hi! First of all congrats to this great instructable! Very well documented, and very genius ideas.<br>However, I would be concerned with the parallel connected mosfets. Not one electronic part is equal (exactly the same characteristics). So if you take two LED's for example they will not be perfectly identical. This is the case for mosfets as well. So if one of them opens faster then it will have to handle amperage which it can't handle...<br>This is just a thought....:)</p><p>THank you and best regards,</p><p>Lorant</p>
Anyone have a copy of the .brd files the link is dead. I was looking forward to making this, but I dont want to buy the parts if there's no instructions to go with them
i am seeing your schematic, and, sorry to say, it's wrong. All the P-channel mosfets are reversed, you have a pair of p-channel mosfets on each H-bridge disconnected from the power. But apparently you fixed those two things on your PCB, it's a trap for beginners, you should fix it.<br /> <br /> You have no back EM protection, not even a diode, and the mosfets are too small in voltage, i used 100v mosfets with a 24vdc motor, 12A and&nbsp; they just exploded, all the protection died, and the microcontroller died. We measured the inductive peaks in approximately 200v, and you have 2 times the current here. You have no hardware protection to prevent both sides of the H-bridge from turning on at the same time.<br /> We even used toric transformers and 100uf capacitors next to the motor and, even then, it exploded, with fire and everything. <br /> <br /> The only solution that worked, after a year of trying (we didn't find something like a BTS7960 in my city, we looked for it) was to use a double inverter relay in series with 2 500v 8A mosfets in parallel, plus all the usual diode based protections, thermistor based protections, capacitor based protections, and, of course, optoisolated from the control logic.<br /> <br /> that was for an electric wheelchair.<br /> <br /> so, if your circuit worked, the motors are almost magic, you are extremely lucky, or you are omitting something.<br /> <br /> i wish you the best<br />
<p>Hey</p><p>you seem to be a expert on this field. I need some help. I made a remote lawn mover with wheel chair motors and 2x25A. It caught on fire after over heating. Now I am looking for a powerful MOSFET H bridge. Could you please send me a schematic with high power H bridge if you have got one. I am doctor in profession therefore minimal knowledge in electronics, need good good explanatory schematic. my email is Isuru7777wg@yahoo.com. Thank you for your help.</p>
sorry about any schematic and board differences... I am a beginner in Eagle, so I made the .brd file before the .sch file. <br /> <br /> The mosfets&nbsp; I used are 50 amp and 60v.... I am also fairly new to mosfet theory, so I can't argue with you on much, but I do know that they have built in ESD protection diodes that are rated far above the 24 volts that I am using. I thought about adding additional diodes, but as it turns out, that is not necessary. My bot weighs over 100lbs and I can do very fast direction reversing and it does nothing to the mosfets or the microcontroller (It has had the same Atmega168 since I&nbsp;built it a few months ago). I was worried about the gate-source voltage spikes above 24 volts affecting the P-channel mosfets, but the mosfets I used have a Vgs max of 25v and they have performed very well so far at 24vdc.&nbsp;&nbsp;<br /> <br /> I have used this controller with several different motors and it worked with each. Also it will carry me on top of my mower across the yard... so that is over 300lbs and it doesn't heat up at all. I may be very lucky, but it can handle anything I throw at it and it is very responsive, which is far more than I was expecting to get when I started.<br /> <br /> I&nbsp;think 2 people have already made this board and said it worked... but I am designing a new board based on the OSMC schematic, so I will post it as a replacement when&nbsp;I am done.<br />
maybe those mosfets are extremely good and more resistant to transient voltages than normal ones (IRFxxx), normally mosfets are very sensitive to overvoltages, and they are good with high currents.
<p>This is the best Instructable on Instructables. Pure genious. I think I first found this on RC Groups and then Googled around until I ended up here. I searched on eBay and Craigslist for wheelchair motors. They were all way to expensive. ($300 for a set). But I just found an old guy that rebuilds wheelchairs in his garage. I got a set of motors and wheels, some castor wheels, battery boxes, and several other things for $50! I'll be FPV-RC lawn mowing by spring!</p>
<p>Hi! Great job. I have a question. I'm in a similar project. what are the engine specifications?</p>
<p>Wow, Great job! Do you have a steering mechanism for the front wheels (IE a servo etc) or is all the turning done by the rear motors and the front wheels just pivot?</p><p>Thanks :-)</p>
<p>I want to make one with a bit more features :D</p><p>one with a good webcam or 2 and computer control ;P (me being a programmer)</p><p>it would be the pinnacle of lazy lawn mowing especially if i could turn it on from my computer. :D</p>
<p>Does anyone have the schematic or .brd file? None of the links seem to work.</p>
<p>One more thing. What kind of arduino did you use? Will an Uno work? Thanks!</p>
<p>Hi! I'm lazy and don't feel like doing the math on how much it is going to cost to make. Do you have a good minimum to maximum price range on building this thing? Thanks!</p>
<p>How do you pull and hold the throttle cable?</p>
<p>I took the spring off of the switch on the motor that the throttle cable pulls... then used a zip-tie to hold the switch open so it would allow me to crank the mower and it stay running. Then connected 2 wires to the contacts on the cutoff switch, connected to a relay to turn it off.</p>
<p>amaizing... maybe you can tech me how to make it..beocuse i'm newbe</p>
You have inspired me to create one! On the search for wheel chair! Thanks for laying the ground work and doing all the hard work.
<p>Sorry to bug you all again, another question. I am having an issue finding a 6ch Transmitter Reciever for a car. Does it need to be 6 channel, can it be more or less. Or is that for expansion of future stuff?</p>
<p>Hello, i have recently had this project rekindled in things to build. I have wanted to do something like this for a long time. And with the recent snows this year i have had a thought to put a snow scoop on the front of it to shovel. I have one maybe two questions for you. All the RC transmitter reciever pairs i am finding on ebay are in the GHZ range. I am new to arduino and not sure if this will work. And i guess the second question is, I see alot about the scooter motors, wheel chair motors are pretty expensive versus the scoter motors. Do you think the scooter motors handle mowing the lawn, hauling dirt and or a person around, and shoveling snow? Thank you in advanced for any comments</p>

About This Instructable




Bio: I have always been one to take things apart to figure out how they work, so most of what I own has been dismantled. If ... More »
More by johndavid400:Arduino controlled Bluetooth-bot Core3duino Arduino R/C Lawnmower (painted) 
Add instructable to: