Analog Temperature Sensor (KY-013) [S020]



https://www.youtube.com/watch?v=uTssvJqHvms


*GitHub : https://github.com/rdiot/rdiot-s020.git


* Specs

Using of plug-in full-color LED

Three primary colors (RGB) connected with the current- limiting resistance to prevent burning

Adjusting three primary colors by PWM to get different colors in mixture

Can be connected with a variety of single-chip 

Working voltage: 5V

LED driver mode: Cathode driver


* Content

- Connect

S - A0

middle - 5V

- - GND


- Key Code

GetTemperature(analogRead(pin);


double GetTemperature(int v)

{

double Temp;

Temp = log(10000.0 / (1024.0 / v - 1)); 

Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp))* Temp);

Temp = Temp - 273.15; // Convert Kelvin to Celcius

return Temp;

}





Posted by RDIoT

댓글을 달아 주세요