Project showcase
Quizmo

Quizmo

A gadget to help your kids practice basic arthematics.

  • 1,143 views
  • 5 comments
  • 11 respects

Components and supplies

Apps and online services

About this project

This project is related to developing a handy gadget to help kids practice basic arithmetic operations. I decided to make it as my kids were very lazy to look into the books and come back very soon saying that they have done it (specially multiplication tables). This gadget randomly asks different questions and evaluate kids performance.

For this you need a 4x3 keypad to interact with the gadget and an LCD to show you results. for connectivity of LCD with arduino, you can follow instructions on below path:

http://www.instructables.com/id/Connecting-an-LCD-to-the-Arduino/

Once you have setup brightness using the rehestat, you can note down the values and replace it with fixed resistors or keep it there if you want the user to adjust brightness as per his/her comfort.

In order to connect keypad with arduino, use guide on this link:

http://www.instructables.com/id/interface-keypad-with-arduino/

Power up Arduino and it will ask you what kind of quiz you want to take. Selec appropriate option and it will start. Once you have input your answer, you need to press * in order to submit and let the gadeget check your answer. In order to finish the quiz or take next one, press # and main menu will appear again. You can increase the difficulty level from the code by changing the maximum range of random number generator. This gadget currently produces random questions by using numbers from 1 to 12.

Code

Arduino CodeC/C++
Upload this code directly to UNO and make sure you use the wiring similar to mentioned in code
#include <Keypad.h>
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

long rand1,rand2,ans,ans1,opr,score,total;
char selec,selec1;
boolean quiz=false;
String stringTwo;

const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}
};
byte rowPins[ROWS] = {10, 9, 8, 7}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {6,1,0}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){
  lcd.begin(16, 2);
  mk_menu();
  keypad.addEventListener(keypadEvent);
}
  
void loop(){
  selec = keypad.getKey();
  while (selec==NO_KEY){ 
    selec = keypad.getKey();
  }
  lcd.print(selec);
  delay(500);
  if (selec!=NO_KEY){
    switch(selec){
      case '1':
         quiz=true;
         opr=1;
         quiz_sum();
      break;
      case '2':
        quiz=true;
        opr=2; 
        quiz_subt();
      break;
      case '3':
        quiz=true;
        opr=3; 
        quiz_mult();
      break;
    }
  }
}

void mk_menu(){
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("1)+ 2)- 3)x");
  lcd.setCursor(0, 1);
  lcd.print("Choose: ");
}
void quiz_sum(){
    lcd.clear();
    lcd.setCursor(0, 0);
    rand1=random(1,99);
    rand2=random(1,99);
    lcd.print("Find ");
    lcd.print(rand1);
    lcd.print("+");
    lcd.print(rand2);
    lcd.print("?");
    ans1=rand1+rand2;
    selec1 = keypad.getKey();
    while (selec1==NO_KEY){ 
      selec1 = keypad.getKey();
    }  
    while (quiz){
      while (selec1==NO_KEY){ 
      selec1 = keypad.getKey();
    }
     switch(selec1){
      case NO_KEY:
         break;
      default:
        lcd.print(selec1);
        stringTwo.concat(selec1);
        ans=stringTwo.toInt();
        //lcd.print(stringTwo);
        selec1=NO_KEY;
        break;
    }
  }
}

void quiz_subt(){
    lcd.clear();
    lcd.setCursor(0, 0);
    rand1=random(1,99);
    rand2=random(1,99);
    lcd.print("Find ");
    if(rand1>=rand2){
      lcd.print(rand1);
      lcd.print("-");
      lcd.print(rand2);
      ans1=rand1-rand2;
    }
    else if(rand1<rand2){
      lcd.print(rand2);
      lcd.print("-");
      lcd.print(rand1);
      ans1=rand2-rand1;
    }
    lcd.print("?");
    selec1 = keypad.getKey();
    while (selec1==NO_KEY){ 
      selec1 = keypad.getKey();
    }  
    while (quiz){
      while (selec1==NO_KEY){ 
      selec1 = keypad.getKey();
    }
     switch(selec1){
      case NO_KEY:
         break;
      default:
        lcd.print(selec1);
        stringTwo.concat(selec1);
        ans=stringTwo.toInt();
        //lcd.print(stringTwo);
        selec1=NO_KEY;
        break;
    }
  }
}

void quiz_mult(){
    lcd.clear();
    lcd.setCursor(0, 0);
    rand1=random(1,12);
    rand2=random(1,12);
    lcd.print("Find ");
    lcd.print(rand1);
    lcd.print("x");
    lcd.print(rand2);
    lcd.print("?");
    ans1=rand1*rand2;
    selec1 = keypad.getKey();
    while (selec1==NO_KEY){ 
      selec1 = keypad.getKey();
    }  
    while (quiz){
      while (selec1==NO_KEY){ 
      selec1 = keypad.getKey();
    }
     switch(selec1){
      case NO_KEY:
         break;
      default:
        lcd.print(selec1);
        stringTwo.concat(selec1);
        ans=stringTwo.toInt();
        //lcd.print(stringTwo);
        selec1=NO_KEY;
        break;
    }
  }
}

void chk_ans(){
  lcd.clear();
  if (ans1==ans){
     lcd.clear();
     lcd.print("Correct");
     score=score+1; 
  }
  else {
     lcd.clear();
     lcd.print("Incorrect");
  }
}
void keypadEvent(KeypadEvent key){
    switch (keypad.getState()){
    case PRESSED:
        if (key == '*') {
            chk_ans();
            total=total+1;
            stringTwo="";
            delay(400);
            if(opr==1){
              quiz_sum();
            }
            else if(opr==2){
              quiz_subt();
            }
            else if(opr==3){
              quiz_mult();
            }
        }
        else if (key == '#') {
            quiz=false;
            stringTwo="";
            lcd.clear();
            lcd.print("Your Score: ");
            lcd.print(score);
            lcd.print("/");
            lcd.print(total);
            delay(1500);
            score=0;
            total=0;
            mk_menu();
            loop();
        }
        break;
    }
}

Schematics

Block Diagram
This is how whole system must look like
Circuit vxuoxjb1jo

Comments

Similar projects you might like

Servo Control with TV Remote Control

Project showcase by eldo85

  • 5,592 views
  • 5 comments
  • 17 respects

Start/Stop Chronometer

Project showcase by Gabriele Scordamaglia

  • 3,667 views
  • 0 comments
  • 5 respects

Multifunctional Watch With Arduino Uno

Project showcase by shaqibmusa94

  • 3,602 views
  • 2 comments
  • 8 respects

Arduino-based Obstacle Monitoring System

Project showcase by Boaz Lawnce

  • 2,243 views
  • 0 comments
  • 4 respects

RFID Based Automatic Door System

Project showcase by Robodia Technology

  • 35,759 views
  • 20 comments
  • 97 respects

Gesture-Controlled Lock

Project tutorial by Arduino “having11” Guy

  • 8,668 views
  • 6 comments
  • 35 respects
Add projectSign up / Login