BrainPlay - Howest MCT
by ChadiaWillems in Circuits > Raspberry Pi
23 Views, 0 Favorites, 0 Comments
BrainPlay - Howest MCT


Brainplay is a smart, interactive play cube designed to monitor cognitive and motor function in people with dementia, even when they are still living independently at home.
The cube features four interactive games that test reaction time and fine motor skills. A connected web dashboard collects data from these games and displays it in graphs, giving caregivers or relatives a clearer picture of the user’s condition and progress over time.
Note: A better photo of the final prototype is coming soon.
Supplies
Supplies:
- Hardware:
- Raspberry Pi (I use the 4)
- RPi Micro SD card
- Power supply for the Raspberry Pi
- External power supply (3.3 V and 5 V)
- Power supply for the external power supply
- LAN cable
- 6 LEDs (color does not matter)
- 1 push button
- 1 buzzer
- 1 RFID reader (RC522)
- 1 servo motor
- 1 rotary encoder
- 1 joystick
- 1 MPU6050
- 1 LCD display
- 1 potentiometer
- 1 SPI bus (MCP3008)
- 2 I²C buses (PCF8547AP)
- Jumper wires
- Resistors
- Software:
- Python
- FastAPI
- Uvicorn
- Javascript
- HTML & CSS
- Tools:
- soldering iron
- wood glue
- laser cutter (MDF 3mm)
- multimeter (for checking your voltage usage ect...)
- super glue
Building the Electronics Circuit



This step involves connecting all the hardware components to the Raspberry Pi and configuring the power setup.
Key Instructions
- The LCD screen is connected via a PCF8574 I²C expander to save GPIO pins.
- 5 LEDs are connected via another PCF8574, with the A0 pin connected to 3.3 V instead of GND.
- The LDR sensor and joystick axes are analog and connected to an MCP3008 on the SPI bus.
- All other digital components (button, buzzer, encoder, etc.) are connected to GPIO pins.
Important:
- The RFID reader must be connected to CE0. It is hardcoded to work on that chip-select pin.
- The MCP3008 should be connected to CE1.
- To prevent overloading the Raspberry Pi, power your components using a separate 3.3 V and 5 V external supply.
Preparing the Raspberry Pi
We’ll now install the operating system and set up network access.
What You’ll Need
- Raspberry Pi
- MicroSD card
- Raspberry Pi Imager
Instructions
- Open Raspberry Pi Imager on your PC.
- Insert the microSD card and select:
- Your Pi model
- OS: Raspberry Pi OS Lite (64-bit) recommended
- SD card as the storage device
- In the “advanced options,” configure:
- SSH (enable)
- Username & password
- Wi-Fi (optional)
- Click Write and wait for it to complete.
- Insert the SD card into the Pi and connect it to your network using a LAN cable.
- Connect to it via SSH using the IP address (findable via router or tool like ping or arp-scan).
Troubleshooting tip: If SSH fails, check firewall settings, IP config, or try connecting via HDMI + keyboard.
Creating Database

This step involves setting up a database for storing user data, sensor logs, and game statistics.
What It Does
- Saves game sessions
- Tracks user performance over time
- Avoids hardcoded front-end content
Files & Tools
- Use the brainplay.sql file to import the full schema and tables.
Available on GitHub:
- Data > brainplay.sql
The ERD (Entity Relationship Diagram) for the database is also provided.
Coding the System



Your code is split into a frontend and a backend, each with its own responsibilities.
Frontend (HTML, CSS, JavaScript)
Before coding, I recommend prototyping your interface in Figma. This will help plan layout and flow—especially useful since the UI is optimized for mobile use.
Above you’ll see my Figma design as an example.
Backend (Python + FastAPI)
The backend controls all sensor logic and communication with GPIO pins.
- I use FastAPI to serve the backend.
- Custom Python classes manage each sensor.
- For RFID, I use the SimpleMFRC522 library.
If this library doesn’t work, search online for alternative forks or libraries.
📎 GitHub paths:
- Backend > app.py
- Front > script > app.js
Building the Enclosure






For the casing, I laser-cut a cube out of 3 mm MDF.
Assembly Instructions
- Use wood glue to assemble the cube.
- For the servo motor door, I:
- Glued a thin screw into the motor’s top with super glue.
- Attached the screw to a small wooden square on the door.
All interior parts are fixed using a combination of wood glue, super glue, or hot glue depending on the component.
Technical drawing available at:
- Docs > behuizing.ai
Conclusion & GitHub
You can find the full project, including code, diagrams, and designs, here:
🔗 GitHub Repository → https://github.com/howest-mct/2024-2025-projectone-mct-ChadiaWillems
Feel free to recreate or adapt this project!