Introduction: RCXD Arduino Car
This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com)
I have designed a RCXD Arduino Car. I have programmed the turret on the top to move in multiple directions as well as programming the wheels to move forward, backward, Left, and Right, as well as Stopping on command. I am able to do this via a IR remote and IR receiver. I have included the necessary files and steps required to recreate this design.
Step 1: Materials Required:
The Materials required to build this design are as follows:
1. Arduino Uno
2. Arduino Kit (i.e. comes with everything you need to work on arduino projects
3. L293n Motor Driver
4. IR Receiver (Kit)
5. IR Remote (One comes with kit, but any IR remote works)
6. 4 Arduino DC Motors
7. Servo Motor (Kit)
8. Wires (Kit)
All of these materials can be easily purchased off amazon or any ONLINE retailer as they don't sell many Arduino materials in store. Having a battery pack for (9V) batteries is also useful to obtain.
Step 2: Step 2 Setup: IR Remote Codes
In order for your IR remote to work with the program and Arduino you'll need the codes for each button pressed on IR remote. You'll need to setup your Arduino like this and implement this a code for IR Receiver to work. After uploading this code, click on the Serial Monitor button ( at the top right). Press some buttons on your remote and view the codes popping up. Once you've registered which code applies to which buttons, start copying those codes. As you can see, I've copied and commented, by "//" before my code, the codes for each button pressed.
Step 3: Step 3 Code: Main Code
In order to get everything to work together you'll need a main code file that you'll have to upload to your Arduino. On top of that you'll need certain libraries for the codes that aren't already built into Arduino. Thankfully they're easy to acquire and install/include as well as you can just copy the libraries into your file under a .h or .cpp tab.
Once you've copied each code to the corresponding button you've pressed you'll need to include them in your main file. As you can see, Ive commented many of the lines of code so you can understand what does what and I've included where you add your IR remote codes. For yours to work like mine I added the AFMotor library and IRremote library in order for the IR receiver to function as well as the motors.
Step 4: Step 4 Hardware Setup: Arduino
There are multiple ways you can build the setup for this design. You can include a breadboard, more motors, wires, etc. However, I only incorporated my IR receiver, the receiver relay, the L293d Motor Driver, the Arduino Uno, and a couple batteries as well as wires.
First you'll want to get the setup for your IR receiver. Which i have already included. You don't need the breadboard for this but you can use it if desired. Correctly wire the IR relay to Arduino Uno and then fit the IR receiver gently into relay pins: GRND, PWR, OUTPUT/INPUT. I used the relay because the IR receivers are very delicate and can fry easily.
Secondly I placed the L293d Motor Driver into Arduino Uno. I know with the wires already setup for IR relay its hard or doesn't seem like it'll fit, but it will (have extra wires and be careful with force). An easier way to use L293d Motor shield and extra wires with Arduino is to solder the wires to the shield. In order to do that you'll need soldering equipment.
Then attach both the wires from each gearbox motor into the motors you want them attached too. The motor Driver has places for four Motors. You can also fit multiple wires into one pin which is what i did for simulataneous movement, as in when it reads the code for that Motor, those wheels attached will respond as one. The red and black wire can be attached to any pin; depending on attachment may cause wheel to move in opposite direction as written in code.
Continue by attaching the servo motor wires to your motor driver at the pins listed SER1 "Servo 1". Wire correctly + to +, GRND to -, etc. After this you're all set to test code. In order for it to work you may need extra power which is where a battery pack comes in or 9V battery. I used two 9V batteries but sometimes one and wire to you computer will be enough. Depends.
Step 5: Step 5 Inventor/Solid Works: Building Your Design
To complete my project I designed each piece in Inventor 2019 which I acquired via student at USF. However, you can use any program similar to Inventor such as AutoCad or SolidWorks, etc. The important thing is the format you save as, some printers require .STL while others may require another format; check your 3D printer. I will include all of the .stl files I used for my design excluding the wheels. You can design your project in any way you'd like as it does not matter in final design. Complete the project in pieces and then assemble it when done. I built my base in two parts and then the wheel and finally with the turret. On a side note my turret is printed attached to its base, which I later had to slice apart. Keep that in mind when designing
WARNING: When designing your project, two key details are the measurements and design from an engineering standpoint. If you print your design in mm it will appear as a dot on 3D printer and if you enlarge it, the piece may be distorted because of low resolution. On top of that, if you design it with a 1mm thick base, it'll snap easily when pressed so design your project structurally sound.
NOTE: If you would like the inventor parts email me or comment below at Lauer.Cole@gmail.com and I can send them to you.
Step 6: Step 6 Printing/Building: Build Your Project
3D printing takes awhile (multiple days at best) so when printing keep that in mind. Also use lots of glue when designing your project as well as the right type of glue. You may need a drill as well.
I first began my gluing both the top base and bottom base together by placing glue along the edges and applying force to each when pressed together. Then i glued my wheel covers to the wheels that fit into your DC gearbox motor TT. I then detached my Turret from its base and glued the base to the bottom of the car rails at the top of my RC car. I glued the turret to my Servo motor pointer, the piece that attaches to servo, that way when the servo rotates so does my turret. Finally I glued a thick construction paper to one edge to create a covering that you can lift open as well as a piece around turret for looks.
You don't have to do this but I did, I glued the IR relay to my car in order to stabilize it from moving around which also helps with receiving your remote signal. If you do this, make sure your IR Receiver is in the correct orientation that you want to receive signals from.
Step 7: Step 7 Final Setup: Place Arduino
After gluing everything together I glued my DC Gearbox Motors to the base plate of my RC car. I then drilled four holes into the bottom close to each gearbox and center. I maneuvered the two wires from each DC motor through the holes and then re-pined them to the L293D motor driver shield.
Wire everything together again and leave Arduino Uno inside your RC car. You can also bolt it down or glue it down to steady everything which would be a great idea if you'd like.
Step 8: Step 8 Upload: Main File
After the setup is complete. Upload your code to your Arduino Uno via the USB cable the kit comes with or buying the cable online. Click Upload code at the bottom of Arduino App.
Step 9: Step 9 Test: Check If It Works
After uploading the code, plug the batteries into your arduino and/or directly into your L293D motor driver shield, if you use the shield attach the wires into the pins labeled PWR. Those after placing wires inside screw it down and test away. If nothing is happening try adding more power or if you already have tons of power, try removing some.
Begin by pressing the corresponding buttons you assigned in your code.
Step 10: Tips: Enjoy!
Some helpful tips I could've used when building this design are:
1. When 3D modeling the project, remember that it needs to be structurally sound, or can support itself when printed. Otherwise it'll fall apart or break easy or fail when printing.
2. Use the right glue. I used 3 different glues and finally after hours of pain with the gearboxes breaking off I ended with some super gorilla glue. Use the right glue for the right material.
3. When designing where the wheels will fit remember the gearbox has another side to it that juts outward. If you're trying to place it up against a side surface (like I tried) this won't work.
4. Overall, know which parts you want immediately because this can be a costly endeavor.
5. Keep a backup IR Receiver with you. They are delicate and burn out easily which can be a pain when trying to complete this project. That is why I used the relay for protection.
Enjoy your design!