Explanation of the code

Let's discuss the steps that we need to follow:

  1. Initially we declare the values of B and R0. These values are obtained from the datasheet, as shown in the algorithm.
  1. Next, we declare the analog pin, tempPin, which will be used.
  1. In the setup() function, we just perform the Serial.begin(9600) operation. The thing is that we don't set the tempPin to be in input mode because of the fact that analog pins by default are in input mode.
  1. Next in the loop, we implement the calculations performed earlier in code and display it on the serial monitor.
  1. To access the serial monitor, press the top right corner button. After the serial windows opens, you will see your current room temperature:
Serial window. Note the baud rate and the temperature readings
From the preceding screenshot, you can note the temperature reading, which is pretty close to the original temperature. Depending on the sensitivity, the temperature may vary.

Now that we know how to access temperature sensor readings, we can move forward with the integration of other sensors for our weather station project.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.206.25