Project tutorial

QuizBox - The Offline Internet Quiz © CC BY-NC-SA

An offline internet quiz to find out what subreddit you are, who doesn't need that?

  • 997 views
  • 0 comments
  • 0 respects

Components and supplies

Necessary tools and machines

3drag
3D Printer (generic)
09507 01
Soldering iron (generic)
4966285
Solder Wire, Lead Free
Hy gluegun
Hot glue gun (generic)

Apps and online services

About this project

Overview

Below a quick overview of the content.

  • Introduction and Showcase Video
  • Printing the Box
  • Adding some Electronics
  • Writing the Code
  • Making a Quiz
  • The Result

Introduction and Showcase Video

I've discovered internet quizzes, and they have changed my life. For instance, now I know that if I would be a dog, I would be a Golden Retriever, win! To show some love and gratitude for all this vital information, we're going to build our own internet quiz. However, this internet quiz will be special, it's going to be an offline internet quiz.

Project Video

Printing a Box

First things first, we need a box to put everything in. To make sure it perfectly fits our needs, we're making one that's 3D printable.

This 3D printed box is made out of four parts.

The base plate is nothing more than a 4 mm thick square, with four tjoepies. These tjoepies will hold our corner pieces in place, and make sure everything is spaced out correctly.

Corner pieces, they're pillars with a grove on two sides. These groves will later on hold the walls in place. They also have two indents so they can click onto the tjoepies of the base plate and lid.

With the corners in place, we can slide in the walls, as pictured below. Tip: A colorful print makes the box really pop.

The lid is a bit more complex. It is almost identical to the bottom plate, but we've added some holes and indents. The holes are for three toggle switches, a big red button and provides space for the printer paper to come out. No worries, we will cover all of this later on.

The indents will each hold a colorful block, see below. The idea is that the quiz will consist of three choices. A pick your color kind of thing.

All that is left to do is put on the lid, and our box is ready for the next steps.

You can find all the 3D models inthe attachments.

Adding Some Electronics

Now we can move on to the electronics. As mentioned above we have space in the lid to neatly hold most of them. We'll start off with adding the three toggle switches, so people can make their choice. They come with handy rings, so tightening them is very easy

Next up is the big red button to submit the answers. This button also has a neat screw-on mechanisme.

With all the components attached, we can now start wiring everything together.

Que the Arduino. Both the button and all three switches use the same ground, with a small breadboard in between. However they each have their own input pin.

Last but not least, we add a little thermal printer. There's great documentation about connecting and setting it up, right here.

With that the hardware is all done. Putting both the Arduino and the printer in the box and pulling through the printer paper completes the physical part of this build.

Writing the Code

The code will have the following logic:

  • Check if the big red button is pressed
  • If pressed, read out the state of each toggle switch
  • and based on the combination of states, print the correct answer

We won't dive into the details too much, you can find the full code in attachment.

Making a Quiz

With all our parts ready, the last step is to come up with a catchy quiz. In this case we're going to define people as a subreddit, or simply put:

Some fiddling with the print layout and wording completes our offline internet quiz!

The Result

We have an internet test that works offline and can figure out which subreddit you are based on three color choices, woopwoop!

Secret Bonus Part

