Raspberry pi 3 Tutorial Connecting DHT11 Temperature and humidity Sensor with Raspberry pi

Tutorial on Connecting Raspberry Pi 3 temperature sensor  to Thingsio.ai 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:

  1. 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.
  2. 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.
  3. Download the OS for raspberry pi 3 “Raspbian stretch with desktop” from the link: https://www.raspberrypi.org/downloads/raspbian/ .
  4. Completely format the SD card through SD card formatter.
  5. 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 .
  6. Flash the OS Raspbian stretch through Win32 Disk Imager
  7. Make “ssh”and wpa_supplicant.conf file in notepad as type “All Files” 
  8. 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}
  9. Eject the SD card and attach into the raspberry pi.
  10. Wait for the booting of raspberry pi.
  11. Scan the IP addresses attach through Advance IP scanner and enter “168.0.1-254, 192.168.137.1-254”.
  12. Open the putty and enter the IP address of your raspberry pi in SSH option. Port number will be the same. Click on Open.
  13. Enter the Login as “pi” and password as “raspberry”. This is default.
  14. To enable the ssh on raspberry pi. Enter the “sudoraspi-config”.  
  15. Navigate to the Advance options  and hit enter. Enable the ssh option.
  16. Install the vnc server. Enter the “sudo apt-get install tightvncserver”.
  17. After that, enter the “tightvncserver”. You will see the console like this.
  18. Open the VCN Viewer and register.
  19. 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.
  20. Click on connect option. You will be now in raspberry pi OS.
  21. 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.

    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

  22. Register the account in http://thingsio.ai/#/register. 
  23.  You will get the notification for sign up.
  24.   Go in your email address and verify your account. You will get the  notification  for the email verification   
  25.  After that, sign in your account with your email address and password
  26. Now, you will be on the project dashboard of your account. Click on the  new  project option:
  27. Click on the add a new device option:
  28. You will get your Device ID. After that, Enter the device name and click on the create and configure device:
  29. 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)                           
  30. 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.
  31. Click on the “Send trial data” to send a trial data to the server:

    Part III: Setting up Raspberry Pi 3

    Now switch back to your Raspberry pi compiler. The new few steps you have to do it you project and is related to raspberry pi 3.

  32. Open the terminal page and enter:sudo apt-get updatesudo apt-get upgradesudo apt-get install git-coregit clone git://git.drogon.net/wiringPi
  33.  After that, open the Geany programmer’s editor.
  34. Before compiling and executing a program with WiringPi library in Geany Programmer’s Editor, we should add few lines in build settings. To add these lines, click on Build and select Set Build Commands which is shown as follows:
  35. Modify C and Execute commands section for compiling and executing program using WiringPi Library shown as follows and click on OK.
  36. Go in sample device code options in http://thingsio.ai/
  37.  Copy and paste the sample code into your editor/compiler in “file.c”.
  38. Now, click on the configure device option

Part IV:Charting and visualizations on Thingsio.Ai

  1. You can set the special parameters (this is tracked on the dashboard) & transform it accordingly and add new  
  2. Click on the update device option:
  3. You can also set your device geographical location
  4. To create a graph for your device click on the “create graph option”.
  5. Click on the preview option and click save change
  6. Attach the DHT11 sensor on GPIO pin
  7. Click on the build option and build the code
Sign up to receive weekly updates

 

Please follow and like us:
0

Leave a Reply

Your email address will not be published. Required fields are marked *