Skip to content

Commit

Permalink
feat: docu docu
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablito2020 committed Jan 16, 2024
1 parent 3aff6e5 commit 5a15e52
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 76 deletions.
86 changes: 43 additions & 43 deletions docs/sections/activity_monitor.tex
Original file line number Diff line number Diff line change
@@ -1,78 +1,83 @@
\subsection{System Monitor}

\subsubsection{Objective and Functionality}
The System Monitor is a pivotal component in a biometric data-based framework for user access and verification. It serves two main functions: position detection using user location data and user identification. The System Monitor's functionalities include:
The System Monitor is a pivotal component in a biometric data-based framework for user access and verification. It serves one main function: Showing the user data in a screen. The System Monitor's functionalities include:
\begin{itemize}
\item Subscribing to and processing location data from two ESP-01 modules with ultrasonic sensors via MQTT.
\item Displaying user location and verification data on an LCD screen.
\item Subscribing and processing user data from the user data collector system and showing it via the screen
\item Subscribing and showing the user identity into the screen.
\item Visually representing user proximity using an LED bar.
\end{itemize}

\subsubsection{Project Definition and Milestones}
The development of the System Monitor involved the following milestones:
\begin{enumerate}
\item Establishing MQTT communication to receive data from ultrasonic sensors.
\item Integrating and configuring the LED bar and LCD with the ESP32.
\item Developing and testing the software for proximity detection and data display.
\item Establishing MQTT communication.
\item Integrating and configuring the LED bar and LCD with the ESP32
\item Developing and testing the software for and data display.
\item Efficient multitasking and task synchronization within FreeRTOS.
\end{enumerate}

\subsubsection{Achieved milestones, execution order, priority, and dependencies}
\begin{enumerate}
\item \textbf{Milestone 1: Establishing MQTT Communication}
- \textit{Priority:} High. Fundamental for data transmission.
- \textit{Dependencies:} Basic WiFi setup.
- \textit{Execution Order:} First, as it is crucial for data reception.
\begin{itemize}
\item \textit{Priority:} High. Fundamental for data transmission.
\item \textit{Dependencies:} Basic WiFi setup.
\item \textit{Execution Order:} First, as it is crucial for data reception.
\item \textit{Assigned to:} Ferran
\end{itemize}

\item \textbf{Milestone 2: LED Bar and LCD Integration}
- \textit{Priority:} Medium. Important for user interface.
- \textit{Dependencies:} Successful MQTT setup.
- \textit{Execution Order:} Second, building upon established communication.
\begin{itemize}
\item \textit{Priority:} Medium. Important for user interface.
\item \textit{Dependencies:} Successful MQTT setup.
\item \textit{Execution Order:} Second, building upon established communication.
\item \textit{Assigned to:} Alex, Pablo
\end{itemize}

\item \textbf{Milestone 3: Software Development}
- \textit{Priority:} High. Essential for functionality.
- \textit{Dependencies:} Functional hardware setup.
- \textit{Execution Order:} Third, focusing on processing and display.
\begin{itemize}
\item \textit{Priority:} High. Essential for functionality.
\item \textit{Dependencies:} Functional hardware setup.
\item \textit{Execution Order:} Third, focusing on processing and display.
\item \textit{Assigned to:} Pablo
\end{itemize}

\item \textbf{Milestone 4: Multitasking and Task Synchronization}
- \textit{Priority:} High. Critical for system reliability.
- \textit{Dependencies:} Completion of initial software development.
- \textit{Execution Order:} Fourth, finalizing the system integration.
\begin{itemize}
\item \textit{Priority:} High. Critical for system reliability.
\item \textit{Dependencies:} Completion of initial software development.
\item \textit{Execution Order:} Fourth, finalizing the system integration.
\item \textit{Assigned to:} Pablo
\end{itemize}
\end{enumerate}

\subsubsection{Hardware Development}
The hardware setup for the System Monitor comprises:
\begin{itemize}
\item An ESP32 microcontroller connected to a breadboard.
\item An LED bar and an LCD screen interfaced with the ESP32 for display.
\item Two ESP-01 modules, each with an ultrasonic sensor, for distance measurement.
\end{itemize}

\subsubsection{Software Implementation}
The software, written in C++, leverages FreeRTOS for effective multitasking. Key functions include:
\begin{itemize}
\item \texttt{WiFiTask} for managing WiFi connectivity.
\item \texttt{MQTTTask} for handling MQTT communication.
\item \texttt{LCDDisplayTask} and \texttt{checkForPresenceAndDirection} for controlling the display based on sensor data.
\item Semaphore (\texttt{xSemaphoreLCD}) to ensure safe LCD access.
\end{itemize}

\subsubsection{Interaction with Other Components}
The System Monitor interacts with the ESP-01 modules to determine the user's location based on distance data, which is then displayed on the LED bar and LCD screen.

\subsubsection{Testing}
Testing ensured accurate sensor data transmission via MQTT and responsive displays on the LED bar and LCD. An iterative approach was applied to refine the system's performance.
The System Monitor interacts with the ESP-01 modules to determine the user's location based on distance data, the user data collector system, and the rpi user authentication system. Everything is then displayed on the LED bar and LCD screen.

\subsubsection{Dedication Time}
Approximately 20 hours were dedicated to developing the System Monitor, focusing on both hardware assembly and software programming.
Approximately 30 hours were dedicated to developing the System Monitor, focusing on both hardware assembly and software programming.

\subsubsection{User Story}
As a user approaches, the System Monitor detects their presence, lighting up the LED bar and displaying their approximate location (left, right, or center) on the LCD screen, providing real-time feedback.
When the user uses the data collector system, the user shows the current heart rate and galvanic data, and when the raspberry authenticates the user (using the data and a camera) it shows it's name on the screen

\subsubsection{Challenges and Solutions}
\begin{itemize}
\item \textbf{Hardware Challenges:} Complex wiring and space constraints on the breadboard, along with troubleshooting LED issues.
\item \textbf{Software Challenges:} Establishing reliable communication and processing sensor data accurately. Achieved through careful coding and testing.
\item \textbf{Software Challenges:}
\begin{enumerate}
\item Establishing reliable communication and processing the proximity data accurately (when it's center? when it's on the right? etc)
\item The synchronization system using rtos was a pain. Altough the documentation was good, the ESP-32 didn't do allways the same things running the same code (and we're using mutex locks....).
\end{enumerate}
\end{itemize}

\subsubsection{Hardware and Software Integration}
Expand All @@ -84,25 +89,20 @@ \subsubsection{Hardware and Software Integration}
\end{figure}

\subsubsection{Microcontroller Interaction Protocol}
The System Monitor project involves coordinated communication between multiple microcontrollers, primarily the ESP32 and two ESP-01 modules. The communication is structured as follows:
The System Monitor project involves coordinated communication between multiple microcontrollers, primarily the ESP32, the two ESP-01 modules, the Arduino 33 BLE, and the raspberry pi 4. The communication is structured as follows:

\paragraph{Communication Protocol}
The project utilizes the MQTT (Message Queuing Telemetry Transport) protocol, a lightweight and efficient messaging protocol ideal for IoT applications. This protocol is chosen for its low bandwidth usage and its ability to provide reliable communication over WiFi.

\paragraph{WiFi Configuration}
Each microcontroller in the system is configured to connect to a WiFi network, enabling them to send and receive data over the network. The network credentials (SSID and password) are programmed into the microcontrollers.

\paragraph{Data Flow and Configuration}
The ESP-01 modules, each equipped with an ultrasonic sensor, collect distance data and publish this information to specific MQTT topics. The ESP32, acting as the central unit, subscribes to these topics to receive the data.

\subsubsection{MQTT Tree Structure}
The MQTT protocol in the System Monitor project uses a structured approach to manage the data flow. Below is the outline of the MQTT topics and their functions:

\paragraph{MQTT Topics}
The ESP-32 subscribes to the following topics for retreiving all the data:
\begin{itemize}
\item \textbf{sensor1/distance:} This topic is used by the first ESP-01 module. It publishes the distance data measured by its connected ultrasonic sensor. The ESP32 subscribes to this topic to receive updates on the user's distance from this sensor.
\item \textbf{sensor2/distance:} Similar to the first, this topic is for the second ESP-01 module. It provides distance data from its sensor, allowing the ESP32 to determine the user's location relative to this second sensor.
\item \textbf{rpi/prediction:} Topic that shows the name of the user identified.
\item \textbf{sensor3/heart}: Gets the heart rpm.
\item \textbf{sensor3/galvanic}: Gets the galvanic data
\end{itemize}

\paragraph{Data Organization and Utilization}
The data sent to these topics include numerical values representing the measured distances. The ESP32, upon receiving this data, processes it to determine the user's proximity and location. Based on these calculations, the ESP32 then controls the LED bar and the LCD display to provide real-time feedback about the user's position.
9 changes: 9 additions & 0 deletions docs/sections/main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ \section{Technical Documentation}
instructions on how to setup the system and how to use it, please refer to the following specifications
(which can also be found in the project repository):

\subsection{MQTT Tree Structure}
The figure \ref{figura:mqtt} shows the mqtt tree structure of the overall project.
\begin{figure}[!htbp]
\includegraphics[scale = 0.09]{../images/mqtt-diagram.png}
\centering
\caption{MQTT Tree Structure}
\label{figura:mqtt}
\end{figure}

\input{../technical-docs/rpi.tex}
\input{../technical-docs/linux-router.tex}
\end{document}
20 changes: 13 additions & 7 deletions docs/sections/presence.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@ \subsubsection{Project Definition and Milestones}
\subsubsection{Achieved milestones, execution order, priority, and dependencies}
\begin{enumerate}
\item \textbf{Milestone 1: Establishing MQTT Communication}
- \textit{Priority:} High. Fundamental for data transmission.
- \textit{Dependencies:} Basic WiFi setup.
- \textit{Execution Order:} First, as it is crucial for data reception.
\begin{enumerate}
\item \textit{Priority:} High. Fundamental for data transmission.
\item \textit{Dependencies:} Basic WiFi setup.
\item \textit{Execution Order:} First, as it is crucial for data reception.
\item \textit{Assigned to:} Alex.
\end{enumerate}

\item \textbf{Milestone 2: Send the collected that from the sensor}
- \textit{Priority:} High. Essential for functionallity
- \textit{Dependencies:} Successful MQTT setup.
- \textit{Execution Order:} Second, building upon established communication.
\begin{enumerate}
\item \textit{Priority:} High. Essential for functionallity
\item \textit{Dependencies:} Successful MQTT setup.
\item \textit{Execution Order:} Second, building upon established communication.
\item \textit{Assigned to:} Alex.
\end{enumerate}
\end{enumerate}

\subsubsection{Hardware setup}
Expand Down Expand Up @@ -64,4 +70,4 @@ \subsubsection{MQTT Tree Structure}
\end{itemize}

\paragraph{Data Organization and Utilization}
The data sent to these topics include numerical values representing the measured distances.
The data sent to these topics include numerical values representing the measured distances.
47 changes: 31 additions & 16 deletions docs/sections/raspberry.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,44 @@ \subsubsection{Project Definition and Milestones}
\subsubsection{Achieved milestones, execution order, priority, and dependencies}
\begin{enumerate}
\item \textbf{Milestone 1: Setting up an MQTT broker}
- \textit{Priority:} High. Fundamental for all the data transmission.
- \textit{Dependencies:} Basic WiFi setup.
- \textit{Execution Order:} First, as it is crucial for data reception.
\begin{enumerate}
\item \textit{Priority:} High. Fundamental for all the data transmission.
\item \textit{Dependencies:} Basic WiFi setup.
\item \textit{Execution Order:} First, as it is crucial for data reception.
\item \textit{Assigned to:} Pablo
\end{enumerate}

\item \textbf{Milestone 2: Establishing MQTT communication to receive and send data}
- \textit{Priority:} Medium. Important for working with real data.
- \textit{Dependencies:} Successful MQTT setup.
- \textit{Execution Order:} Second, building upon established communication.
\begin{enumerate}
\item \textit{Priority:} Medium. Important for working with real data.
\item \textit{Dependencies:} Successful MQTT setup.
\item \textit{Execution Order:} Second, building upon established communication.
\item \textit{Assigned to:} Pablo
\end{enumerate}

\item \textbf{Milestone 3: Training neural network}
- \textit{Priority:} High. Essential for effective prediction.
- \textit{Dependencies:} Functional hardware setup (webcam).
- \textit{Execution Order:} Third, getting a first prediction.
\begin{enumerate}
\item \textit{Priority:} High. Essential for effective prediction.
\item \textit{Dependencies:} Functional hardware setup (webcam).
\item \textit{Execution Order:} Third, getting a first prediction.
\item \textit{Assigned to:} Ferran
\end{enumerate}

\item \textbf{Milestone 4: Training a classification tree}
- \textit{Priority:} Medium. Important for a more accurate prediction.
- \textit{Dependencies:} Functioning MQTT communication and neural network.
- \textit{Execution Order:} Fourth, finalizing the machine learning prediction.
\begin{enumerate}
\item \textit{Priority:} Medium. Important for a more accurate prediction.
\item \textit{Dependencies:} Functioning MQTT communication and neural network.
\item \textit{Execution Order:} Fourth, finalizing the machine learning prediction.
\item \textit{Assigned to:} Ferran
\end{enumerate}

\item \textbf{Milestone 5: Sending the results}
- \textit{Priority:} High. Essential for system effectiveness.
- \textit{Dependencies:} Functioning MQTT communication and classification tree.
- \textit{Execution Order:} Fourth, last step towards getting a prediction shown to the user.
\begin{enumerate}
\item \textit{Priority:} High. Essential for system effectiveness.
\item \textit{Dependencies:} Functioning MQTT communication and classification tree.
\item \textit{Execution Order:} Fourth, last step towards getting a prediction shown to the user.
\item \textit{Assigned to:} Oriol
\end{enumerate}
\end{enumerate}

\subsubsection{Hardware setup}
Expand Down Expand Up @@ -93,4 +108,4 @@ \subsubsection{MQTT Topics}
\end{itemize}

\subsubsection{Conclusion}
The development on the RaspberryPi system was a very interesting experience, it was the first time working with machine learning for some of us and it was very challenging to get an accurate prediction, but after some research and testing it was possible to get a good result. The MQTT broker setup was very straight forward and it was easy to get it working.
The development on the RaspberryPi system was a very interesting experience, it was the first time working with machine learning for some of us and it was very challenging to get an accurate prediction, but after some research and testing it was possible to get a good result. The MQTT broker setup was very straight forward and it was easy to get it working.
29 changes: 19 additions & 10 deletions docs/sections/user_data_collector.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,28 @@ \subsubsection{Project Definition and Milestones}
\subsubsection{Achieved milestones, execution order, priority, and dependencies}
\begin{enumerate}
\item \textbf{Milestone 1: Read data from BPM and galvanic}
- \textit{Priority:} High. Fundamental for data collection.
- \textit{Dependencies:} Working hardware setup.
- \textit{Execution Order:} First, as it is the backbone of this system.
\begin{enumerate}
\item \textit{Priority:} High. Fundamental for data collection.
\item \textit{Dependencies:} Working hardware setup.
\item \textit{Execution Order:} First, as it is the backbone of this system.
\item \textit{Assigned to:} Ferran
\end{enumerate}

\item \textbf{Milestone 2: Establish connection with MQTT and publish data}
- \textit{Priority:} Medium. Important, the rest of the system needs this data.
- \textit{Dependencies:} Working WiFi setup.
- \textit{Execution Order:} Second, needed for debugging the data retrieval from Arduino to ESP01.
\begin{enumerate}
\item \textit{Priority:} Medium. Important, the rest of the system needs this data.
\item \textit{Dependencies:} Working WiFi setup.
\item \textit{Execution Order:} Second, needed for debugging the data retrieval from Arduino to ESP01.
\item \textit{Assigned to:} Alex
\end{enumerate}

\item \textbf{Milestone 3: Getting data from Arduino to ESP01}
- \textit{Priority:} High. Essential for usage of real data.
- \textit{Dependencies:} Functional hardware setup and MQTT communication.
- \textit{Execution Order:} Third, focusing on data transmission.
\begin{enumerate}
\item \textit{Priority:} High. Essential for usage of real data.
\item \textit{Dependencies:} Functional hardware setup and MQTT communication.
\item \textit{Execution Order:} Third, focusing on data transmission.
\item \textit{Assigned to:} Alex
\end{enumerate}
\end{enumerate}

\subsubsection{Hardware setup}
Expand Down Expand Up @@ -82,4 +91,4 @@ \subsubsection{MQTT Topics}
\end{itemize}

\subsubsection{Conclusion}
The integration of the Arduino NANO-BLE33 with the ESP-01 for biometric data collection and transmission via MQTT represents a significant advancement in the biometric verification system. This setup not only provides real-time data monitoring but also enhances the system's capability to make a prediction on the user's identity.
The integration of the Arduino NANO-BLE33 with the ESP-01 for biometric data collection and transmission via MQTT represents a significant advancement in the biometric verification system. This setup not only provides real-time data monitoring but also enhances the system's capability to make a prediction on the user's identity.

0 comments on commit 5a15e52

Please sign in to comment.