Ks0033 keyestudio Analog Temperature Sensor: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
<br>
==Introduction==
==Introduction==
This module is based on the working principle of a thermistor (resistance varies from temperature change in the environment). It can sense the temperature change in its surrounding and send the data to the analog IO in the Arduino board. <br>
This module is based on the working principle of a thermistor (resistance varies with temperature change in the environment). <br>
All we need to do is to convert the sensor output data into degrees Celsius temperature by simple programming, finally it will be displayed on the screen. It's both convenient and effective, and it’s widely applied in gardening, home alarm system and other devices. 
It can sense temperature change in its surrounding and send the data to the analog IO in the Arduino board. <br>
All we need to do is to convert the sensor output data into degrees Celsius temperature via simple programming, finally to display it. <br>
It's both convenient and effective, thus it is widely applied in gardening, home alarm system and other devices.  
<br>[[File:Ks0033.png|500px|frameless|thumb]]<br>
<br>[[File:Ks0033.png|500px|frameless|thumb]]<br>


<br>
==Specification==
==Specification==
*Interface Type: analog
*Interface Type: analog
*Working Voltage: 5V
*Working Voltage: 5V
*Temperature Range: -55℃~315℃
*Temperature Range: -55℃~315℃
*Size: 30*20mm
*Weight: 3g


<br>
==Connection Diagram ==
==Connection Diagram ==
<br>[[File:Ks0033-.png|700px|frameless|thumb]]<br>


<br>[[File:332.png|500px|frameless|thumb]]<br>  
<br>


==Sample Code ==
==Sample Code ==


Copy and paste the below code to Arduino software.


<pre>
<pre>
Line 26: Line 32:
{int sensorValue = analogRead(A0);
{int sensorValue = analogRead(A0);
Serial.println(sensorValue);
Serial.println(sensorValue);
   delay(1);  
   delay(1); }
}</pre>
</pre>
 
<br>
You can see that the analog value is changing according to the temperature change in the environment. But it’s not very obvious. Let’s solve it by using the following equation. The value read from the serial port is similar to normal temperature, eg. The temperature right now is 30C.
The above code is only for analog value. <br>
You can see that the analog value is changing according to the temperature change in the environment. But it’s not very obvious.<br>
Let’s solve this by using the following equation. Then upload the code below to the Arduino board. The value read from the serial port is similar to normal temperature. <br>
e.g. The temperature right now is 30°C. <br>


<pre>
<pre>
#include <math.h>
#include <math.h>
double Thermister(int RawADC) {
void setup()
double Temp;
{
Temp = log(((10240000/RawADC) - 10000));
  Serial.begin(9600);
Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
}
Temp = Temp - 273.15; // Convert Kelvin to Celcius
void loop()
return Temp;
{
  double val=analogRead(0);
  double fenya=(val/1023)*5;
  double r=(5-fenya)/fenya*4700;
  Serial.println( 1/( log(r/10000) /3950 + 1/(25+273.15))-273.15);
  delay(1000);
}
}
void setup()
</pre>
{Serial.begin(9600);
 
} void loop() { Serial.print(Thermister(analogRead(0))); // display Fahrenheit Serial.println("c"); delay(500);
 
}</pre>
<br>
== Result ==
<br>[[File:KS0349 19-2.png|800px|frameless|thumb]]<br>
Done wiring and powered up, upload well the code, then open the serial monitor, you will see the current temperature value. Shown below.
<br>[[File:KS0349 19-3.png|900px|frameless|thumb]]<br>
 
<br>
==Extension Learn==
You are able to use keyestudio analog temperature sensor to meansure the current temperature of environment, displaying the data on the LCD screen. Like below: <br>
<br>[[File:图片-KS0033.png|600px|frameless|thumb]]<br>


<br>
==Resources ==
==Resources ==


'''Video'''
* '''Video'''<br>
http://video.keyestudio.com/ks0033/


http://www.keyestudio.com/wp/ks0033/
* '''PDF and Code'''<br>
https://fs.keyestudio.com/KS0033


'''PDF'''


https://drive.google.com/open?id=1RLgiaOSsJxZ6TxaOc6YjAQALESPXhR9E
<br>


==Buy from ==
==Buy from ==
'''Official Website'''
*[https://www.keyestudio.com/free-shipping-keyestudio-analog-temperature-sensor-detection-module-for-arduino-p0153.html  '''Official Website''']


http://www.keyestudio.com/keyestudio-analog-temperature-sensor-for-arduino.html
*[https://ae01.alicdn.com/kf/HTB1UVQ_owMPMeJjy1Xbq6AwxVXan/-Free-shipping-KEYES-Analog-temperature-detector-module-for-arduino.jpg_200x200.jpg  '''Shop on aliexpress''']




[[Category: Sensor]]
[[Category: Sensor]]

Latest revision as of 14:51, 7 January 2021


Introduction

This module is based on the working principle of a thermistor (resistance varies with temperature change in the environment).
It can sense temperature change in its surrounding and send the data to the analog IO in the Arduino board.
All we need to do is to convert the sensor output data into degrees Celsius temperature via simple programming, finally to display it.
It's both convenient and effective, thus it is widely applied in gardening, home alarm system and other devices.  
thumb


Specification

  • Interface Type: analog
  • Working Voltage: 5V
  • Temperature Range: -55℃~315℃


Connection Diagram


thumb


Sample Code

Copy and paste the below code to Arduino software.

void setup() 
{Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() 
{int sensorValue = analogRead(A0);
Serial.println(sensorValue);
  delay(1); }


The above code is only for analog value.
You can see that the analog value is changing according to the temperature change in the environment. But it’s not very obvious.
Let’s solve this by using the following equation. Then upload the code below to the Arduino board. The value read from the serial port is similar to normal temperature.
e.g. The temperature right now is 30°C.

#include <math.h>
void setup()
{
   Serial.begin(9600);
}
void loop()
{
  double val=analogRead(0);
  double fenya=(val/1023)*5;
  double r=(5-fenya)/fenya*4700;
  Serial.println( 1/(  log(r/10000) /3950 + 1/(25+273.15))-273.15);
  delay(1000);
}



Result


thumb
Done wiring and powered up, upload well the code, then open the serial monitor, you will see the current temperature value. Shown below.
thumb


Extension Learn

You are able to use keyestudio analog temperature sensor to meansure the current temperature of environment, displaying the data on the LCD screen. Like below:

thumb


Resources

  • Video

http://video.keyestudio.com/ks0033/

  • PDF and Code

https://fs.keyestudio.com/KS0033



Buy from