Author Topic: Internet of things - SHT31 to Wifi  (Read 2156 times)

0 Members and 1 Guest are viewing this topic.

Offline dupreezd

  • Forecaster
  • *****
  • Posts: 512
Internet of things - SHT31 to Wifi
« on: June 25, 2017, 06:54:52 PM »
Has anybody on this forum done this? I can hear it calling my name lol.
I have been playing with the Arduino for some time now doing a couple of projects and need something else to do in the house during the hot Houston summer time  :grin:

"Thinking" - a couple of these at various places in and around the house. Maybe have two (or more  :shock:)  in a shield to compare values. Store the data maybe in SQL. Write a nice web page to display all the data. mmm

https://www.controleverything.com/docs/SHT31-Connecting-Guide-ESP8266-Board
 [ You are not allowed to view attachments ]
Davis VP2 6163 | WiFi Logger
CWOP - FW0717
Blitzortung 2100

Offline vreihen

  • El Niņo chaser
  • Forecaster
  • *****
  • Posts: 1216
  • K2BIG
Re: Internet of things - SHT31 to Wifi
« Reply #1 on: June 25, 2017, 08:22:03 PM »
Here's a thread from a few months ago about my NodeMCU (ESP8266-based module) running a Lux, UV, and barometer/temperature sensor:

https://www.wxforum.net/index.php?topic=31308.0

I also have a one-wire thermometer keeping an eye on my garage freezer on another NodeMCU board.....
WU Gold Stars for everyone! :lol:

Offline dupreezd

  • Forecaster
  • *****
  • Posts: 512
Re: Internet of things - SHT31 to Wifi
« Reply #2 on: June 25, 2017, 08:43:45 PM »
Thank you for the link. Now I know it is possible and do-able.
I will order the parts and go from there.

Yep,  :idea: going to 'replace' my WS-1200 sensors somehow, will see. Not physically, but software wise as you have done. Thanks
Davis VP2 6163 | WiFi Logger
CWOP - FW0717
Blitzortung 2100

Offline vreihen

  • El Niņo chaser
  • Forecaster
  • *****
  • Posts: 1216
  • K2BIG
Re: Internet of things - SHT31 to Wifi
« Reply #3 on: June 26, 2017, 06:18:53 AM »
I wrote some ugly spaghetti code based on someone else's implementations to import the data as additional sensors in WeeWX.  Ideally, I would love to have a web server on each sensor and poll it for JSON records like a true IoT device, but for power savings and other reasons I decided to just push the readings to WeeWX via a web data collection app that I hacked together.

My next project is a heated rain bucket.  I picked up a cheap Acu-Rite tipping rain bucket, removed their electronics, and fitted a NodeMCU.  Was wrestling with software input debouncing in an interrupt routine when I put the project aside, but had a temperature sensor/relay/incandescent night light bulb circuit ready to go as a controlled heater for keeping the bucket above freezing in the winter.....
WU Gold Stars for everyone! :lol:

Offline dupreezd

  • Forecaster
  • *****
  • Posts: 512
Re: Internet of things - SHT31 to Wifi
« Reply #4 on: June 26, 2017, 08:39:46 AM »
Thank you blazing the trail with this. It appears you are the only one who did this which is quite surprising.
What coding did you use, PHP?

Cant wait for my stuff to get here and start playing.

Quote
Ideally, I would love to have a web server on each sensor and poll it for JSON records like a true IoT device, but for power savings and other reasons
I have a VM server that runs PFsense for firewall and other hosts. So, it needs to run 24/7 anyway. I will just add another VM to take care of the Webserver part.
Davis VP2 6163 | WiFi Logger
CWOP - FW0717
Blitzortung 2100

Offline vreihen

  • El Niņo chaser
  • Forecaster
  • *****
  • Posts: 1216
  • K2BIG
Re: Internet of things - SHT31 to Wifi
« Reply #5 on: June 26, 2017, 09:02:34 PM »
I built upon his work:

https://github.com/DanV410/weewx-sdr-arduino

IIRC, I think that I borrowed some code from here for the Raspberry Pi running weewx:

https://github.com/weewx/weewx/wiki/Raspberry%20Pi%20weather%20station%20with%20i2C%20sensors

Weewx is written in Python, so I had to hack up an example file to import the data from a scratch file.  The scratch file was created by a simple PHP script, because I have more experience with it.....
WU Gold Stars for everyone! :lol:

Offline dupreezd

  • Forecaster
  • *****
  • Posts: 512
Re: Internet of things - SHT31 to Wifi
« Reply #6 on: July 09, 2017, 12:40:48 PM »
Progress update.

I ordered 4 of the ESP-01 for $8 as well as the USB-FTDI adaptor. While I was waiting for the parts I got my Webserver with PHP up and running.  :grin:

First program was just to make a led turn on and off by sending commands to the ESP.
Then connected a DHT11 to it and after some   ](*,) and  #-o, I was able to read data from the ESP.  \:D/
I am not very impressed with the range, signal strength drops off real quick.  Might have to add an external antenna.
 [ You are not allowed to view attachments ]

Next step is to decide how am I going to store the data.


Davis VP2 6163 | WiFi Logger
CWOP - FW0717
Blitzortung 2100

Offline vreihen

  • El Niņo chaser
  • Forecaster
  • *****
  • Posts: 1216
  • K2BIG
Re: Internet of things - SHT31 to Wifi
« Reply #7 on: July 09, 2017, 02:03:06 PM »
Next step is to decide how am I going to store the data.

Weewx.  I have mine piped from weewx to Meteotemplate for archiving and display, since Jachym takes data reporting and accuracy very seriously.....
« Last Edit: July 09, 2017, 02:05:33 PM by vreihen »
WU Gold Stars for everyone! :lol: