From 7175dec2017177695104f8636497c823dece6ec3 Mon Sep 17 00:00:00 2001
From: Stefan Gehr <stefan.kerman.gehr@fau.de>
Date: Wed, 26 Oct 2022 17:10:44 +0200
Subject: [PATCH] fixing mistakes

---
 report/{src => figures}/prototype2.jpeg | Bin
 report/src/report.tex                   |  61 ++++++++++++++++--------
 2 files changed, 41 insertions(+), 20 deletions(-)
 rename report/{src => figures}/prototype2.jpeg (100%)

diff --git a/report/src/prototype2.jpeg b/report/figures/prototype2.jpeg
similarity index 100%
rename from report/src/prototype2.jpeg
rename to report/figures/prototype2.jpeg
diff --git a/report/src/report.tex b/report/src/report.tex
index 655ffa0..29b5afe 100644
--- a/report/src/report.tex
+++ b/report/src/report.tex
@@ -4,8 +4,8 @@
 \usepackage{csquotes}
 \usepackage[style=iso]{datetime2}
 \usepackage{amsmath, amssymb}
-%\usepackage{graphicx}
-%\graphicspath{{../figures/}}
+\usepackage{graphicx}
+\graphicspath{{../figures/}}
 \usepackage{siunitx}
 \usepackage{ragged2e}
 \usepackage{booktabs}
@@ -26,7 +26,19 @@
 \tableofcontents
 
 \section{Introduction}
-For uor final project we decided to create a control system for a solar pump.
+\begin{figure}
+	\centering
+	\includegraphics[width=0.75\textwidth]{prototype2.jpeg}
+	\caption{Picture of the solar pump control circuit.
+	On the upper breadboard, the Arduino Uno is fixed to the left side with cable ties.
+	On the right side of the same breadboard are the four temperature sensors (three in light blue and one in black) attached.
+	Underneath them, two LEDs representing the pumps (for testing purposes), and one button, are put on.
+	Parts of the LCD can be seen on the right top corner.
+	On the lower breadboard is the mp3 module installed.
+	In the final circuit the LEDs are replaced with relays for the pumps.}
+	\label{fig:proto1}
+\end{figure}
+For our final project we decided to create a control system for a solar pump.
 There is a temperature sensor up at the solar array, and another one down at the heat exchanger.
 When the temperature difference is sufficiently high the pump gets turned on.
 It moves the hot water from the array to the heat exchanger.
@@ -35,16 +47,10 @@ This whole setup is actually realised twice, which means two solar arrays, two h
 The reason for this is that we are actually planning to use this system.
 One of the author's uncle currently uses some analog electronics to handle his two solar arrays, but he would like to modernise it with a microcontroller.
 He also wants to know what the current state of the pumps are and what the temperatures are.
-For this we have provided a speaker, such that the microcrontroller can tell all the infos, and also a small display with all the infos on it.
+For this we have provided a speaker, such that the microcontroller can tell all the infos, and also a small display with all the infos on it.
 The reason for the speaker is that he is visually impaired.
 The display was just a nice add-on for us, but actually not that useful to our ``client''.
-
-\begin{figure}[h]
-	\centering
-	\includegraphics[width=0.75\textwidth]{prototype2.jpeg}
-	\caption{Picture of the solar pump control circuit. On the upper breadboard, the arduino uno is fixed to the left side with cable ties. On the right side of the same breadboard are the four temperate sensor (three light blue and one black one) attached. Underneath them, two LEDs (for testing porpoises) and one button are put on. Parts of the LCD can be seen on the right top corner. On the lower breadboard is the mp3 module installed. The final circuit replaces the LED's with relays for the pumps.}
-	\label{proto1}
-\end{figure}
+A photo of the prototype used for testing and developing can be seen in \autoref{fig:proto1}.
 
 \section{Main Code}
 At first everything is getting initialised, such that it can be used later.
@@ -82,13 +88,15 @@ If the display is currently turned on and the this timestamp is more than 30 sec
 
 \section{MP3}
 \label{sec:mp3}
-
-	All the sounds we are playing over the speaker are pregenerated mp3-files.
-	We used a text-to-speech program available at \url{https://www.text-speech.net}, which had the best sounding artificial voice in our opinion. The web side only plays the sound file, and therefore another program was needed to record it. In our case, \textit{audacity} was used. During the recording session, the sounds were cut in matching time length via visual judgement. These sound files are then loaded onto the SD card. The mp3 player plays a file if the matching integer, which represents the storage position on the SD card, is sent. In \textit{soundFiles.h} macros are defined, to easily assign the sound file to its position integer. The whole sound extraction process could be improved by using a dedicated text to speech program which creates mp3 files, because in our case unnecessary silence after the cutting process still remained. 
-	
-% TODO: Mario, the stage is yours.
-% - header file soundFiles.h blabla
-% - mp3 module sending the signal start/stop "file number on the sd card"
+All the sounds we are playing over the speaker are pregenerated mp3-files.
+We used a text-to-speech program, available at \url{https://www.text-speech.net}, which had the best sounding artificial voice in our opinion.
+The website only plays the sound file, and therefore another program was needed to record it.
+In our case, the free and open source program \textit{Audacity} was used.
+During the recording session, the sounds were cut in matching time length via visual judgement.
+These sound files are then loaded onto the SD card.
+The mp3 player plays a file, if the matching integer, which represents the storage position on the SD card, is sent.
+In \textit{soundFiles.h} macros are defined, to easily assign the sound file to its position integer.
+The whole sound extraction process could be improved by using a dedicated text to speech program which creates mp3 files, because in our case unnecessary silence after the cutting process still remained.
 
 Another challenge was to not halt the main loop when we want to say something.
 For example if we want to say the ``twenty five'' we would love to simply call the functions as \\
@@ -167,8 +175,21 @@ as we want to say ``zweihundert'' for \(n=200\) and not ``zweihundertnull''.
 Finally our main function sayNumber(\(n\)) goes thorugh all the possible cases.
 A peudocode implementation of it can be seen in \autoref{alg:saynumber}.
 \section{Temperature}
-
-	For our prototype, we use different temperature sensors, who need different libraries. For this reason, we wrote four different function for each temperature sensor, who work on the same principles. The function will return the state, an enum defined by us, in which the sensor is at the moment and updates the temperature accordingly. We use static variables to handle the time related queries. At the beginning we checked if the update time has been has passed, and if it didn't, the unchanged state gets returned and nothing happens. In the other case, the problem goes on and the temperature from the sensor gets read out. After this, we check if some error occurred and the resulting temperature is faulty. We differentiate between two cases, the short term error and long term error. The long term error gets returned if the error occurred continuously the last 60 seconds. If this isn't the case, only the short term error gets returned. In the case of the long term error, the pumps will be turned on, and the owner gets notified about the error. In the case of the short term error, nothing will happen, but the program will keep track of the time at which the function worked without an error. If no error occurred, the program will go on and updated the temperature, time keeping variables and returns the success state. The pumps are controlled accordingly to the measured temperature differences. 
+For our prototype, we use different temperature sensors, which need different libraries.
+For this reason, we wrote four different functions for each temperature sensor, which work on the same principles.
+The function will return the state, an enum defined by us, in which the sensor is at the moment and updates the temperature accordingly.
+We use static variables to handle the time related queries.
+At the beginning we check whether the update time has been passed.
+If it didn't, the unchanged state gets returned and nothing happens.
+In the other case, the problem goes on and the temperature from the sensor gets read out.
+After this, we check if some error occurred and the resulting temperature is faulty.
+We differentiate between two cases, the short term error and long term error.
+The long term error gets returned if the error occurred continuously for at least 60 seconds.
+If this isn't the case, only the short term error gets returned.
+In the case of the long term error, the pumps will be turned on, and the owner gets notified about the error.
+In the case of the short term error, nothing will happen, but the program will keep track of the time at which the function worked without an error.
+If no error occurred, the program goes on and update the temperature and the time keeping variables, and returns the success state.
+The pumps are then controlled accordingly to the measured temperature differences.
 
 %\listoffigures
 
-- 
GitLab