Reading Data from an Arduino

Reading data from 2 different Agents (arduino & teensy)

Xbee communication over serial port

(incomplete) In this tutorial we’ll be measuring temperature and humidity data from the DHT11 sensor and plotting the real-time data using CosmosPlot. The sensor is connected to the Arduino which in turn is connected to a computer that can read a serial port (USB to Serial).

**Note: There are 2 Arduino IDEs - online IDE and offline (Desktop IDE).

1.Download the Arduino IDE appropriate for your OS from here:

https://www.arduino.cc/en/Main/Software

a. Extract and install the archive. Follow the instructions linked here: https://www.arduino.cc/en/Guide/Linux#toc3

b. If the resulting executable is not named “Arduino IDE”, right click on the file and under Properties>Permissions, check the box that allows the file to be executed as a program.

c. Setup the Arduino IDE for your board.

  1. Clone the COSMOS Arduino repository from https://bitbucket.org/cosmos-project/cosmos-arduino to the folder /source/projects/cosmos-arduino

a. Useful files:

 1. (arduino_code.ino) Template program for the Arduino that sends data on the serial port in JSON format

 2. (agent_arduino.cpp) Use this as a template to make an agent for the arduino

 3. (plot-arduino.json) Configuration file for CosmosPlot 
  1. Create Node or clone node-arduino

a. Create Node

   1. Use DMT to create new node (follow this tutorial to install/compile DMT)

   2. Node information must match the sensor information
Tags: