loading
(Arduino Pro Mini Protoboard Version)

Latest Release:  http://code.google.com/p/dinocalc/
Development:      https://github.com/WeaselJones/DinoCalc

This is a calculator without a LCD that tells you if your math answer is right or wrong, without giving you the answer.  This instructable will show you how to make this simple math checking calculator using "off-the-shelf" items.

[UPDATE:  A TUTORIAL SHOWING HOW TO CREATE YOUR OWN CUSTOM INLAY GRAPHIC IS NOW INCLUDED! ALONG WITH A NEW GRAPHIC FOR GIRLS TO USE INSTEAD OF THE DINOSAUR.  CHECK OUT APPENDIX A AND B AT THE END OF THIS INSTRUCABLE!]

When I was younger I had a calculator that did not have a LCD display but instead had two LED lights, one green and one red.  You would enter a math problem with what you thought the correct answer was.  If your math problem was for example, 12 + 12, you would enter on the keypad:  12+12 = 24, and then press the "?" key.  If your answer was right then the green LED would light up, if your answer was wrong, the red LED would light up.

This is my salute to that toy from my childhood, as well as a great way for me to engineer and program a neat little project that my preschool son can actually use to check his simple math.

This first version will document the prototype that I have built. My first objective was to create a calculator capable of just adding and subtracting using off the shelf items. I plan on starting with an Arduino Pro Mini for the developmental and prototype stage and  I will then move on to a final version that has a lower cost and device count (ATmega328P on a custom PCB).

The way the calculator will work is:

1) User enters:
      a Number, (for example, 12)
     then a math operator, (let's pick addition, +)
     then a Second Number, (let's add 13 to our first number)
     then press the equal sign, (=)
     then the user enters what he (or she) believes the answer to be, (let's guess 22)
     then press "?" to see if you're right or wrong!
  
2) Microprocessor then calculates the correct answer.
    In our case, 12 + 13 = 25. So the Calculated correct answer is 25.  This answer is just
    stored in memory and not shared with the user.

3) Microprocessor compares the calculated answer to the user's
   guessed answer. 
   If they are not equal then the microprocessor turns on the red LED. 
   If they are equal then the microprocessor turns on green LED.
   We guessed 22, so 22 is not equal to 25 so the RED LED LIGHTS UP!

Notes and Limitations: 
1) Only one math operation is currently supported (ie, 12+12 or 12 - 12 will work, but 12+12+12 or 12+12-12 will not)

2) Negative numbers will work (ie, -12 + -12 or -12 - -12 will work)
3) Large numbers will work (ie, 123456789 + 8765 will work)

4) Decimal Numbers will work (ie, 12.1 +12.2 will work)
5) I made this for my preschool son, so right now the only math operators currently supported is addition and subtraction.  Multiplication and Division will be easy to add in the near future.
6)  The last limitation is your imagination.  Just because I did something one way, don't be afraid to change it to work for you!

TIP:  TO COMPLETE THIS PROJECT THE BUILDER WILL NEED TO HAVE EXPERIENCE WITH SOLDERING AND USING THE ARDUINO IDE. THERE ARE MANY TUTORIALS ON USING THE ARDUINO IDE ON INSTRUCTABLES AND AT HTTP://ARDUINO.CC.  IF YOUR EXPERIENCE IS LIMITED, I RECOMMEND BUILDING THIS PROJECT FIRST ON A BREADBOARD, AS SHOWN IN THE OPTIONAL STEP 5, SO THAT THE BUILDER CAN BECOME MORE FAMILIAR WITH THE DINOCALC SOFTWARE AND PROGRAMMING OF THE ARDUINO PRO MINI. 
AND WHILE THIS PROJECT ISN'T COMPLICATED TO SOLDER
YOU MIGHT NOT WANT THIS TO BE YOUR FIRST SOLDERING EXPERIENCE.  IF YOU'VE NEVER SOLDERED BEFORE THERE ARE MANY "LEARN HOW TO SOLDER KITS" THAT YOU CAN PRACTICE AND LEARN ON FIRST.  SUCH AS:  Elenco AmeriKit Learn to Solder Kit.

Step 1: "How do you eat an Elephant?"


TIP:  Even a small project can be overwhelming and risks not being finished if you try and do too much at once.  Instead, establish some goals and guidelines and work to meet them one step at a time.  You'll feel better after each achievement and it helps to prevent your project from winding up in some storage box unfinished.

We've all heard the question about eating an elephant one time or another and we know the answer, "One bite at a time".

I have often been guilty of starting a project and then placing the unfinished project into a box or on a shelf to collect dust because either I hit a "road block" or just overwhelmed myself with trying to do too much at once.  I often try to eat the Elephant in one bite. 

This time I decided to try a different approach (plus I promised my wife I'd actually finish something this time).

So first I set a series of goals for my project and I decided to stick to them.  I then divided all my goals into two main groups: Software and Hardware.   When I found time to work on my project I'd focus on one goal and try not to get distracted.  If I came up with an idea that belonged with another goal, I'd write it down so I could revisit my idea when I was working on that particular goal.  If it was an idea that would be nice to have but really belonged in a future version (ie, custom etched PCB board, low power mode, battery recharging, etc) I would write it down in my notebook under "Future Objectives".  This way I didn't overwhelm myself by making my project so large that it would never stop growing and never get finished.  My notebook held my project together. 

I highly recommend you too keep a notebook to jot down your experiments, references, and even your failures.  I've learned a lot, even from my failures. Success consists of going from failure to failure without loss of enthusiasm. --Winston Churchill

HARDWARE
1)  Needs to be able to be set up on a breadboard for the software development phase
     I started with a keypad, Arduino Uno, and some LED's.  I used this breadboard setup until my code was finished.
2)  What is used during development needs to be easily translated into a prototype product
     I needed something smaller then the Uno and the Arduino Pro Mini fit the bill.  I could use my program I developed on the Uno and the Arduino Pro Mini would be small enough to fit in the "Sparkfun" enclosure I was looking at.  I thought about custom etched PCB with just a low powered ATMega328P but decided to stick with my original goals of using "off the shelf" items and save the custom PCB for a future version.
3)  Needs to be easy to hold and operate by 4 yr old fingers
     I searched many different enclosures and was about to settle on using the "Sparkfun" enclosure when I can across the Hammond enclosure with battery holder.  It was exactly what I envisioned.
4)  Needs to be appealing in appearance so the 4 yr old wants to use it
     My son loves hot wheels, lizards, and dinosaurs.  So I searched around until I found a dinosaur face that would scale easily to the front of the hand held enclosure.  Image was found at:  http://www.arthursclipart.org/dinosaurs/dinosaurs/page_02.htm

SOFTWARE
1)  Needs to be able to detect button presses from a keypad
     First goal, I needed to be able to tell which button was being pressed.
2)  Needs to be able to input the button presses into variables
     I then needed to have my program store my button presses.  I needed to be able to use numbers larger than just single digits.
3)  Needs to be able to perform addition or subtraction (multiplication and division can come later, since my son is only 4 yrs old)
     Having my program know when to add or subtract became a challenge.  And this then became a major challenge when I decided to include negative numbers. If I hadn't broke my software code development into "smaller" bites, this could have been the "road block" that would have killed this project.  I did add decimal numbers to the programming so that when I do add division it will already be there.
4)  Needs to be able to calculate the correct answer and then compare it to the guessed answer the User inputs
     This goal led to my discovery about the limitation of floating number math which was solved by comparing the absolute value of the difference between the correct answer and the guessed answer.
5)  Needs to be able to respond to the user with either a correct or incorrect response.
     Light the Red LED for wrong; Green LED for right.



So now that you know the approach I took, lets get started on building your DinoCalc!

Advertisement

I want to modify this to do multiplucation/division. Any idea on where to get started?
If all you need are two operands ( something like 5 x 5 = 25) it shouldn't be too hard. I added lots of comments to my code and I hope some of this makes some sense as you look through it. You'll need to get a bigger keypad or add two more buttons to represent multiplication and division. Then you'll need to add in the code what to do when those keys are pressed. Just follow what I did for addition as an example. In the software I used the variable &quot;i&quot; to store what math operation is being performed. When i=1, addition; when i=2, subtraction. You'll need to expand on that for multiplication/division, something like i=3 for multiplication when the multiply key is pressed. Then in the calcAnswer function of the code you'll need to expand your calculations to include multiplication/division. Just follow how I did the adding and subtraction in calcAnswer. Hopefully the comments will make sense when you start dissecting the code. <br> <br>Also, on Github under the &quot;Software: multiple operand&quot; branch I was working on a way to allow multiple operands (like 1+2-3+4-5). I started using arrays to keep track of the calculations but I haven't placed anything for &quot;order of operations&quot; that you'll need when you multiply or divide. My job has been keeping me away from my hobbies so it isn't finished, but you're welcome to look at it.
this is brilliant. I'm not confident that I would be patient enough to do this, but I would definitely buy one for my youngest son. You should market this.
Agreed, check out https://www.sparkfun.com/tutorials/315
Cool!!!, <br> <br>Ouch! It just bit my finger off!!!
Hey, this is a really well written instructable, good job!
thank you

About This Instructable

14,269views

17favorites

License:

More by weaseljones:DinoCalc Version 1.0 
Add instructable to: