Post your best Lua script examples here

User avatar
By uber4
#13300 Hi,

I made a test with a DHT22 inside a dark box, uploading data every 15sec to thingspeak. Distance between DHT22 and ESP-01 was 4cm.

I tried powering the DHT22 from 3,3V output from AMS1113 with a 470uF cap. All the readings were very inaccurate, with +/- 2ºC temp and +/- up to 5% hum:
3V3.png
DHT22 3,3V


My next try was powering the DHT22 with 5V, using a simple resistor divider to communicate with the ESP-01. Data was really stable, with +/- 0,2ºC temp and +/- 1,5% hum:
5v.jpg
DHT22 5V


Hope this helps.
User avatar
By Nabila Aziz Shifat
#20597 Hi

Thanks for the code but I am not understanding the code. if you could slightly explain how the code works that could have been of great help to me. I am confused with the serial communication and how we are saving and reading the data from the GPIO2 .

Thank you.