Thermostat w/ WIFI (ESP8266)

Hello!
I am working on a thermostat that will be controlled by an Atmega328 chip with, a 10k NTC thermistor, tactile switches, relays, a 16x2 LCD screen. I programming the ATmega328 chip and soldering it to some perfboard with the other components. I have the code, and I can create the thermostat itself, but I want to add wifi capability to the thermostat with an ESP8266. My goal is to change the temperature, view the temperature, and turn on the furnace using a computer or smartphone. The problem that I am encountering is that I am finding next to for how to upload and download information using the ESP8266. I know it is possible, but I don't know how. I know that I will probably have to host a server on a computer, and I am ok with that, but I don't know how to communicate with the ESP8266. I am still somewhat of a beginner. So, please excuse my incompetence. Any help would be appreciated. Thanks!

The ESP8266 module is an extremely poor choice for a beginner. I have found an English translation of the amazingly incomplete Chinese data sheet, and unless you are already very familiar with wifi and chip communications protocols, it will be a major challenge to get anything working.

Instructables are usually wrong, incomplete or at least misleading, but you might be able to make something out of this one: http://www.instructables.com/id/ESP8266-Wifi-Temperature-Logger

Greensprings:
sorry to be a pooper, but just buy one

www.nest.com

I could buy a smart thermostat or a wifi thermostat, but they are expensive. I am looking for a DIY solution for heating at my Dad's hanger. At the same time, I also want to use all my electrical components and research that I have been doing in a practical way. Thanks for the suggestion though. :smiley:

jremington:
The ESP8266 module is an extremely poor choice for a beginner. I have found an English translation of the amazingly incomplete Chinese data sheet, and unless you are already very familiar with wifi and chip communications protocols, it will be a major challenge to get anything working.

Instructables are usually wrong, incomplete or at least misleading, but you might be able to make something out of this one: http://www.instructables.com/id/ESP8266-Wifi-Temperature-Logger

I have come across that intructable in my research. It might turn out to be useful with the uploading data part of my goals (such as the current temperature). As for the ESP8266 being a poor choice...I am open to any suggestions of different hardware. I just chose the ESP8266 because of the price, compatibility with Arduinos, and the fact that I have seen many projects using them on Google and Youtube. Thanks for your suggestion! I am still open to any suggestions, even if they go about my goals in a completely different way or use different components. :smiley:

Just an update for you guys...I have had a suggestion from the ESP8266 forum to look into ESP8266 transparent bridge project (GitHub - beckdac/ESP8266-transparent-bridge: Absolutely transparent bridge for the ESP8266). I also found a video on Youtube that looks like it will be lots of help (Cheap and Easy WiFi (IoT) Tutorial Part 1 - ESP8266 Setup/Intro - YouTube), but the creator of the Youtube video hasn't put out his code yet. Therefore, I'm still not much closer to my goal. Help would still be appreciated. :smiley:

The Roving Networks wifi modules are much better documented and there is quite a bit of code "out there" for them. One option is at Sparkfun.

did you made it work? i'm also thinking on using this module... any help would be awesome!

fabmsg:
did you made it work? i'm also thinking on using this module... any help would be awesome!

No I haven't made any progress yet. I'm still trying to figure out all the code. I'm pretty a much a beginner. :smiley:

Just an update...I think I finally found the solution to the code that I was looking for. I found two Youtube videos that teaches how to send data from a webpage to an ESP8266 and how to have an ESP8266 send data to a webpage. I haven't had a chance to put together the code for the Arduino, but I have had a chance to put together a little bit of code for the webpage. I've included my HTML code, but it still needs quite a bit of work. I've never worked with HTML or PHP before, so I know that I probably made mistakes and missed stuff. The HTML requires another file (jquery.min.js). The link to that file, and the links to other files are in the descriptions of the videos.

Send Data From Webpage to ESP8266 (Toggle Arduino Pins From Webpage)
ESP8266 Send Data To a Website (ESP-01/ESP-12)

<html>
	<head>
		<title>Hanger Thermostat Control</title>
	</head>
	<body>
	<?php
		$var1 = $_GET['currenttemp'];
		$var2 = $_GET['targettemp'];
		echo "Current Temperature: ".$var1."\n";
		echo "Target Temperature: ".$var2."\n";
	?>
	

	

	<p> Furnace
		

		<button id="11" class="led" style="font-size:100%;width:100px;height:60px;">On/Off</button>
	</p>
	

	<p>
		Temperature
	

	
		<button id="12" class="led" style="font-size:125%;width:50px;height:60px;">-</button> 
		<button id="13" class="led" style="font-size:125%;width:50px;height:60px;">+</button>
	</p>
	<script src="jquery.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$(".led").click(function(){
				var p = $(this).attr('id'); // get id value (i.e. pin13, pin12, or pin11)
				$.get("http://192.168.4.1:80/", {pin:p}); // execute get request
			});
		});
	</script>
	</body>
</html>

Check out this discussion on the ESP8266 ESP8266 - Home Automation - Arduino Forum

jremington:
Check out this discussion on the ESP8266 ESP8266 - Home Automation - Arduino Forum

Thanks for the suggestion! I have been watching that topic too! I almost have all the code wrote up for the webpage and the Arduino. I should have it all the programming done in the next few days, but it will be a while before I can actually set it all up because I am waiting for some hardware to arrive from China.

Here is complete tutorial how to build ESP8266 thermostat with touch screen, Arduino Meaga 2560, ESP8266 and EasyIoT server (windows or Raspberry Pi):

ESP8266 thermostat