Crash & Go Bots RC Mode

by Tech Rockstar Academy in Circuits > Remote Control

32 Views, 0 Favorites, 0 Comments

Crash & Go Bots RC Mode

The original Crash & Go Bots have been a hit in my local community and at the Maker Faire and Opensauce. One issue I found with the original bot was the Wi-Fi would regularly fail. When the Wi-Fi would fail or lag it would make the battle very random. I started looking into budget friendly solutions for controlling the robots. I noticed my 3D printed RC monster truck had excellent connection to its transmitter during a Maker Faire which got me thinking could I use a toy grad RC transmitter and receiver to drive the robot? Crash& Go Bots only have two states spin and drive forwards which only need a signal to go high or low. I tested this theory by attaching a toy RC receiver to and analog pin on an Arduino nano and I was able to receive data on the state of the trigger from the transmitter. In this Instructable I will show you how you can take an inexpensive RC toy and turn it into a fun nondestructive combat robot.

Supplies

Parts Needed

L298N

Toy grade rc controller and receiver

Arduino Nano

Mini breadboard

F to M breadboard wires

2x DC Geared motors

9v Battery box with switch

M4 Screws and nuts

Electrical tape

Tools

Hot Glue Gun

Wire Stripper

Soldering Iron (optional)

3D Prints

Custom top plate

Crash & Go Bot Arduino Edition

Print Parts

Download the STL file from the link in the components section. Print the Chassis kit with PLA or PETG at 15% infill. I used a Bambu A1 for my print but you can use any FDM printer. If your printer needs more adhesion, enable brim. For the wedge do 10% infill with supports enabled. I used natural supports, the regular setting will work too. I suggest TPU for the wedge due to its flexibility and durability. PLA will work well too. If you plan on using these robots outside in the sun I highly suggest printing in PETG. The sun will degrade PLA over time. Using plastic nippers or scissors to remove any brim or supports from the print.

Power Distribution Circuit

Take the 9v Battery box and hot glue it to the chassis in the orientation shown in the first picture. You will see in that picture I also glued the RC receiver to the underside of the top plate. Depending on what RC toy you use the receiver will fit next to the motor driver or above it on the top plate. Take one black M to F wire and cut the F side off, see second picture. Strip the cut end of the black wire using a wire striper or other tool, see picture 2. Cut the soldered end off the black and red wires coming from the battery box and strip them, see picture 3. Remove the receiver from the RC car and note the two wires from the battery compartment and the wires controlling the rear motor, see picture 4 and 5. Once removed, strip the end of the wires that used to go to the battery compartment, picture 6. Take the black wire coming from the battery box, the stripped black bread board wire, and the ground wire from the RC receiver and twist them together, see picture 7. Note, the ground wire on the receiver will be black or brown and where the wire is soldered you should see a minis symbol. Take an orange M to F wire. Cut the F side off and strip that end of the wire. If the RC you are using takes 2 or 3 double AA or a 3.7v LIPO battery twist the red/orange wire you just stripped together with the red wire coming from the receiver that used to be connected to the battery compartment, see picture 8. If the RC uses a 6.5 - 7.4v battery insert the wire you just stripped and the RC receiver red wire coming from the battery compartment into the 12v port on the L298n motor driver and secure it by tightening the screw down port, see picture 9. Attach the L298n motor driver in the orientation shown in picture 10. Use the M4 screw and nuts to attach the motor driver to the chassis. Make sure the screws are coming from the bottom and up through the chassis, see picture 11. In the 12v port on the L298n motor driver insert the red wire from the battery box and screw down tight, See picture 12. Insert the twisted end coming from the receiver and orange breadboard wire into the 5v port or 12v port see bolded text above on the L298n and screw down tight, see picture 13. Take the twisted end of the black wires coming from the battery box, receiver, and breadboard wire and insert it into the L298n and tighten down see picture 14. Using the breadboard attach the Arduino Nano in the orientation shown in picture 15. Take the top plate and adhere the breadboard to it using the provided adhesive as shown in picture 16. Finally, attach the top plate to the chassis and pull the Orange and black M breadboard wires through the slits. Insert the black wire’s pin into the breadboard next to the GND label on the Arduino Nano, see picture 17. Insert orange wires into the breadboard next to the VIN label on the Arduino, see picture 18.

Motors and Motor Driver Circuit

There are two options for attaching the wires to each motor. You can take a breadboard wire and cut the F side off, strip it and solder it to the motor terminals, picture 1. You can also do this without solder by gently twisting the stripped ends of the wires to the motor terminals, picture two. Pulling those wires down along the bell of the motor, hot glueing them in place and then shielding the exposed wires and terminals with electrical tape, picture 3 and 4. Once you've attached the wires to the motors use the 3D printed clips to slide them on, see picture 5 and 6 for orientation. Insert the wires from each motor into the L298n motor ports and loosely screw them down, see picture 7. Note, do not worry about which motor wire goes where, we will address this after uploading the code in Step 6 Troubleshooting just plug them into the nearest port. The following are the connections you will make from the L298n motor driver to the Arduino Nano. You can use the slits in the top plate for cable management, see picture 6. Note, for new users who haven’t used an Arduino Nano before you will insert the wire pin into the breadboard next to the label on the chip. For example, if you are plugging a wire in from ENA on the Motor Driver to pin 3 on the Arduino Nano , you would locate 3 on the chip and insert the wire on the breadboard adjacent to it, see picture 7.

L298n ENA -> Female end - Yellow wire - Male end -> Arduino Nano Pin 3

L298n IN1 -> Female end - White wire - Male end -> Arduino Nano Pin 2

L298n IN2 -> Female end - Purple wire - Male end -> Arduino Nano Pin 4

L298n IN3 -> Female end - Blue wire - Male end -> Arduino Nano Pin 5

L298n IN4 -> Female end - Green wire - Male end -> Arduino Nano Pin 8

L298n ENB -> Female end - Yellow wire - Male end -> Arduino Nano Pin 9

Transmitter, Receiver, and Uploading Test Code

The final connection to the Arduino Nano is the RC receiver. We will need to upload a test code to figure out which wire will send data when we pull the trigger back to tell the robot to charge forward. You can download the integrated development environment, the IDE, here: Arduino Software: Download the Arduino IDE, Cloud and App Lab

You will use the IDE to write and upload code for/to your Arduino Nano. Once the IDE is installed you will be able to open the code you can download from the materials step in this Instructables. Once the test code is downloaded open your Arduino IDE and navigate to File -> Open -> downloads. Once you select the code it will ask you to make a folder select yes and the code will appear. Before we go any further with the code lets wire the receiver to the Arduino Nano. In Step 2 Power Distribution Circuit, we noted the wires coming from the battery compartment and the rear motor. Strip both the wires that were noted as the rear motor. Take the M to F breadboard wire matching the color of the receiver wires that were just stripped and remove the F ends and strip each wire, see picture 1. Twist the stripped ends of the breadboard wires to their matching colored stripped wire coming from the receiver, see picture 2. Pick one of the receiver wires, lace it through the top plate and insert next to the A0 pin on the Arduino Nano, see picture 3. Leave the other unconnected. Connect the Arduino Nano to the computer’s USB. In the IDE go to the tools tab at the top most ribbon. In the drop down menu hover over Boards. Hover over Arduino AVR Boards and select Arduino Nano, see picture 4. Open the AnalogTest.ino code(you can download this from the supplies section) select the upload arrow, see picture 5. If the upload fails you will need to select a different processor. You can do this by selecting tools and hovering over the processor option, see picture 76 At the time of writing this the Arduino IDE will default to Atmega328p. If you bought your Arduino Nano from Amazon or Aliexpress they will usually the the Atmega328p(Old Bootloader) processor. If that doesn’t fix the issue please troubleshoot further with Arduino here: If your sketch doesn't upload – Arduino Help Center

Now that you have to code installed we will see if any data is being sent from the receiver to the Arduino Nano. Make sure to put the 9V battery into the robot, put on the wheels and wedge, and make sure the receiver is switched on before proceeding. Keep the Arduino Nano connected to the computer and navigate to tools and select Serial Monitor. You will see the monitor popup at the bottom of the screen and a bunch of text scrolling, see picture 8. Once you see this, turn on your transmitter and pull the trigger and note if you see the values change. If they do change every time you pull the trigger you have the correct wire plugged into the Arduino Nano. Otherwise, you will need to replace the wire plugged next to the A0 pin on the Arduino Nano with the other wire coming from the receiver, see picture 9. If nothing changes with either wire, please check that both the receiver and transmitter are switched on.

Let’s Code

Now that you have information going to the Arduino Nano from the receiver we will upload the code that makes it respond. You can download the Crash_Go_Controller_v_2_1 code from the supplies section. Once you open the code you will see grey lines of text that will explain what the line of code below it does. Navigate to line 45 where you will see if(ValA ,20), see picture 1. You will want to delete the number 20 and set it to the value when you're not pressing the trigger you noted from the Step 4. Once that's done place the robot on top of the electrical tape roll, so the wheels aren't touching the ground. Once this code is uploaded the robot will attempt to drive. Attache the robot to your computer via the USB cord. Power on the RC transmitter, the RC receiver, and the robot. Upload the code and wait a second for the wheels to start turning. One wheel should be going backwards and other forward. If not pull the trigger on the transmitter back and note the wheel that changes direction. The wheel that changes direction should be rotating backwards and the other wheel forwards. If either are not going in the correct direction. Power off the robot and locate the ports on the motor driver where that motor is connected. Remove the wires and switch their orientation, this will reverse the direction of that motor. For example, if the blue wire is attached to the port closet to the wedge and the white wire is in the rear remove both. Insert the white wire where the blue wire was and secure it. Insert the blue wire where the white wire was and secure it.

Troubleshooting

Here are some common issues and their solutions:

The robot's receiver gets stuck making the robot charge forward or spin in place after a few commands. There isn't enough voltage going to the receiver. Remove the receiver power wire from the 5v input on the L298n motor driver and move to the 12v pin instead.


The robot isn't receiving commands. Turn off everything. Turn on the transmitter first, then the robot, and finally the receiver. This will re-pair the transmitter to the receiver.

The robot seems to charge or spin at random. Open the Crash_Go_Controller_v_2_1 and reduce the value in the if statement and reupload. Sometimes the value transmitted from the receiver changes with the lifecycle of the battery.


The motors are going in the wrong direction, see Step 5 of this Instructible.

Battle!

Now that you have a functioning RC Crash & Go Bot there are several ways to battle.

You can do a robot wrestling match where you set up boundaries and try to push your opponent out. Another fun game is to 3D print a bunch of cones and do and obstacle race. You can even play a version of robot soccer/ hockey with these bots. If you have questions or ideas, please leave them in the comments below and I will respond ASAP.