Driving Straight and Turning with the MPU-6050



Make your robot drive straight (ok, well, straighter) using the MPU-6050 6-Degrees-of-Freedom accelerometer/gyro.

This is another presentation given to the Nashua Robot Builders.

Here’s the Arduino code: _2020Bot_MUP6050.ino.zip

Please note… the Arduino code isn’t up to my usual standards, but it will show you a few things.  Pay attention to the required libraries (links are in the comments).

Here’s a zip file for the Apple Keynote version: Driving Straight and Turning

2020 Bot Motor Control Examples

I just updated the 2020 Bot Arduino Library to include a couple motor control examples: https://github.com/robojay/_2020Bot_Library

One uses the delay() function between motions. This is great for ease of understanding, but not so great to use in practice. The delay() function blocks the robot from doing most other tasks until the time expires.

The second example uses millis() and a timestamp to step through the motions. This lets the robot do other important tasks, such as blinking the LED, while still controlling motions.

IR Proximity Sensing

Proximity sensing for your robot.

Proximity sensing for your robot.

When you build a robot, it’s nice to have layers of sensors.  You can think of the layers either top down (maybe starting with a 3D laser scanner), or from the bottom up (are my motors stalled?).  Proximity sensing sits on one of the lower layers, and generally is used as “Hey, there’s something near me, and it might be in general direction X”.

Using infrared LEDs and detectors is an inexpensive and common approach to basic proximity sensing.

I did a presentation on this topic for the Nashua Robot Builders.  You can find the slides and demo code at https://github.com/robojay/IrProximityDemo

2020 Bot Wiring

Here is a hookup diagram and a wiring checklist to go along with the 2020 Bot video instructions.  The diagram has a couple breadboard locations that are different than what are called out in the video and checklist, but they are functionally equivalent.

Click on each image to download PDF versions:

DinoBot – circa 1993

This probably qualifies as my first real robot.  Still works after 20+ years.

I built it as part of the final project in my grad school Artificial Intelligence course.  The professor made sure I understood the project was a software project, and not to get hung up on the hardware side (fortunately, being an electrical engineer in a comp-sci class made that a little easier).

Here’s my final report, along with all the typos intact…


Yard Bot

What do you do with some scooter chair motors, big casters, and a sheet of MDF?  Make a radio controlled Yard Bot of course!

I’ve had the various pieces for this project kicking around for a while. Finally took the time to put them all together.  Just something to play around with…

Continue reading