Smart Study System: an IoT-Based Study Monitoring and Focus Tracking

by fara7alhabib in Circuits > Arduino

20 Views, 0 Favorites, 0 Comments

Smart Study System: an IoT-Based Study Monitoring and Focus Tracking

WhatsApp Image 2026-06-04 at 7.01.00 PM.jpeg

This project presents a Smart Study Environment Monitoring System developed using an Arduino Nano 33 IoT, an HC-SR04 ultrasonic sensor, an LED, a buzzer, MQTT communication, and a Node-RED dashboard.

The purpose of the system is to help students maintain focus during study sessions by automatically monitoring their presence at the study desk. The ultrasonic sensor detects whether the student is present or away. When the student leaves the study area for an extended period, the system activates visual and audio alerts through an LED and buzzer. Real-time data is transmitted using MQTT and displayed on a Node-RED dashboard, which shows focus status, study mode, alert status, study time, and a summary of time spent on different units.

This project demonstrates how IoT and embedded systems technologies can be used to improve study habits, increase productivity, and provide real-time feedback to users.

Supplies

HARDWEAR.png

Tools and Materials

Hardware Components

  1. Arduino Nano 33 IoT
  2. HC-SR04 Ultrasonic Distance Sensor
  3. LED
  4. Buzzer
  5. Breadboard
  6. Jumper Wires
  7. USB Cable

Software Tools

  1. Arduino IDE
  2. Node-RED
  3. MQTT Broker (broker.emqx.io)
  4. Google Chrome Web Browser

Arduino Libraries

  1. WiFiNINA Library
  2. ArduinoMqttClient Library

Development Tools

  1. GitHub (source code repository)
  2. Instructables (project documentation)
  3. Windows 11 Operating System

Communication Protocol

  1. MQTT (Message Queuing Telemetry Transport)

Dashboard Platform

  1. Node-RED Dashboard for real-time monitoring and visualization

Prepare the Hardware

First, prepare the required hardware components: Arduino Nano 33 IoT, HC-SR04 ultrasonic sensor, LED, buzzer, breadboard, jumper wires, and USB cable.

The ultrasonic sensor is used to measure the distance between the student and the study desk. The LED and buzzer are used as alert outputs when the student moves away from the desk.

Connect the Ultrasonic Sensor

Connect the HC-SR04 ultrasonic sensor to the Arduino Nano 33 IoT.

The wiring used in this project was:

  1. VCC → 5V
  2. GND → GND
  3. TRIG → D4
  4. ECHO → D5

The TRIG pin sends the ultrasonic signal, and the ECHO pin receives the reflected signal. The Arduino uses this reading to calculate the distance between the sensor and the user.

Connect the LED and Buzzer

Next, connect the LED and buzzer to the Arduino.

The wiring used was:

  1. LED signal pin → D2
  2. Buzzer signal pin → D3
  3. LED ground → GND
  4. Buzzer ground → GND

The LED and buzzer are activated when the system detects that the user has moved away from the study desk for more than the configured time threshold.




Install Arduino IDE and Required Libraries

Install Arduino IDE on the computer. Then install the required libraries:

  1. WiFiNINA
  2. ArduinoMqttClient

These libraries allow the Arduino Nano 33 IoT to connect to WiFi and communicate with the MQTT broker.

Upload the Arduino Code

Open Arduino IDE and paste the Smart Study System code.

Update the WiFi details in the code:

char ssid[] = "YourWiFiName";
char pass[] = "YourWiFiPassword";

The MQTT broker used in this project was:

broker.emqx.io

After updating the WiFi details, select the correct board:

Arduino Nano 33 IoT

Then select the correct COM port and upload the code.

Test the Sensor Readings

After uploading the code, open the Serial Monitor in Arduino IDE.

Set the baud rate to:

9600

The Serial Monitor should display the distance reading, motion status, alert status, and study mode.

Example output:

Distance: 25 cm
Motion: Present
Alert: No Alarm
Study Mode: ON

If the user moves away from the sensor, the output changes to:

Motion: No Motion
Alert: Alarm - User Away
Study Mode: OFF

Install and Run Node-RED

Install Node-RED on the computer.

Open Command Prompt and run:

node-red

When Node-RED starts, open the editor in a web browser:

http://localhost:1880

The dashboard can be opened using:

http://localhost:1880/ui


Create MQTT Nodes in Node-RED

In Node-RED, create MQTT input nodes to receive data from the Arduino.

The MQTT topics used were:

study/motion
study/alert
study/mode/status
study/distance

These topics receive the focus status, alert status, study mode, and distance readings from the Arduino.

Create the Dashboard

Screenshot 2026-06-04 191428.png

Create a Node-RED dashboard with the following sections:

Study Controls

  1. Unit Name input
  2. Study Time input
  3. Start Study button
  4. Stop Study button

Live Status

  1. Current Unit
  2. Focus Status
  3. Alert Status
  4. Study Mode
  5. Planned Study Time

Analytics

  1. Focus History graph
  2. Time Invested

Study Summary

  1. Summary of all units studied
  2. Time spent on each unit

The dashboard allows the user to monitor study progress in real time.

Test the System Operation

WhatsApp Image 2026-06-04 at 6.58.37 PM.jpeg
WhatsApp Image 2026-06-04 at 6.58.38 PM.jpeg

To test the system:

  1. Open the Node-RED dashboard.
  2. Enter the unit name.
  3. Set the planned study time.
  4. Sit near the ultrasonic sensor.
  5. Check that the dashboard shows:
  6. Focus Status: Focused
  7. Alert Status: No Alarm
  8. Study Mode: ON
  9. Move away from the desk.
  10. Wait for the away threshold time.
  11. Check that the LED and buzzer turn on.
  12. Check that the dashboard shows:
  13. Focus Status: Not Focused
  14. Alert Status: Alarm - User Away
  15. Study Mode: OFF
  16. Return to the desk and check that the LED and buzzer turn off.


View the Study Summary

The Study Summary page displays all units that have been studied and the amount of time spent on each unit.

Example:

SIT210: 1 min 2 sec
SIT330: 3 min 43 sec

This allows the student to track study time across multiple subjects.

Fault Tolerance Features

The system includes fault tolerance features to improve reliability.

If the ultrasonic sensor gives an invalid reading, the system does not immediately trigger the alarm. This helps reduce false alerts.

If WiFi or MQTT communication fails, the Arduino continues running the local monitoring logic and attempts to reconnect. Once the connection is restored, dashboard updates resume.

A delay is also used before activating the alarm, so the system does not trigger an alert if the user only moves briefly.

Access the Source Code

The complete source code for this project, including the Arduino program and Node-RED implementation, is available on GitHub.

GitHub https://github.com/fara7alhabib/SIT210_T12026/tree/9072813c9433c94e05b6942d158d3a154631b81c/Smart-Study-System

The repository contains:

  1. Arduino Nano 33 IoT source code
  2. MQTT communication implementation
  3. Node-RED dashboard flow
  4. Project documentation
  5. System diagrams

Users can clone or download the repository and follow the steps in this guide to recreate the Smart Study Environment Monitoring System.

Final Result

The completed Smart Study Environment Monitoring System successfully monitors user presence using an ultrasonic sensor, tracks study sessions, records study time for different units, and provides real-time feedback through a Node-RED dashboard.

The system automatically activates an LED and buzzer alert when the user leaves the study area for an extended period and returns to normal operation when the user comes back. The dashboard provides live monitoring, focus history, study mode information, and study summaries, helping students improve productivity and maintain focus during study sessions.

This project was completed as part of SIT210/SIT730 – Embedded Systems Development, School of Information Technology, Deakin University.