No Distra: Smart Study Enhancement System
by ZeinedinAbdela in Circuits > Raspberry Pi
3 Views, 0 Favorites, 0 Comments
No Distra: Smart Study Enhancement System

What is NoDISTRA?
NoDISTRA is a smart, sensor-powered productivity assistant. It's a physical lockbox that helps students or focus- seekers stay distraction-free by:
- Locking away your phone during focus sessions.
- Showing live sensor data (light, weight, temperature, distance, etc.) on OLED screens.
- Tracking real-time data via a FastAPI dashboard with WebSockets.
- Unlocking only after meeting study conditions
Features
- Automatic locking/unlocking via servo and time/session management.
- Live OLED displays for user feedback.
- Live Web Dashboard built with FastAPI + SocketIO + HTML/CSS/JS.
- Sensors:
- Ultrasonic sensor (distance detection).
- Load cell (phone weight).
- LDR (light detection).
- Reed switch (door status).
- Temperature sensor.
- Rotary encoder (manual control).
Supplies



















Item Quantity
Raspberry Pi 5 1
OLED Display (SSD1309, SPI) 1
Servo Motor (SG90 or MG90S) 1
Reed Switches 2
Ultrasonic Sensor (HC-SR04) 1
LDR + MCP3008 ADC 1
Load Cell + HX711 Module 1
Rotary Encoder 1
Jumper Wires Lots
Breadboard / PCB 1
5V Power Supply 1
Breakoutboard 1
Dallas Temprature Sensor 1
Wireless charger 5W 1
Double Sided Tape 1
Assembly Base








First print the case (you can find the case on the github repo => 3D file)
Use hot glue or M2 screws for the reed sensors and secure it on the base.
Ensure reed switches trigger at correct position.
Assembly Drawer















Mount servo securely on the drawer.
Drill a hole on the drawer to secure the magnet for the reed sensors.
On the bottom side of the phone holder secure the coil of the wireless charger on its place and the control board to the side with a double sided tape. Add the load cell and secure the phone holder with screws.
Assembly Middle Part


Slide the middle part on top of the bottom part.
Secure the Raspberry pi on its place.
Secure ultrasonic, ldr, rotary encoder and the tempreature sensor with double sided tape on the base.
Secure the base with the middle part with a screw.
Wiring Diagram

Assembly Top Part











Secure the Oled screen with double sided tape and connect it to the pi.
Secure the top part with the middle part with screws.
Software Setup
1. Clone the Repo
2. Create a Virtual Environment
3. Install Dependencies
4. Run the Backend
How It Works
Locking Mechanism
- Servo closes the lid.
- Reed switches detect if the lid is fully closed/open.
- Safety timeout ensures the servo doesn’t overdrive.
Sensors
- LDR measures ambient light.
- Ultrasonic sensor detects objects near the box.
- HX711 + Load Cell measures weight to check if the phone is inside.
- Temperature sensor logs the surrounding environment.
OLED Display
- Rotary encoder navigates through menus.
- Emergency unlock feature with timeout.
Menu Navigation
Action Description
Rotate CW Move down
Rotate CCW Move up
Click Select item
Show IP Displays device IP
Emergency Unlock Opens box temporarily