Friday, September 14, 2012

$10 Robot Challenge Submission

Math Player

Description

This submission is a category two robot controlled via an Arduino Uno with an ATmega16U2 processor.  The robot is designed for primary education.  The robot is a fun, constructive game for younger children to use while learning simple arithmetic.  It randomly generates an addition problem within set parameters and displays it to the user in a simple, comfortable format.  The user can then enter their response on the colorful, attached keyboard.  The user's inputted response is displayed, and can be submitted.  The robot will check a user's inputted solution and immediately provide feedback for correct or incorrect results.  If the user's answer is correct, the robot lights up, and then generates a new problem.  If the user is incorrect, the robot vibrates, and allows the user to try again on the same problem.

This robot would likely be built in a factory and then shipped to end users as wiring and soldering are required  The only necessary accessoriey for the unit is a $1 9V battery.

This prototype was produced for $90.13.  I believe this robot could be massed produced for 53.87 per unit when produced in quantities of 100 units.  I would expect this number to be significantly lower if production was 1000 units, for example.

Educational Application

This device has tremendous educational applications.  It is designed primarily for primary education; specifically younger children learning simple arithmetic.  The robot randomly generates math problems for the user to solve.  The robot will then check the user's inputted solution, and immediatly notify them if they are correct or incorrect.  Incorrect answers require the user to try again before moving on.  The robot entire functionality is educational.

Tools & Materials

Tools
All parts and equipment are easily found and readily available from many resources, including most general electronics stores.

Materials
For a total cost of $90.13.

* The included I2C Backpack is necessary to daisy chain the displays (reducing the number of Arduino pins necessary).

Construction Process

The robot was constructed in two phases: Hardware & Software.

Hardware

  1. All parts and materials were compiled
  2. All 3 4-Digit 7 Segment displays were assembled according to Adafruits included instructions (available here).  They are very easy to follow, so I won't reproduce them here, although here are a few project specific points:
    • Jumper wires were soldered directly to the board.  Adafruit's instructions provide for male header pins to be soldered to the board, however, I'm not going to be attaching this board  a breadboard, so jumper wires work a lot better.
    • Since this project uses 3 individual 7-segment displays, daisy chained together, we need a way to address each display individually in code.  In order to accomplish that, one display will be left alone, another will have the A0 pad bridged, and the final will have the A1 pad bridged.  The A pads are on the side of the display opposite the adafruit logo (shown on the left edge of the board in the picture below).  This step is very important.  If forgotten, all the displays will show the same thing (a lesson I learned the hard way).
    • Further, since we are daisy chaining the displays together, all of the leads of the same type can be soldered together.  For example all of the "SCL" leads coming from each of the boards were soldered together, and then to one extending lead (Note the joint where the three individual leads meet with the extending lead was covered to prevent shorting when the project is put together into the final case).  This extending lead will eventually be connected to the Arduino.
Photo from Adafruit Learning Technologies.  http://learn.adafruit.com/system/assets/assets/000/000/152/medium800/7segsolder.jpg?1339688588

  1. The case was then cut to accommodate the three 4-digit 7-semgent displays
    1. A rough sketch of the placement was made, and then a scizzors was used to make an initial, rough hole in order to put the nibbler into the plastic.
    2. The nibbling tool was then used to cut a rectangular slot for each display.
    3. Each slot was then filed down to smooth out the edges and facilitate a better fit for the displays.
  2. Each display was then glued into the case.  An initial, small amount of glue was placed inside the case to secure each display, and then the majority of the parimeter was glue to ensure a snug fit and a tight seal.
  3. The case's door was then measured and cut to accommodate the Arduino's USB port.  In a production version of this product, this would be unnecessary.  However, in order to facilitate easier testing and debugging in this prototype model, this hole was cut.  The inital hole was again made with a scissors, and then cleaned with the nibbling tool and a file.
Photo of the project case - including the door and included screws
Photo from Sparkfun.com https://dlnmh9ip6v2uc.cloudfront.net/images/products/8/6/3/2/08632-06-L.jpg


   4.  The Arduino was then placed inside the case.  It's a close fit, but a drop of hot glue was added to ensure it wouldn't move.
   5.  The keyboard matrix was then wired to the Arduino.  It requires 7 pins, so I attached 7 jumper wires to the keyboard, and then plugged them into 7 consecutive Arduino pins.  The keyboard was then lightly glued to the outside of the case to hold it in place, with the keyboard sticking out, and the wires inside the case.
   6.  Turning back to the displays, recall we previously soldered all like leads together; now we need to connect those leads to the Arduino.  The big solder joints where the 4 wires meet was lightly glued to the case in order to prevent the wires tangling or obstructing the closing of the case.
   7.  The vibration motor was then soldered to two leads, and then attached to the case (an adhesive came attached to the motor).  The leads were connected to the Arduino.
   8.  Finally the LEDs were wired and glued into their positions.  Their wires were carefully placed under the other large bunches of wires already present.

Software

  1. Using the Arduino IDE, a new program was created and set up.
  2. All necessary variables and hardware were declared and initialized.
  3. Some basic setup was preformed in the default setup method.
  4. The standard loop method was then set up to check if a key was pressed on the keyboard:
    1. If a number key was pressed, update the internal variables and display the user's inputted value on the screen.
    2. If the "*" key was pressed, check the user's inputted solution and respond accordingly.
    3. If the "#" was pressed, clear the board.
  5. A method to generate new problems was also established:
    1. It first resets the displays to ensure they are prepaired for the new data.
    2. It then randomly generates a new value for each display, and prints it to the display.
    3. Finally, it makes sure the user's input display and the associated variables are clear.
  6. A method was also created to check the user's inputted solution:
    1. This method begins by comparing the value the computer knows to be correct, with the value the user entered.
    2. If the user is correct, the computer turns on the LEDs, and fades them out.
      1. When the LEDs are done, it tells the computer to generate another problem
    3. If the user is incorrect, the computer blinks the displays, and vibrates the unit for two second.  It then clears the user's display and the associated variable, to allow the student another opportunity to work that problem.  The computer requires a student to successfully solve a problem before generating a new problem.*
Note: these directions follow the overall flow of the code.  The code is also extensively commented.  To get the source code (available open source), see below.

*This is one of the tremendous benefits robots and computers provide for education; they are infinitely patient.  The robot will continue to present the same problem until the student masters it.

Mass Production
This robot can absolutly be mass produced and thus, the cost significatly reduced.  One inital (and major) cost reduction would come from the processor itself.  In this prototype, an untire Arudino Uno was part of the robot.  However, only the ATmega16U2 (the processor) is essentially the only absolutely necessary part of the robot's brain.  The rest of the Arduino board provides an easy way for the chip to be programmed (and a few minor, but required parts, such as resistors).  So in mass production, the ATmega16U2 could simply be programmed in an Arduino Uno board, then removed, and inserted into the robot.  The chip itself costs usually retails for $5.95, which amounts to a saving of $24.00 per robot.  And in bulk, a discount of $1.19 is available on order of over 100 units from Adafruit.

Similarly, the 4-Digit 7-Segment displays retail for $9.95 each, however, orders of 100+ save $1.99 each, for a savings of $7.96 per unit.  In addition, the keyboard matrix can be purchased for $0.79 less in orders of 100+ units.  Orders of 100+ cases save $2.39 per case  The vibration motor will also cost $0.99 less per 100 units.  And $0.79 can be saved on the battery case for orders of 100+ units.  The LEDs will also be $0.07 cheaper in 100 unit order.

Therefore, the overall cost per unit would become $53.87 per unit, assuming at least 100 are purchased.  This is a savings $36.26 per unit.  And that just the start.  This is for 100 units.  The savings would be further compounded if 1,000 or 10,000 units were purchased.

Demo

This is a video of myself demonstrating the robot.  There is no sound.




Experimentation

I tested the robot with a group of second graders.  Initally I started with two students, and with minimal instruction, let them play with the robot.  The results are truely astonishing.

Note in the videos, the robot is being powered by a computer, instead of a 9V battery, as described above.  In these cases, I wanted more analytical data to be recorded as the student were using it, so I connected it to a computer instead of a battery.  To the robot, it makes no difference where its power source comes from.






For example, the "#" key on the keyboard is used to clear the board.  Within minutes, and without being told, the students figured out what that button does and how/when to use it.


Here is a short minute video of them using it and answering questions about the game

I was unable to embed this video - so click here to view it on youtube.


After allowing them to play with it for less than ten minutes, we brought in two additional second graders. This time, we told the original two students to explain to the second group what to do.  Again the results were tremendous.

I was unable to embed this video into this post - so it is available at this link

Code

The code specific to this project is available open source (click here).  From this link, head over to the downloads tab to grab a copy of the source code (in the format of .ino - The Arduino IDE's format)

As previously mentioned, this robot is controlled via an Arduino with an ATmega16U2 processor.  The  Arduino was programmed via the standard Arduino IDE (available for free here).  I used serval free public libraries, including Adafruit's LED Backpark Library, which was necessary in order to use the I2C Backpack chips on the 4-Digit 7-Segment Displays.

Future upgrades

  • data logging
  • more colors
  • sound
  • internet connectivity
  • water proof
  • multiply, divide

About

Andrew Rosenblum is a software and hardware enthusiast focusing primarily on iPhone/iPad apps.  Andrew is a senior at Cape Henry Collegiate School in Virginia Beach, Virginia, and will be attending Johns Hopkins University Engineering in the fall.

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Andrew,
    Excellent work. I am impressed with your finished product and your commitment of your free time and the extra effort this project took to accomplish.
    Good luck in the contest.

    ReplyDelete