Abstract Jay Vang Arduino Temperature Sensor Senior Capstone

• Abstract Jay Vang Arduino Temperature Sensor, Senior Capstone Project, Fall 2017 Advisor: Dr. Rad Alrifai Northeastern State University Arduino technology uses hardware and software to read input and turn it into an output. The main purpose of this project is to take the Arduino hardware and implement a set of instruction into the board to compute the readings of room temperature. The data temperature will then be saved into a text file for later uses. The software language is written in C++. The boards have different libraries that enact different computations of instructions, but the board cannot do everything alone. Other add on hardware such as the TMP 36 temperature sensor that I am using for this project also helps the board. A USB connector is able to make the connection possible from board to software on a laptop. To recognize the board, all that is needed to be done is set the settings to the right COM port that the board is on. This method of building and implementing hardware to read temperature has increase my knowledge of what really goes on behind technology of today’s society. • Methodology This project was programmed through the Arduino IDE that was downloaded off their website: Arduino. cc. The syntax is coded in C++ with minor adjustments to the software. The actual hardware itself consist of: a laptop, Arduino Uno R 3 board, breadboard, TMP 36 temperature sensor, and jumper wires. The laptop will be the base power source for the board; connecting it to the connection port on the Arduino Uno R 3 will provide the electrical source needed to power the micro-controller. The Arduino Uno R 3 has many different libraries programmed into it that allows for different computation of outputs. The TMP 36 is a low voltage, centigrade temperature sensor that is linear to Celsius. By placing the TMP 36 onto the breadboard(base for electronic circuits), the connection between the TMP 36 and Arduino Uno R 3 can be made with the jumper wires. Coding is then implemented to retrieve the voltage output from the TMP 36. Using math, the voltage is converted into Celsius, and then Celsius into Fahrenheit. Each degree will then be put into arrays to determine MAX and MIN values for each. The output that will display in the Serial Monitor of the software will be the voltage, Celsius, Fahrenheit, and MAX and MIN values. I also used Visual Studios to create a Windows Form to collect and save the data from the Arduino IDE into a text file called temp. Data. Figure 2. Set up of the Arduino Temperature Sensor Figure 6. Activity Diagram for the process • Conclusion Figure 3. Output results from the Arduino Temperature Sensor • Implementation The most important code in this project is the voltage conversion into Celsius and then Celsius into Fahrenheit. The syntax is shown in Figure 1. It is hard to vision how the set up looks like, so Figure 2 shows the set of the entire temperature sensor. The important thing to note here is that all the connections are inserted into the right places on the Arduino board and the breadboard. Figure 3 shows the output of the temperature sensor. First line of code consist of the actual voltage read at the TMP 36 pin followed along by the converted Celsius and converted Fahrenheit temperature. The lines below consist of the updated MAX and MIN value of each new temperature change. In Figure 4, it shows the Windows Form with three buttons with individual functions: -Start Button: starts the retrieval of data from the board. -Stop Button: stops the retrieval process. -Save Data Button: saves the data retrieve into a text file. By clicking on the Save Data Button, a message box will pop up, allowing user to know if the data was able to be saved or not. In Figure 5, the text file in which the temperature data was saved into is on display. Figure 6 consist of the Activity diagram that was used to construct my project. • References Ada, L. (2012, July 29). Using a Temp Sensor. Retrieved from https: //learn. adafruit. com/tmp 36 -temperature-sensor/using-a-temp-sensor Arduino Un R 3. (n. d. ). Retrieved from https: //www. pololu. com/product/2191 Buekban, C. (2014, July 19). Arduino and Visual C#-Receive/Show/Save Data in Windows Figure 4. Data retrieved into the Windows Form and saved as a file Forms Application Part 1. Retrieved from https: //www. youtube. com/watch? v=a. CT 2 n. I 8 j 8 p. U&t=2 s Buekban, C. (2014, July 19). Arduino and Visual C#-Receive/Show/Save Data in Windows • Figures Forms Application Part 2. Retrieved from https: //www. youtube. com/watch? v=h. En 3 K 8 Gc. Ad. M Codebender_cc. (n. d. ). How to Use the TMP 36 Temp Sensor. Retrieved from //Function that returns true voltage(0 to 5 volts) present on an analog input pin voltage = get. Voltage(temperature. Pin); //Conversion of voltage to Celsius degrees. C = (voltage - 0. 5) * 100. 0; //Conversion of Celsius to Fahrenheit degrees. F = degrees. C * (9. 0/5. 0) + 32. 0; http: //www. instructables. com/id/How-to-use-the-TMP 36 -temp-sensor-Arduino-Tutorial/ HELLOTECHIE (n. d. ). SIK Experiment Guide for Arduino. Retrieved from https: //learn. sparkfun. com/tutorials/sik-experiment-guide-for-arduino---v 32/experiment -7 -reading-a-temperature-sensor ----- JOEL_E_B, M-SHORT. (n. d. ). How to Use a Breadboard. Retrieved from float get. Voltage(int pin) { //equation that converts that analog. Read() returns, //into true voltage being read at the pin return (analog. Read(pin) * 0. 004882814); https: //learn. sparkfun. com/tutorials/how-to-use-a-breadboard Robtillaart. (2013, July 21). Finding the Max and Min Value of Sensor Reading. Retrieved from http: //forum. arduino. cc/index. php? topic=177599. 0 } Figure 5. Folder containing saved file temp. Data Figure 1. Code on voltage conversion into Celsius, then Celsius to Fahrenheit In conclusion, this project was meant for people who would like to experiment with more hands on activity. With so many vast variety of Arduino boards and hardware add ons, the temperature sensor could possibly be extended to a wider range or even programmed into a more graphical output The strength to my project is that it provides a good outlook for the people who are not too strong with their coding. The hardware is great to work with, and the coding is limited to basic knowledge of coding. The challenges that I faced included transferring the data over to the Windows Form. I was not able to connect my data into an online database, which would be a better source for saving my data. That is what I would like to do with my project in the future. Overall, I was able to build a micro-controller and understand how electrical circuits worked. I was also able to strengthen my C++ coding through using the Arduino IDE and Visual Studios. What is Arduino. (n. d. ). Retrieved from https: //www. arduino. cc/en/Guide/Introduction
- Slides: 1