For all of you reading to the end, here's a list of possible answers:

                 "                                "
                 "    --- r/oddlysatisfying ---   "
                 "                                "
                 "  Some people may call you odd, "
                 "   or even think you're fluky.  "
                 " Nonetheless, you bring your own"
                 "  unusual charm and joy to the  "
                 "         lives of many.         "
                 "                                "
                 "    --- 8 Bits and a Byte ---   "
                 "                                "
  
                 "                                "
                 "          --- r/DIY ---         "
                 "                                "
                 "   Independent and resourceful. "
                 "  You are able to bring to life "
                 "  even the most ambitious ideas."
                 "                                "
                 "    --- 8 Bits and a Byte ---   "
                 "                                "
  
                 "                                "
                 "          --- r/aww ---         "
                 "                                "
                 "Irresistible to almost everybody" 
                 " you are the true embodiment of "
                 "     all good in this world.    "
                 "                                "
                 "    --- 8 Bits and a Byte ---   "
                 "                                "
  
                 "                                "
                 "     --- r/todayilearned ---    "
                 "                                "
                 "  You have an insatiable thirst "
                 "         for knowledge.         "
                 "  This means you are capable of "
                 " providing an endless stream of "
                 "   fun fact and true oddities.  " 
                 "                                "
                 "    --- 8 Bits and a Byte ---   "
  
                 "                                "
                 "         --- r/funny ---        "
                 "                                "
                 "  Whenever there is fun you're  "
                 "          always near.          "
                 "Your sense of humor is unmatched"
                 "and brings comic relief to many." 
                 "                                "
                 "    --- 8 Bits and a Byte ---   "
                 "                                "
  
                 "                                "
                 "        --- r/gaming ---        "
                 "                                "
                 "        A true adventurer,      "
                 "you have traveled many different" 
                 "  worlds and have lived through "
                 "        countless stories.      "
                 "                                "
                 "    --- 8 Bits and a Byte ---   "
                 "                                "
  
                 "                                "
                 "      --- r/worldnews ---       "
                 "                                "
                 "   Always in the know-how and   "
                 "           up-to-date,          "
                 "  your unique ability makes you "
                 "the cornerstone of this society."
                 "                                "
                 "    --- 8 Bits and a Byte ---   "
                 "                                "
  
                 "                                "
                 "          --- r/art ---         "
                 "                                "
                 " With a distinctive personality "
                 "   and the skill set to match,  "
                 "  you have the power to create  "
                 "       beauty and to speak      "
                 "         without talking.       "
                 "                                "
                 "    --- 8 Bits and a Byte ---   "
                 "                                "

Superduper secret part

You can do the quiz online as well, right here.

Code

CodeC/C++
#include "Adafruit_Thermal.h"
#include "SoftwareSerial.h"

const int TX_PIN = 6; 
const int RX_PIN = 5; 

const int buttonBigRedPin = 7;
const int switchOnePin = 8;
const int switchTwoPin = 12;
const int switchThreePin = 13;

int buttonBigRedState = 0;
int switchOneState = 0;  
int switchTwoState = 0;  
int switchThreeState = 0;

String oddlysatisfyingInfo = (
                  "                                "
                  "    --- r/oddlysatisfying ---   "
                  "                                "
                  "  Some people may call you odd, "
                  "   or even think you're fluky.  "
                  " Nonetheless, you bring your own"
                  "  unusual charm and joy to the  "
                  "         lives of many.         "
                  "                                "
                  "    --- 8 Bits and a Byte ---   "
                  "                                "
                  );
                  
String DIYInfo = (
                  "                                "
                  "          --- r/DIY ---         "
                  "                                "
                  "   Independent and resourceful. "
                  "  You are able to bring to life "
                  "  even the most ambitious ideas."

                  "                                "
                  "    --- 8 Bits and a Byte ---   "
                  "                                "
                  );
                  
String awwInfo = (
                  "                                "
                  "          --- r/aww ---         "
                  "                                "
                  "Irresistible to almost everybody" 
                  " you are the true embodiment of "
                  "     all good in this world.    "
                  "                                "
                  "    --- 8 Bits and a Byte ---   "
                  "                                "
                  );
                  
String todayilearnedInfo = (
                  "                                "
                  "     --- r/todayilearned ---    "
                  "                                "
                  "  You have an insatiable thirst "
                  "         for knowledge.         "
                  "  This means you are capable of "
                  " providing an endless stream of "
                  "   fun fact and true oddities.  " 
                  "                                "
                  "    --- 8 Bits and a Byte ---   "
                  );
                  
String funnyInfo = (
                  "                                "
                  "         --- r/funny ---        "
                  "                                "
                  "  Whenever there is fun you're  "
                  "          always near.          "
                  "Your sense of humor is unmatched"
                  "and brings comic relief to many." 
                  "                                "
                  "    --- 8 Bits and a Byte ---   "
                  "                                "
                  );
                  
String gamingInfo = (
                  "                                "
                  "        --- r/gaming ---        "
                  "                                "
                  "        A true adventurer,      "
                  "you have traveled many different" 
                  "  worlds and have lived through "
                  "        countless stories.      "
                  "                                "
                  "    --- 8 Bits and a Byte ---   "
                  "                                "
                  );

