HausOfPayne/Arduino
Gord Payne's "Plastic Ant" Battle Bot Build (PAB3)
Completed May 6, 2018
'Plastic Ant' is a relatively new class of battle bot, detailed on sparkfun.com. The intention of this class is to provide the ability to build relatively inexpensive battle bots that are fairly 'safe' for young adults to construct and enter into competition.
The key features of the class are that the bots are made of plastic and must weigh no more than 1 pound fully loaded (0.453kg). This is a variation of the 'Ant Weight' class that is any bot with a total weight of 1 pound or under.
At the bottom of this page is a list of parts that were sourced for the build. All parts were purchased from eBay or aliExpress. They're a fraction of the cost of the parts on sparkfun.com and work identically. For programming the bots, you can find appropriate code if you do some hunting.
The key features of the class are that the bots are made of plastic and must weigh no more than 1 pound fully loaded (0.453kg). This is a variation of the 'Ant Weight' class that is any bot with a total weight of 1 pound or under.
At the bottom of this page is a list of parts that were sourced for the build. All parts were purchased from eBay or aliExpress. They're a fraction of the cost of the parts on sparkfun.com and work identically. For programming the bots, you can find appropriate code if you do some hunting.
Sparkfun Plastic Ant Videos:
The links in the videos will take you to sparkFun.com for parts, and to Thingverse.com for the basic wedge design .stl files. I downloaded the files and modified them slightly with TinkerCad. Primarily I rotated the case file so that the bottom of the case is on the bed of the printer.
March 9, 2018
The Tech Department at my school was kind enough to loan me their Cubicon 3D printer (Thanks MS!). The parts took in excess of 6 hours to print even with FAST speed and NO InFill. You may wish to use some degree of infill for structural integrity.
I did a quick fitting of the motors, wheels and lid. Things look great for a first assembly! March Break starts today so I'll do a bit of assembly over the vacation. Those 1.6mm screws for the motors are TINY!! Get out your mini Phillips screwdriver!
I'll probably use an Arduino Pro Mini for the controller. That's a Pro Micro in the picture just for scale. The bot is 100mm long and 80mm wide. It's petit!
March 9, 2018
The Tech Department at my school was kind enough to loan me their Cubicon 3D printer (Thanks MS!). The parts took in excess of 6 hours to print even with FAST speed and NO InFill. You may wish to use some degree of infill for structural integrity.
I did a quick fitting of the motors, wheels and lid. Things look great for a first assembly! March Break starts today so I'll do a bit of assembly over the vacation. Those 1.6mm screws for the motors are TINY!! Get out your mini Phillips screwdriver!
I'll probably use an Arduino Pro Mini for the controller. That's a Pro Micro in the picture just for scale. The bot is 100mm long and 80mm wide. It's petit!
April 19, 2018
It's been a long wait for the battery to arrive. Wouldn't you know it, it's too tall for the case! I ordered another one, hopefully it'll fit better.
I've spent the last couple of days working on transmit/receive circuits and sketches. Initially I wanted to use Bluetooth modules for both the transmitter and the receiver. I also decided to turn my YABR joystick transmitter shield into a dual-mode shield by adding Bluetooth to it.
The shield mods went fine. But Bluetooth was problematic. I had to use an HC-05 for the transmitter as it needs to be in 'master' mode. Took a couple of days to decypher several websites and had to solder a wire onto pin 34 to get it into AT mode. After that, I got it to pair to an HC-06 'slave' but it wouldn't send/receive. Obviously things aren't totally configured correctly.
So I've put the Bluetooth option to bed.
I'm thinking that Bluetooth may be best suited for just using a module for a receiver in the robot and using an Android (or iOS) app to control the bot.
Thankfully, HC-12 is a much more straightforward option. HC-12 also has a longer range (between 1000m and 1.8km!)
The HC-12 module goes right into my modified transmitter shield and it works great! I also got a receiver sketch working to which I'll just add the robot motor driving code.
I'm basing the joystick code on the YABR remote code. The nunchuk is an i2c device. Who knew?
Now it's time to start the actually assembly of the parts. It's going to be a VERY tight fit. I may wind up using a straight L293D h-bridge IC rather than a motor-shield to save space. We'll see how things go.
I'll be replacing the battery connector with a smaller JST type connector with slightly more narrow gauge.
More to come!
April 20, 2018
Major progress today!
I assembled the robot components with a breadboard for testing. Had to learn how to use the DC motor controller and in the process was 'schooled' on the perils of Pulse Wave Modulation. I'm using an UNO for the testing but I'll need to use the Arduino Pro Mini to squeeze everything into the bot case.
The motor controller has a maximum continuous current limit of 600mA. I used a demo sketch to learn how to use the controller and it had a maximum speed variable defined. I didn't realize the purpose for the max_speed variable until I started feeding 255 to my PWM ports and the motor controller got fried because my battery can supply substantially more than 600mA per motor (my battery can supply 650mA).
Thankfully I had a second motor controller that seems to run fine when I maximize my PWM value at just under 200.
The 'reverse' part of the sketch works fine with no real modifications. However for some strange reason, the 'forward' part produces opposite speed. So for now, I just did 200 minus the value from the nunchuk and it works well.
The nunchuk sketch works great and using HC12 was a walk in the park compared to trying to use Bluetooth.
Next up? Squeeze everything into the case. Final assembly!
April 24, 2018
The second battery arrived from Amazon.ca. Out of dozens, it's the smallest thickness I could find with just over 1000mAh. Batteries with exactly 1000mAh were actually thicker so wouldn't allow the lid to be put on . This one fits with the lid about 0.5mm still open.
I cut off one of the screw posts to make room under the wedge for the 12v to 5v buck converter and the Pro Mini.
Here's a picture of the trial fitting. It sure is SNUG!
Time to start soldering!
It's been a long wait for the battery to arrive. Wouldn't you know it, it's too tall for the case! I ordered another one, hopefully it'll fit better.
I've spent the last couple of days working on transmit/receive circuits and sketches. Initially I wanted to use Bluetooth modules for both the transmitter and the receiver. I also decided to turn my YABR joystick transmitter shield into a dual-mode shield by adding Bluetooth to it.
The shield mods went fine. But Bluetooth was problematic. I had to use an HC-05 for the transmitter as it needs to be in 'master' mode. Took a couple of days to decypher several websites and had to solder a wire onto pin 34 to get it into AT mode. After that, I got it to pair to an HC-06 'slave' but it wouldn't send/receive. Obviously things aren't totally configured correctly.
So I've put the Bluetooth option to bed.
I'm thinking that Bluetooth may be best suited for just using a module for a receiver in the robot and using an Android (or iOS) app to control the bot.
Thankfully, HC-12 is a much more straightforward option. HC-12 also has a longer range (between 1000m and 1.8km!)
The HC-12 module goes right into my modified transmitter shield and it works great! I also got a receiver sketch working to which I'll just add the robot motor driving code.
I'm basing the joystick code on the YABR remote code. The nunchuk is an i2c device. Who knew?
Now it's time to start the actually assembly of the parts. It's going to be a VERY tight fit. I may wind up using a straight L293D h-bridge IC rather than a motor-shield to save space. We'll see how things go.
I'll be replacing the battery connector with a smaller JST type connector with slightly more narrow gauge.
More to come!
April 20, 2018
Major progress today!
I assembled the robot components with a breadboard for testing. Had to learn how to use the DC motor controller and in the process was 'schooled' on the perils of Pulse Wave Modulation. I'm using an UNO for the testing but I'll need to use the Arduino Pro Mini to squeeze everything into the bot case.
The motor controller has a maximum continuous current limit of 600mA. I used a demo sketch to learn how to use the controller and it had a maximum speed variable defined. I didn't realize the purpose for the max_speed variable until I started feeding 255 to my PWM ports and the motor controller got fried because my battery can supply substantially more than 600mA per motor (my battery can supply 650mA).
Thankfully I had a second motor controller that seems to run fine when I maximize my PWM value at just under 200.
The 'reverse' part of the sketch works fine with no real modifications. However for some strange reason, the 'forward' part produces opposite speed. So for now, I just did 200 minus the value from the nunchuk and it works well.
The nunchuk sketch works great and using HC12 was a walk in the park compared to trying to use Bluetooth.
Next up? Squeeze everything into the case. Final assembly!
April 24, 2018
The second battery arrived from Amazon.ca. Out of dozens, it's the smallest thickness I could find with just over 1000mAh. Batteries with exactly 1000mAh were actually thicker so wouldn't allow the lid to be put on . This one fits with the lid about 0.5mm still open.
I cut off one of the screw posts to make room under the wedge for the 12v to 5v buck converter and the Pro Mini.
Here's a picture of the trial fitting. It sure is SNUG!
Time to start soldering!
April 26, 2018
Soldering went well however it's very tight so connecting wires need to be short. I'm soldering the wires directly to the Arduino Pro Mini to save vertical space so the HC12 transceiver can sit on top of the Arduino (or vice versa).
Lesson learned: Don't solder when you're tired. I soldered the HC12 RX and TX pins to the RX and TX pins on the Arduino rather than pins 2 and 3. I'll correct it tonight.
Because the Pro Mini doesn't have a USB adapter, you either need a USB-FTDI adapter or make your own programming cable used in combination with an Arduino UNO. See my main Arduino webpage for details on making the cable.
With some luck, we power up and drive it tomorrow tonight!
April 27, 2018
It's assembled! I installed a master power switch on the back as it would not be practical to constantly unscrew the lid just to power the bot on and off.
I installed an LED on pin 9 that indicates when the bot is powered on as per the Plastic Ant class rules.
Installed a momentary contact switch inside the transmitter to allow the unit to power up as 2.4Ghz (for the YABR) or HC-12 for the battle bot based on whether the switch is depressed or not, on startup. Just have to modify the transmitter sketch with a switch/case structure to manage which mode is operating at any given time.
The battery dominates the inside of the case. the connector above the Arduino holds the HC12 transceiver.
I ordered some 2000 rpm motors and I'll try them in the bot when they arrive, but the original 200 rpm motors work very well. The bot turns in its own length.
I hope there'll be interest to try this class in high schools. It's an inexpensive yet challenging way to get into battle bots!
April 29th, 2018
Setback - Blew a second motor controller board! AAAHH!! I'm going to try using a good old L293D quad h-bridge IC. It has the same 600mAh rating and I think I have some in my stock.
Ah...the challenges of being a maker!
Soldering went well however it's very tight so connecting wires need to be short. I'm soldering the wires directly to the Arduino Pro Mini to save vertical space so the HC12 transceiver can sit on top of the Arduino (or vice versa).
Lesson learned: Don't solder when you're tired. I soldered the HC12 RX and TX pins to the RX and TX pins on the Arduino rather than pins 2 and 3. I'll correct it tonight.
Because the Pro Mini doesn't have a USB adapter, you either need a USB-FTDI adapter or make your own programming cable used in combination with an Arduino UNO. See my main Arduino webpage for details on making the cable.
With some luck, we power up and drive it tomorrow tonight!
April 27, 2018
It's assembled! I installed a master power switch on the back as it would not be practical to constantly unscrew the lid just to power the bot on and off.
I installed an LED on pin 9 that indicates when the bot is powered on as per the Plastic Ant class rules.
Installed a momentary contact switch inside the transmitter to allow the unit to power up as 2.4Ghz (for the YABR) or HC-12 for the battle bot based on whether the switch is depressed or not, on startup. Just have to modify the transmitter sketch with a switch/case structure to manage which mode is operating at any given time.
The battery dominates the inside of the case. the connector above the Arduino holds the HC12 transceiver.
I ordered some 2000 rpm motors and I'll try them in the bot when they arrive, but the original 200 rpm motors work very well. The bot turns in its own length.
I hope there'll be interest to try this class in high schools. It's an inexpensive yet challenging way to get into battle bots!
April 29th, 2018
Setback - Blew a second motor controller board! AAAHH!! I'm going to try using a good old L293D quad h-bridge IC. It has the same 600mAh rating and I think I have some in my stock.
Ah...the challenges of being a maker!
May 3, 2018
I built an L293D-based motor controller last night. It's tight, it's not elegant but it does the job.
It will be important to carefully calibrate the maximum PWM values that are sent to the motors so as not to burn out the L293D (and potentially cause a LiPo bot fire!) Notice the heat sink on top of the IC.
Tested the module in the car with an external UNO and some basic sketches and the motors turn at various speeds.
Now I just have to re-load the onboard Arduino Mini Pro with the sketch and play around to get the sketch working with the new module.
Getting close!
I built an L293D-based motor controller last night. It's tight, it's not elegant but it does the job.
It will be important to carefully calibrate the maximum PWM values that are sent to the motors so as not to burn out the L293D (and potentially cause a LiPo bot fire!) Notice the heat sink on top of the IC.
Tested the module in the car with an external UNO and some basic sketches and the motors turn at various speeds.
Now I just have to re-load the onboard Arduino Mini Pro with the sketch and play around to get the sketch working with the new module.
Getting close!
May 6, 2018
Finished testing the receiver/motor sketch. The original Pro Mini is shot. I replaced it with another and everything works great!
I hot-glued machine nuts into the screw posts inside the bot so it'll be much more robust for repeated opening/closing of the lid.
This has been another very instructive and challenging project with a great finish!
Go build your own! I need an opponent!
Drop the mic!
Finished testing the receiver/motor sketch. The original Pro Mini is shot. I replaced it with another and everything works great!
I hot-glued machine nuts into the screw posts inside the bot so it'll be much more robust for repeated opening/closing of the lid.
This has been another very instructive and challenging project with a great finish!
Go build your own! I need an opponent!
Drop the mic!
NOW GO OUT AND
MAKE SOMETHING WONDERFUL!
Parts List
(The links may expire over time. Do your best.)
All are from eBay and aliExpress
I have tried to source identical parts to those in the SparkFun project. The motors do fit the holes that were printed in the robot case.
Microcontroller - I used a Pro Mini. Use whatever will fit in your case with all the components and battery.
Motors - DC 6V 200RPM to 2000RPM Micro Speed Reduction Gear Motor with Metal Gearbox Wheel Shaft
Get the highest RPM rated motors you can that have the correct dimensions to fit the case. Higher RPM means your
bot's power will drain faster.
Motor Mounting Screws - 1.6mm by 6mm long, Stainless Steel Phillips Countersunk head Screws
Wheels - 4 Pieces/Lot,42-3A Small Rubber Wheels, Pulley, DIY Toy Wheels,3mm D-Hole, 39mm Diameter, Suitable for N20 gearmotors. (Remember, if your wheels' diameter is too small, you'll be 'turtled' if you're flipped over. Make sure the wheels extend beyond the chassis' top and bottom.)
Motor Shield - L9110S H-bridge Stepper Motor Dual DC Driver Controller Board for Arduino YC
HINT - These shields are VERY inexpensive. Order a few. You'll probably fry a few in the process of building/coding
your bot.
Battery - High Quality ZOP Power 7.4V 1000mAh 25C Lipo Battery JST Plug for RC Helicopter Qudcopter Car Airplane
WARNING! - make sure the battery you order will fit inside your bot case. It's pretty tight and low in there!
Check the measurements of the battery before ordering.
WARNING 2 - Try to get a suitable battery with close to the 1000mAh rating. The motor shield can only handle a
maximum current of 600 mAh per side so 1000/2 = 500, a bit of a safety margin. If not possible, make sure
you limit your maximum PWM value that you can send to the motors so you don't over-current the
controller.
You may want some battery connector leads such as the ones here:
100mm JST Connector Plug Cable Female Male for RC BEC Lipo Battery Hot
The style you get will depend upon the connector on the battery you purchase.
Remote Control. You have several options including:
a) Bluetooth with Android (or "BLE" if you want to run it with an iPhone/iPad) is an inexpensive option. There are free 'RC Car' apps for Android and iOS. Just look around. Bluetooth is very easy to program in Arduino.
b) HC-12 transceiver modules. These are very inexpensive and they're easier to program than Bluetooth! They also have a range between 1000m and 1.8kilometres! Order the modules that come with the little coil antennas.
c) 2.4GHz transceiver pair along the lines of the YABR Balancing Robot by Joss Brokking (brokking.net). The transceivers are
fairly inexpensive but they're significantly more complex to program in Arduino than Bluetooth.
d) Off-the-shelf RC unit with a modified receiver as per the Sparkfun Youtube videos. This looks like a fair bit of work.
Remember you have limited space in the case so keep things small!
Microcontroller - I used a Pro Mini. Use whatever will fit in your case with all the components and battery.
Motors - DC 6V 200RPM to 2000RPM Micro Speed Reduction Gear Motor with Metal Gearbox Wheel Shaft
Get the highest RPM rated motors you can that have the correct dimensions to fit the case. Higher RPM means your
bot's power will drain faster.
Motor Mounting Screws - 1.6mm by 6mm long, Stainless Steel Phillips Countersunk head Screws
Wheels - 4 Pieces/Lot,42-3A Small Rubber Wheels, Pulley, DIY Toy Wheels,3mm D-Hole, 39mm Diameter, Suitable for N20 gearmotors. (Remember, if your wheels' diameter is too small, you'll be 'turtled' if you're flipped over. Make sure the wheels extend beyond the chassis' top and bottom.)
Motor Shield - L9110S H-bridge Stepper Motor Dual DC Driver Controller Board for Arduino YC
HINT - These shields are VERY inexpensive. Order a few. You'll probably fry a few in the process of building/coding
your bot.
Battery - High Quality ZOP Power 7.4V 1000mAh 25C Lipo Battery JST Plug for RC Helicopter Qudcopter Car Airplane
WARNING! - make sure the battery you order will fit inside your bot case. It's pretty tight and low in there!
Check the measurements of the battery before ordering.
WARNING 2 - Try to get a suitable battery with close to the 1000mAh rating. The motor shield can only handle a
maximum current of 600 mAh per side so 1000/2 = 500, a bit of a safety margin. If not possible, make sure
you limit your maximum PWM value that you can send to the motors so you don't over-current the
controller.
You may want some battery connector leads such as the ones here:
100mm JST Connector Plug Cable Female Male for RC BEC Lipo Battery Hot
The style you get will depend upon the connector on the battery you purchase.
Remote Control. You have several options including:
a) Bluetooth with Android (or "BLE" if you want to run it with an iPhone/iPad) is an inexpensive option. There are free 'RC Car' apps for Android and iOS. Just look around. Bluetooth is very easy to program in Arduino.
b) HC-12 transceiver modules. These are very inexpensive and they're easier to program than Bluetooth! They also have a range between 1000m and 1.8kilometres! Order the modules that come with the little coil antennas.
c) 2.4GHz transceiver pair along the lines of the YABR Balancing Robot by Joss Brokking (brokking.net). The transceivers are
fairly inexpensive but they're significantly more complex to program in Arduino than Bluetooth.
d) Off-the-shelf RC unit with a modified receiver as per the Sparkfun Youtube videos. This looks like a fair bit of work.
Remember you have limited space in the case so keep things small!