Introduction: Creating a Binary to Decimal Converter Using Arduino Nano

About: I am an electrical student who likes to work with different electronics. I have been working on a different project for years now and I can't wait to share it with everyone!

In this project, I will show you to create a simple 4-bit binary to-decimal number converter using Arduino uno and discuss the basics. The input is given by 4 momentary switches and the corresponding outputs are shown on a seven-segment display. This project was initially made for an undergraduate course. Hope you will learn something.

Supplies

Tools needed:

1 x Arduino nano LINK

1 x Breadboard LINK

4 x switches LINK

1 x cathode seven segment display LINK

1 x 100 ohm resistor LINK

Few connecting wires LINK

Step 1: Know the Components

Seven segment display: The output of the circuit is displayed in this display, it can display only single digit. The common pin is connected to the ground using a 100ohm resistor and all the other pins are connected to the Arduino. Check the diagram above from geeksforgeeks.org

Arduino nano: This is the brain of the system. It is programmed to take input from the digital pins and output high/low on its digital output pins.

Button: Push switch is used to input the binary code. One downside to this is that you need to keep hold of the switch to input different binary numbers. Other types of switches can also be used.

Step 2: Theory

A computer only understands binary numbers whereas we humans are used to decimal numbers, thus it is crucial to understand how decimal numbers are converted to binary and back and forth.

For example, binary number 0001 represents the decimal number 1 similarly:

0000 0

0001 1

0010 2

0011 3

0100 4

0101 5

0110 6

0111 7

1000 8

1001 9

The A B C D are the inputs and the outputs are a b c d e f g

Step 3: Build the Circuit

Connect the circuit as shown in the diagram. You can change the resistor's value to adjust the display's brightness. You can directly power the circuit using USB cable.

Step 4: Upload the Code

Check the comments in the code for understanding how it works.

Step 5: Complete

Watch this video below to get better understanding.