-
1Step 1
Get the parts... Some in the parts list are for the different iterations of the project.
Basically you need a good 3.3v regulator, the ESP8266 and a DHT11/22.
I'm sure you have all the others just laying around.
-
2Step 2
I included a crude schematic in the gallery but here is the basic wiring.
I'm assuming you already have the ESP flashed with the Node-Mcu firmware and your HC-05 already configured to 9600 8N1.
- Give 3.3v to both the Vcc and CH_PD pins.
- Ground the GND pin of course.
- Paying attention to polarity use the 1000uf cap on the 3.3v input and ground.
- GPOI0 to the DATA pin on the DTH11/22 with a 10k pullup to 3.3v.
- DTH11/22 power and ground as you would guess.
- Power the HC-05 as normal and connect up the TX and RX properly to the ESP
-
3Step 3
Software... err Code stuffs
The GitHub link on the project page will get you the three scripts I am using. It really could all be in the init.lua. but I like the separation. The compile steps are really optional but you save a lot of heap by doing so. If you decide not to compile or your version of the node-mcu firmware does not include "compile" make sure you modify init.lua to reference 'server.lua' instead of 'server.lc'
- Upload either the dht11 or dht22 script.
- Modify server.lua for the series of sensor you are using. (I tried to comment it)
- While still in server.lua replace 'XXXXXXXXXXXXXXX' with your ThingSpeak API key.
- Upload the server.lua script.
- node.compile("dhtxx.lua")
- node.compile("server.lua")
- optionally file.remove("server.lua") and file.remove("dhtxx.lua")
- Upload the init.lua and node.restart()
On your console you should see one or two periods then the IP Address the module was assigned. From there on start watching your ThingSpeak feed.
** again the code in the lua scripts was grabbed from all over the place. If I ended up using anyones super secret ideas I apologize. I can't recall where I collected all the snippets... 2am and coffee fueled as I was...
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.