Professional Documents
Culture Documents
instructables (/circuits/)
circuits
Projects (/circuits/projects/) Contests (/contest/) Let's Make...
advertisement
Download Favorite
(https://cdn instructables
auto=webp&frame=1&fit=bounds&md=1509322843)
com/ORIG/FIB/Z48W/J98RL5BZ/FIBZ48WJ98RL5BZ jpg?
(/member/PraetorianCZ/)
By PraetorianCZ
(/member/PraetorianCZ/)
More by
www.terracontrol.cz
the author:
(http://twitter.com/praetoriancz)
Follow
About: Technology geek, love discovering new possibilities... More About PraetorianCZ » (/member/PraetorianCZ/)
QUESTION: Would you be interested in new version using Wemos D1 mini and both DS18 sensor
(for temperature) and DHT22 (for humidity)? Let me know in the comments. Thanks!
/
If you like this project, please VOTE for it in the Wireless contest... Thank you all very
much!
Hey guys,
after few months of playing with ESP8266 I nally got new version of TerraControl I'm satis ed
with and willing to share with you. Some of you might notice I'm skipping version 2.0...that's
because that version was using mostly the old code with few additions but it was still messy as
hell. Thanks to Blynk I was able to cut over 600 rows of code to 100 rows of much simple code!
What's changed?
Little adjustments is the physical connections. Mainly because of the DHT sensor which could
not be connected while booting up in the old version. It is all xed now and no power
blackout will mess with your settings.
No ESP8266 WebServer. Which is a good thing, trust me on this.
Total control via Blynk app. From anywhere in the world, you can control anything you want. I
know this might sound as an advertisement, but I really grew to like Blynk.
Much more possibilities - whole household connected and controllable/monitored via one
app.
advertisement
(https://cdn instructables
auto=webp&frame=1&fit=bounds&md=1509326405)
com/ORIG/FWE/9WL9/J98RL6X5/FWE9WL9J98RL6X5 jpg? (https://cdn instructables
auto=webp&frame=1&fit=bounds&md=1509326406)
com/ORIG/F84/3ENU/J98RL6XF/F843ENUJ98RL6XF jpg?
/
NodeMCU 1.0 12E board - $3.32 (https://www.ebay.com/itm/ESP8266-ESP-12E-CH340G-WIFI-
Network-Development-Board-Module-For-NodeMcu-Lua/201743743504?
epid=581455279&hash=item2ef8dd3a10:g:Qk8AAOSwF3JZga5A)
Relay board - for example - $5.90 (https://www.ebay.com/itm/NEW-4-Four-Channel-relay-
module-with-opto-isolated-compatible-3-3V-and-5v-signal/122712496311?
hash=item1c923c18b7:g:tR4AAOSwna1Zv8Kj) (https://www.ebay.com/itm/NEW-4-Four-
Channel-relay-module-with-opto-isolated-compatible-3-3V-and-5v-signal/122712496311?
hash=item1c923c18b7:g:tR4AAOSwna1Zv8Kj)
Temperature and humidity sensor DHT22(11) - $2.87 (https://www.ebay.com/itm/1PCS-
DHT11-DHT22-AM2320-AM2302-Digital-Temperature-Humidity-Wemos-Sensor-
M85/152363526589?hash=item237992e9bd:g:kS0AAOSwhdRYWQPB)
Given the nature of NodeMCU board (its output is only 3.3v) you will either have to buy 3.3V
relay board (in the link above), or modify 5v board, or buy I2C logic converter module - for
example (https://www.ebay.com/itm/2Pcs-4-Channel-IIC-I2C-Logic-Level-Converter-Bi-
Directional-Module-5V-3-3V/221919114584?hash=item33ab68f558:g:NvIAAOSw5VFWJwmj)-
$0.9
5V source (I'm using older usb charger)
wires
solder
case/box
Arduino IDE
relayLight --> D1
relayHeat --> D2
relayHeat2 --> D5
relayFan --> D9 (RX pin on NodeMCU)
You need to power the modules according to their specs. If you are using 3.3v relay board, you
can power it straight from the NodeMCU, otherwise you need to use external 5V.
I'm using my old parts and case, only needed to switch two wires...
/
For those who don't know what Blynk is, it is a Platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet. It's a digital dashboard where you can
build a graphic interface for your project by simply dragging and dropping widgets. You might
need to purchase some energy in the Blynk app but I think $4-5 is a good price for project like
this.
Let's start on Andorid device (iOS version doesn't allow adding widgets or editing Eventor
events yet):
Use the widget settings as seen on the last picture (if you set it up di erently you will need
to modify the code)
In the project settings (nut icon on the top) "Send app connected command" to ON.
Close the settings and open Eventor
/
Add Tip V Ask Question | Comment Download
Step 3: Eventor
When you are done, close the Eventor and hit the play button on you project.
I hope you get the idea. If you start playing with Eventor you will discover more possibilities and
options. In the current setup, the Light and Heat is automated and Heat2 and Fan manually
controlled, but all four features can be controlled simply via pushing the button and it will
override your current settings until the next condition is met.
Connect your board to the computer re up the Arduino IDE, open the source code and let's
have a quick look at it...
Libraries
ESP8266WiFi.h
DHT.h
BlynkSimpleEsp8266.h (from the Blynk library)
That's it! You can upload the code and check on you phone that it is connected.
For full disclosure I'm still using the opposite states for relay 3 & 4 (Heat2 & Fan) from the rst
version (https://www.instructables.com/id/TerraControl-V10-With-NodeMCU-Webserver/). See
the picture. Heat has states HIGH when the Blynk button is ON, LOW when OFF. The Heat2 has
the opposite states.
TerraControl_v3.0_INS…
Download (https://cdn.instructables.com/ORIG/FJ7/T8JM/J98RLFV8/FJ7T8JMJ98RLFV8.ino)
(https://cdn.instructables.com/ORIG/FJ7/T8JM/J98RLFV8/FJ7T8JMJ98RLFV8.ino)
/
Step 5: Working...? Great!
(https://cdn
auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=1509338414)
instructables com/ORIG/F0V/TWIK/J98RLGXZ/F0VTWIKJ98RLGXZ jpg? (https://cdn auto=webp&frame=1&height=1024&fit=bounds&md=1509330014)
instructables com/ORIG/FKK/5OXW/J98RL9PW/FKK5OXWJ98RL9PW png?
You might come up with even better solution of using the Eventor. To clarify the use of LED
widgets: When you press a button or the Eventor sends a switch event, the code will at rst
switch the relay to the desired state and then re a virtualWrite to turn the corresponding LED
ON/OFF. This way you always know whether or not was your action successful (might be cause
of connection issues but it did not happened while I was using this app for the last two months).
History graph is not necessary but a nice feature to have, it is using the same data we are
sending to the Labeled values and stores them on Blynk server. You can have much more data
available to you with the export option, which was not possible with the previous version.
This setup is universal. I believe I managed to clear up the code as much as it was possible with
the same functionalities and more. You can use it to control your terrarium, aquarium, garden,
aqua-phonic systems, incubators, etc. Just have fun and if you like this project, leave a
comment. I'm sorry if I skipped some setup or something is not clear enough. In that case, send
me a PM and I will x it asap. Thank you for reading!
advertisement
advertisement
/
Participated in the
Wireless Contest (/contest/wireless2017/)
View Contest
/
robert.stark.73 (/member/robert.stark.73/) made it!
I Made It!
Recommendations
(/id/Build-a-Pocket-RGB-LED-Light-for-Your-
Home-Photo-S/)
8
3 469
(/contest/puzzles2020/) (/contest/handsfree/)
Add Tip
V Ask Question
/
| Post Comment
11 Discussions
(https://cdn.instructables.com/ORIG/FXO/ZX3H/JTYNDW7L/FXOZX3HJTYNDW7L.jpg?
(https://cdn.instructables.com/ORIG/F7U/M8HW/JTYNDW7S/F7UM8HWJTYNDW7S.jpg?
fit=bounds&height=1024) fit=bounds&height=1024)
/
(https://cdn.instructables.com/ORIG/FWO/0OOI/JTYNDW7W/FWO0OOIJTYNDW7W.jpg?
(https://cdn.instructables.com/ORIG/FWO/0OOI/JTYNDW7W/FWO0OOIJTYNDW7W.jpg?
fit=bounds&height=1024)
1 reply F
PS: Ok i looked into the code and in my option is useless to use with live animal. The problem is that all the
computing is on blynk side, so when the heater is on and we lost internet connection in house we can cook
our snake or other animal :(
1 reply F
Post Comment
advertisement
advertisement
/
Categories About Us Resources
Circuits Living Who We Are Sitemap (/sitemap/)
(/circuits/) (/living/) (/about/) Help (/id/how-to-
Workshop Outside Why Publish? write-a-great-
(/workshop/) (/outside/) (/create/) instructable/)
Craft Teachers Jobs (/jobs/) Contact (/contact/)
(/craft/) (/teachers/)
Cooking
(/cooking/)
Find Us