# Developing a Secured Software Frontend, Backend and Analysis Dashboard for Sensor’s Data Visualization

> The project was created to visualize the real-time data coming from sensors, consisting of three phases: the frontend, the backend, and the microcontroller.

## Project Overview
The project aimed to create software that synchronizes with hardware to build an IoT system, providing a user-friendly interface for visualizing real-time sensor data. The system architecture consists of three main components:
*   **Frontend:** Provides an interface for users to visualize and retrieve data.
*   **Backend:** Acts as the central logic hub, handling APIs, data manipulation, user sessions, access privileges (admin/student), and email notifications.
*   **Microcontrollers (e.g., Arduino Uno):** Responsible for retrieving data from sensors and passing it to the backend.

**Technology Stack:** MERN (MongoDB, Express, React, Node.js).

**Keywords:** Secured Software; MERN Stack; Mongo Database; Sensor’s data visualization; Arduino Uno; Software Dashboard.

## Frontend and Dashboard
The frontend, built with React, allows users to authenticate and interact with the system.

### 2.1 Dashboard
The dashboard displays essential data including temperature, humidity, intrusion status, recent measurements, and system notifications. It features:
*   **Real-time updates:** Data is sent over sockets for live visualization.
*   **Access Control:** Interfaces are rendered based on user roles (Admin vs. Student).
*   **Data Export:** Users can download sensor data in CSV format.

### 2.2 Charts
The system utilizes bar, line, and pie charts to provide better analysis of temperature, humidity, distance, and notification frequency over time.

### 2.3 Admin Access
The admin role includes exclusive features such as creating and updating system users, with specific UI rendering tailored to administrative privileges.

### 2.4 IoT System Interface
The dashboard includes a gate controller prototype (using a servo motor) to demonstrate how software can control IoT system components.

## Backend Architecture
The backend performs the heavy lifting, managing reliable data transfer and system logic.

### 3.1 Handle Incoming Requests
APIs manage user authentication, database access, and request validation based on user access levels.

### 3.2 Manage Database
The project uses MongoDB (cloud-based MongoDB Atlas) to store critical sensor and user data.

### 3.3 Microcontroller Integration
The backend communicates with microcontrollers via serial connection, allowing for both data retrieval and command transmission.

### 3.4 Real-Time Communication
Real-time, low-latency communication is achieved using `socket.io`, which utilizes full-duplex, bidirectional web sockets between the client and server.

## Microcontroller and Embedded Systems
The embedded systems were programmed in C/C++ to handle sensor data (temperature, humidity, HC-SR04 ultrasonic sensor) and control servo motors. Two microcontrollers were used to isolate the servo motor operations from the sensor readings to prevent signal spikes and ensure data consistency. The system also includes a visual LED indicator for proximity alerts.

## Conclusion
The project successfully demonstrated the integration of software and hardware to create a functional IoT prototype. It highlights the potential for building scalable, low-budget, and high-quality IoT systems that provide simple, abstracted control for end-users.

## Authors
*   **Sameer Karn:** sameer.karn@edu.savonia.fi
*   **Rajeev Kanth:** rajeev.kanth@savonia.fi