Components required :

For this project you would require :

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

The connections are very simple. Follow the instructions and the circuit diagram given in the picture below

, 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.


Creating an account in Cayenne:

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.

Programming SLabs-32

Download the files attached to this project.

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%20SLabs-32.pdf

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.