Summary:
This Project aims in the building of one application of robots in the automation of Collecting environmental aspects. The robot supports remote performance monitoring and maintenance of various factors of the environment in any given area. The details of the design, setup and the use of the robot in Data Acquisition (DAQ) system are given here. The sensors provide accurate and reliable real time data needed for autonomous monitoring and control of any type of area or industry. Data Acquired by the proposed system can be remotely accessed, plotted and analyzed. This provides a fully automated solution for the monitoring and control of remote locations.
Fig. 1: Prototype of Arduino based Land Rover Robot used for Sensor Data Acquisition
Description:
Prerequisites & Equipment:
You are going to need the following:
-
An Arduino Board or Arduino clone(Here is a guide if you need)
-
Two DC Motors.
-
A 5v TTL -UART Bluetooth module.
-
Robot chassis and wheels which suit your chassis size and motor size.
-
Arduino IDE for the programming.
Block Diagram:
Fig. 2: Block Diagram of Arduino based Sensor Data Acquisition Robot
Our aim of this project is to collect the sensor data and to store it for the future analysis. There are many techniques used for Data acquisition such as EEPROM, SD card. Here we are going to use internet based storage, which is a reliable and efficient way for analysis of any sensor data.
Hardware assembly:
Make the Robot connections as are given by the circuit diagram. Make the robot assembly with your selected parts and connect the motors to the circuit. Optocouplers are used to safeguard the Arduino from High voltage risks. Note: RX of Arduino should be connected to TX of Bluetooth module and TX of Arduino should be connected to RX of Bluetooth module.
Working:
In this Robot we add internet functionality by using a GSM modem which provide GPRS connection. The section below will explain how to send the sensor readings via an HTTP command to a website. We use the ThingSpeak website which provides a simple and free API for logging data from a variety of sensors.
Fig. 3: Graph showing Light Intensity variations sensed by LDR on Data Acquisition Arduino Robot
Fig. 4: Graph showing Humidity variations recorded by DHT11 sensor on Data Acquisition Arduino Robot
Fig. 5: Graph showing Temperature variations recorded by DHT11 sensor on Data Acquisition Arduino Robot
These are some example charts which were generated from sensor data sent from robot to channel on the ThingSpeak website:
Thing Speak Setup
Here are the steps required in order to get this example working with the ThingSpeak website:
-
Create an account with ThingSpeak (Sign-up).
-
Create a New Channel
Fig. 6: Screenshot of Thingspeak Website showing Creation of Channel for Data Acquisition
-
Copy the WRITE API KEY from the APIKEYS tab for your new channel.
-
Configure your new channel (see the Channel Settings tab).
-
Add three fields to your channel.
-
Name the channel and each of the fields.
-
Save the new channel settings.
-
Note: The channel and field names are used for labelling the data in the charts these names have no effect on the API and can be changed at any time.
-
Here are the settings of the channel used for this Robot:
Fig. 7: Screenshot of Thingspeak website showing addition of Light Intensity, Temperature and Humidity Fields in created channel for displaying sensor data
Libarary Includes
In addition to the existing libraries, we must now also include the Timerone, Soft serial and DHT libraries in the sketch using the #include compiler directive.
#include <TimerOne.h>
#include <SoftwareSerial.h>
#include <DHT.h>
The ThingSpeak API limits the data upload to a maximum of once every 15 seconds. Also, it takes some time to establish the GPRS connection before any data can be sent. For this reason, we adjust the Timer1.initialize(4000000); // set a timer of 4 second. And make a variable to 5 called tick_count so that the readings are taken once per 20 seconds. (the units are microseconds)
Setup:
In addition to the existing setup code for robotic controls, we should make some initializations to GSM.
GPRS.write(“AT+CGATT=1”); //Attach a GPRS Service
GPRS.write(“AT+CGDCONT=1,”IP”,”airtelgprs.com””); //Define PDP Context
GPRS.write(“AT+CSTT=”airtelgprs.com”,””,”””); //Set Access point, User ID, and password
GPRS.write(“AT+CIICR”); //Bring up wireless connection with GPRS Time consuming
GPRS.write(“AT+CIFSR”); // Get Local IP address. No actually needed though.
GPRS.write(“AT+CIPSTATUS”); // Get Connection Status P.S. It should be ‘IP STATUS’. // This can be used as a check point.
GPRS.write(“AT+CIPHEAD=1”); // Add headers to the HTTP request.
GPRS.write(“AT+CDNSORIP=1”); //Indicates whether connection request will be using IP address (0), or domain name (1)
GPRS.write(“AT+CIPSTART=”TCP”,”api.thingspeak.com”,”80″”); //Start up TCP connection (mode, IP address/name, port) P.S. if returns ‘CONNECT OK’ then you’re lucky
GPRS.write(“AT+CIPSEND”);//Telling the GSM module that we’re going to send the data
Collection of Data:
Light = analogRead(A0); // Reading Light intensity
Reading temperature or humidity takes about 250 milliseconds! Sensor readings may also be up to 2 seconds ‘old’ (its a very slow sensor)
h = dht.readHumidity(); // Read temperature as Celsius (the default)
t = dht.readTemperature();
Data sending to Thing Speak:
itoa (Light,LIGHT_data,10);
itoa (h,HUMID_data,10);
itoa (t,TEMP_data,10); //Function for converting integer to string.
GPRS.write(“AT+CIPSEND”); //Telling the GSM module that we’re going to send the data
GPRS.write(“GET /update?key=XXXXXXXXXXXXXXXXXXXXXXX= “); // Change to your API KEY.
GPRS.write(LIGHT_data);
GPRS.write(“&field2= “);
GPRS.write(HUMID_data);
GPRS.write(“&field3= “);
GPRS.write(TEMP_data);
GPRS.write(” HTTP/1.1″); //And finally here comes the actual HTTP request //The following are the headers that must be set.
GPRS.write(“Host: api.thingspeak.com”);
GPRS.write(“Connection: keep-alive”);
GPRS.write(“Accept: */”);
GPRS.write(“*”);
GPRS.write(“Accept-Language: en-us”);
GPRS.write(0x1A);//It tells the GSM module that we’re not going to send data anymore
// char ctrlZ = 0x1A;
You may also like:
Circuit Diagrams
Project Video
Filed Under: Electronic Projects, PIC Microcontroller
Filed Under: Electronic Projects, PIC Microcontroller
Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.