String worldnewsInfo = (
                  "                                "
                  "      --- r/worldnews ---       "
                  "                                "
                  "   Always in the know-how and   "
                  "           up-to-date,          "
                  "  your unique ability makes you "
                  "the cornerstone of this society."
                  "                                "
                  "    --- 8 Bits and a Byte ---   "
                  "                                "
                  
                  );

String artInfo = (
                  "                                "
                  "          --- r/art ---         "
                  "                                "
                  " With a distinctive personality "
                  "   and the skill set to match,  "
                  "  you have the power to create  "
                  "       beauty and to speak      "
                  "         without talking.       "
                  "                                "
                  "    --- 8 Bits and a Byte ---   "
                  "                                "
                  );

SoftwareSerial mySerial(RX_PIN, TX_PIN);
Adafruit_Thermal printer(&mySerial);


void setup() {

  mySerial.begin(19200);
  
  pinMode(7, OUTPUT); digitalWrite(7, LOW);

  printer.begin();
  printer.justify('C');  

  pinMode(buttonBigRedPin, INPUT);
  pinMode(switchOnePin, INPUT);
  pinMode(switchTwoPin, INPUT);
  pinMode(switchThreePin, INPUT);

  digitalWrite(buttonBigRedPin, HIGH);
  digitalWrite(switchOnePin, HIGH);
  digitalWrite(switchTwoPin, HIGH);
  digitalWrite(switchThreePin, HIGH);
  
}

void printSubreddit(String subreddit){
  
  printer.print(subreddit);
  
}

void printBorder(){
  
  String border = "********************************";
  printer.print(border);
  
}

void loop() {
  
  // read the state of the pushbutton value:
  buttonBigRedState = digitalRead(buttonBigRedPin);
  
  // check if the pushbutton is pressed. If it is, the buttonState is LOW:
  if (buttonBigRedState == LOW) {
    
    switchOneState = digitalRead(switchOnePin);
    switchTwoState = digitalRead(switchTwoPin);
    switchThreeState = digitalRead(switchThreePin);

    printBorder();
    
    // Print the correct answer based on all three switch states
    if(switchOneState && switchTwoState && switchThreeState){
      
      printSubreddit(oddlysatisfyingInfo);
      
    }else if(switchOneState && switchTwoState && !switchThreeState){

      printSubreddit(DIYInfo);
      
    }
    else if(switchOneState && !switchTwoState && switchThreeState){

      printSubreddit(awwInfo);
      
    }
    else if(switchOneState && !switchTwoState && !switchThreeState){

      printSubreddit(todayilearnedInfo);
      
    }
    else if(!switchOneState && !switchTwoState && !switchThreeState){

      printSubreddit(funnyInfo);
      
    }
    else if(!switchOneState && !switchTwoState && switchThreeState){

      printSubreddit(gamingInfo);
      
    }
    else if(!switchOneState && switchTwoState && !switchThreeState){
      
      printSubreddit(worldnewsInfo);
      
    }    
    else if(!switchOneState && switchTwoState && switchThreeState){
      printSubreddit(artInfo);
      
    }

    printBorder();
    printer.println("\n\n\n");
    
  } 
  
  delay(500);

}

Custom parts and enclosures

Base Plate
Corner
Wall with Hole
Choice Block
Name Plate

Schematics

Schematic
Uploads2ftmp2fdbf3b26c 59d9 4f7e 936b 6f8864320a6f2funtitledsketch bb nd2pjsnnpk

Comments

Similar projects you might like

Christmas Crib Controlling via Internet

Project showcase by tomek10861

  • 1,437 views
  • 0 comments
  • 5 respects

Otto DIY+ Arduino Bluetooth robot easy to 3D Print

Project tutorial by Team Otto builders

  • 67,122 views
  • 131 comments
  • 208 respects

"Mini-Vintage" Internet Radio

Project tutorial by Guilherme Schallenbach

  • 33,312 views
  • 24 comments
  • 149 respects

IoT for Coins

Project tutorial by Erik Moran

  • 9,821 views
  • 1 comment
  • 49 respects

Portable Range Detection Device

Project tutorial by Viktor S

  • 8,224 views
  • 5 comments
  • 20 respects

WW2 Tank Laser Tag Sherman & Panther

Project tutorial by Arduino “having11” Guy

  • 17,704 views
  • 1 comment
  • 57 respects
Add projectSign up / Login