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.

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!

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)

3) Large numbers will work (ie, 123456789 + 8765 will work)

AND WHILE THIS PROJECT ISN'T COMPLICATED TO SOLDER

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:

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.

I started with a keypad, Arduino Uno, and some LED's. I used this breadboard setup until my code was finished.

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.

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.

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.

First goal, I needed to be able to tell which button was being pressed.

I then needed to have my program store my button presses. I needed to be able to use numbers larger than just single digits.

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.

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.

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!

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 "i" 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 "Software: multiple operand" 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 "order of operations" 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