Web
Analytics
 
 

Stuck inside? Build a robot!

Updated: Apr 21, 2020

Hey guys! Matt here with our first official ACBR tutorial! Now, this is going to be a big one. My main goal with this first tutorial is to provide anyone with exactly all of the info they need to build your own robot from scratch! The robot I'll be using for this example is the ACBR Rover! Which we currently have available in our shop. These are trying times for so many people around the globe right now, and with so many people unable to leave their homes, I wanted to do as much as I could for those who may want to occupy their time to learn a little more about robotics, electronics, and programming! That's why we made the decision to post all of our design files, all of our robotics curriculum online right here for free. By the end of this tutorial, you should have everything you need to build your own robot or one of ours. Let's get started!

For this tutorial, I'm going to use the trusty ACBR Rover as an example. I figured the best way to teach someone how to design their own robot, was to go through and explain how I designed one of mine!

There are absolutely bigger faster crazier robots out there, but what I love about this robot is that it's surprisingly fast and capable, it's compact and highly hack-able! I go over the entire process in the video below, so if you'd like to see footage of any of this, go ahead and click the link to that video, and give it a watch!




STEP ONE: The parts!


Now the first step in building your own robot is grabbing your parts! Now at a bare minimum, you'll need the following.


1. Motors

2. Wheels

3. Microcontroller

4. Motor Driver

5. Batteries


The Motors!

Now there are all kinds of great motors out there, arguably some of the most common are what are typically referred to as "TT Motors" They operate anywhere from 5 volts - 9 volts and come in several common gear ratios, they also have tons of mounting options, and a wide variety of wheel options that can be attached easily, so they're a great option for building your own bot. For the Rover, we'll be using these black TT Motors, at 8.4 volts (using 2x 18650 batteries), with the diameter of a standard TT Motor Wheel you get an RPM of right around 250 RPM, which makes for a quick little bot!


The Wheels!

Like I mentioned before, there are tons of options for attaching wheels to DC Motors, and if I had one bit of advice, it would be to buy both at the same time. Making sure that your wheels are compatible with your motors, is really important. These black wheels are designed for our TT Motors, and will work perfectly.


The Microcontroller!

Alright, now here you really can't go wrong. For this bot, I'll be using an Arduino Nano, but there are tons of options out there for giving a little logic to your bot. In this example, I chose the Arduino Nano because of its small size, it's micro-USB plug, and it's built-in NRF24L01 radio. There are also tons of great ways to make your robot wireless such a Bluetooth and WiFi, but in this example, we'll go with radio. It's simple, powerful, and already built-in! that means we can make our robot wireless without any additional hardware!


The Motor Driver!

I've got a confession to make, I am obsessed with motor driver IC chips, I love designing them, building them all of it! Now there are tons of options, and just like choosing your microcontroller, you can't go wrong. For this robot, I'm using the trusty L293D. I chose this chip because it is exactly no more, and no less than what we need. Its current limit won't easily be reached by our 4 motors, it's easy to program, and really easy to get a hold of.


The Batteries!

Now I can't stand when I find an awesome robot that I'm so excited about until I see the expensive proprietary battery pack. I don't like it when you're stuck buying batteries that only work with that one robot. I also don't like powering robots, with 9-volt batteries, AA, AAA or any other non-rechargeable batteries. So I chose to go with 18650 batteries for a couple of reasons! For one they're affordable, you can find them for only a few bucks apiece. Secondly, they're powerful, by wiring up two in series, at full charge you can get 8.4 volts, which in our bot will let us explore all day long. Lastly, they're rechargeable. You can find 18650 chargers everywhere, we even include one in our kits! They make perfect rechargeable robot batteries.


Step Two: The design!

Our next step will be figuring out our wiring diagram. Since I need two PWM Pins to control my speed, and 4 digital pins to control direction, I'll wire my control pins for my motor driver, to Pins 3,4,5,6,7,8 on my Arduino. (Don't worry too much about what PWM means if you're unfamiliar with that term, it refers to Pulse Width Modulation, which we'll use to control our motor speed later.)


First things first, let's grab a breadboard, Arduino nano, and an L293D to build our prototype!

Let's take a second and discuss the pins of the L293D. There may be 16 pins here, which can seem a little intimidating, but if we break down the pins into a few different groups, it's not too crazy. Let's start with our Ground pins. Now every single electrical circuit ever has a positive and negative, right? That's how electricity flows! So in this case, our "positive" will be 5 volts, and the negative is what we call "ground". In engineering, robotics, electronics, etc. we always refer to the negative as "ground". If you look closely, you'll see there are two pins on the Arduino labeled GND. These are our ground pins! Now the L293D has four GND pins, and they're all right in the middle of the chip. Let's grab some wires and connect the four GND pins of the L293D to the GND pin of our Arduino.



Alright! We have all four of the GND pins of the L293D pins connected to one of the GND pins of the Arduino! Our next step will be sending positive voltage to our motor driver, we'll start with the main voltage-in pin, which will be our top left pin.


One of the coolest things about the L293D is that it's an incredibly symmetrical IC chip. So, the opposite pin (the bottom right pin) is also a positive voltage-in pin. But this pin sends voltage straight to the motors! What's so cool about this is that our chip only needs 5v to start thinking, but we have the ability to send a higher voltage into the chip for our motors. Since the speed of a DC motor is greater with a greater voltage, we're not limited to 5v! This is the pin we'll be plugging into our 18650 batteries in the next step. For now, we'll plug it into 5 volts as well.


The next step is our motors! We'll wire them to the output pins of our L293D. The output pins are located on either side of the ground pins. The two wires of each DC motor will be connected to either side of our ground pins.


Your DC motors will almost certainly look a little different, but so long as it has two wires, like our TT motors, both ends of the motor will be wired to the same spot. Don't worry about which motor wire goes to the right or the left, since that will change the motor direction, and that's exactly what our chip is going to do for us.


Next, we need to wire up our pins for controlling the speed of our motor! These are what is known as the "Enable Pins" of our chip. We're going to need a PWM frequency to control our speed, don't worry too much about what that means yet, right now it means we need to plug our two enable pins to control the speed of our two motors into PWM pin on our Arduino. On an Arduino Nano, and an Arduino Uno, these are pins 3,5,6,9,10,11. We're going to wire up our two enable pins to pins 3 and 6.


Ok, we're on our last step! Admittedly, our circuit is looking a little crazier. It can be really helpful to go step by step. Our last step is wiring up our input pins! They will control the direction of our motor. There are two input pins per motor. Whenever we send voltage to one of our input pins, our motor will spin one direction, and if we send 5 volts to the other input pin, our motor will spin the opposite direction! We're going to wire up our bottom motor's input pins to pins 4 and 5 of our Arduino, and the top motor's input pins to pins 7 and 8. Let's give it a shot!


That wiring got crazy! Now, at this point, you've basically got yourself a robot! You could send over some code, and so long as you attached a battery, and connected the motors, it would roll around. But our next step will be designing a custom circuit board. That way we can embed all of these wires into a circuit board, making our robot more secure, easier to connect, and more professional looking! With that, we'll head over to https://easyeda.com/ to translate our wiring diagram into a schematic! the link below will take you straight to the schematic for our robot. Check it out!


https://easyeda.com/matt_9455/acbr-rover


Here's a picture of our schematic as a whole.


If you've never looked a schematic before, this may look a little intimidating, but all we've done here is create a map of all of the electrical connections we need to make! Let's take a closer look at the L293D and Arduino we have in our schematic here.



Now instead of wires, we're using what we call Net Flags to indicate our electrical connections, if you look carefully, you'll see that all of our connections are going to the same place as they were in our wiring diagram! The voltage-in pin is going to 5v, we have our enable pins to control speed going to pins 3 and 6, and we have our input pins to control direction connected to pins 4,5,7, and 8. This is just a different way to represent it!


Our full schematic has a few extra pieces that we didn't include in our first wiring diagram like our batteries, switch, etc. Let's take a look.



This part of our circuit represents the two 18650 batteries, a diode for reverse battery protection, and a power switch. To the right, we have four JST connectors for our motors, that we're connecting to our output pins of our L293D using net flags! Feel free to add to this schematic, and switch things around if you're trying to customize your bot!


Once you're done with your schematic it's time to convert it to a Gerber file! On the top menu, you'll find a button that looks just like this.


You can click this button once you've finished with your schematic. If you'd like, you can also click the link below that will take you the example circuit board we made with this schematic. You can also pick up one of the circuit boards from us!


https://easyeda.com/matt_9455/acbr-rover



Once you have your circuit board designed, you can have a manufacturer make your boards for you! I use JLC PCB, they are awesome. Affordable, fast, and really high quality. Our finished board looked something like this!



All that's left now is soldering in the components and writing some code! The best way to see how to solder this guy up is by checking out our video guide, it goes through the entire process in great detail.


https://www.youtube.com/watch?v=dCgnZcnw7JI&t=4s


We have these boards available in our shop as a kit with everything you need to get rolling! As always, a portion of all proceeds goes towards donating robotics supplies to those in need all around the world.


https://www.anyonecanbuildrobots.com/product-page/acbr-rover-robotics-kit



We hope this guide was helpful! Have fun, learn a little, and remember... anyone can build robots!!






382 views0 comments

Recent Posts

See All