I did a project on a calculator a few months ago, Galdeano 01, although I just published it. And I found it so interesting and fun that I have been expanding it. I have put a larger screen, with more resolution and color. I have put a bigger keyboard and I have used a microcontroller with more memory to be able to do symbolic calculations. Finally, the screen module has an SD card, which we can only use in some cases. Of course, 7x6 buttons are a lot... soldering the board becomes complicated... so I developed a custom PCB board. On the second try, it worked fine.
By design I wanted to use only hole electronic elements, I don't want surface elements, because soldering them is complicated and not everyone has the ability and the means to do it. So we do not use the esp32 module directly, nor the ILI9341 screen, but a couple of modules are already soldered with pins to connect them to the PCB. The problem is that in return we pay for a thicker calculator.
To this PCB you have to solder the different components, and you have to power it. When designing the PCB board I thought of giving it power with 4 AAA batteries, but putting two in parallel and then in series, to give a voltage of 2.4V (2*1.2 if they are rechargeable batteries) or 3V (2*1.5 if they are rechargeable batteries). alkaline). So I need a boost converter to output the 3.3 volts that I power everything with. However, after making the 3D case, I saw that the battery hole was not very friendly. The battery holders are metal and are not easy to fit. In addition, the batteries are thick, it is a device too thick.
So we made a second version, the power stays on another PCB outside the main one, with a lipo battery charger and a buck-boost converter, to go from the 4V-3.0V range of the lipo battery to 3.3V circuit power supply.
Later we put a 3D box. It is divided into three parts, the lower part that has the batteries, an upper part with the holes for the buttons, and the screen and the buttons. On the first try, the buttons were square and all black. In the second attempt, they are rectangular and colored, I think that this second attempt is correct. I have put bronze pieces in the casing so that when screwing the pieces together they do not wear out.
In the end, I have ended up with several firmwares that work in the calculator, a modification of the one I used in Galdeano01, changing the driver that reads the keyboard and the one that handles the screen. This firmware is fun because it allows you to play with micropython's eval() function and pass different dictionaries to it for the environment.
Later I used a firmware made in Arduino-C, with the TFT-ESPI library, which allows access to all the resources of the board. This is important, because when using an esp32 WROVER micro and with a 7x6 keyboard, all the I/O ports are occupied, so you have to connect the TFT, the touch, and the SD card reader to the same SD port. IN this firmware is where you 'plug' George Weigt's software, Eigenmath. It's a pretty nice symbolic calculus software, which is written in C and is relatively easy to integrate. A couple of issues with the amount of static memory that esp32 is able to instantiate (we switched to dynamically instantiated memory) and fixed.
But the fun part is being able to use micropython to program the device. This makes it possible for us to use Thonny to program directly on the device. For that, we have modified a version of lv_micropython. In the micropython version of esp32 with SPI memory, all memory is allocated to the micropython heap. But the symbolic computation engine needs to instantiate memory. So I've enabled the use of malloc() in the project configuration and added a dynamic micropython heap reservation, leaving room for Eigenmat to work its magic. We have put an interface to Eigenmath itself to be able to execute a Run() function to which we pass the string that we want to execute and this returns another string with the symbolic result. Including lv_micropython also helps us solve the problem of printing UTF-8 characters, the Greek symbols. To do this we have compiled a font with these characters... and by the way of outputting the response, with a fixed-width font. We had some problems with the space that the firmware occupies in the flash, so we have cut from Eigenmath the functions that format the response in latex, and some special features of lv, such as the calendar widget. But the best thing about this firmware is that it can be programmed in python, with graphic widgets, and if necessary, with a symbolic calculation engine.
Comments
Please log in or sign up to comment.