Picture of 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 adsRemove these ads by Signing Up

Step 1: Parts List

Picture of 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.
9. some pin headers.
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 59Next »
AshwinS14 months ago

Can you please make a tutorial to decode the binary and display the numbers on a seven segment display with an IC?

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 ...???
plz help me regarding the working of this calculator ... which are the inputs , which are outputs ..n how to read this ... plz tell me :)
What program do you write the code in?
pilotavery3 years ago
Would you sell it? $30?
Syst3mX (author)  pilotavery3 years ago
There is nothing left to sell the project was recycled to something else
cosmicr3 years ago
how come you don't need a resistor per led? they are wired in parallel but there is only one resistor per row?
this article: says it wouldn't work?

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)  cosmicr3 years ago
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.
m1s73r3 years ago
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?

Syst3mX (author)  m1s73r3 years ago
Yep you are correct but my cheap ebay LEDs work like crap with a higher resistance.
m1s73r Syst3mX3 years ago
Oh ok, hopefully mine work better... I bought 50 LEDs + 50 resistors for just 6,77 $ But anyways, thanks for answering my question!
mwagner633 years ago
Which switches in the wiring diagram connect to the transistors?
Syst3mX (author)  mwagner633 years ago
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.
mwagner633 years ago
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)  mwagner633 years ago
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".
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.
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)  Emiliano Valencia3 years ago
Yeah I am familiar with that trick, but the problem is the this chip doesn't have a built in ADC.
callain3 years ago
Is it bad if you replace the 74HC594 by a 74HC795N or a 74HC795D ??
Thanks !
Syst3mX (author)  callain3 years ago
I have never heard about this kinds but the schematic has it a bit wrong the part is : 74HC595
callain Syst3mX3 years ago
So is it ok ?
Syst3mX (author)  callain3 years ago
a 74HC595 is ok the 74HC795 i can't find at all
jensenr303 years ago
VERY NICE soldering work! I greatly respect the work, thought, and effort you have put forth into this project!
sexysaqib3 years ago
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?
Teslaling4 years ago
It's too bad u can't enter this into the Microcontroller contest!
Syst3mX (author)  Teslaling4 years ago
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
shane114 years ago
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)  shane114 years ago
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.
shane114 years ago
IS there a way i can do this without soldering????
Syst3mX (author)  shane114 years ago
I think you can do it on a breadboard but it will not look nice
menghuei3214 years ago
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)  menghuei3214 years ago
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.
menghuei3214 years ago
Wanna ask if I use the attiny28, can I still using your HEX file which you have provided?
mathman474 years ago
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)  mathman474 years ago
Thank you sir :)
menghuei3214 years ago
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)  menghuei3214 years ago
Ohh right, thank you for telling me.
I will fix it as soon a possible.
menghuei3214 years ago
can I use attiny28 to replace attiny2313 ? attiny28 got 28 pins, but attiny2313 got 20 pins.
Syst3mX (author)  menghuei3214 years ago
Ahm yes why not
1-40 of 59Next »