The idea was to build a small, yet expandable, kit for our members of the "Middle TN Robotic Arts Society". We plan workshops around the kit, especially for competitions, such as line following and quick trip.
We've incorporated an Arduino Nano due to its small size, yet big I/O count. With the addition of a Breakout board, all pins are easily accessible and Servo-friendly. We ditched standard batteries and opted for a 3350mAh Power Bank which includes a USB charging cable and power LED status. The USB cable doubles as the programming cable. Two Continuous Rotation servos for drive to get builders rolling quickly and easily. A small breadboard allows you to quickly and easily prototype. 3mm Holes line the perimeter of the board to allow you to add components.
For our club members we sell the kit AT COST and you must be in attendance to get one. Actually we're losing money if you factor in the time it takes to design, build a curriculum, make the parts (3D printing, Laser cutting etc) and kit it all together. We got our kit cost down to $29.99. You can get this price lower if you order parts with longer shipping times. We realize that it's not the cheapest kit out there, but we put an emphasis on coming up with something easy to build and expandable that does not take days to put together. In fact, this kit should take less than an hour to get moving.
- Arduino Nano
- Battery Power Bank
- Robot Frame
- SliderM-F Jumpers
- Ultrasonic Sensor
- Qty 3 - 3mmx10mm 3m Screws with Nuts
- Qty 3 - 3mmx3mm spacer
- Qty 2 - Continuous Rotation SF90R Servo
- Qty 2 - Wheels 52ish mm Wheels
- Qty 4 - 6" Zip Ties (Get the thin ones about 3.5mm wide) The variety pack from Harbor Freight work well.
- Mini Breadboard
- Soldering iron to solder the headers on the Nano
- Glue Gun
- Basic screwdriver
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Frame
To help get builders going quickly, we engraved an outline with text on each side of the frame to indicate where the parts should be placed.
We were fortunate to have laser cutter access. If you do not, we suggest reaching out to local makerspaces to see if they have one you could use or if they would be willing to cut the frame out for you.
A 3D printer could also be used to print the base. We included the SVG and STL for you to use with either.
We used 3mm acrylic for our kits. You could use other media such as wood, cardboard, foam board, etc.
Step 2: Prep the Arduino
To make it easier to solder the headers to the Arduino, insert the male headers into the Arduino shield. Line up the Arduino Nano with the headers. Note the markings on the board vs the shield. Solder all the pins up and you're done.
Step 3: Mount the Arduino Shield
- Align the 3 yellow spacers with the precut or 3D printed Arduino holes.
- Use the M3x10 screws and nuts to attach the Arduino shield. Snug, not tight. If you're worried about the screws loosening up, just add a touch of hot glue to the end of the nut. Don't worry about the 4th hole on the shield, as it will not be needed and interferes with the Power Bank later during the build.
Step 4: Mount the Servos
- Note the orientation of the Servo outline on the frame. (Not shown on the 3D printed version but reference the pictures)
- Thread two zip ties through the rectangular slots with the head of the Zip Tie on the top side of the frame.
- Insert servos and run wire harness through rectangular slots towards the rear. Tighten Zip Ties tight. If the servo does not feel secure, you can add a little hot glue on the sides where the servos touch the frame.
Step 5: Power Bank Mount
- Run a Zip Tie between the Arduino and Breadboard location in the orientation shown with the head of the Zip Tie on the top side. Keep loose.
- Run a Zip Tie through the back. Keep loose.
- Slide in the Power Bank and tighten Zip Ties firmly. Note the orientation.
Note: We are using a 3D printed "slider" for the front, seen in the images. However, we found it was causing too much friction, so you may want to experiment with other ideas like a bottle cap, plastic furniture glider, etc.
Step 6: Wheels
We used a laser cutter to cut our wheels out of EVA foam. You can use whatever you like. Lids from jars, 3D printed, old toy wheels, etc. Try to find wheels approximately 52mm in diameter.
- Make sure the center of your wheel has an opening to allow the small phillps head screw to mount the circular servo horn.
- Center up the servo horn included with your servos and glue to the wheels. Be careful not to get glue into the center hole and keep the wheel even with the servo horn to reduce wobble.
- Using the small phillips screw attach the wheels to the servos. Snug not tight.
Step 7: Breadboard
Peel the backing off the breadboard. Align with the engraving on the top of the frame and attach. If using the 3D printed frame, use the rectangular recessed portion of the print.
Step 8: Time to Get Moving
Wire up the SERVOS to get moving.
- Attach the wire harness from the left servo (Servo to the left if your looking from the back) to Pin 10 with the orange wire closest to the Arduino.
- Attach the wire harness from the right servo (Servo to the right if your looking from the back) to Pin 11 with the orange wire closest to the Arduino.
Step 9: Giving Your Bot Sight
Now we need to add something to keep the bot from running into things. Use the Ultrasonic sensor.
- Attach the sensor to the Breadboard as shown in the picture.
- Use a red M-F jumper to go from "VCC" on the sensor to any pin on the "V" rail or anywhere you see the pin labeled "5V" on the shield.
- Use a brown or black M-F jumper to go from "Gnd" of the sensor to any pin on the "G" rail or anywhere you see a pin labeled "GND".
- Using any other color M-F jumper go from the "Echo" on the sensor to pin 9 on the shield. In the picture we are using a white jumper.
- Using any other color M-F jumper go from the "Trig" on the sensor to pin 8 on the shield. In the picture we are using a yellow jumper.
Go ahead and clean up all the wiring so they are secure. You can use zip ties or the 1/4" cable wrap cut to length.
Step 10: Programming - Setup
Download the Arduino Software.
We are using vs 1.8.9
Follow the standard instructions.
Once you have it installed, open the software and setup for an Arduino Nano. This may vary between different manufacturers but if you have the one from the parts list:
- Open “Tools”
- Select “Arduino Nano” as the Board type
- Select Atmega328P (Old Bootloader) as the Processor type
- Connect the Arduino Nano using the Micro USB cable included with your charger to any USB port on your PC. If you get an error like "Unknown Device" you may need to install the correct drivers. See the Addendum portion of this instructable to help.
Step 11: Code Overview
The code is very basic and uses two libraries - Servo.h and NewPing.h. Servo.h is a built in library provided by the Arduino foundation and is used to control PWM (pulse width modulated) signals to each of the servos. The reference to this library can be found here: https://www.arduino.cc/en/Reference/Servo
NewPing.h, as mentioned before, is a 3rd party library by Tim Eckel. It is used to give us a simple interface into the world of time based measurement. The reference to this library can be found here: https://www.arduino.cc/en/Reference/Servo
For this setup we've created a basic forward, left, right, repeat example. We wanted to give our members a starting point that would demonstrate how to use both the ultrasonic sensor and two continuous rotation servers(one in reverse of the other). In our loop, the robot scans ahead and if clear continues moving forward. However, if it senses that it is near and object (ping time is shorter than our chosen minimum), then it stops, turns left, scans, turns right, scans again, and goes in the direction that is more open.
You may notice that each of the two servos are given different commands for forward - this is because the servos are mounted on the chassis pointing in opposite directions. Because of this, each servo needs to move in opposite directions for the bot to move forward as opposed to in a circle. The same is true if you wanted to move in reverse.
This example demonstrates very basic obstacle avoidance but can be greatly improved upon. Example "homework" for you might be to do a full 360 degree sweep of the area on start up and choose the most open path. Scan wider from side to side and see if the bot is getting "boxed in". Combine with other sensors to solve a maze.
Step 12: Programming - Libraries
Start by making sure you have the correct libraries installed . The Servo.h library should be a default. The NewPing.h you may need to install.
- In the software go to Sketch>Include Library>Manage Libraries.
- Search for "NewPing" by Tim Eckel
- Select the latest version and install.
Step 13: Program
- Download the MTRAS_Kit_Ping_Sensor.ino file.
- Plug in your Arduino via USB.
- Select the COM port (See picture). Your COM port may differ.
- Click the check mark to make sure there are no errors.
- If everything checked out click on the right arrow to download the program to the Arduino.
- Once complete disconnect the USB cable and plug into the Power Bank.
Step 14: Congratulations!!! You Built a Robot.
The robot should start moving around. Whenever it senses an object within 35cm it will stop, move to the left and take a quick measurement, then move to the right and do the same. It determines which side had the highest distance and moves in that direction.
Check out the great pictures of our first build day using line sensors. Everyone had a great time and we learned a lot from the build. We hope you do to.
Now that you're finished, share it with your friends. Bring it to your local makerspace or robotics club. Build more. Make it better. The kit is always evolving but we always try to keep it simple enough to build in a short time frame.
Let us know if you have any questions, ideas, if you built one etc. Don't forget to check out the Addendum for some troubleshooting tips.
Don't forget to vote for us for the "Robotics Contest"!!!
Step 15: Addendum
Robot Turning the Wrong Direction:
- Try swapping the wire harness between the left servo and right servo.
PC Doesn't recognize my Arduino:
- If you have issues uploading you may need to load the drivers for the Arduino
Emakefun Nano is using the chips ATmega328P and CH340, not FT232 so please use the driver from this link.
Also see this video for further help.
Arduino turns off randomly:
- If you notice the Battery Pack turning off use a 100ohm Resistor to simulate a load. The battery pack is designed to charge so it requires a certain load to stay on. Run the resistor between 5V and GND on the shield. You can use the bread board for the resistor and run a wire from one side of the resistor to a "GND" pin on the shield and the other jumper to a "5V" pin.
Robot doesn't seem to move very well:
- Try sliding the Power Bank forward or backward a little.
- Replace the front slider with something smoother.
- Add a rubber band to the wheels for better traction.
1 Person Made This Project!
AndrewHoover made it!