The Stroop effect is the delay in reaction time that occurs when people are asked to name the ink color of a word that spells out a different color, for example, the word "BLUE" written in red ink. This phenomenon, named after psychologist John Ridley Stroop, demonstrates interference between automatic processes, like reading, and controlled tasks, like color naming. It's a widely used tool in psychology to measure attentional control, cognitive flexibility, and the ability to inhibit irrelevant information.
Based on this, I decided to create a Stroop Effect game using an OLED screen and 4 colored buttons connected to an Arduino. The game will help players test their reaction time and attentional control by pressing the button that matches the color of the word, not the word itself.
I used Fusion 360 for designing the Stroop Box because it allows me to create precise 3D models and technical drawings. I used it to design the outer case, the button layout, and the internal compartments for the electronics. Fusion 360 helped me visualize the final product, ensure that all components fit correctly, and prepare the files for laser cutting and 3D printing.
For the front-side sketch, the first thing I did was download my screen model from GrabCAD ( I don't recommend it cuz the dimensions were not real ) and created a project on it to adjust its dimensions and screw positions. Then, I drew my rectangle with a length of 140 mm and a width of 100 mm.
After that, I created another sketch on top of the screen to place my buttons. I kept a distance of 15 mm between the buttons and positioned them 25 mm away from the screen.
3MM EXTRUDE
For the back part, I used the same dimensions: length 140 mm and width 100 mm. I created tabs with a length of 10 mm and a height of 3 mm, keeping a distance of 15 mm between each tab. The distance from the top and bottom was 26.667 mm because I only drew two tabs there.
3MM EXTRUDE
For the right side, I kept the height at 140 mm and the width at 60 mm. I created 4 T-slot holes on the sides, with one at the top and one at the bottom, to ensure the box fits securely.
3MM EXTRUDE
For the other side, I used the same dimensions, but I created a project for the Arduino adapter and cable to mark the positions of the openings where they will be installed.
3MM EXTRUDE
For the top side, I drew a sketch with a length of 60 mm and a width of 100 mm so it would fit the box properly. I also created a project for the Arduino screw holes from the bottom, because I was unsure whether to place the Arduino on the top or the bottom, so I did the same for both sides.
3MM EXTRUDE
After everything was prepared and extruded, with the Arduino and screen fixed in their places, I started creating joints between the right side and the bottom.
Then, I completed the joints for the back side, left side, and the front with the top, and so on.
Finally, I chose my apertures from the Appearance menu, selecting the wood type called Oak.
After saving the files as DXF, I used Laser Work to adjust the parameters for the edges so they would be cut smoothly with the laser.
3MM PLYWOOD
ELMALKY LASER CUTTING MACHINE
I arranged the entire file in order and marked that everything should be cut, except for the word “Stroop Game”, which I set to engrave.
Then, I adjusted the cutting parameters: speed 20 and power 50 for cutting properly, and for engraving, I set power 20 and speed 330.
After exporting the file in . ai format from LaserWork, we save it to a flash drive to transfer the data to the laptop connected to the machine, where we fine-tune the parameters further.
After downloading the file from the computer, we go to the machine, load the file, and adjust our origin and frame.
we need to secure the wood so it doesn’t move during the cutting process.
Then we start adjusting the focus, since it wasn’t set properly.
VOILA
The screen I used was a TFT ST7789V, 1.14 inch, color display with 8 pins. I chose this screen because it is compact, easy to connect with Arduino, and supports fast updates, which is perfect for a color-based reaction game like the Stroop Effect.
For the buttons, I used 4 buttons with different colors: red, yellow, orange, and green. I chose them because they are easy to connect to the Arduino and work well for the Stroop Effect game, allowing players to quickly react by pressing the button that matches the color of the word.
In Tinkercad, I connected 5 push buttons to pins 2, 3, 4, 5, and 6. Since I couldn't find my exact screen module, I used a regular I2C LCD for the simulation instead.
For the power source, I will use a 9V adapter. I chose this because it provides stable and sufficient voltage for the Arduino and all connected components, ensuring that the screen, buttons, and other electronics work reliably during the game.
the player would speak the answer and the code was handling voice input (with an extra library for speech recognition).
Instead of voice input, I replaced it with buttons. So wherever the original code was checking for a voice command, I used:
pinMode(..., INPUT_PULLUP) → to set the buttons as inputs.
digitalRead(...) → to read which button was pressed.
The rest of the flow stayed the same:
Start screen → shows "PRESS TO START".
Game loop → displays a color word in a random ink color.
Player input → now handled with physical buttons instead of voice.
Answer check → shows "Correct!" or "Wrong".
End screen → displays "GAME OVER" and the score out of 100.
So basically, I adapted the same logic but switched the input method from voice recognition to button presses, which made it simpler and more suitable for my Arduino project.
Adafruit_GFX → general graphics functions for drawing text, shapes, etc.
Adafruit_ST7789 → driver library for the ST7789 TFT display (135x240).
SPI → handles SPI communication protocol between Arduino and the display.
I defined the TFT pins:
CS (10) → Chip Select pin for the display.
RST (9) → Reset pin to restart the display.
DC (8) → Data/Command pin to tell the display if I’m sending data or commands.
I defined button pins:
Green → 2
Red → 3
Yellow → 4
Orange → 5
Start → 6
I created the display object:
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);
This object lets me use all the functions from the ST7789 library, like tft.init(), tft.setRotation(), and tft.print().
So far:
I imported the libraries.
I set up the pins for the TFT and the buttons.
I created the display object.
Next step will be to write the setup() function to initialize the display and buttons, then add the game logic inside loop().
I created arrays:
colors[] → text labels ("RED", "GREEN", "YELLOW", "ORANGE").
colorValues[] → actual TFT color values (using constants from Adafruit_ST7789).
buttons[] → an array of button pins to make checking them easier.
In setup() I did:
Used Arduino core functions:
pinMode(..., INPUT_PULLUP) → configured all buttons as inputs with pull-up resistors.
randomSeed(analogRead(A0)) → initialized the random number generator.
Used Adafruit_ST7789 library functions:
tft.init(135, 240) → initialized the display with 135x240 resolution.
tft.setRotation(3) → set display orientation.
tft.fillScreen(ST77XX_BLACK) → cleared the screen with black color.
tft.setTextWrap(false) → disabled text wrapping.
Finally called showStartScreen() → (custom function to display the start message).
Game score variable:
int correctAnswers = 0;
Keeps track of how many correct answers the player gets.
Game rounds:
for (int i = 0; i < 10; i++) { ... }
The game runs for 10 rounds.
Random word & color:
int wordIndex = random(4);
int inkColorIndex = random(4);
wordIndex → which word to display ("RED", "GREEN", etc.).
inkColorIndex → what color the word will be drawn in.
(This creates the Stroop effect: text and color may not match).
Display the word:
tft.fillScreen(ST77XX_BLACK);
showCenteredText(colors[wordIndex], colorValues[inkColorIndex], 3);
Clears the screen and shows the word in the chosen ink color, using Adafruit_GFX functions through showCenteredText.
Wait for player input:
int userAnswer = -1;
while (userAnswer == -1) {
for (int j = 0; j < 4; j++) {
if (digitalRead(buttons[j]) == LOW) {
userAnswer = j;
}
}
}
Loops until the player presses one of the 4 color buttons.
digitalRead() comes from the Arduino core library.
Check correctness:
if (userAnswer == inkColorIndex) {
showCenteredText("Correct!", ST77XX_GREEN, 2);
correctAnswers++;
} else {
showCenteredText("Wrong", ST77XX_RED, 2);
}
delay(1000);
If the chosen button matches the ink color → show "Correct!" in green and increase score.
Else → show "Wrong" in red.
Wait 1 second before moving to the next round.
👉 Libraries used here:
Arduino core: random(), digitalRead(), delay().
Adafruit_ST7789 + Adafruit_GFX: fillScreen(), text drawing through showCenteredText().
tft.fillScreen(ST77XX_BLACK);
showCenteredText("GAME OVER", ST77XX_WHITE, 2);
delay(1500);
Clears the screen.
Displays "GAME OVER" in the center.
Waits 1.5 seconds.
char scoreBuffer[40];
sprintf(scoreBuffer, "Score: %d / 100", correctAnswers * 10);
showCenteredText(scoreBuffer, ST77XX_YELLOW, 2);
delay(3000);
Creates a string (scoreBuffer) that shows the player’s score out of 100.
Uses sprintf (from the C standard library) to format text.
Displays the score in yellow for 3 seconds.
showStartScreen();
After showing the score, the game returns to the start screen so the player can restart.
tft.fillScreen(ST77XX_BLACK);
showCenteredText("PRESS TO START", ST77XX_WHITE, 2);
Clears the screen and shows "PRESS TO START" in the center.
while (digitalRead(BTN_START) == HIGH) {
delay(10);
}
Waits until the Start button is pressed (button pin goes LOW).
tft.fillScreen(ST77XX_BLACK);
showCenteredText("Stroop Test", ST77XX_WHITE, 3);
delay(1500);
After pressing start: clears the screen.
Shows "Stroop Test" title for 1.5 seconds before the game begins.
Libraries used in this part:
Arduino core: digitalRead(), delay().
Adafruit_ST7789 + Adafruit_GFX: fillScreen(), text drawing via showCenteredText().
C stdlib: sprintf() for formatting score text.
void showCenteredText(const char* text, uint16_t color, uint8_t size) {
Takes three parameters:
text → the string to display.
color → text color (from ST77XX color constants).
size → text size multiplier.
tft.setTextSize(size);
tft.setTextColor(color, ST77XX_BLACK);
Sets text size.
Sets text color with black background.
int16_t x1, y1;
uint16_t w, h;
tft.getTextBounds((char*)text, 0, 0, &x1, &y1, &w, &h);
Uses Adafruit_GFX function getTextBounds() to calculate:
w and h → width and height of the text in pixels.
x1, y1 → coordinates of the bounding box (not really needed here).
int16_t x = (tft.width() - w) / 2;
int16_t y = (tft.height() - h) / 2;
Calculates the position so the text is centered:
Horizontal center = screen width − text width / 2.
Vertical center = screen height − text height / 2.
tft.setCursor(x, y);
tft.print(text);
Moves the cursor to the calculated position.
Prints the text in the center.
ST7789 Display connections (to Arduino UNO):
VCC → 5V
GND → GND
SCL (Clock) → Pin 13
SDA (MOSI) → Pin 11
RES (Reset) → Pin 9
DC (Data/Command) → Pin 8
CS (Chip Select) → Pin 10
Push Buttons connections:
Button 1 → Pin 2
Button 2 → Pin 3
Button 3 → Pin 4
Button 4 → Pin 5
Button 5 → Pin 6
I connected the Arduino side( bottom) with the right side which shows' the adapter whole
then I added the back side which contains the breadboard .
After that I put all my buttons and connected the OLED with the Arduino and breadboard .
Everything was neatly fitted inside the box, the wiring was perfect, and everything worked as expected — this is the final product.
This project is a Stroop Test game built with an Arduino, a 135x240 ST7789 TFT display, and five buttons (four for colors and one for start).
Used Adafruit_GFX and Adafruit_ST7789 libraries to control the display.
Game flow:
Start screen → "PRESS TO START".
10 rounds → display a random color word in a random ink color.
Player selects the ink color using buttons.
Correct/Wrong feedback shown after each round.
End screen → "GAME OVER" + player score out of 100.
All components were wired and placed neatly inside a box, resulting in a working final product.
The screen’s mounting holes were 2 mm, which made it difficult to secure. My instructor suggested making a bridge with standard 3 mm holes and placing it behind the screen to hold it firmly. So, I designed the model in Fusion with a thickness of 2 mm and a length of 79 mm.
THIS IS HOW IT LOOKS , THE SCREEN IS SECURED AND FIXED IN IT PLACE
If I had more time, I would have 3D-printed the word “Stroop Game” as letters, and I would have made the game with multiple levels — each one harder than the previous — with a set timer for added challenge.