Scientific Calculator

An ARM based scientific calculator

Similar projects worth following
One year ago I wanted to own a graphing calculator, but they were too expensive and I knew I really didn't need one, so I decided to build one myself. This is my first 'serious' project. At the moment it is (or at least pretends to be) a basic scientific calculator.
I plan on releasing the source and schematics when I solve some little bugs, but things may be slow because this year i have to prepare for the University Entrance Exams.

What the calculator can do at the moment:

  • Add, subtract, multiply, divide.
  • Square root, nth root, exponentiation.
  • Trigonometry: sin, cos, tan with their respective inverse functions (working with degrees, radians and gradians).
  • log10 and log.
  • Factorial
  • x10^

To do:

  • Low power
  • Constants menu
  • Splash screen intro
  • Graphing mode

Known bugs:

  • Syntax error when two or mor unary operators are put together.
  • Can't set precision to 7-9
  • Unary '-' doesn't behave as expected when located after ')'
  • Cursor may not be in correct position after making a line leap

The schematic and PCB layout

Zip Archive - 958.67 kB - 02/22/2017 at 14:46


  • 1 × MKL25Z128VLK4 ARM Cortex-M0+ (80-pin LQFP) Microprocessors, Microcontrollers, DSPs / ARM, RISC-Based Microcontrollers
  • 1 × Electronic Assembly DOGL-128 128x64 low power LCD
  • 10 × 1uF Capacitor
  • 2 × 22pF Capacitor
  • 1 × 8 MHz Crystal

View all 8 components

  • Releasing schematic and source code

    Ramón Calvo02/22/2017 at 15:45 0 comments

    About the circuit:

    • A day after I ordered the PCBs I realized I had forgotten to put a power switch on the board. I thought maybe using sleep modes and wake-ups by interrupts I could solve that problem but to my disappointment the MKL25Z only has interrupts in ports A and D, and I connected the keypad to B and C. Because of this the calculator powers on and off putting in and taking the battery out (sighs).
    • I also forgot to design a reverse voltage protection circuit, which combined with the previous problem becomes a great danger.
    • If you want to replicate the PCB please make sure that the silkscreen doesn't overlap the SWD programming interface (very important)

    About the code:

    The library used to drive the LCD was made by [imachooon]. Thank you for your library [imachooon].

    The code is not finished at the time of writing (and probably won't be for a long time) and can present some bugs, but it works.

  • A summary of almost a year

    Ramón Calvo02/17/2017 at 22:49 2 comments

    I started this project in February of 2016, but it hasn't been a continuous work, here is a summary:

    The first problem I encountered making the calculator was obviously the parsing. Being unable to come up with a solution, a quick Google search led me to something called Reverse Polish Notation and a sweet algorithm invented by Edsger Dijkstra called shunting-yard algorithm. Explaining all of this in detail is beyond the scope of this text, but to understand it, RPN gets rid of every parenthesis and makes it easy to make the calculation (with the shunting-yard algorithm). More about that here: Shunting-yard algorithm and RPN.

    The above, combined with the keypad, were the 'funny' thing to program. The rest was a bit tedious. I also have to say that originally this was an Arduino project, but I didn't quite liked the result, it needed a 9V battery, wasn't low power at all and was bigger than my hand. And also didn't have much precision (32-bit float).

    That's why I decided to move to mbed, specifically to the Freescale's Freedom KL25Z development board. So I ported the code I had and made a working prototype. Everything went fine but when I tried to get the voltage doubler of the st7920 LCD driver to work I couldn't (that meant I couldn't get the needed voltage for contrast out of a 3V coin cell). That was in July of last year and I gave up. The project had remained in a shoe box for six months until I decided to bring it to an end.

    I bought a new LCD and designed the PCB using KiCAD. I got the PCBs manufactured by Elecrow. It was the first time I ordered any PCB but I can say they are very good quality. The bad part was the delivery time (about 25 days).

    Although I don't own a soldering station I managed to solder the microcontroller with a cheap soldering iron and a thin tip pin by pin (with the help of a magnifier, of course). SMD was something I had a lot of respect before that day. I finally understand those who say it is even easier than through hole (I mean it's not easier but also you don't need that much experience).

    I may have skipped some important steps but that's it. This is a big summary of my year-long (and not yet finished) journey.

View all 2 project logs

Enjoy this project?



Garth Wilson wrote 05/13/2017 at 19:12 point

How many digits of precision are you using, and what methods are you using for the trig and log functions, whether CORDIC or the first so many terms of the Taylor series with the coefficients adjusted to make up for the smallish number of terms?  Have you tested the accuracy?  I have yet to see an explanation of CORDIC in English (rather than sterile, theoretical math Ph.D. language) but it looks like you still need an iteration for every bit or digit as you advance toward an answer, using a smallish lookup table at every step.  I would like to understand it.  I have Jack Crenshaw's book, "Math Toolkit for Real-Time Programming," but he never mentions CORDIC.  Real time tends to need the best performance.

  Are you sure? yes | no

EngineerAllen wrote 04/27/2017 at 07:46 point

that capacitor on the back

  Are you sure? yes | no

Max.K wrote 04/20/2017 at 19:14 point

This is an awesome project! I love how the finished pcb with the green display looks like.

  Are you sure? yes | no

Michael Fincham wrote 02/28/2017 at 03:17 point

Hello! Could you please clarify what license the code and design files are available under?

  Are you sure? yes | no

danjovic wrote 02/22/2017 at 20:47 point

Awesome build! 

  Are you sure? yes | no

James Hall wrote 02/22/2017 at 16:54 point

The design of this reminds me of a Pocket Operator. I'm glad to see someone working on an DIY scientific/graphing calculator. 

  Are you sure? yes | no

Ted Yapo wrote 02/22/2017 at 16:02 point

I want to make an RPN version!

  Are you sure? yes | no

zakqwy wrote 02/21/2017 at 16:05 point

Great silkscreen graphics!

  Are you sure? yes | no

Ramón Calvo wrote 02/22/2017 at 15:59 point

Thank you! Fractals rule!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates