Lessons learned using Arduinos to build robots

Danny here, one of the co-founders of the Lab and an instructor of our Summer Labs.

I’ve always been a big fan of the Arduino platform for robotics, and we’ve found success with middle schoolers and high schoolers alike. However, that’s not to say it doesn’t come with its own rough edges. We’ve been at it for awhile and thought we’d share some of those lessons learned about using Arduino’s for robotics.

The core of the robots that we build are based on an Arduino Uno with an Arduino Motor Shield v3.  At this point, we’ve probably owned at least 50 of those boards in our Summer Labs.

Disclaimer: We have no affiliation with Arduino, Amazon, or any vendors – we’re just big fans.

Have a lot of batteries

We have gone through a ton of AA and 9V batteries. Every robot needs 4 AA batteries for the Motor Shield and one 9V for the Arduino, and we expect robots to go through 8-12 batteries by the end of our sessions. We’ve been trying to move to rechargeable batteries, but they are also more expensive and have presented new challenges like needing to make sure we have a constant supply of recharged batteries.

We’ve been using this Rechargeable Battery Charger from SunLabz that seats 12 batteries and its been working out OK.

Have a multi-meter on hand

Have a multi-meter on hand. The 4AA batteries are good in the range of ~4.7 to 6V. Anything less than that, and things start working incorrectly. It’s also a great tool to make sure that issues with the robot are caused by the code, and not by the batteries.

We’ve been pretty happy with these multi-meters from Innova

You can’t use some pins

Don’t use Pins 1 or 0, even if you’re just using the Arduino without the Motor Shield. They are reserved for the USB connection so you might start seeing that the board is not recognized by the Arduino program.

Using the Arduino Motor Shield uses up 4 pins to drive 2 motors (3, 11, 12, 13) so it really cuts down on the remaining electronics you use with the Arduino. At the same time, that’s been a good incentive for students to be smart about what the sensors they’re using.

Use the Motor Library

There’s an open-source Arduino Library called Motor that works really well with the Arduino Motor Shield.

The README on Github states that it is made for the Ardumotor shield, but we’ve tested it with the Arduino Motor Shield and it works correctly.

It lets you write simpler code to make a motor go in a specific direction.

isBumped = digitalRead(BUMP_SENSOR);
if (isBumped) {
leftMotor.go(255);
rightMotor.stop();
}

It takes care of doing the calls to set pinMode(), so you can pay more attention to the logic in your program.

Watch where you seat the Arduino on your robot

If you set the Arduino down and the back of the Arduino (the side with all the metal nubs) touches a metal/conductive surface, it can causes a short that’s difficult to trace down and can damage the Arduino. The newer Arduinos come seated in a plastic container. I’ve been using that as a way to keep the Arduinos from coming into contact with other metal items. Arduinos

We’ve fried a few Arduinos by placing one on top of an uncovered battery 4 AA battery pack. It made sense at the time. Lo and behold, that Arduino overheated, started smoking, and melted a few wires. That Arduino never functioned again understandably – but hey, thats also another part of the process.

Debugging a short somewhere in the circuit leads to weird issues when using the Arduino software. And they are sometimes hard to trace down if you’ve got a few sensors on your breadboard. A short on a breadboard won’t necessarily damage the Arduino, it just won’t turn on even when its plugged in via a USB cable or 9V battery. This will cause the Arduino software to no longer recognize the board.

Overall, our students have very much enjoyed the process of building with the Arduino and we’ve worked hard at creating an atmosphere where students feel motivated to try new things and learn from their mistakes.

Interested in learning to build robots with us? Check out this summer’s Junior Lab.

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz