EcoRenovator  

Go Back   EcoRenovator > Improvements > Geothermal & Heat Pumps
Advanced Search
 


Blog Register 60+ Home Energy Saving Tips Recent Posts Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Display Modes
Old 01-19-21, 02:15 AM   #11
Acuario
Apprentice EcoRenovator
 
Join Date: May 2011
Location: Tortosa, Spain
Posts: 218
Thanks: 2
Thanked 75 Times in 44 Posts
Default

Sounds interesting...
The ESP32 is a good option if starting from nothing as you say, more GPIO and ADC possibilities. There is also onboard bluetooth and it is also possible to connect an ethernet interface. I think the memory is the same though as an ESP12 (which is what I use), 4Mb, although this should be more than enough. It didn't exist when I started my controller, that's why I used the ESP8266.

I added my own design expansion board (controlled with I2C) with a 4 channel ADC and 8 channel I/O to overcome the limitations of the ESP8266 - as I designed my own pcb I also incorporated all the driver circuitry, connectors and relays onto the board. You could certainly build a controller without a custom pcb, just connecting to expansion modules directly with wires.

As stated above, I tried with DS18B20 sensors but in the end went back to 10K NTC sensors.

I control the pump, fan and reversing valve with mechanical relays and the compressor with a SSR, the SSR should work with a 3.3V control but as I have my I/O I'm using a 5V input.

Originally I had a physical interface (buttons and OLED display) for programming but I abandoned that and went 100% web based as it's much more flexible and easier to program.

As an IDE I (still) use the Visual Micro extension to Visual Studio - does pretty much everything I need.

I think most of the libraries I'm using support ESP32 so it shouldn't be too difficult to move to ESP32.

I've attached my code - it's somewhat documented so hopefully understandable. There are a few bits of legacy code and some bits I use when testing out possible new features but that shouldn't cause any problems.

It looks like cloudMQTT no longer have free MQTT accounts so you'll need to look elsewhere and update the MQTT details.

openweather shouldn't be a problem.

Maybe it's worth buying a WemosD1 and loading the code onto that, from there you can move to the ESP32. It should all run quite happily on the WeMos, even without sensors or relays connected. You can check out the web interface etc...


You need to add a file Passwords.h with the following:
Quote:
#pragma once

//Arduino OTA password
constexpr auto OTA_PASSWORD = "<your ota password>";

//MQTT (cloudMQTT.com)
constexpr auto MQTT_USER = "<your username>";
constexpr auto MQTT_PASS = "<your password>";
constexpr auto MQTT_HOST = "m20.cloudmqtt.com";
constexpr auto MQTT_PORT = 19167;

//Wifi networks - add more in WiFiWPS.cpp for more networks
constexpr auto SSID_1 = "<your ssid>";
constexpr auto PASS_1 = "<your pass>";
constexpr auto SSID_2 = "<your ssid>";
constexpr auto PASS_2 = "<your pass>";

//Weather (openweathermap.org)
constexpr auto CURRENT_WEATHER = "/data/2.5/weather?id=3107677&units=metric&APPID=<your id>";
constexpr auto FORECAST_3HR = "/data/2.5/forecast?id=3107677&cnt=3&units=metric&APPID=<your id>";
And a file board.txt
Quote:
# HPControllerESP build property overrides
#
network.password=<your ota password>
network.auth_upload=yes
network.port=8266

# Force LittleFS Usage for ESP8266
runtime.tools.mkspiffs.path=notTheToolYoureLooking For
Have fun! Let me know if you need any help.

Attached Files
File Type: zip data.zip (78.5 KB, 23 views)
File Type: zip HPController.zip (42.8 KB, 26 views)
Acuario is offline   Reply With Quote
The Following User Says Thank You to Acuario For This Useful Post:
Automate (01-28-21)
Old 01-19-21, 11:36 AM   #12
jeff5may
Supreme EcoRenovator
 
Join Date: Jan 2010
Location: elizabethtown, ky, USA
Posts: 2,384
Thanks: 403
Thanked 604 Times in 506 Posts
Send a message via Yahoo to jeff5may
Default

Tyvm! I've been looking at the original version for awhile now, I think I have a good grip on the overall operation. Haven't dug deep inside subroutines to see exactly where the rubber hits the road, but it works, so for the moment I shouldn't need to.

So you used a wemos d1 module? Mini, pro, or something else version? No indicators at the MCU board at all, totally relying on the WiFi for comms? I like to at least flash the onboard LED (if equipped) with a heartbeat or blink code, just for live status dead reckoning. When shtf, a quick look see to verify status can save all manner of wonder why. Kind of like a furnace control.

Last edited by jeff5may; 01-19-21 at 12:35 PM..
jeff5may is offline   Reply With Quote
Old 01-19-21, 12:45 PM   #13
Acuario
Apprentice EcoRenovator
 
Join Date: May 2011
Location: Tortosa, Spain
Posts: 218
Thanks: 2
Thanked 75 Times in 44 Posts
Default

I actually have my own designed board that I use - it is actually a slightly hacked board that I use for my thermostats but it has everything I need. It has the ESP-12 soldered onto the pcb - I just suggested the WeMos as a quick hack as I use this as it can be re-programmed via the com port as it uses the RTS to reset - my board doesn't - sometimes the mods throw a wobbly so it's just easier to use the WeMos.

I get the idea about the led - problem sometimes with the ESP8266 is it uses one of the gpio lines and it can be different on different boards.

You'll see there is a watchdog in the code that resets (or should) if something goes wrong. So far I've not had any lockups that I'm aware of - the occasional reset (no idea why) but it always recovers.
Acuario is offline   Reply With Quote
The Following User Says Thank You to Acuario For This Useful Post:
jeff5may (01-21-21)
Old 01-19-21, 01:11 PM   #14
Acuario
Apprentice EcoRenovator
 
Join Date: May 2011
Location: Tortosa, Spain
Posts: 218
Thanks: 2
Thanked 75 Times in 44 Posts
Default

A few pointers..
If you get the code up and running then:
If you open Windows Explorer and go to Network you should see your heatpump listed there, double click to open the web interface..

If you open the web interface and go to <your IP>/debug.html you'll see the debug output from all the routines.

With no sensors connected the sensors return -6c, this will force a defrost cycle to occur at regular intervals..
Acuario is offline   Reply With Quote
Old 01-19-21, 11:44 PM   #15
jeff5may
Supreme EcoRenovator
 
Join Date: Jan 2010
Location: elizabethtown, ky, USA
Posts: 2,384
Thanks: 403
Thanked 604 Times in 506 Posts
Send a message via Yahoo to jeff5may
Default

I had to go google for a minute to figure out what a esp12 was. Doh, it's the same 8266, stripped down. Does it even have a status LED? For 3 bucks shipped to my house, anything more than an unpopulated pcb is a bonus!

https://www.ebay.com/itm/NodeMCU-Lua...4-80ad70937bf3

Oh wait, that's considered a dev board. It has a micro usb port, a reset button and other accessories!

jeff5may is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:54 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Ad Management by RedTyger
Inactive Reminders By Icora Web Design