Raspberry Pi 3 Model B IoT Project Tutorial Connecting DHT11 Temperature Sensor to Cloud

The Raspberry Pi 3 Model B is the earliest model of the third-generation Raspberry Pi. It replaced the Raspberry Pi 2 Model B in February 2016.The Pi isn’t like your typical machine, in its cheapest form it doesn’t have a case, and is simply a credit-card sized electronic board of the type you might find inside a PC or laptop but much smaller.

The goal of this tutorial is to enable you to send capture and send data to cloud from your device. Before starting this tutorial make sure you have your Raspberry pi and DHT11 Humidity and temperature sensors handy, so that this tutorial should go smoothly.

Part I: Installation and settings of Raspberry pi:

You can have hardware like HDMI cable, LAN cable, SD card 8/16 GB, DHT11 and one data cable with your device raspberry pi 3.

Download and install the softwares: Advance IP scanner, SD card formatter, XLaunch and Xming, Putty, VNC Viewer and Win32 Disk Imager for installation and settings for Raspberry Pi 3 on windows platform.

Download the OS for raspberry pi 3 “Raspbian stretch with desktop” from the link: https://www.raspberrypi.org/downloads/raspbian/ .

Completely format the SD card through SD card formatter.

You can follow this link for unallocated space in SD card. https://www.isumsoft.com/computer/how-to-use-unallocated-space-on-usb-drive.html .

Flash the OS Raspbian stretch through Win32 Disk Imager

Make “ssh”and wpa_supplicant.conf file in notepad as type “All Files”

Enter your wi-fi credentials like this in wpa_supplicant.conf and save it. Now, you can access remotely your raspberry pi through your windows system. ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdevnetwork={ssid=”YOUR_NETWORK_NAME”psk=”YOUR_PASSWORD”key_mgmt=WPA-PSK}

Eject the SD card and attach into the raspberry pi.

Wait for the booting of raspberry pi.

Scan the IP addresses attach through Advance IP scanner and enter “168.0.1-254,”.

Open the putty and enter the IP address of your raspberry pi in SSH option. Port number will be the same. Click on Open.

Enter the Login as “pi” and password as “raspberry”. This is default.

To enable the ssh on raspberry pi. Enter the “sudoraspi-config”.

Navigate to the Advance options and hit enter. Enable the ssh option.

Install the vnc server. Enter the “sudo apt-get install tightvncserver”.

After that, enter the “tightvncserver”. You will see the console like this.

Open the VCN Viewer and register.

In VNC Server, Go in File-> New connection and enter the same IP address which you gave in putty and write the Name of device.

Click on connect option. You will be now in raspberry pi OS.

Raspberry pi 3 side of the setup is now done. We will park it here for few minutes and setup cloud account, which will give you sample code to paste it back. Cloud account will be setup on Thingsio.ai, which enables the raspberry pi to send, store and visualize your sensor data.

Raspberry Pi 3 Model B Connection to DHT11 Sensor

        // Your code here

Part II: Setting up Cloud Account on Thingsio.AI

ThingsIO.AI is aIoT Platform for developers. As a developer we understood the pain of not having a seamless place to connect, analyze and process device data. Many pure analytics platforms does not offer device management, which is core for the iot. That is the reason of ThingsIO.AI

Register the account in http://thingsio.ai/#/register.

You will get the notification for sign up.

Go in your email address and verify your account. You will get the notification for the email verification

After that, sign in your account with your email address and password

Now, you will be on the project dashboard of your account. Click on the new project option:

Click on the add a new device option:

You will get your Device ID. After that, Enter the device name and click on the create and configure device:

You will be on your device dashboard: track your device’s special parameters here.This can be set in the device configuration(default to null)

Go in sample device code options and click on the Raspberry pi. You will get the sample code from there copy and paste into your vi-editor or Geany programmer’s editor.

Click on the “Send trial data” to send a trial data to the server: