Introduction: Weather Station Using Single Board - SLabs-32

In this instructable, we will be making a weather station which measures temperature, air humidity and soil moisture with our SLabs-32 board which also sends this data to the Cayenne cloud for data acquisition. We also simultaneously gets the current weather information from the internet and display it on the TFT screen. All this is done using one single board, which is SLabs-32 an ideal board for IoT-based projects.

To get your own SLabs-32 click on the link given below :

https://www.fabtolab.com/slabs-32

SLabs-32 has 2 onboard processors which are ESP8266 and Atmega328p. This board combines the high processing capabilities of 32 bit microcontroller L106 and numerous GPIOs available for HMI on the Atmega328p. With I2C as interprocessor communication, Slabs-32 board facilitates a combination of processing power and sufficient GPIOs for all your complex prototyping needs.

Step 1: List of Materials

For this project you would require :

  • SLabs-32
  • DHT 11 temperature and humidity sensor
  • Soil moisture sensor
  • PIR sensor (Optional)
  • Jumper Wires

Step 2: Hardware Connections

The connections are very simple. Follow the instructions and the circuit diagram given above, and you should have no problems.

Connecting DHT11 :

  • Vcc pin to SLabs-32's 3.3V output
  • GND to SLabs-32's GND pin
  • Data pin to 3

Connecting Soil moisture sensor :

  • Vcc pin to SLabs-32's 3.3V output
  • GND to SLabs-32's GND pin
  • Data pin to A0

Connecting PIR sensor :

  • Vcc pin to SLabs-32's 3.3V output
  • GND to SLabs-32's GND pin
  • Data pin to 2

The soil moisture sensor's data pin-out can either analog or digital, it's up to us to decide. In our case, we have used the analog data pin-out.

Step 3: Make an Account in Cayanne

Create an account in Cayenne. To do that go the link below:

https://cayenne.mydevices.com/cayenne/login

Sign up for an account and enter your Name, Email and create a Password.

Once you create an account, you then have to add your device so it can be accessed in the online dashboard. From your dashboard, you can remotely monitor and control your IoT devices.

Cayenne supports multiple devices and also a range of sensors, extensions and actuators.

In our project, we will select “Bring your own thing” as we are using a custom board. Once you click that it will show you the “MQTT USERNAME”, “MQTT PASSWORD” and “CLIENT ID” all these credentials are unique and is used to detect your device. Make sure you make note of these because you need to use these parameters in your code.

Step 4: Programming SLabs-32

Download the sketch files attached to this step.

After downloading the file, open the sketch of the Esp8266 module and do the following things :

  • Enter your WiFi credentials by editing the "SID[]" and "PASSWORD[]" variables in the code
  • Enter your MQTT username and password of provided by cayenne.
  • Enter your clientID provided by cayenne.

Once this is done, upload the code for both Atmega 328p and Esp8266 and get your weather station start working.

To know more about how to program SLabs-32 click on the link given below :

http://startoonlabs.com/Getting%20started%20with%2...

Step 5: Sit Back and Relax !

Once you have uploaded the code, it should run smoothly. Open your Cayenne account to see your sensor values being updated periodically. It's up to you how you want to customize your Cayenne dashboard, for demonstration purposes we have selected a simple widget.

This instructable is a continuation of the instructable given below

Making Weather Widget under 10 minutes

Make sure to follow us for more easy and quick IoT projects.

Resources :

DHT11 library used :

DHT11