Introduction: Mind Reader With Arduino
Hello everybody !!
This is my Mind Reader for Arduino.
The Mind Reader will ask you a few questions and will tell you which letter of alphabet (ABC) or which card in the deck that you thought.
It is a very simple project for assembly and with few wire connections but the results are surprising!
In fact I have developed this algorithm for different plataforms along last years and now it is time for the Arduino.
Ok, let's go fun !
April 2nd., 2016
Step 1: List of Material
- (1x) Arduino board: UNO R3 / Nano V3.0 or another equivalent board.
- (1x) Display OLED 0.96" I2C: with SSD1306 controller or equivalent.
- (2x) Push buttons (2x).
- (1x) Small Breadboard.
- Wires for connections.
- Power supply: I use a rechargeable battery pack as explained on my another Instructable shown here.
- (1x) Expansion Board for Arduino Nano
Step 2: Diagram & Program
The diagram is very simple with few connections among the components.
Just take care with +5V and GND pins and also pay attention with tactile push buttons to avoid any mismatch connection.
Personally I have used the optional expansion board with Arduino Nano (see the pictures) because it is a more compact assembly.
But of course you have the option to use an Arduino Uno and connect the wires directly on it.
- Arduino Program
The Arduino program is attached on this step and you will need of the following libraries to work properly:
1. Wire (to support I2C and already included on main libraries of Arduino)
2. TimerOne (to read the push buttons on microseconds intervals)
3. U8glib (to control the I2C display)
On the site of library U8glib to control the display you can find a tutorial explaining how to work with it and also you can find the description of all available fonts you can apply in your projects.
But here there is a warning about the size of the fonts.
Each font will be compiled together your Arduino program and of course these fonts will take a considerable part of available free memory.
This project applies 3 different fonts and after compiling it, 96% of total 30 KB of Arduino memory were used.
Each font is 5 KB of size on average and you also need consider the necessary space for your program!
So take care with the use of these fonts.
Another important information is about what controller you have to use for the I2C display.
On the library there are many options but you must apply the right version for your device.
For the display I have to use the following statement on the program:
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_DEV_0 | U8G_I2C_OPT_NO_ACK | U8G_I2C_OPT_FAST); // Fast I2C / TWI
All the options are as comments (//) and you need to remove them to set the properly version according with your display controller (SSD1306 in my case).
Step 3: Playing
To play with Mind Reader is very easy as you can see on the pictures and on the video:
At first screen is displayed the title and two options you must select with the push buttons:
1 > ABC - Select the Left/Red button (connected on digital port 8 of Arduino) to run the Mind Reader (alphabet version).
2 > 52-Card Deck - Select the Right/Green button (connected on digital port 7 of Arduino) to run the Mind Reader (cards version).
After you set the option you will see on next page the Question #1 that you need to answer Yes (Green button) or No (Red button) if you see the letter (or the card) you have imagined.
But don't be hurry.
If you have not sure if your letter or the card was displayed, all of them will be replayed again until you have pressed the properly button.
After you press the button of your answer, the program will move for the next page of question.
For the ABC you have 5 questions and for the Cards you have 6 questions to answer properly.
At the end, the program will show you the correct letter or card you had chosen!!
And finally, any of the buttons pressed will restart the game.
You can realize that the answers will be different each time you play.
Even you repeat the same letter or card!!
If you don't believe, I recommend you write on a paper your answers!
But how can be this possible ? How can Mind Reader work ?
Sure I know, but this is my secret !! ;-)
If you have some clue , share with us, please!!
LAGSILVA - 02.Apr.2016
We have a be nice policy.
Please be positive and constructive.