# 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: 6 months ago
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: 6 months ago
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: 7 months ago
What program do you write the code in?
pilotavery says: 1 year ago
Would you sell it? \$30?
Syst3mX (author) in reply to pilotavery1 year ago
There is nothing left to sell the project was recycled to something else
cosmicr says: 1 year ago
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 cosmicr1 year 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.
m1s73r says: 2 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?

Thanks
Syst3mX (author) in reply to m1s73r2 years ago
Yep you are correct but my cheap ebay LEDs work like crap with a higher resistance.
m1s73r in reply to Syst3mX2 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!
mwagner63 says: 2 years ago
Which switches in the wiring diagram connect to the transistors?
Syst3mX (author) in reply to mwagner632 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.
mwagner63 says: 2 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) in reply to mwagner632 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".
mwagner63 in reply to Syst3mX2 years ago
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.
Emiliano Valencia says: 2 years ago
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 Emiliano Valencia2 years ago
Yeah I am familiar with that trick, but the problem is the this chip doesn't have a built in ADC.
callain says: 2 years ago
Is it bad if you replace the 74HC594 by a 74HC795N or a 74HC795D ??
Thanks !
Syst3mX (author) in reply to callain2 years ago
I have never heard about this kinds but the schematic has it a bit wrong the part is : 74HC595
callain in reply to Syst3mX2 years ago
So is it ok ?
Syst3mX (author) in reply to callain2 years ago
a 74HC595 is ok the 74HC795 i can't find at all
jensenr30 says: 2 years ago
VERY NICE soldering work! I greatly respect the work, thought, and effort you have put forth into this project!
sexysaqib says: 2 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?
Teslaling says: 2 years ago
It's too bad u can't enter this into the Microcontroller contest!
Syst3mX (author) in reply to Teslaling2 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
shane11 says: 2 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) in reply to shane112 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.
shane11 says: 2 years ago
IS there a way i can do this without soldering????
Syst3mX (author) in reply to shane112 years ago
I think you can do it on a breadboard but it will not look nice
menghuei321 says: 3 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) in reply to menghuei3213 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.
menghuei321 says: 3 years ago
Wanna ask if I use the attiny28, can I still using your HEX file which you have provided?
mathman47 says: 3 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) in reply to mathman473 years ago
Thank you sir :)
menghuei321 says: 3 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) in reply to menghuei3213 years ago
Ohh right, thank you for telling me.
I will fix it as soon a possible.
menghuei321 says: 3 years ago
can I use attiny28 to replace attiny2313 ? attiny28 got 28 pins, but attiny2313 got 20 pins.
menghuei321 in reply to menghuei3213 years ago
thx
Syst3mX (author) in reply to menghuei3213 years ago
Ahm yes why not
menghuei321 says: 3 years ago
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 »