We all spend a lot of time together at our apartment which happens to be three stories tall. Out of curiosity, we looked to develop temperature monitors that we could place within the three bedrooms which are spread over the first, second, and third floor level. We wondered if the room on the third floor would be measurably warmer than the other two since heat rises. This Hackster.io project summarizes the work we completed to create the three temperature sensors.
Youtube Overview of Project
Setting up the Circuit
The center leg is the data output. This will connect to D2. Pin D2, as well as the positive leg of the temperature sensor, will be connected to 3v3, however for the D2 connection you may use a 4.7k or 1k ohm resistor.
Setting up Ubidots
Log in to Ubidots and create a data source. Then add a new variable. This variable will be a measurement of your temperature.Please copy your Variable ID as that will be used in your code. This can be found under the info button of your variable as shown below.
Now, under your My Profile tab, create a token and record the token ID.
Coding the Particle
Now, navigate to build.particle.io , and create a new app. Our next step is to include the necessary libraries for the project. We'll walk you through how to import the HTTPCLIENT Library, then you must import the OneWire and Spark Dallas Temperature Library.
Click on the libraries icon and search for "HTTPCLIENT". Click on the HTTPCLIENT library and then click the include in app button.
Repeat the same steps with the OneWire and Spark Dallas Temperature library. If the Spark Dallas Temperature library is giving you issues follow our fix listed in the code section.
Now copy the code below over into build.particle.io .Remember that the code has two defined constants: TOKEN and VARIABLE_ID. Replace their values with the ones noted above.
Flash the code to the particle and you should now be able to see the temperature data in Ubidots!
Example Data (3 graphs for the 3 different sensors)
Comments