概括:
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
描述:
Prerequisites & Equipment:
You are going to need the following:
An Arduino Board or Arduino clone(Here is a guide if you need)
两个直流电动机。
5V TTL -UART蓝牙模块。
机器人底盘和车轮适合您的底盘尺寸和运动尺寸。
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.
硬件组件:
按照电路图给出的机器人连接。将机器人组件与您选择的零件一起进行,然后将电动机连接到电路。光耦合器用于保护Arduino免受高压风险。注意:Arduino的RX应连接到蓝牙模块的Tx,Arduino的TX应连接到蓝牙模块的Rx。
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.
图3:图表显示LDR在数据采集Arduino机器人上感受到的光强度变化
图4:图显示了DHT11传感器在数据采集上记录的湿度变化
Fig. 5: Graph showing Temperature variations recorded by DHT11 sensor on Data Acquisition Arduino Robot
这些是一些示例图表,这些图表是从从机器人发送到the thesspeak网站上发送到频道的传感器数据生成的:
Thing Speak Setup
以下是要使此示例使用的步骤ThingSpeakwebsite:
创建一个帐户ThingSpeak(注册)。
Create a New Channel
图6:Thingspeak网站的截图显示Creation of Channel for Data Acquisition
从“ Apikeys”选项卡中复制Write API键,以获取新频道。
Configure your new channel (see theChannel Settingstab).
Add three fields to your channel.
Name the channel and each of the fields.
保存新的频道设置。
笔记:这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:
图7:Thingspeak网站的屏幕截图显示了在创建的频道中添加光强度,温度和湿度字段,以显示传感器数据
Libarary Includes
除了现有的库外,我们现在还必须在草图中使用#include Compiler指令在草图中包括Timerone,Soft Serial和DHT库。
#include
#include
#include
这ThingSpeakAPI将数据上传限制为最多每15秒一次。同样,在发送任何数据之前,需要花费一些时间来建立GPRS连接。因此,我们调整the Timer1.Initialize(4000000);//将计时器设置为4秒。并制作一个称为tick_count的5变量,以便每20秒进行一次读数。(单位是微秒)
设置:
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”);//定义PDP上下文
gprs.write(“ at+cstt =” airtelgprs.com”,“”,“”);//设置访问点,用户ID和密码
gprs.write(“ at+ciicr”);//与GPRS耗时的无线连接
gprs.write(“ at+cifsr”);//获取本地IP地址。虽然实际上不需要。
gprs.write(“ at+cipstatus”);//获取连接状态P.S.它应该是“ IP状态”。//这可以用作检查点。
gprs.write(“ at+ciphead = 1”);//将标题添加到HTTP请求中。
gprs.write(“ at+cdnsorip = 1”);//指示连接请求是使用IP地址(0)还是域名(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(“在+cipsend”); //告诉GSM模块我们将发送数据
数据收集:
Light = Analogread(A0);//阅读光强度
阅读温度或湿度大约需要250毫秒!传感器读数也可能最多2秒“旧”(它是一个非常缓慢的传感器)
h = dht.readHumidity(); // Read temperature as Celsius (the default)
t = dht.readTemperature();
发送到事物的数据说话:
itoa(光LIGHT_data 10);
itoa (h,HUMID_data,10);
itoa(t,temp_data,10);//将整数转换为字符串的功能。
在+ CIPSEND GPRS.write(“”); //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(“连接:keep-alive”);
gprs.write(“接受: */”);
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;
Questions related to this article?
询问并讨论EDAboard.comand电气技术在线。comforums.
Tell Us What You Think!!
你一定是logged into post a comment.