Search

Unsigned 2-bit binary converter with Arduino

Quantum Computing From Bits to Quantum Leaps cover image

Overview

Secondary School

Physics, Mathematics, Computer Science, Engineering

Quantum Computing

English

Overview

Keywords: Arduino, 2-bit, unsigned binary, binary to decimal conversion, digital input, digital output, breadboard, circuits, Tinkercad
Age group: 14-17
Required knowledge/skills: Basic electronics, Arduino programming, circuit design, working in tinkercad.com virtual environment, basic understanding of quantum concepts
Time frame: 1-2 hours per simulator: assembling the circuit in Tinkercad and uploading simple Arduino code to the microcontroller

Authors: Astrinos Tsoutsoudakis (GR)

Content

Conceptual introduction
Required materials
Tasks for teachers/students
 

Summary

An unsigned 2-bit binary converter with an Arduino is a circuit that takes a 2-bit binary input (i.e. 00, 01, 10 or 11) and displays its decimal equivalent (i.e. 0, 1, 2 or 3). The input is typically provided by switches or buttons, and the output is shown on an LCD display (a 16×2 I2C one is the best choice here for the ease of connectivity) or an array of LEDs.

This project is a perfect introduction to:
- Binary numbers: Understanding how the combination of 0s and 1s can represent any number.
- Digital logic: Seeing how a physical "on" or "off" state translates into a digital value.
- Microcontroller programming: Learning how to write code that reads physical inputs and controls physical outputs.

Quantum Computing From Bits to Quantum Leaps teaser

We're going to take a journey into the secret language of computers: binary. Everything a computer does, from showing a picture to playing a song, is based on just two simple numbers: 0 and 1. This is the fundamental language of all digital electronics.

Our activity today is a fantastic hands-on project that will make this idea come to life. We're going to build a device that acts like a translator. We'll speak to our Arduino in its own language, binary, and it will translate what we say into a language we better understand: decimal numbers.

Imagine we have 2 light switches in a row. Each switch can be either on (1) or off (0).

  • The first switch (on the far right) is special. It has a value of 1.
  • The next switch has a value of 2.

By flipping these switches, we can create any number from 0 all the way up to 3!

Our project will use a series of switches to create these binary numbers. We'll then use our Arduino, a tiny but powerful computer, to read these switches, do a little bit of math in a flash, and then display both the binary and the decimal number on a screen.

2-bit binary to decimal

BinaryDecimal
000
011
102
113

Required materials

Hardware

NameQuantityComponent
U11Arduino Uno R3
U21MCP23008-based, 32 (0 x 20) LCD 16 x 2 (I2C)
S1/S22Slide switch
R1 / R2210 kΩ Resistor

 

 

Tasks for teachers

  • Set up Tinkercad classrooms, provide Arduino code templates, circuit diagrams.
  • Introduce binary to decimal number conversion. (Introduction to Binary)
  • Help students place components correctly: resistors, button or slide switches, LCD display.
  • Support coding activities.
  • Encourage inquiry and discussion.
  • Use short quizzes, discussion, or mini presentations to check comprehension.

Tasks for students

  • Learn basic electronics and coding.
  • Assemble the circuit in Tinkercad, upload and modify code.
  • Document the project and present findings.
  • Think creatively about how to suggest improvements.
The circuit realized in tinkercad.com virtual environment
© screenshot
The circuit realized in tinkercad.com virtual environment
The circuit realized in tinkercad.com virtual environment
© screenshot
The circuit realized in tinkercad.com virtual environment
Schematics of the circuit
© screenshot
Schematics of the circuit
Part of the Code in Blocks
© screenshot
Part of the Code in Blocks

You can find the Tinkercad design to reuse here.

Close search