Ks0104 keyestudio EASY plug Analog Temperature Sensor: Difference between revisions
Keyestudio (talk | contribs) |
Keyestudio (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
[[image:Ks0104-.png|thumb|600px|right|EASY plug Analog Temperature Sensor]] | |||
<br> | |||
==Introduction== | ==Introduction== | ||
Are you still looking for a low-cost thermometer? Did you get one? Aha! Here it is! This EASY Plug analog temperature sensor is based on a thermistor. The resistance varies with surrounding temperature change. <br> | |||
Note: this module | It can measure temperature change in the surroundings and send the data to Arduino analog IO. Just need to convert the output data to degrees Celsius temperature by simple programming. <br> | ||
The sensor is convenient and cost effective, widely applied to gardening, home alarm system and other devices. <br> | |||
<span style="color: red">'''Note: ''' </span> this module should be used together with EASY plug control board.<br> | |||
<br> | |||
==Specification== | ==Specification== | ||
*Sensor type: Analog | |||
* Sensor type: | *Working voltage: 5V | ||
* Working voltage: 5V | *Temperature range: -55℃~315℃ | ||
* Temperature range: -55℃~315℃ | *High quality connector | ||
* | |||
<br> | |||
==Technical Details== | |||
* Dimensions: 38mm*20mm*18mm | |||
* Weight: 4.2g | |||
<br> | |||
== Connect It Up == | |||
== | Connect the EASY Plug analog temperature sensor to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable. | ||
<br>[[File: | <br>[[File:Ks0104-3.png|700px|frameless|thumb]]<br> | ||
<br> | |||
==Sample Code== | ==Sample Code== | ||
Copy and paste below code to [http://wiki.keyestudio.com/index.php/How_to_Download_Arduino_IDE Arduino IDE] and upload. | |||
<pre> | <pre> | ||
void setup() | void setup() | ||
Line 29: | Line 36: | ||
{int sensorValue = analogRead(A1); | {int sensorValue = analogRead(A1); | ||
Serial.println(sensorValue); | Serial.println(sensorValue); | ||
delay(1); | |||
} | } | ||
</pre> | </pre> | ||
We can see that the analog value is changing according to the temperature change | <br> | ||
We can see that the analog value is changing according to the surrounding temperature change. But it’s not very obvious. <br> | |||
Let’s solve this by using the following equation. <br> | |||
The value read from the serial port has little difference to normal temperature. eg. The temperature right now is about 25℃.<br> | |||
<pre> | <pre> | ||
# | #include <math.h> | ||
void setup() | |||
{ | |||
Serial.begin(9600); | |||
} | } | ||
void loop() | |||
{ | { | ||
double val=analogRead(1); | |||
double fenya=(val/1023)*5; | |||
// Ohm’s law r/100=fenya/(3.3-fenya) | |||
double r=(5-fenya)/fenya*4700;// divider resistance 4.7K,4.7K resistor to ground | |||
//double r=fenya/(5-fenya)*10000;//divider resistance10K,thermistor to ground | |||
Serial.println( 1/( log(r/10000) /3950 + 1/(25+273.15))-273.15);//3950 is the value B of thermistor | |||
delay(1000); | |||
} | } | ||
</pre> | </pre> | ||
<br> | |||
==What You Should See== | |||
Done uploading the code, open the serial monitor and set the baud rate to 9600, the temperature value will display on the Arduino’s serial monitor. | |||
<br>[[File:Ks0104-4.png|600px|frameless|thumb]]<br> | |||
<br> | |||
==Resources == | ==Resources == | ||
'''PDF''' | '''Download the PDF:'''<br> | ||
https://drive.google.com/open?id=1pQj561dWpMkzIBY1siyFwDCJgOCjXUPi | |||
'''Download the Code:'''<br> | |||
https://drive.google.com/open?id=1PBnazbkjn06xvLcIw2G4GqYJiH5W4Xsf | |||
<br> | |||
==Buy from == | ==Buy from == | ||
'''Official Website''' | *'''Official Website:''' http://www.keyestudio.com/ks0103.html | ||
*[https://www.aliexpress.com/store/product/2016NEW-Keyestudio-EASY-plug-Passive-Buzzer-Module-for-Arduino/1452162_32637357831.html?spm=2114.12010612.8148356.11.43b8484e8Kd7LP Shop on aliexpress ] | |||
[[category:EASY Plug]] | [[category: EASY Plug]] |
Revision as of 08:46, 28 November 2018
Introduction
Are you still looking for a low-cost thermometer? Did you get one? Aha! Here it is! This EASY Plug analog temperature sensor is based on a thermistor. The resistance varies with surrounding temperature change.
It can measure temperature change in the surroundings and send the data to Arduino analog IO. Just need to convert the output data to degrees Celsius temperature by simple programming.
The sensor is convenient and cost effective, widely applied to gardening, home alarm system and other devices.
Note: this module should be used together with EASY plug control board.
Specification
- Sensor type: Analog
- Working voltage: 5V
- Temperature range: -55℃~315℃
- High quality connector
Technical Details
- Dimensions: 38mm*20mm*18mm
- Weight: 4.2g
Connect It Up
Connect the EASY Plug analog temperature sensor to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable.
Sample Code
Copy and paste below code to Arduino IDE and upload.
void setup() {Serial.begin(9600); } // the loop routine runs over and over again forever: void loop() {int sensorValue = analogRead(A1); Serial.println(sensorValue); delay(1); }
We can see that the analog value is changing according to the surrounding temperature change. But it’s not very obvious.
Let’s solve this by using the following equation.
The value read from the serial port has little difference to normal temperature. eg. The temperature right now is about 25℃.
#include <math.h> void setup() { Serial.begin(9600); } void loop() { double val=analogRead(1); double fenya=(val/1023)*5; // Ohm’s law r/100=fenya/(3.3-fenya) double r=(5-fenya)/fenya*4700;// divider resistance 4.7K,4.7K resistor to ground //double r=fenya/(5-fenya)*10000;//divider resistance10K,thermistor to ground Serial.println( 1/( log(r/10000) /3950 + 1/(25+273.15))-273.15);//3950 is the value B of thermistor delay(1000); }
What You Should See
Done uploading the code, open the serial monitor and set the baud rate to 9600, the temperature value will display on the Arduino’s serial monitor.
Resources
Download the PDF:
https://drive.google.com/open?id=1pQj561dWpMkzIBY1siyFwDCJgOCjXUPi
Download the Code:
https://drive.google.com/open?id=1PBnazbkjn06xvLcIw2G4GqYJiH5W4Xsf
Buy from
- Official Website: http://www.keyestudio.com/ks0103.html