IoT Weather Station With Adafruit HUZZAH ESP8266 (ESP-12E) and Adafruit IO (UPDATED)

31,688

224

20

Posted

Introduction: IoT Weather Station With Adafruit HUZZAH ESP8266 (ESP-12E) and Adafruit IO (UPDATED)

Hello, everyone ! Time ago I saw this Weather Station by Aleator777 and I was inspired to make my own weather station. I saw that the Intel Edison is too expensive in my country, so I decided to look for something much cheaper, and I found the Adafruit HUZZAH which is lot cheaper and I ordered one.

When the breakout arrived I start to build my IoT Weather Station, and now I will show you how to make your own and how to stream the data from it to Adafruit IO.

The weather station is using a DHT11, for measuring air humidity, a TMP102, for measuring air temperature a BMP180, for measuring the pressure and a prototyping PCB to build it. I know I am using too much sensors but that is because I had them, and if you ask I should use DHT22 and BMP180 or just one BME280 which reads - temperature, humidity, pressure and altitude.

The waether station measures the temperature in Celsius(it could be changed to Fahrenheit), the pressure in PSI - Pounds per square Inch and humidity in percentage. It also has deep sleep mode that can be controlled, by default is set on 5 minutes.

You can see the readings from my weather station here, they are for my home town - Polski Trambesh. - ONLINE

Step 1: Info About Adafruit HUZZAH ESP8266 (ESP-12E)

The ESP8266 processor from Espressif is an 80 MHz microcontroller with a full WiFi front-end (both as client and access point) and TCP/IP stack with DNS support as well.

Technical details:

  • Reset button,
  • User button that can also put the chip into bootloading mode,
  • Red LED you can blink,Level shifting on the UART and reset pin,
  • 3.3V out,
  • 500mA regulator (you'll want to assume the ESP8266 can draw up to 250mA so budget accordingly)
  • Two diode-protected power inputs (one for a USB cable, another for a battery)
  • Two parallel, breadboard-friendly breakouts on either side give you access to:
  • 1 x Analog input (1.8V max)
  • 9 x GPIO (3.3V logic), which can also be used for I2C or SPI2 x UART pins
  • 2 x 3-12V power inputs,
  • reset,
  • enable,
  • LDO-disable,
  • 3.3V output


Features:

  • 802.11 b/g/n
  • Integrated low power 32-bit MCU
  • Integrated 10-bit ADC
  • Integrated TCP/IP protocol stack
  • Integrated TR switch, balun, LNA, power amplifier and matching network
  • Integrated PLL, regulators, and power management units
  • Supports antenna diversity
  • WiFi 2.4 GHz, support WPA/WPA2
  • Support STA/AP/STA+AP operation modes
  • Support Smart Link Function for both Android and iOS devices
  • SDIO 2.0, (H) SPI, UART, I2C, I2S, IR Remote Control, PWM, GPIO
  • Deep sleep power <10uA, Power down leakage current < 5uA
  • Wake up and transmit packets in < 2ms
  • Standby power consumption of < 1.0mW (DTIM3)
  • +20 dBm output power in 802.11b mode
  • Operating temperature range -40C ~ 125C
  • FCC, CE, TELEC, WiFi Alliance, and SRRC certified

Step 2: Info About DHT11

The DHT11 is a basic, ultra low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a digital signal on the data pin (no analog input pins needed). Its fairly simple to use, but requires careful timing to grab data. The only real downside of this sensor is you can only get new data from it once every 2 seconds, sensor readings can be up to 2 seconds old.

Features:

  • Small size, low cost
  • Easy to use 3 to 5V power and I/O
  • 2.5mA max current use during conversion (while requesting data)
  • Good for 20-80% humidity readings with 5% accuracy
  • Good for 0-50°C temperature readings ±2°C accuracy
  • No more than 1 Hz sampling rate (once every second)

Step 3: Info About TMP102

TMP102 is a super small digital temperature sensor. The TMP102 is a digital sensor (I2C a.k.a. TWI), has a resolution of 0.0625°C, and is accurate up to 0.5°C. This is a very handy sensor that requires a very low-current.

Communication with the TMP102 is achieved through a I2C serial interface. There is no on-board voltage regulator, so supplied voltage should be between 1.4 to 3.6VDC. Filtering capacitors and pull-up resistors are included as shown.

Features:

  • 12-bit, 0.0625°C resolution
  • Accuracy: 0.5°C (-25°C to +85°C)
  • Low quiescent current
  • 10µA Active (max)
  • 1µA Shutdown (max)
  • 1.4V to 3.6VDC supply range
  • Two-wire serial interface
  • 2x Mounting Holes

Step 4: Info About BMP180

This is a breakout board for the Bosch BMP180 high-precision, low-power digital barometer. The BMP180 offers a pressure measuring range of 300 to 1100 hPa with an accuracy down to 0.02 hPa in advanced resolution mode. It’s based on piezo-resistive technology for high accuracy, ruggedness and long term stability. These come factory-calibrated, with the calibration coefficients already stored in ROM. What makes this sensor great is that it is nearly identical to its former rev, the BMP085!


Features:

  • Digital two wire (I²C, TWI, “Wire”) interface
  • Wide barometric pressure range
  • Flexible supply voltage range (1.8V to 3.6V)
  • Ultra-low power consumption
  • Low noise measurements
  • Factory-calibrated
  • Includes temperature sensor
  • Low-profile with a small footprint

Step 5: Tools & Materials for the Project

You will the following stuff:

Parts:

Tools:

  • Soldering iron
  • Hot glue gun
  • Clips

Step 6: Making the Circuit Board

Make it with the help of the prototyping board. Connect the SDA and SCK pins of the TMP102 and BMP180 sensors to pins 5 and 4 (like on Arduino UNO) of the HUZZAH module and the DHT sensor to pin 2. GND to GND on the board and the power input of the sensors to +3 V pin of the HUZZAH board. If you want put a hardware reset button so you can reset the board. Also add a battery connector so you can power it with a battery like me. Also you have to put jumper between pin 16 and RST of the HUZZAH board so the board wake up.

By default the time for sleep is set on 300s - 5 minutes, if you want you can change it.

I have putted additional headers for more sensors such as anemometer for measuring wind speed, pyranometer for measuring solar radiation, rain gauge for measuring liquid precipitation over a set period of time. So check this instructable regular for updates.

Step 7: Enclosure

My enclosure is a simple plastic box from nearest store, but you can use another box,a 3D printed, laser cutted or a normal plastic box. The box should have enough space for the main board, the battery and the sensors.

I putted the BMP180 and the TMP102 on the right side of the box and the DHT at the top.

I have pointed the digital sensors to North because of the Sun (its warming up the TMP102 sensor).

Step 8: Setting Up Adafruit IO

WATCH THE VIDEO !!!


Adafruit IO is giving you the opportunity to connect your device to internet and to read data from sensors or to control it remotely from every point on Earth (if you have internet of course), and in this step I will snow you how to set it up.

Go to Adafruit IO and sign up or sign in. Then the dashboard page will load, on this page are your dashboards. On left you will see a menu, click on feeds then on right you will see the create feed button(its blue) click on it. Name the feed temperature, add description and then click on the createfeed button(its grey) and your feed is done. Repeat the process for other feeds such as: humidity,pressure, altitude, etc.

Now go to Dashboards menu and create new dashboard, then add gauge and name it temperature, make the rest.

After that go to settings and click on View AIO Keys and copy your key, then paste it in the Arduino sketch. If you refresh your key you have to replace it. You can get your key from any of your feeds or dashboards by clicking on the key button which is on the right (it is yellow in color with small white key in it) then move to the next step.

If you forget to make the feeds don't worry, the module will create them for you !

NOTE: If you have issues with Adafruit IO, go to settings and destroy all IO data and IO account, then sign in with your Adafruit account.

Step 9: Download and Install the Software

This step is easy, just download .INO fileESP8266_Weather_Station_v1.0 - then open and it with the Arduino IDE put your WLAN name and password, add your Adafruit IO username and IO key. After that upload the code to the ESP8266 module with the help of FTDI cable.

Libraries:

BMP180 lib from SparkFun

DHT lib from Adafruit

Adafruit MQTT library

Download and unzip the libraries at - /Program Files(x86)/Arduino/Libraries (default).

Arduino IDE and ESP8266 set up:

Copy this link : http://arduino.esp8266.com/stable/package_esp8266c... open Arduino IDE and press H + comm to open preferences then paste it into Additional Board Manager URLs field. Restart Ardiuno IDE and go to boards manager, search for ESP8266 and download it.

Step 10: Congrats !!!

If you receive the data on you Adafruit IO account that means everthing is OK. Now you have your own weather station.

Bitcoin tips: 1Bfgrq4dQSuRHuTdk5jzZPtnMZLymDQ5dv

Share

Recommendations

  • Epilog Challenge 9

    Epilog Challenge 9
  • Sew Warm Contest 2018

    Sew Warm Contest 2018
  • Paper Contest 2018

    Paper Contest 2018
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

20 Comments

Is publish the command to send something to the API ?

fatal error: ESP8266WiFi.h: No such file or directory

fatal error: ESP8266WiFi.h: No such file or directory

For deep sleep to work properly:

"Everything behaves as expected, however, when i put my HUZZAH board into deep sleep (yes GPIO16 has to be connected to RST for this to work)."

I couldn't find this in the instruction, can you give me some feedback for this?

how often do you read sensors and how does the battery you choose last, with your setup, before recharging?

I read the sensors on every 5 minutes and I dont know how long it will take for the battery to discharge. I will tell you when this happens.

not so great, in the end... maybe updating online data a less often, or disabling wifi if not needed, or some low power optimization, will enhance the time...