LED Binary Calculator

You can't calculate binary values "as is" on most handheld calculators and using the windows one is just a pain, so i decided to make my very own (binary only) calculator.
This calculator supports all the basic functions like : NOT,OR,AND,XOR, addition,subtraction,multiplication,division and modulo.

So join me as we are going to enter the world of ones and zeros and play with some LEDs and switches along the way!

Remove these ads by Signing Up

Step 1: Parts List

Like any electronics project you will need to get some basic tools  like:
a soldering iron, some solder wire, a cutter, a needle nosed plier,some wire, wire striper, and some desoldering tools fro fixing mistakes along the way.

The parts for the calculator:
1. 32 LEDs.
2. 8 resistors( The value is determent by the type of LEDs, in my case 91 ohm).
3. 74HC595 shift register.
4. 9 1KOhm resistors.
5. 4 2n4401 transistors.
6. A Perfboard.
7. ATtiny2313.
8. 16 tact switches with 4 pins.
10. A programmer for the micro.
11. 9V battery holder.
12.A slide switch.
13. 7805 voltage regulator
14. 100nF cap
15. 10uF cap

 1-40 of 58 Next »
mycolourpurple says: Jun 4, 2013. 2:30 AM
plz help me regarding the working ov this calculator .. how it works ? where are the inputs .. which one are outputs ... n how to read it ...???
mycolourpurple says: Jun 4, 2013. 2:20 AM
hello..
plz help me regarding the working of this calculator ... which are the inputs , which are outputs ..n how to read this ... plz tell me :)
electronicz says: Apr 22, 2013. 4:54 PM
What program do you write the code in?
pilotavery says: Jan 18, 2012. 8:55 PM
Would you sell it? \$30?
Syst3mX (author) in reply to pilotaveryJan 20, 2012. 11:41 AM
There is nothing left to sell the project was recycled to something else
cosmicr says: Jan 10, 2012. 6:56 PM
how come you don't need a resistor per led? they are wired in parallel but there is only one resistor per row?

also, using 91 ohms and 5v does that mean your led current is 55mA? That seems high to me and using (Vin-Vled)/(Iled) it would mean your led is 0.086V? I'm confused.

But thanks for the great instructable, I'm planning on using these concepts to make a bit led array (as soon as I get my head around it!)
Syst3mX (author) in reply to cosmicrJan 12, 2012. 7:21 AM
Because I used the same type of LEDs in this project(they all came from a batch of 1000 LEDs) There is little worry for on LED taking all of the current.

If all of the LEDs are the same the current will divide equally between the 3 LEDs.

But the article is correct generally it's not the best of ideas to use just one resistor but I wanted to save some space and I had the same type of LEDs.
m1s73r says: Nov 13, 2011. 3:53 PM
I've got a question:

So, you're using blue LEDs and resistors with 91ohm... But my question is what's the source voltage? Doesn't the voltage regulator lower it to 5V ? Therefore you should use 120ohm resistors - am I right?

Thanks
Syst3mX (author) in reply to m1s73rNov 14, 2011. 10:52 AM
Yep you are correct but my cheap ebay LEDs work like crap with a higher resistance.
m1s73r in reply to Syst3mXNov 15, 2011. 5:46 AM
Oh ok, hopefully mine work better... I bought 50 LEDs + 50 resistors for just 6,77 \$ But anyways, thanks for answering my question!
mwagner63 says: Aug 28, 2011. 7:30 AM
Which switches in the wiring diagram connect to the transistors?
Syst3mX (author) in reply to mwagner63Aug 28, 2011. 8:17 AM
I will update this instructable till the end of this weak, I just not home so I don't have the original project next to me.
mwagner63 says: Aug 24, 2011. 6:12 PM
How do you read the answer lines. I'm a noob when it comes to binary as i just started learning it. Also what is LSB and MSB.
Syst3mX (author) in reply to mwagner63Aug 24, 2011. 11:32 PM
The answer line consists of 2 lines.
In the upper line in first right LED is the LSB ( Least significant bit ) which is like the first number in a digit. Lets say you work with a normal number of 5623 the number 3 will be like the LSB because if you change it that number the change in the overall value wouldn't change that much.
And the 5 is the MSB ( Most significant bit ) if you change that number the overall value will change dramatically.
So in this calculator the bottom left LED is the MSB one.
Now the way you read the answer is like so : the first 8 LEDs are the lower part of the answer and the bottom line is the upper answer.

To make it a bit clearer lets say we have an answer of 1259, The first line would be "59" and the second line would be "12".
mwagner63 in reply to Syst3mXAug 26, 2011. 6:42 PM
Thanks but I have one more thing. In the schematic you have the switches numbered. Could you help me out by telling me which number switch does what function? I had difficulty understanding the wiring diagram of the switches. Thanks again.
emihackr97 says: Jul 21, 2011. 6:30 PM
hi, I just want to tell you, you could have read all the pushbuttons with only 1 pin, an ADC, you would have to connect all the buttons in a resistor series and Gnd on the other side, that would give you some 7 extra pins
Syst3mX (author) in reply to emihackr97Jul 22, 2011. 12:18 AM
Yeah I am familiar with that trick, but the problem is the this chip doesn't have a built in ADC.
callain says: May 27, 2011. 10:52 AM
Is it bad if you replace the 74HC594 by a 74HC795N or a 74HC795D ??
Thanks !
Syst3mX (author) in reply to callainMay 27, 2011. 11:18 AM
I have never heard about this kinds but the schematic has it a bit wrong the part is : 74HC595
callain in reply to Syst3mXMay 27, 2011. 12:23 PM
So is it ok ?
Syst3mX (author) in reply to callainMay 27, 2011. 12:25 PM
a 74HC595 is ok the 74HC795 i can't find at all
jensenr30 says: May 8, 2011. 4:59 PM
VERY NICE soldering work! I greatly respect the work, thought, and effort you have put forth into this project!
sexysaqib says: May 6, 2011. 11:05 AM
I'm trying to make this calculator, but the schematic you've provided doesn't work when I simulate it in proteus design suite. Can you help?
Teslaling says: Feb 1, 2011. 11:02 AM
It's too bad u can't enter this into the Microcontroller contest!
Syst3mX (author) in reply to TeslalingFeb 1, 2011. 11:18 AM
hhh yeah i was thinking about the same thing when I saw that contest.
I wish I had more free time on my hands to make something
shane11 says: Jan 30, 2011. 7:19 AM
OK so im new at circuitry so bear with me i know programming and trying to get started in circuits so where do i make a programmer to put the code on the device and also how much about did the project cost to make thank you.
Syst3mX (author) in reply to shane11Jan 30, 2011. 7:26 AM
Well if you are new to this kind of things I think this kind of project is a bit over your head, I can recommend starting with something simpler like a LED chaser just to get some basic skills.
I used 2 softwares in this project one called "AVR studio" in which I write the program in C and "Khazama AVR programer " that I use to write the program on to the micro itself.

The total cost with the program(which is a 1 time buy) is about 30-40 dollars.
shane11 says: Jan 29, 2011. 4:15 PM
IS there a way i can do this without soldering????
Syst3mX (author) in reply to shane11Jan 30, 2011. 5:35 AM
I think you can do it on a breadboard but it will not look nice
menghuei321 says: Oct 26, 2010. 3:10 AM
My programmer cannot read the attiny28l chip, can I use pic chip like pic18F4620 to replace the attiny? If can, can I use the same HEX file you have provided?
Syst3mX (author) in reply to menghuei321Oct 26, 2010. 9:07 AM
Yes you can use any micro you want, the only thing is to look for the same number of I/Os or more.
This HEX file will only work for the micro I used so you will need to compile the code for the micro you use.
menghuei321 says: Oct 26, 2010. 1:42 AM
Wanna ask if I use the attiny28, can I still using your HEX file which you have provided?
mathman47 says: Oct 23, 2010. 8:39 PM
I always like hardware/firmware that does something completely different and shows how to save pins.Just wish desktop PCs were as flexible as these little & cheap micro-controllers. I paid \$289 for my i7-930 and my Arduino was \$34.

I wonder why it took 17 days for Instructables to send me an email that this was published? Keep up the good work.
Syst3mX (author) in reply to mathman47Oct 24, 2010. 10:33 AM
Thank you sir :)
menghuei321 says: Oct 18, 2010. 8:51 PM
seems you have used the pin PD0 to pin PD6 have been used by the led circuits, then why you connect the buttons to pin PD0 to pin PD7 again?? It is pin PB but not PD in the circuit above?
Syst3mX (author) in reply to menghuei321Oct 19, 2010. 4:42 AM
Ohh right, thank you for telling me.
I will fix it as soon a possible.
menghuei321 says: Oct 13, 2010. 1:33 AM
can I use attiny28 to replace attiny2313 ? attiny28 got 28 pins, but attiny2313 got 20 pins.
menghuei321 in reply to menghuei321Oct 14, 2010. 8:25 AM
thx
Syst3mX (author) in reply to menghuei321Oct 13, 2010. 7:57 AM
Ahm yes why not
menghuei321 says: Oct 13, 2010. 1:31 AM
can i use attiny28 to replace attiny2313 ? Is it the same function for these two micro cips because I found that attiny28 contain 28 pins which have the pin same like attiny2313 but attiny2313 with 20pins.
 1-40 of 58 Next »