RC lawnmower built from hoverboard parts and hobby rc control, with an arduino doing a little math.

Be Safe! Disconnect the spark plug while you’re working around the blade area.
Parts:

ESC x2


Batteries


Caster Wheels x2

Spektrum dx5e radio

I made heavy use of this arduino ESC library. All credit and thanks to the author.
https://www.robotshop.com/blog/en/rc-speed-controller-esc-arduino-library-20470
https://github.com/RB-ENantel/RC_ESC

Some FAQ:
-Connect one esc to arduino’s ground and 5v and the signal wire to a pwm pin. on the second esc, you only need to connect the ground and signal.
-Connect to the ground, power, and signal pins on the radio throttle channel. Any other channels you want to monitor just need the radio signal pin connected to the arduino pwm pin
-You can swap the 3 motor power wires around until you find the correct combination that reverses it.
-Not all ESC seem to work with the wheels and I’m not sure why. I can’t answer that. Another one I tried only made the wheels studder and never achieve constant rotation.
– It only turns by basically turning off one wheel, and it can’t do very tight turns. I’m not sure how to add any braking effect to make it turn harder.
-I don’t know how to reverse the motor with this esc, if it’s even possible. I haven’t really looking into it much tho, it could be easy.

This code is not a complete program, but posted here to maybe help you. YT won’t allow greater than or less than character, you’ll have to replace “isgreaterthan” obviously
ch1 = pulseIn (inputpin1,HIGH); // left stick up-down range 1000-1700
ch2 = pulseIn (inputpin2,HIGH); //rightstick left-right range 1300-1900 center: 1600
if(ch2″isgreaterthan”1700){
rightspeed = ch1 – 2*(ch2-1700);
}
else{
rightspeed = ch1;
}
if(ch2″islessthan”1500){
leftspeed = ch1 – 2*(1500-ch2);
}
else{
leftspeed = ch1;
}
constrain(rightspeed, 0, 2000);
constrain(leftspeed, 0, 2000);
leftwheel.speed(leftspeed);
rightwheel.speed(rightspeed);
delay(5);

source

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.