arduino tft lcd calculator made in china
Arduino development boards always help us to build a project easily and make it look more attractive. Programming an LCD with touch functionality may sound like a complicated task, but it can be made very easy by using Arduino libraries and extension modules. In this project, we will use a 3.5" Arduino TFT LCD to build an Arduino touchscreen calculator that can perform all basic calculations such as addition, subtraction, division, and multiplication.
Before we dive into the project, it is important to understand how this 3.5" TFT LCD module works and the model number used. Let"s take a look at the pinout of this 3.5" TFT LCD module.
As you can see, the module has 28 pins and fits perfectly into any Arduino Uno / Arduino Mega development board. The table below gives a description of these pins.
As you can see, the module pins can be divided into four main categories, namely LCD command pins, LCD data pins, SD card pins and power pins, we don"t need to know the details of how these pins work because they will be implemented by the Arduino library.
You can also find an SD card slot on the bottom of the module shown above. This slot can be used to load an SD card with bmp image files, which can be displayed on our TFT LCD screen using the Arduino program.
Another important thing to keep in mind is your interface IC. there are many types of TFT modules on the market from Adafruit TFT LCD modules to cheap Chinese clones. A program that fits an Adafruit expansion board may not be the same for a Chinese expansion board. Therefore, it is very important to know which type of LCD LCD you are holding. This detail must be obtained from the supplier. If you have a cheap clone like mine, then it most likely uses driver IC ili9341. You can follow the official Arduino tutorial to try some basic example programs to get familiar with this LCD.
If you intend to use the touch screen function of a TFT LCD module, it must be calibrated to work properly. An LCD screen that is not calibrated is unlikely to work properly; for example, you may touch in one place and the TFT may think it is touching somewhere else. These calibration results are not the same for all boards, so you will have to do this work yourself.
The best way to calibrate is to use a calibration sample program (with a library) or use a serial monitor to detect your errors. But for this project, calibration should not be a big issue due to the large size of the buttons, and I will also explain how to calibrate your LCD in the programming section below.
The 3.5" TFT LCD is a great Arduino expansion board. You can push the LCD directly onto the top of the Arduino Uno and have it match the pins perfectly and slide them in. However, for safety reasons, the programming terminals of the Arduino UNO must use small insulating tape in case the terminals come into contact with your TFT LCD screen. the LCD assembled to the UNO development board looks like the following.
We use the SPFD5408 library to ensure that the arduino calculator code works properly. This is a modified Adafruit library that works seamlessly with our LCD TFT module. You can view the full program at the end of this article.
Now, open the Arduino IDE and select Sketch -> Include Librarey -> Add .ZIP library. a browser window will open to navigate to the ZIP file and click "OK". If successful, you should notice "Library added to your Libraries" in the bottom left corner of your Arduino.
Now you can use the following code in the Arduino IDE and upload it to Arduino UNO to get the touchscreen calculator working. Further down the page, I"ll explain the code in small segments.
As mentioned before, we need to calibrate the LCD to make it work properly, but don"t worry the values given here are almost universal. The variables TS_MINX, TS_MINY, TS_MAXX and TS_MAXY determine the calibration of the screen. If you feel that the calibration is not ideal, you can make a slight change.
As we know, TFT LCD screens can display many colors, all of which must be entered as hexadecimal values. To make it more readable, we assign these values to a variable as shown below.
Okay, now we can move on to the programming part. This program involves three parts. One is to create a user interface for the calculator using buttons and displays. Then, detect the buttons based on user touch and finally calculate the results and display them. Let"s go through them one by one.
Here you can get creative to design the user interface of the calculator. I simply made the basic layout of the calculator with 16 buttons and a display unit. You must build the design as if you were drawing something on an MS drawing board. The added libraries will allow you to draw lines, rectangles, circles, characters, strings and more in any of the preferred colors. You can learn about the available features from this article.
The final step is to calculate the results and display them on the TFT LCD screen. The arduino calculator can only perform two numeric operations. These two numbers are named as variables "Num1" and "Num2". The variable "Number" is given and taken from Num1 and Num2, and the result is obtained.
The process of working with this Arduino touch screen calculator is very simple. You need to upload the following code to the Arduino development board and then power it up. At this point, a calculator will be displayed on the LCD screen.
Arduino has always helped to build projects easily and make them look more attractive. Programming an LCD screen with touch screen option might sound as a complicated task, but the Arduino libraries and shields had made it really easy. In this project we will use a 2.4” Arduino TFT LCD screen to build our own Arduino Touch Screen calculator that could perform all basic calculations like Addition, Subtraction, Division and Multiplication.
Before we actually dive into the project it is important to know, how this 2.4” TFT LCD Module works and what are the types present in it. Let us take a look at the pinouts of this 2.4” TFT LCD screen module.
As you can see there are 28 pins which will perfectly fit into any Arduino Uno / Arduino Mega Board. A small classification of these pins is given in the table below.
As you can see the pins can be classified in to four main classifications such as LCD Command Pins, LCD Data Pins, SD Card Pins and Power Pins, We need not know much about the detailed working of these pins since they will be take care by our Arduino Library.
You can also find an SD card slot at the bottom of the module shown above, which can be used to load an SD card with bmp image files, and these images can be displayed in our TFT LCD screen using the Arduino Program.
Another important thing to note is your Interface IC. There are many types of TFT modules available in the market starting from the original Adafruit TFT LCD module to cheap Chinese clones. A program which works perfectly for your Adafruit shield might not work the same for Chinese breakout boards. So, it is very important to know which types of LCD display your are holding in hand. This detail has to be obtained from the vendor. If you are having a cheap clone like mine then it is most probably using the ili9341 driver IC.You can follow this TFT LCD interfacing with Arduino tutorial to try out some basic example programs and get comfortable with the LCD screen. Also check out our other TFT LCD projects with Arduino here:
If you planning to use the touch screen function of your TFT LCD module, then you have to calibrate it to make it work properly. A LCD screen without calibration might work unlikely, for instance you might touch at one place and the TFT might respond for a touch at some other place. These calibrations results will not be similar for all boards and hence you are left on your own to do this.
The 2.4” TFT LCD screen is a perfect Arduino Shield. You can directly push the LCD screen on top of the Arduino Uno and it will perfectly match with the pins and slid in through. However, as matters of safety cover the Programming terminal of your Arduino UNO with a small insulation tape, just in case if the terminal comes in contact with your TFT LCD screen. The LCD assembled on UNO will look something like this below.
We are using the SPFD5408 Library to get this arduino calculator code working. This is a modified library of Adafruit and can work seamlessly with our LCD TFT Module. You can check the complete program at the end of this Article.
Now, open Arduino IDE and select Sketch -> Include Librarey -> Add .ZIP library. A browser window will open navigate to the ZIP file and click “OK”. You should notice “Library added to your Libraries” on the bottom-left corner of Arduino, if successful. A detailed guide to do the same is given in the Interfacing Tutorial.
Now, you can use the code below in your Arduino IDE and upload it to your Arduino UNO for the Touch Screen Calculator to work. Further down, I have explained the code into small segments.
As said earlier we need to calibrate the LCD screen to make it work as expected, but don’t worry the values given here are almost universal. The variables TS_MINX, TS_MINY, TS_MAXX, and TS_MAXY decide the calibration of the Screen. You can toy around them if you feel the calibration is not satisfactory.
As we know the TFT LCD screen can display a lot of colours, all these colours have to be entered in hex value. To make it more human readable we assign these values to a variable as shown below.
Okay now, we can get into the programming part. There are three sections involved in this program. One is creating a UI of a calculator with buttons and display. Then, detecting the buttons based on the users touch and finally calculating the results and display them. Let us get through them one by one.
This is where you can use a lot of your creativity to design the User Interface of calculator. I have simply made a basic layout of a calculator with 16 Buttons and one display unit. You have to construct the design just like you will draw something on MS paint. The libraries added will allow you to draw Lines, Rectangle, Circles, Chars, Strings and lot more of any preferred colour. You can understand the available functions from this article.
I have used the line and box drawing abilities to design an UI which looks very similar to the 90’s calculator. Each box has a width and height of 60 pixels.
The final step is to calculate the result and display them on TFT LCD Screen. This arduino calculator can perform operation with 2 numbers only. These two numbers are named as variables “Num1” and “Num2”. The variable “Number” gives and takes value from Num1 and Num2 and also bears the result.
The working of this Arduino Touch Screen Calculator is simple. You have to upload the below given code on your Arduino and fire it up. You get the calculator displayed on your LCD screen.
In this Arduino touch screen tutorial we will learn how to use TFT LCD Touch Screen with Arduino. You can watch the following video or read the written tutorial below.
As an example I am using a 3.2” TFT Touch Screen in a combination with a TFT LCD Arduino Mega Shield. We need a shield because the TFT Touch screen works at 3.3V and the Arduino Mega outputs are 5 V. For the first example I have the HC-SR04 ultrasonic sensor, then for the second example an RGB LED with three resistors and a push button for the game example. Also I had to make a custom made pin header like this, by soldering pin headers and bend on of them so I could insert them in between the Arduino Board and the TFT Shield.
Here’s the circuit schematic. We will use the GND pin, the digital pins from 8 to 13, as well as the pin number 14. As the 5V pins are already used by the TFT Screen I will use the pin number 13 as VCC, by setting it right away high in the setup section of code.
I will use the UTFT and URTouch libraries made by Henning Karlsen. Here I would like to say thanks to him for the incredible work he has done. The libraries enable really easy use of the TFT Screens, and they work with many different TFT screens sizes, shields and controllers. You can download these libraries from his website, RinkyDinkElectronics.com and also find a lot of demo examples and detailed documentation of how to use them.
After we include the libraries we need to create UTFT and URTouch objects. The parameters of these objects depends on the model of the TFT Screen and Shield and these details can be also found in the documentation of the libraries.
So now I will explain how we can make the home screen of the program. With the setBackColor() function we need to set the background color of the text, black one in our case. Then we need to set the color to white, set the big font and using the print() function, we will print the string “Arduino TFT Tutorial” at the center of the screen and 10 pixels down the Y – Axis of the screen. Next we will set the color to red and draw the red line below the text. After that we need to set the color back to white, and print the two other strings, “by HowToMechatronics.com” using the small font and “Select Example” using the big font.
In order the code to work and compile you will have to include an addition “.c” file in the same directory with the Arduino sketch. This file is for the third game example and it’s a bitmap of the bird. For more details how this part of the code work you can check my particular tutorial. Here you can download that file:
After uploading the code you"ll able to see the calculator running in your display as mine and now you can perform basic mathematics calculations on this. So have fun making your own calculator with Arduino UNO.
WF43WTYBEDSG0 is a 4.3-inch IPS TFT-LCD display with a Capacitive Touch screen, made of resolution 480x272 pixels. This module is built-in with BT815 controller IC, and it supports SPI and QSPI interfaces. The QSPI interface can achieve four times data rate compared with the current SPI interface and make a smoother display accordingly. The series of BT815/6 controller IC with EVE (Embedded Video Engine) technology simplifies the system architecture, Eve technology is a revolutionary concept that utilizes an object-oriented approach to creating high-quality human-machine interfaces (HMI). This new technology supports display, audio and touch, enabling engineers to quickly and efficiently design HMI and provide a powerful solution for high-resolution displays that reduce material costs.
We offer the TFT module WF43WTYBEDSG0#000 designed to support the Arduino board. The control signal for WF43WTYBEDSG0 is 3.3V; it has a built-in storage device (FLASH 32M). The control signal of WF43WTYBEDSG0#000 is 5V; without a built-in storage device (FLASH); but with a MicroSD Socket, pins CON1~CON4 are designed for SPI control (such as for Arduino Uno Rev3). WF43W model can be operating at temperatures from -20℃ to+ 70℃ and storage temperatures from -30℃ to +80℃.
Looking for reasonable wholesale tn calculator lcd display to offer your customers? Alibaba supplies RF beauty equipment that is accurate, durable, and efficient. Straight from the factories, all our wholesale products are well-priced, reliable, and designed for easy-to-use daily usage.
Choose from a variety of formats to cater to every customer, from larger, more intensive equipment for the full-body, to battery-powered portable designs that are perfect for traveling and moving around. Stock the portable RF skin rejuvenation machine, the home-use skin rejuvenation mini, the portable 6-in-1 hydro peel microdermabrasion hydra facial, and the portable RF micro-current skin tightening face machine 2-in-1 to supply tn calculator lcd display that will leave beauty salon clients looking young and fresh.
Don"t forget our wholesalers" tn calculator lcd display for hair removal either, with easy-to-use screen displays, offering an uncomplicated user-friendly experience. Supply the latest wholesale portable laser RF hair removal machines, stocked by Alibaba"s wholesalers. You"ll also find factory-price portable magic eye RF beauty machines for eye circles from our wholesalers on Alibaba.com. Find everything a beauty salon needs in Alibaba"s range of tn calculator lcd display, from cellulite-removal, skin-tightening, anti-aging, hair removal, and more, at wholesale prices on Alibaba.com.
The ST7735 color TFT display is a 1.8″ display with a resolution of 128×160 pixels and can display an extensive range of colors. It utilizes the SPI protocol for communication, features its own pixel-addressable frame buffer, and only needs four I/O pins of a microcontroller. To complement the display, it also comes with an SD card slot on which colored bitmaps can be loaded and easily displayed on the screen.
The hardware setup for this experiment is fairly easy as the only thing you need to wire with the Arduino Uno is the TFT display. Well, connect the TFT display module to the Arduino Uno as pointed in the table below.
The ST7735 is a single-chip controller/driver for 262K-color, graphic type TFT-LCD, which consists of 396 source line and 162 gate line driving circuits. This chip is capable of connecting directly to an external microprocessor and accepts Serial Peripheral Interface (SPI), 8-bit/9-bit/16-bit/18-bit parallel interface. Display data can be stored in the on-chip display data RAM of 132 x 162 x 18 bits.
Also read this loosely related guide http://www.lcdwiki.com/1.8inch_Arduino_SPI_Module_ST7735S_SKU:MAR1801 Now, you can see below a seller’s description of the TFT display used in my experiments.
It’s very crucial to note at this point that the maximum power supply voltage for the ST7735 display driver chip is 3.3V and same for its interface pins. Some TFT modules include a 3.3V regulator and a logic level shifter onboard in which case it can be used with any 5V microcontrollers. If not, some logic level shifting must be done if the microcontroller is not powered from 3.3V!
Copy the following code to your Arduino IDE and upload it to your Arduino Uno. This code displays “HELLO MAKER!” in the middle of the screen and changes the font color every 500 milliseconds.
Note that since the TFT display communicates with the Arduino via SPI communication, you need to include the SPI library in your code. You also need to use the TFT library, which’s already included with Arduino IDE 1.0.5, and later, to write and draw on the TFT display.
Below is another easiest example code to manifest the possibilities of the TFT display. This no-frills Arduino Sketch simply displays the value of Uno’s analog input A0 on the TFT display.
And sure enough, the TFT library enables the Arduino to communicate with the TFT display module, and it simplifies the process of drawing lines, shapes, images, and text to the display screen. Note that the TFT library relies on the SPI library for communication with the display and SD card, and needs to be included in all sketches. For additional information, see this page https://www.arduino.cc/reference/en/libraries/tft/.
In my book, this ST7735 display controller based 1.8″ colour TFT display is a very handy module for use in microcontroller projects. Here I just discussed about displaying elements on the TFT display but you can follow my upcoming tutorials to learn more about making a bit more advanced display projects.
Arduino has always helped to build projects easily and make them look more attractive. Programming an LCD screen with touch screen option might sound as a complicated task, but the Arduino libraries and shields had made it really easy. In this project we will use a 2.4” Arduino TFT LCD screen to build our own Arduino Touch Screen calculator that could perform all basic calculations like Addition, Subtraction, Division and Multiplication.
Begin by carefully starting the rear connector of the TFT shield onto the Arduino uno. Go slowly and ensure that all pins are inserted correctly and are straight.
Here is the latest version of the Sinclair Scientific Calculator emulator running on a custom PCB which accurately replicates the size and the circuitry of the original calculator. This is powered by an Arduino Nano.PCB v6 is the same size as a real Sinclair Scientific Calculator, the keyboard and display circuit is accurate as well.A matrix keyboard and 9 digit LED display are connected to an Arduino Nano. The Nano runs a port of Ken Shirriff JavaScript 0805 TI CPU Emulator. The emulator is executing the actual 320 instructions that ran on the 1974 calculator. The Nano has some glue logic implementing the translation of keypresses into the I/O signals the Sinclair code expects to see. The original code is given a chance to run one of its very unique 11-bit instructions that contained both the operand and the address of the next instruction. The Nano then inspects the internal state of the calculator's A register and outputs it to the LED displays.The 1974 Sinclair Scientific was unique as it took the work of geniuses to implement a reverse Polish notation (RPN) scientific calculator with trigonometric functions on a chip barely capable of doing addition, subtraction, and multiplication and division as iterative algorithms. The Texas Instruments TMS 08XX CPU was also limited to storing a 320 instruction program in its internal ROM.Implementing all of those functions was not without cost. The calculator was slow, some answers can take up to 15 seconds to show up, meanwhile a blank screen is shown. Its accuracy is limited: 4 * arctan(1) yields a value of PI of 3.1440 as shown on the product screenshots. Calculating arctan(0.0001) goes into a loop for a minute and a half before yielding the wrong value of 0. The decimal point is in a fixed spot as storing numbers in a scientific format simplifies both internal calculations and displaying the result. Reverse Polish Notation was used as it simplifies the processing of the operands. There is no space in ROM for important constants, so those were printed on the face of the calculator.Part of the genius of this product was realizing that sometimes "Worse is Better", the limited accuracy and its other quirks were offset by the fact that this calculator was Cheap! When first released, it cost around $100 when other scientific calculators cost almost $400. After a year, a kit was released for £9.95 (around $24) (incl. VAT)The hardware portion of this project is now an accurate recreation of the Sinclair Scientific Calculator circuitry. The connections from the keys to the display were reverse engineered by pushing two keys at a time on the original calculator and seeing which two digits in the display were affected.The Arduino software is a very thin layer interfacing to the original code. There is one option however, code execution speed. If the calculator is powered up, it runs at the original speed and the display is blanked out while a result is being calculated, just like in the original hardware. If the keys 1,2 or 3 are pressed during power-up, prior to 0.0000 00 being shown, the screen will stay illuminated all the time and the speed will be either slow (1), normal (2) or very fast (3). It is very interesting seeing the intermediate results the calculator goes thru before arriving at an answer. The normalize function can be seen working on the slowest setting. Type 0.0001 + and the 1 will be shifted left while the mantissa is incremented.This work could not have been possible without this:@KenShirriffSinclair Scientific Calculator Simulator http://files.righto.com/calculator/sinclair_scientific_simulator.htmAnother calculator based on the TMS CPU http://files.righto.com/calculator/TI_calculator_simulator.htmlRecent Hackaday articles on the Sinclair Scientific https://hackaday.com/?s=Sinclair+ScientificWikipedia page https://en.wikipedia.org/wiki/Sinclair_ScientificHackaday.io project page: https://hackaday.io/project/91895-sinclair-scientific-calculator-emulator
I am a big fan of "glow-in-the-dark"-displays of all kind, for calculators as well as for other objects. This includes Nixie clocks (I have two readymade ones, two selfmade ones and engough parts to make two or three more...).
Recently I have come across the "Elekstube IPS" clock, made in China obviously. A description and review can be found here: http://www.tubeclockdb.com/non-tube-cloc...ul-andrews Every digit is a little color LCD screen about 25mm (one inch) high and with a good resolution (135x240 pixels). One can select from a range of supplied display styles but it is also possible to upload one"s own images. Even grey-on-grey 14 segment HP-41 style digits if one would wish so...
Now these displays would be very useful for a DIY desktop calculator if only one could buy them separately. Therefore my question: Has anyone seen anything like it yet or happens to know a source for them?
Wondering if anyone has experience interfacing one of the many higher resolution colour GLCD"s now available? I am looking at replacing the black and white 128x64 GLCD I"ve been using with a colour one. An electronics magazine I bought the other day had an article on interfacing this 3.5 inch GLCD to an Arduino.
It is a 480x320 colour GLCD with an SD card holder and uses SPI to communicate with the microcontroller. My main concern is that the relatively high resolution could result in a slow refresh rate, especially as it uses SPI. Here is a 4 inch 480x320 colour GLCD with an 8-bit parallel interface, which is faster but uses more microcontroller pins.
Regarding the original question: The higher resolution graphics capable LCDs that I have played with so far all came with an Arduino "shield" for the connections. Two monochrome ones are installed in my 3D printers and I got another 2 or three colour ones for future experimenting. The ones I have tried so far all come with 8 bit parallel buses and require 11 or 12 lines in total.
However recently I acquired two "smart" LCD displays (with the intention of eventually using them for an Apollo guidance computer DSKY replica) from Nextion (https://nextion.itead.cc/). These are pretty amazing devices which come with their own microcontollers and on-board "intelligence" and require only minimal amounts of data transfer from their host computer. I guess it should be even possible to program them as a standalone four-function calculator with touch interface. On the internet I have seen stuff like standalone Tic-tac-toe.
These displays require a PC application for configulation and programming. The program can then be transferred either by a serial connection or (very easy!) via SD card. Once it is programmed, 2 way serial communication from the Arduino requires only two lines. The main disadvatage may be their price: the smallest 2.4in Nextion display costs around 15 $/Euros including shipping compared to a similar sized "dumb" TFT shield that comes for less than 3 $/Euros). The other disadvantge is the display itself which is not as good as those we know from our modern smartphones. Especially the viewing angle is somewhat limited.
I took some photos for comparison of some displays I pulled out of one of my tinkering boxes. The first one is for size comparison shows an overview of 3 Arduino boards (Nano, Mega and Uno) and 3 grahic displays:
This is the backside of the dumb display shield . It shows how many lines are connected to the Arduino. It uses more connections than necessary for the display itself because it gives touch feedback as well and there is also an SD card interface and a temperature sensor. There are plenty of libraries online for these boards and lots of examples.
one of my projects is to see if I can duplicate the 48sx some day. I"ve been playing with the source for x48 and compiling on a couple mcu"s like the PIC and AVR (arduino) then plan to make a keyboard and lcd like these and eventually have a whole calculator.
The graphical (G) displays enable you to turn individual pixels on and off, whereas LCD"s can only display characters, e.g. four function calculators, fax machines etc.
(05-16-2019 10:35 AM)Maximilian Hohmann Wrote: [ -> ]This is the backside of the dumb display shield . It shows how many lines are connected to the Arduino. It uses more connections than necessary for the display itself because it gives touch feedback as well and there is also an SD card interface and a temperature sensor. There are plenty of libraries online for these boards and lots of examples.
However I"m not sure if this particular 2.8 inch display will work with my 3.3V logic microcontroller. A lot of these displays are designed for the Arduino/RPi and feature additional circuitry to convert 5V to 3.3V, perhaps the shield is expecting 5V from the pins?
Once I find a display, Dirk Heisswolf, creator of the AriCalculator hardware, has kindly agreed to start designing PCB"s to turn my TI LaunchPad prototype into a handheld unit, which is pretty exciting. The idea is to plug one PCB with the keys and display attached to it into the male header pins on top of the LaunchPad, and the other PCB for the power supply into the female pins underneath the LaunchPad.
EDIT: Even without TFT, parallel + SD card uses a lot of pins, judging from the underside of the 2.8 inch. The TI LaunchPad has 40 pins but 14 are used for the 8 row, 6 column matrix keypad. Perhaps SPI is better - it really depends on how long it will take to redraw the higher resolution display. I am about to upgrade to the TM4C1294XL, which is 120MHz, so hopefully that will give acceptable results.
(05-17-2019 03:11 AM)Dan Wrote: [ -> ]So if anyone knows of a quality 3.3V GLCD around 3.5 inches with parallel interface and SD card connection, please let me know!
(05-17-2019 02:26 AM)Dan Wrote: [ -> ]The graphical (G) displays enable you to turn individual pixels on and off, whereas LCD"s can only display characters, e.g. four function calculators, fax machines etc.
Interesting. I never knew that the definition of LCD (Liquid Crystal Display) precluded pixel-by-pixel addressability. The thousands of manufacturers who call them simply "LCD" must all be wrong.
(05-17-2019 10:07 AM)grsbanks Wrote: [ -> ](05-17-2019 02:26 AM)Dan Wrote: [ -> ]The graphical (G) displays enable you to turn individual pixels on and off, whereas LCD"s can only display characters, e.g. four function calculators, fax machines etc.
Interesting. I never knew that the definition of LCD (Liquid Crystal Display) precluded pixel-by-pixel addressability. The thousands of manufacturers who call them simply "LCD" must all be wrong.
It"s probably just nomenclature used in the embedded dev systems market to differentiate LCDs strapped to a character generator and controlled via a simple serial interface from the ones that are directly addressable.