ESP8266 Temperature Monitor. Get an alert if your fridge's temperature rises above 40 F (very dangerous!). For this project I used an ESP8266 ESP12e module with NodeMCU and Lua, along with a DHT11 for sensing the temperature. I also used a 10k ohm resistor between DHT11 data and DHT11 VCC. It can print out the temperature on a serial.
Sat Jan 03, 2015 6:25 am sancho wrote: cdrwolfe wrote:I'm beginning to wonder if this is possible at all using lua. For the life of me I can't get the chip to correctly control the gpio pins. With the DHT22 connected it is always set as high, calling gpio.write(pin, gpio.LOW) does nothing. If anyone else has any luck feel free to post it.
Regards Cdr Which version of ESP do you have? The very first ESP-01 did not have GPIO pins connected to the output pins of the board - therefore doing anything with the code would result in absolutely nothing. Wait so the ESP8266-01 with only GPIO0 and GPIO02 can't be used? I wish I had known that. I can connect a LED to ground and GPIO02 and switch it on and off using the write commands, but i'm guessing this is just internal resistance?
Apologies for the spelling mistakes, never got that far in testing the script to eek them out. Really the print codes did that?
Seems strange, I will remove them and see if it makes a difference, though i don't have an oscilloscope to view output. I'll also have a go at increasing tmr.delay. Though I suppose it is mute if i can't use the ESP8266-01 for this. Thanks for the help it is really appreciated as this is all new to me. Kind Regards Cdr. Sat Jan 03, 2015 9:36 am Right, removing the print calls got it to at least start the process, thanks Pig. The code was a port from, and there is a little confusion on my part about how to read the data.
The script below waits for it to drop low and then waits a specified time before reading again and checking whether it is high or low to get the bit data. The data sheet indicates to wait for low and the decide on bit value depending on length of high value, so it may be a timing issue.
Guess i'll have to experiment. Sat Jan 03, 2015 9:41 am If you can toggle an LED then it's a good port and should work fine for this. It's the timing that's going to be difficult to troubleshoot without some kind of logic analyzer/DSO. Best voice changing software. The DS18B20 code going around should verify that, assuming you have a DS18B20 to hook up.
This is not the first time I've seen the print function wreck otherwise perfectly good code. It's not even a matter of slowing it down - it just quits working for some reason. 0.9.4 firmware is also troublesome for me. I backed down to 0.9.2 (20141219) and things work much better all around. Haven't tried the 20141230 version. Your code is on the right track, I just haven't spent enough time going through it to figure out where things might be going wrong, and there's the difference between your DHT22 it was designed for and the DHT11 I have here. The Adafruit arduino code does make that distinction even if it might only be in the way it parses the returned data.
The analyzers are not too expensive. I'm using an older version of the Saele Logic 8 () which is no longer sold. They have a 4-line for $99. I've also used the clones () which is (ideally) the same thing internally and uses the Saele software. Quality control is nowhere the same, but two of the three ordered actually worked.