It's showing 32c instead of 18c. It seems that it's working in the opposite way. I mean, when I heat it, temperature drops, if it gets cold, temperature rises. Please revise the code and try to figure out where is the problem.
Temperature sensor module KY-013
These modules are the same, they're all on boards labelled “S1”. THE PINS ARE MARKED BACKWARDS ON THESE.
Has pin 1 (marked S) (GND), pin 2 (5v power) and pin 3 (marked -) (analog signal.)
Today i did some tests on this sensor with due. I connected analog out to S pin in middle i connected power 3.3v and in (-) pin i connected gnd. Because that module is like voltage divider and you can see that between S pin and mid are 10k resistor.
I am using 12 bit precission. And getting ~29-32C(need something like 20). When i measure out pin with tester i get ~1.6 volts but with arduino converting i get 2.26v. Maybe my tester is wrong
volt=float(analogRead(A1))*(3.3/4095); // conversion to volts