Simple "Robot Kit" for Clubs, Teachers Makerspaces Etc.

by pbecker83 in Circuits > Robots

843 Views, 7 Favorites, 0 Comments

Simple "Robot Kit" for Clubs, Teachers Makerspaces Etc.

IMG_9422.jpg
53687197_10158358765913378_4309237677028278272_n.jpg
MTRAS Robot Kit - Ultrasonic Sensor

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.

Supplies

Primary Parts:

Optional:

Tools:

  • Soldering iron to solder the headers on the Nano
  • Glue Gun
  • Basic screwdriver

Frame

IMG_9374.jpg
IMG_9375.jpg

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.

Prep the Arduino

IMG_4463.jpg
IMG_4464.jpg

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.

Mount the Arduino Shield

IMG_9375.jpg
IMG_9377.jpg
IMG_9378.jpg
  1. Align the 3 yellow spacers with the precut or 3D printed Arduino holes.
  2. 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.

Mount the Servos

IMG_9379.jpg
IMG_9380.jpg
IMG_9381.jpg
IMG_9382.jpg
  1. Note the orientation of the Servo outline on the frame. (Not shown on the 3D printed version but reference the pictures)
  2. Thread two zip ties through the rectangular slots with the head of the Zip Tie on the top side of the frame.
  3. 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.

Power Bank Mount

53777507_10158370258398378_4652038370044674048_o.jpg
IMG_9384.jpg
IMG_9385.jpg
IMG_9387.jpg
IMG_9386.jpg
IMG_9389.jpg
  1. 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.
  2. Run a Zip Tie through the back. Keep loose.
  3. 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.

Wheels

53636694_10158372254088378_7154866059969822720_n.jpg
IMG_9391.jpg
IMG_9392.jpg
IMG_9393.jpg

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.

  1. Make sure the center of your wheel has an opening to allow the small phillps head screw to mount the circular servo horn.
  2. 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.
  3. Using the small phillips screw attach the wheels to the servos. Snug not tight.

Breadboard

IMG_9394.jpg
IMG_9395.jpg
IMG_9396.jpg

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.

Time to Get Moving

IMG_4476.jpg

Wire up the SERVOS to get moving.

  1. 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.
  2. 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.

Add-On: Giving Your Bot Sight

IMG_4469.jpg
IMG_4476.jpg

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.

*Reference the wiring diagram further down in the instructable on how to wire up.

Add - On: Border Detection Via IR Sensor

IMG_9397.jpg
IMG_9399.jpg

In order for your bot to avoid falling off the edge of a table, arena etc. let's add a line sensor. We are using a QTR-MD-06RC Reflectance Sensor Array. Six infrared emitter/detectors face down and measure the distance from the surface back to the sensor.

To add the sensor grab the 4 small 2mm screws, the IR sensor standoff (Smiley Face). Reference the pictures for the correct orientation.

*Reference the wiring diagram further down in the instructable on how to wire up.

Programming - Setup

MTRAS Robot Kit Arduino Screen Shot.JPG

Download the Arduino Software.

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:

  1. Open “Tools”
  2. Select “Arduino Nano” as the Board type
  3. Select Atmega328P (Old Bootloader) as the Processor type
  4. 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.

​Code Overview for Ultrasonic Sensor

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.

Code Overview for Line Following Using SUMO Code

Coming soon.

Programming - Libraries

MTRAS Kit Ping Library Screen Shot.JPG

Start by making sure you have the correct libraries installed .

For the Servos the Servo.h library should be a default.

For the Ultrasonic Sensor HC-SR04:

  1. In the software go to Sketch>Include Library>Manage Libraries.
  2. Search for "NewPing" by Tim Eckel.
  3. Select the latest version and install.

For the QTR-MD-06RC Reflectance Sensor Array:

  1. In the software go to Sketch>Include Library>Manage Libraries.
  2. Search for "QTRSensors" by Pololu.
  3. Select latest version and install.

Program

MTRAS Kit Com Port Screenshot.jpg
  1. For just the Ping Sensor download the MTRAS_Kit_Ping_Sensor_1_18_20.ino file.
  2. For the Line Sensor with Ping Sensor programmed for SUMO download MTRAS_Kit_Sumo_1_18_2020.ino file.
  3. Plug in your Arduino via USB.
  4. Select the COM port (See picture). Your COM port may differ.
  5. Click the check mark to make sure there are no errors.
  6. If everything checked out click on the right arrow to download the program to the Arduino.
  7. Once complete disconnect the USB cable and plug into the Power Bank.

Wiring Diagram

layout_bb.jpg

Use the following image to wire your robot up.

  • For the Ultrasonic sensor use m-f jumper wires.
  • For the line sensor use the m-m jumper wires.
  • For the Servos you can plug the 3 pin connector directly to the pins.

Congratulations!!! You Built a Robot.

IMG_9420.jpg
IMG_9421.jpg
IMG_9423.jpg
IMG_9424.jpg
IMG_9425.jpg
IMG_9428.jpg
IMG_9429.jpg
IMG_9416.jpg
IMG_9417.jpg
IMG_9418.jpg
IMG_9419.jpg
MTRAS Robot Kit - Line Following

For the Ultrasonic code 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"!!!

Addendum

Troubleshooting:

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.