ESP8266 Oled Mini Quiz

A small quiz game that reads questions from web and shows them on a small oled dispay, using a 3.6V battery, an ESP8266-01 and two buttons

Similar projects worth following
This is a small quiz game based on ESP8266-01, it uses an oled display to show the questions and two buttons to read the answer from the player. The questions must be with binary answers (for example true or false). The oled display is connected to RX and TX pin of ESP, and answers are read from GPIO0 and GPIO2.

A complete project that let you fully use your ESP8266-01 modules: 

* use both GPIO0 and GPIO2

* use TX and RX to drive I2C Oled display

* use a wifimanager to handle AP configuration panel

* use a server side script to get questions

* smart assemblied

* show images and animation

How it works

The Mini Quiz checks for wi-fi connection and if there isn't a wi-fi connection it uses a small set of questions stored in its memory. 

If during splash screen both buttons are pressed the ESP8266 becomes an Access Point and the admin can configure the wi-fi connection credentias and the url where the game will retrieve questions and answer to play.

The game start displaying a question and playing for 60 seconds. When you answer a question right you gain 1 point, when you choose thw wrong answer you lose 1 point.

At the end of 60 seconds the game ends and you score is shown.

As you can imagine, the Mini Quiz has a part online which is a php script that pass a random question and answer to the ESP.


main file, edited with Arduino IDE. Place this file, the .h files and the .cpp file in the same subfolder "miniquiz" inside the Arduino projects folder.

ino - 11.45 kB - 11/03/2017 at 11:15



wifi manager that talks to oled for debug (no serial connection to debug on Arduino Serial monitor!) and handles wifi connection and AP configuration panel

cpp - 15.66 kB - 11/03/2017 at 11:15



declarations for mywifimanager.cpp

h - 6.78 kB - 11/03/2017 at 11:15



file included that contains data stored in flash memory of ESP, it inclundes a small set of questions (when no wi fi) and images encoded for oled display

h - 6.75 kB - 11/03/2017 at 11:15



file on the server that returns a random question and answers (questions are in italian)

php - 3.01 kB - 11/03/2017 at 12:41


View all 7 files

  • 1 × esp8266-01
  • 1 × I2C oled display SD1306 128x64
  • 2 × 5.1k resistor
  • 2 × button
  • 1 × 3.6V LIR2032 battery

View all 8 components

  • 1
    About these instructions...

    THis is not a step by step instructions list, but it's a group of suggestions and problems I've found and solved to make this project work.

  • 2
    Before working with ESP8266-01

    Before making this Mini Quiz, you need to build some plug-and-play module with a socket where you insert the ESP board to reprogram it. This module will be useful also for some other project where you need to upload a new firmware to ESP8266-01.

  • 3
    PULL up resistors

    You still don't know what is a pull up resistor? The two GPIO need pull up resistors, because they need to be HIGH to start the ESP in normal mode. Since there are pull up resistors normally I read 1 when buttons are not pressed and 0 when they are pressed.

View all 5 instructions

Enjoy this project?



0miker0 wrote 12/20/2017 at 15:26 point

I've tried powering and ESP8266 with the largest coin cell I could find but it drew more power than what the cell could provide. The cell voltage dropped from 3v to almost nothing. I'm not sure how you succeeded.

  Are you sure? yes | no

davedarko wrote 12/20/2017 at 15:58 point

Do you have a LIR2032 or a CR2032? I think that's important, since one is rechargeable and gives more voltage / current.

  Are you sure? yes | no

davedarko wrote 11/03/2017 at 13:00 point

I'm surprised that the ESP01 works with a button cell, I always thought that a coin cell couldn't deliver a high enough current with wifi enabled.

  Are you sure? yes | no

Giulio Pons wrote 11/03/2017 at 13:56 point

why not? it's a LIR2032, 3.6volts

  Are you sure? yes | no

davedarko wrote 11/03/2017 at 14:28 point

They normally have a capacity of around 40mAh where the ESP8266 can draw +200mAh when wifi is in use. That's 5 times the capacity, so 5C - it's not healthy for batteries if they are not rated for that explicitly, IIRC. I'm just surprised that the battery was able to deliver that. I might be off with the numbers though.

  Are you sure? yes | no

davedarko wrote 11/03/2017 at 10:51 point

marvellous :) any plans on sharing code and schematics? 

  Are you sure? yes | no

Giulio Pons wrote 11/03/2017 at 11:33 point

yes. I'm uploading them. I have to make some cleaning :)

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates