This is a primary school children mathematics (multiplication) exercising project. The program generates random integer numbers and asks the user to calculate their product and answer as voice commands. The program checks the answer and gives feedback to the user. The program is in 3 Levels depending on the difficulty of the questions.

Note: This project is built, tested and is FULLY WORKING.

Primary school mathematics – Learning multiplication: This project is based on the concepts of artificial intelligence where a voice activated mathematics (multiplication) project is designed using the MAX78000FTHR microcontroller development board. The project has been designed to be voice activated and is therefore like a game for the children. They learn while playing!.

Random integer numbers are created and the user is expected to find the multiplication of these numbers and give the answer as voice commands.

The project has 3 Levels of difficulty:

LEVEL 1: This is the starting level, aimed for children who just started to learn how to multiply 2 digit and 1 digit numbers. The background is set to GREEN and the level is displayed at the top of the page. An example is shown below. The program displays:

25 x 4 =

The user is then expected to enter the answer as ONE ZERO ZERO followed by YES where YES is the terminator. The answer is checked and a message is displayed to show whether the given answer is correct or not. If the answer is wrong, the user is prompted to enter it again. After 5 consecutive successful correct answers the program moves to LEVEL 2.

LEVEL 2: This level is a bit more complicated. Both of the two generated random integer numbers are between 1 and 100. The background colour is BLUE in this level. Again, the answer given by the user is checked. After 5 consecutive correct answers the program moves to LEVEL 3 which is the last level. If the answer is wrong to any question, then the user is expected to try again and the correct attempt count is set to zero so that 5 more consecutive correct answers must be given before the program moves to the next level. An example is given below:

25 x 15 =

The user is then expected to enter THREE SEVEN FIVE followed by YES

LEVEL 3: In this level the generated integer numbers are both between 10 and 500. This is for more advanced children who have mastered the art of multiplying long numbers. The background is set to RED colour.

At the heart of the MAX78000FTHR is a MAX78000 Cortex-M4 ARM based microcontroller with FPU. Additionally, the board contains 512KB  flash memory, 128KB SRAM, 16KB cache, Convolutional Neural Network Accelerator, VGA image sensor, digital microphone, RGB LED, pushbuttons, microSD card adapter, microUSB connector, stereo audio CODEC, SWD debugger, virtual UART port, and many I/O ports.

Block Diagram: Figure 1 shows the block diagram of the project. A 2.4 inch ILI9341 controller based TFT FeatherWing 240x320 pixel touch-screen TFT display is used at the front end of the project to display the user commands and responses.

Circuit Diagram: Figure 2 shows the circuit diagram of the project. The TFT display is connected to the MAX78000FTHR via the SPI bus interface. Pins MISO, MOSI, SCK and CS of the SPI bus are connected to pins P0_6 (MISO), P0_5 (MOSI), P0_7 (SCK), and P0_11 (CS) of the development board. Pin D/C of the TFT display is connected to pin P0_8, and Vcc and GND are connected to +3.3V and GND pins of the MAX78000FTHR.

The circuit was built on a breadboard and connections were made using jumper wires. Figure 3 shows the project built on a breadboard.

Power is supplied to the circuit through its mikroUSB cable which should be connected to the USB port of a computer during the program development.

Operation of the project: The operation of the project is shown in Figure 4 as a state diagram. The following sounds are recognized by the project (invalid spoken commands are rejected by the project):

Numbers 0 to 9 (entered as voice commands ZERO ONE TWO,…….. NINE)

YES         voice command used to terminate the user entry

Program listing: The 20 keywords in the supplied Maxim project kws20_demo is used with the keywords YES and numbers ZERo to NINE.. The CNN training program was ran on a Linux Ubuntu operating system after creating a WMware virtual machine on a Windows 10 machine with an i7 CPU, 100GB disk space, and 12GB free memory, without a special GeoForce GPU. After training the new words, the created cnn.c, cnn.h files and the weights.c and weights.h files were copied to the workspace and program main.c under folder kws20_demo was modified for this project. The full main.c program listing is given in Figure 5 as a PDF file.

Function Detected_Word detects the spoken words and returns an integer number which is used to identify the detected sound. Number 100 is returned if a non-valid sound is detected by the program. This function body is as follows:

int Detected_Word(int16_t out_class)

{               if(strcmp(keywords[out_class], "YES") == 0) return 10;               else if(strcmp(keywords[out_class], "ONE") == 0) return 1;           // Numeric sounds.....               else if(strcmp(keywords[out_class], "TWO") == 0) return 2;          // ...               else if(strcmp(keywords[out_class], "THREE") == 0) return 3;        // ...               else if(strcmp(keywords[out_class], "FOUR") == 0) return 4;         // ...               else if(strcmp(keywords[out_class], "FIVE") == 0) return 5;            // ...               else if(strcmp(keywords[out_class], "SIX") == 0) return 6;              // ...               else if(strcmp(keywords[out_class], "SEVEN") == 0) return 7;        // ...               else if(strcmp(keywords[out_class], "EIGHT") == 0) return 8;        // ...               else if(strcmp(keywords[out_class], "NINE") == 0) return 9;          // ...               else if(strcmp(keywords[out_class], "ZERO") == 0) return 0;          // Numeric sounds               else

return 100;

}

Random numbers are generated using the MAX78000 processor True Random Number Generator engine (TRNG). The generated number is used as a seed to function srand() so that different number set is generated each time the program is run. Functions rand() are then called to generate the required numbers as shown in the following example:

MXC_TRNG_Random(&rnd8, 1);srand(rnd8);firstno = 1 + rand() % 100;                           // Generate number between 1 and 100

where the seed is generated outside the main program loop.

The ELEKTOR lego was converted into a bitmap image and then into a c file, and is displayed when the project is started (see the section on running the project).

Figures 6.1 to 6.11 show snapshots of the TFT display from the beginning to giving commands to control the LEDs.

Example run of the project: An example run of the project is shown in the You Tube video link. Notice that the ELEKTOR logo is displayed when power is applied to the project, or when the Reset button is pressed. Then, a short screen is displayed as a header which gives very brief information about the project. The user is then prompted to speak the required valid commands.

Suggestions for future work:

The project can be upgraded such that other mathematical functions, such as addition, subtraction, and division can be added to the program. Also, mixed arithmetic can be added such as multiplication together with addition and subtraction, using brackets etc. Written problems can also be added for more advanced users.