ESP8266 BASIC
  • Home
  • Documentation
    • Editor Interface
    • Flashing Instructions
    • Language Reference
    • FAQ
    • Videos
    • Examples
      • ESP8266-projects.com
      • Wifi Station & AP Examples
      • GPIO & PWM & Servo Example
      • GUI Example
      • Hello World Example
      • Graphics Example
      • Blink example
      • I2C READING DS1321 REAL TIME CLOCK
      • Timer Example
      • MSG URL Usage
      • MSG URL (Advanced)
      • DS18B20 Wifi Thermostat
      • CSS Example
      • WIFI Scanner Example
      • Graphic Clock Example
      • Analog Input Graph
  • Flashing Instructions
  • Download
  • Forum
  • Store
  • Home
  • Documentation
    • Editor Interface
    • Flashing Instructions
    • Language Reference
    • FAQ
    • Videos
    • Examples
      • ESP8266-projects.com
      • Wifi Station & AP Examples
      • GPIO & PWM & Servo Example
      • GUI Example
      • Hello World Example
      • Graphics Example
      • Blink example
      • I2C READING DS1321 REAL TIME CLOCK
      • Timer Example
      • MSG URL Usage
      • MSG URL (Advanced)
      • DS18B20 Wifi Thermostat
      • CSS Example
      • WIFI Scanner Example
      • Graphic Clock Example
      • Analog Input Graph
  • Flashing Instructions
  • Download
  • Forum
  • Store

​DS18B20 Wifi Thermostat ​(3.0 branch only)

​memclear
SERIALPRINTLN "restart page"
cls

let curr = 0
let setp = 30
let stat = On

Print "ESP8266 WiFi Thermostat "
print
Button "Setpoint", [refresh]
textbox setp
wprint "CurrTemp="
textbox curr
wprint "<br>"
wprint "Heater="
textbox stat
wprint "<br>"
button "Exit", [quit]
timer 4000, [refresh]
wait

[on2]
io(po,2,0)
SERIALPRINTLN "PIN 2 ON"
let stat = "On"
Wait

[off2]
io(po,2,1)
SERIALPRINTLN "PIN 2 OFF"
let stat = "Off"
Wait


[refresh]
curr = temp(0)
SERIALPRINTLN curr
if curr < setp then goto [on2] else goto [off2]
Wait

[quit]
timer 0
wprint "<a href='/'>Menu</a>"
end
This example was contributed by Rotohammer. Original discussion thread (http://www.esp8266.com/viewtopic.php?f=41&t=6422)

Pin 2 is connected to a relay module to turn the heater on or off.

The onewire sensor must be connected to pin 2 as all onewire communication is hard coded to use this pin.
Powered by Create your own unique website with customizable templates.
  • Home
  • Documentation
    • Editor Interface
    • Flashing Instructions
    • Language Reference
    • FAQ
    • Videos
    • Examples
      • ESP8266-projects.com
      • Wifi Station & AP Examples
      • GPIO & PWM & Servo Example
      • GUI Example
      • Hello World Example
      • Graphics Example
      • Blink example
      • I2C READING DS1321 REAL TIME CLOCK
      • Timer Example
      • MSG URL Usage
      • MSG URL (Advanced)
      • DS18B20 Wifi Thermostat
      • CSS Example
      • WIFI Scanner Example
      • Graphic Clock Example
      • Analog Input Graph
  • Flashing Instructions
  • Download
  • Forum
  • Store