Edsard Boelen, 14-may-2015
Wifi and celular networks are available everywhere, it is best to use those also for small data packets. No zwave or zigbee which need their access points. Usually I was against wifi because the high cost and power consumption. (arduino wifi shield was 5 times the cost of an arduino, a home router was cheaper.) But recently the chineese made ESP8266 has taken those constraints away. About 5 euros and a stand-by current of 10uA. The on-board controller is programmable, but I will use the default serial interface.
wifi thermostat
My first experiment will be a wifi controlled thermostat. It will also have a display which lights up when I wave my hand before it.
The hardware
The hardware will consist of some cheap standard expansion boards:
LCD keypad shield
hc-sr04 ultrasonic module
dht22 temp / humidity sensor
esp8266 wifi module
. .
The connections to the arduino are as follows:
D0, D1
USB serial / program
D2, D3
Soft serial to esp8266
D4, D5, D6, D7
Lcd data
D8, D9, D10
Lcd RS,EN,BL
D11, D12
Ultrasonic sensor
D13
LED diagnostic
A0
Buttons
A1
DHT22
A2
Relay for CV
Software
First test the ESP8266 connection: get the arduino code here not to set your wifi password
The arduino code overview is as follows:
setup:
set initial values
send bootup msg to server.
display values.
loop:
delay 200ms
check Sonar
(turn backlight on if movement is detected within 50cm)
check ButtonPress
(if sync button is pressed, sync immediately)
(if up/down pressed, increase/decrease thermos setting with .5 degrees)
check Backlight counter
(if backlight is on for 1 minute, then turn backlight off)