diff --git a/report/src/prototype2.jpeg b/report/src/prototype2.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..d38f1ccd97787ead636d83298af962f538fc723a Binary files /dev/null and b/report/src/prototype2.jpeg differ diff --git a/report/src/report.tex b/report/src/report.tex index 7b122551f5dd4677894d9af3c2c6828c8f4de799..655ffa08b4612fa5e24ec527d4d6592575d81066 100644 --- a/report/src/report.tex +++ b/report/src/report.tex @@ -26,7 +26,7 @@ \tableofcontents \section{Introduction} -For ur final project we decided to create a control system for a solar pump. +For uor 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. @@ -39,6 +39,13 @@ For this we have provided a speaker, such that the microcrontroller can tell all 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} + \section{Main Code} At first everything is getting initialised, such that it can be used later. This contains the LCD display, the four temperature sensors, the two pumps and the button. @@ -75,8 +82,10 @@ 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 called ... + + 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" @@ -159,6 +168,8 @@ 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. + %\listoffigures \end{document}