Skip to content

An IoT project using an ESP8266 to read sensor values and send them to Thingspeak.

License

Notifications You must be signed in to change notification settings

Aeprox/ESPLogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESPLogger

An IoT project using an ESP8266 wifi-module to read temperature/humidity/illuminance sensor values and send them to Thingspeak. This project is written in Lua and uses the nodeMCU firmware to run lua on the ESP8266.

This project is licensed under the terms of the MIT license. See full license in LICENSE.md

Hardware

  • Any ESP8266 module with GPIO12,13 and 14 pinned out (eg ESP-07,ESP-12)
  • DHT22 temperature and humidty sensor
  • Supports BH1750fvi and TSL2561 Illuminance sensor
  • A USB-to-TTL or arduino to flash the ESP module

ESPLogger schematic

Software

Installing & configuring

  1. Flash the module with the 0.9.6-dev_20150627 build (only tested with floating point builds)
  2. Reboot in user mode
  3. Configure the following settings in usersettings.lua
  • Configure Thingspeak write channel and update interval in usersettings.lua
  • Configure wireless SSID and password
  • Select illuminance sensor (default: none)
    • For tsl2561 sensor: select gain and integration time (default: no gain, 402ms)
  • (Optional: In case you don't use the default hardware wiring as mentioned in the settings above, change the pin values in usersettings.lua)
  1. Upload the following lua files to the module.
  2. usersettings.lua
  3. either bh1750.lua or tsl2561.lua and i2cutils.lua
  4. readsensors.lua
  5. thingspeak.lua
  6. init.lua
  7. Compile all files except usersettings.lua and init.lua to .lc files and delete the original .lua files. You may have to reboot sometimes to clear some heap when the module won't compile the files
  8. Reboot and watch the serial interface to see the magic happen.

If all went well you should now start seeing text on the serial interface (baudrate 9600). If it keeps reconnecting, you might have network issues. Try using some of the nodeMCU API commands to figure it out and/or send me an Issue on github.

Changelog

ESPLogger v1.1 (2015-08-01)

  • Updated to nodeMCU 0.9.6-dev_20150627 (no longer compatible with previous builds)
  • Use new DHT22 C module (instead of lua module) that comes integrated with latest nodeMCU
  • Support for node.dsleep()! Huge powersavings. See usersettings.lua to enable
  • A more versatile approach to the thingspeak code.

ESPLogger v1.0 (2015-06-15)

  • Supports DHT22, BH1750 and TSL2561
  • Sends data to thingspeak
  • No power savings included (yet!)

Known issues

  1. Some cheap chinese modules come with incorrect silkscreen/wrong pin-numbering. Double-check!
  2. The esp8266 can't connect to AES-protected networks (afaik? user input is welcome!)
  3. Weird crashes? Memory issues? Send us a an issue report on github please.

Thanks to:

nodeMCU firmware & TSL2561 library

About

An IoT project using an ESP8266 to read sensor values and send them to Thingspeak.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages