Hi, first time posting!
I am trying to use a Arduino UNO to send wind data to an Excel Sheet on a computer wirelessly.
I have a 6410 Davis Anemometer for Vantage Pro2 connected to my Arduino (Here is the guide) and can confirm that my program is able to send data from the Arduino to Excel via the USB cable successfully with the use of PLX-DAQ version 2.
I purchased a DFRobot WiFi Shield v2.2. I am successful in getting the Arduino to send text to Putty wirelessly as I hooked the Arduino to a battery (with the code below). All the text is showing up in Putty.
#include <math.h>
#include "LowPower.h"
int i = 0;
#define WindSensorPin (2) // The pin location of the anemometer sensor
#define Offset 0;
int VaneValue;
int Direction;
int CalDirection;
int LastValue;
volatile unsigned long Rotations; // cup rotation counter used in interrupt routine
volatile unsigned long ContactBounceTime; // Timer to avoid contact bounce in interrupt routine
float WindSpeed; // speed miles per hour
float WindSpeedMetric;
void setup() {
Serial.begin(9600);
Serial.println("LABEL,Date,Time,Wind Speed M/S,Wind Speed MPH,Direction");
pinMode(WindSensorPin, INPUT);
attachInterrupt(digitalPinToInterrupt(WindSensorPin), rotation, FALLING);
LastValue = 1;
}
void loop() {
VaneValue = analogRead(A4);
Direction = map(VaneValue, 0, 1023, 0, 360);
CalDirection = Direction + Offset;
Rotations = 0; // Set Rotations count to 0 ready for calculations
sei(); // Enables interrupts
delay (10000);
cli(); // Disable interrupts
// convert to mp/h using the formula V=P(2.25/T)
// V = P(2.25/3) = P * 0.75
WindSpeed = Rotations * 0.225; //this is for 10 second delay
WindSpeedMetric = Rotations * 0.225 * 0.44704;
char text[40];
char text1[40];
Serial.print("DATA,DATE,TIME,");
Serial.print(WindSpeedMetric); Serial.print(","),
Serial.print(WindSpeed); Serial.print(",");
Serial.println(CalDirection);
if (CalDirection > 360)
CalDirection = CalDirection - 360;
if(CalDirection < 0)
CalDirection = CalDirection + 360;
}
// This is the function that the interrupt calls to increment the rotation count
void rotation () {
if ((millis() - ContactBounceTime) > 15 ) { // debounce the switch contact.
Rotations++;
ContactBounceTime = millis();
}
Now the issue I am having is figuring out how to get PLX-DAQ to grab the data/text from Putty and insert it onto Excel (or in general: sending data wireless with a WiFi shield and into Excel). I see PLX-DAQ is the best way to insert my data into Excel. Maybe I need a different program to grab the data sent by the WiFi shield?
Any help would be appreciated. Thank you.