1. Self/Team Introduction I am an Arduino enthusiast with a personal website www.lab-z.com, and I have been using Arduino to make various interesting devices. 2. Briefly introduce the project. Last year, Amilo launched a product called The mechanical keyboard of the "calculator", the display and the small keyboard area on the right side of the keyboard can be used as a calculator. This time, I used Arduino to make a device that turns an ordinary USB keyboard into a keyboard with calculator functions. [Please fill in during the competition stage↓] * 1. Describe the project details. Our goal is to design a device that allows an ordinary keyboard to also have the function of a calculator. In addition, we also add an additional voice broadcast.
* 2. Describe the challenges faced by the project and the problems solved. The design idea is to insert our calculator device between the keyboard and the PC, and send all key information to the host intact. In addition, if a small keyboard key is found When downloading, the key information is parsed and used by the calculator.
* 3. Describe the key points involved in the hardware and software parts of the project. The hardware design uses Arduino Pro Micro 3.3V version and USB Host Mini Shield. The circuit diagram is as follows: The PCB design is as follows: The 3D preview is as follows:
After the hardware design is completed, the software design begins. 1. Because the computer calculation range may exceed the integer range of Arduino, you need to choose a "big number library". In the final experiment, we decided to use the BigNumber Library written by nickgammon [Reference 1]; 2. We use the USB Host Shield Library to complete the USB keyboard keystrokes Analysis of information; the key values of the small keyboard area determined through experiments are as follows: 3. With the above two steps, the calculation design can be carried out. The description of the state machine is used in the design. This is a common method of programming, which can make the help code design structure clear and well encapsulated (one more thing, many years ago, I almost had to do software. For a while, I It was rumored that the factory where I worked was going to relocate the motherboard production line to Dongguan, Guangdong. At that time, Dongguan was known as the top ten violent cities, and the news was full of all kinds of news about people killing hands and grabbing mobile phones. In order to prepare in advance, I contacted another colleague Software team, hoping to transfer to write software without having to relocate. One of the interview questions was how to design an automatic control electric door with one button. The final result of the interview was that the other party’s boss confiscated it from us, but he gave it to us while explaining the analysis of the interview questions. I talked about the design method of the state machine, which gave me a sudden enlightenment and benefited a lot. Therefore, it is beneficial to open the book, and it is also very beneficial to change jobs). The following picture means this: after powering on, the program is in Status0. After receiving the NUM (number) key, it will be transferred to Status1 (this also means that only the number key is received); if it receives NUM again, it will still Maintain in Status1 (the first operand becomes larger), if DOT (decimal point) is received, then transfer to Status2; if OP (operator) is received, then transfer to Status3... The following NUM represents a number from 0 to 9; DOT represents the decimal point "."; OP represents the "+-*/" operator; ENTER represents "=". It can also be seen from here that if there is no corresponding documentation, it is a nightmare to directly view the code. 6. In order to be closer to an ordinary calculator, a voice function has been specially added. Playing voice is achieved through the SYN6288 voice module. Arduino encodes the Unicode commands and text and sends them to the serial port of the module [Reference 2].
* 4. Project material list display
element | use |
Arduino Pro Micro 3.3V | The 32U4 operating under 3.3V can directly communicate with the USB Host Shield (the common one is 5V and cannot communicate directly) |
USB Host Shield Mini | Used to parse USB data |
SYN6288 voice module | The serial port receives data and is used to play voice |
1602 LCD | 1602 LCD, I2C interface |
* 5. Upload project pictures 5.1. Print the competition logo picture on the PCB. Failure to do so will be deemed as giving up the competition.
5.2. Other pictures of the project * 6. Demonstrate your project and record it as a video for upload 6.1. Official website of the video upload competition 6.2. Video title and link of Station B. The video can be seen at https://www.bilibili.com/video/bv1q54y1C7VL
* 7. Whether it is released to the public for the first time 7.1. First publication 7.2. First production
* 8. Open source documentation. The specific code and library files used can be seen in the attachment.
* 9. References 1. https://github.com/nickgammon/BigNumber 2. http://www.lab-z.com/ttssyn/
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet