Creating a Binary to Decimal Converter Using Arduino Nano

by alaminashik in Circuits > Arduino

83 Views, 0 Favorites, 0 Comments

Creating a Binary to Decimal Converter Using Arduino Nano

Cover photo.jpg

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

Cover photo.jpg

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

Know the Components

7-Segment-Display-Pinout-Image-4.png
seven segment display.png
arduino-nano-pinout.png

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.

Theory

Truth Table.jpg

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

Build the Circuit

Nihal cse323_bb.jpg

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.

Upload the Code

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

Complete

Watch this video below to get better understanding.