Perform Simple Arithmetic and More with Calcuino

Calcuino is an Arduino-based calculator that uses several seven-segment displays and a button matrix to crunch numbers.

Evan Rust
4 years agoDisplays / HW101

For beginners trying to get into the world of soldering custom circuits and assembling PCBs into functional devices, the task can be quite daunting. YouTuber Volos Projects has designed and assembled a simple calculator on a custom PCB. Its primary display is a six-element seven-segment display with decimal places, so floating-point math can be shown. The unit can also be programmed directly from the Arduino IDE since it has the same processor as the Arduino Uno and a USB to UART converter.

Components

As mentioned previously, the Calcuino is based on an ATmega328P microcontroller, which is loaded with the Arduino bootloader to allow for programs be sent over via USB. A CH340G handles the conversion between the USB and UART protocols. To get user input, there is a 4x4 matrix of momentary pushbutton switches for entering numbers and a given operation. Other than that, there are a few discrete components, such as a couple of crystal oscillators and various capacitors/resistors, plus some LEDs to keep an eye on what the processor is doing.

PCB Design

Volos Projects' calculator PCB has a great layout for both using the calculator and expanding the functionality of the device. At the top, there is a bank of seven-segment display modules, along with a driver for them. The left side of the PCB has the main electronics, including the AVR MCU, CH340G, and micro USB connector, as well as a power switch and connector for the analog 0 pin. Finally, there's an array of 16 buttons with silkscreen labels to show what function each button performs.

Code

The code for this project can be found here in an ino file. The program starts by setting up the MAX7219 IC with the LEDControl library. After that, it enters the main loop and polls each button to see if it's been pressed. If it's a number, the current total gets multiplied by ten and the number pressed gets added. For example, pressing 4 then 3 would result in 4*10+3=43, just like a real calculator. Once there's a number, pressing an operation button sets the op variable and then resets the current amount. Pressing the = button then causes the device to perform the operation with the two operands and then show the result.

Other Features

Although the Calcuino is mainly for calculating numbers, as the name implies, it can also do some other interesting things. One of these is a countdown timer, which lets a user enter in an amount of time and then decrements by one every second, ending in a loud beep from the onboard buzzer. There is even a mode that causes the buzzer to play different tones depending on which button is pressed for making little songs. Finally, a potentiometer can be connected and its analog value can be read and shown on the seven-segment display.

Calcuino is a great example of what a person can do with just a few basic components and some creative coding, and it can serve as an inspiration for other makers to design and assemble their own PCBs into cool projects.

Evan Rust
IoT, web, and embedded systems enthusiast. Contact me for product reviews or custom project requests.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles