ESP8266 (Standalone) Weather Station Using Arduino IDE and GadgetKeeper Cloud Platform
by sibuntu in Circuits > Arduino
19357 Views, 141 Favorites, 0 Comments
ESP8266 (Standalone) Weather Station Using Arduino IDE and GadgetKeeper Cloud Platform
This is an upgrade of my earlier project GadgetKeeper-Weather-Station. In this project I am building the same functionality but only using ESP8266 WiFi SoC standalone with DHT11 temperature and humidity sensor. In the previous project i used Arduino Uno and Arduino Ethernet Shield to send temperature and humidity readings to GadgetKeeper Cloud Platform which I replaced with ESP8266 WiFi SoC for this one.
Parts
1× ESP8266-07
1x CP2102 usb to uart bridge
1x Bread Board Power Supply
1x 12V AC-DC Power Adaptor
2x 400pin Breadboard Wires
1× DHT11 temperature/Humidity sensor
1x 10k resistor
1x mini push button
Wires
Prepare the Hardware
ESP8266 Wiring
PIN name | Connection
Reset | via push button to gnd
GPIO12 | DHT11 data pin
VCC | 3V3
TXD | CP2102 TXD
Pin RXD | CP2102 RXD
Pin GPIO0 | GND
GND | GND
CP2102 Wiring
PIN name | Connection
TDX | ESP8266 TXD Pin
RXD | ESP8266 RXD Pin
GND | GND
DHT11 Wiring
PIN name | Connection
VCC | 3V3
DATA | ESP8266 GPIO12 Pin and 3V3 via 10K resistor
GND | GND
NOTE: for DHT11 sensor, don't forget to connect a 10K resistor from the data pin to VCC
NOTE: to upload code to ESP8266 first connect GPIO0 pin to ground, reset the ESP8266 WiFi module (I have done it via push button connected to ESP8266 reset pin and GND) then upload code. After uploading code GPIO0 can be disconnected again.
Prepare Arduino IDE
Enter
http://arduino.esp8266.com/stable/package_esp8266com_index.json
into Additional Board Manager URLs field in the Arduino v1.6.4+ preferences.
Next, use the Board manager to install the ESP8266 package.
Configure GadgetKeeper
Create the "weatherStation" thing first:
Then create the "temperature" and "humidity" properties under weatherStation as follows.
- In the "Thing: weatherStation" tab, open "Property"
- Click to open "Create Property" dialog
- Set name of the property "temperature"
- Select "persistent" as the property type (property value would be persisted by the GK)
- Select "float" as the data type for this property
- Save property
- In the "Thing: weatherStation" tab, open "Property"
- Click to open "Create Property" dialog
- Set name of the property "humidity"
- Select "persistent" as the property type (property value would be persisted by the GK)
- Select "float" as the data type for this property
- Save property
If you need detailed "point and click" UI instructions how to create thing see "Create, Read, and Write Property" on GadgetKeeper Documentation.
Then create the "weather Station" API Key
- Open "API Keys"tab in GadgetKeeper Console
- Click "New" to open "Create API key" dialog
- Set name "weather Station API key"
- Select things: "weatherStation"
- Check in Granted permissions "All"
- Save API Key
For more information see "GadgetKeeper API" on GadgetKeeper Documentation.
Arduino Sketch
This is the arduino sketch for this cheap homemade IoT device.
Information about uploading Arduino Sketch can be found here.
Create GadgetKeeper Dashboard Widget
- Open "Dashboards" tab in GadgetKeeper Console
- Click "New" to open "Dashboards" dialog
- Set Title "weather Station"
- Save Dashboard
Go to Add Widget and select "Event/Property Gauge"
Select Title: "Temperature
Select Thing: "weatherStation"
Data source: "Property"
Select Attributes: "value"
Select Refresh rate, seconds: 5
Click Apply and Save widget
- Open "weather Station Dashboard" tab
- Go to Add Widget and select "Event/Property Gauge"
- Select Title: "Temperature"
- Select Thing: "weatherStation"
- Data source: "Property"
- Select Property: "temperature"
- Select Attributes: "value"
- Select Refresh rate, seconds: 5
- Click Apply and Save widget
Create humidity dashboard
- Open "weather Station Dashboard" tab
- Go to Add Widget and select "Event/Property Gauge"
- Select Title: "Humidity"
- Select Thing: "weatherStation"
- Data source: "Property"
- Select Property: "humidity"
- Select Attributes: "value"
- Select Refresh rate, seconds: 5
- Click Apply and Save widget