Wednesday, August 3, 2016

ESP8266Basic KY-001 18B20 temperature sensor


Testing the ESP8266 with 18B20 temperature sensor
 ( KY-001 from 37in1Sensor kit )

Hardware connection

  •   Pin S Signal  - GPIO2 ( onewire )
  •   Pin middel VCC +3V3
  •   Pin - Ground

ESP8266Basic (version 3)

TEMP({DEVICE ID}):
Will retrieve temperature sensor reading from certain 1 wire devices connected to pin 2.
Bla = temp({Device ID})

ESP8266 Forum info

In article on http://www.esp8266.com/viewtopic.php?f=40&t=10402&p=49157&hilit=temperature#p49157
i found :
temp( 0 )  First temperature device
temp( 1 )  Second temperature device

ESP8266Basic program 

for (first) 18B20

'  TestKY019.bas  - 2016 V0.1

timer 3000 , [NewVal]
wait

[NewVal]
cls
msg$ = "<head><meta http-equiv='refresh' content='3'></head><H1>Temperature sensor </H1>" &  time() & " Temperature = " &  temp( 0 )
wprint htmlvar( msg$ ) 
returngui
wait

end





No comments: