I've been running some sketch's that seem to werk preaty darn well for wunderground with an UNO
feel free to use and MOD.
(At Well under $100.oo U.S.) No need for a CPU to hook up to after initial programming, A 5 volt system, battery power optional, solar chargeable optional (24 / 7 reporting as long as the router has power and the Internet is on!)
they do have Cell ($45.oo U.S.) adaptors for use with a local Cell carrier to give you some access to really remote locations.
Arduino UNO or just a RRRSA
Arduino ethernet or.........
ADAFRUIT DHT22 T(c or f) and H in %
ADAFRUIT BMP 085 Baro in Pa (or in my code inHg)
ADAFRUIT DS1307 "TIME" for the updates to Wunderground
Re Purposed DAVIS weather vane and anomometer (any anemometer/vane will work (HOME MADE),you just need to tweek the voltages for the vane and measure the anemometer radius and enter it into the code)
And a Re purposed Rain tipper modded with a hall effect switch.
/*
This MODIFIED sketch connects to a website (http://www.rtupdate.wunderground.com)
using an Arduino Wiznet Ethernet shield To upload a weather conditions to wunderground.com,
We make a standard HTTP GET request with the ID, PASSWORD and weather conditions as GET parameters.
http://wiki.wunderground.com/index.php/PWS_-_Upload_Protocol#Personal_Weather_Station_Upload_Protocol
Binary sketch size: 25,960 bytes (of a 32,256 byte maximum)
Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
* DHT to pin A0
* wind direction to pin A1
Anemometer to Digtal 2 (INT0)
Rain tip to Digital 3 (INT1)
* BMP to I2C
* RTC to I2C
created 18 Dec 2009
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe, based on work by Adrian McEwen
**
**
Modified To upload weather conditions to wunderground.com
By the drunkin programer
1,Jan 2014
*/
#include <SPI.h>
#include <Ethernet.h>
#include <Wire.h>
#include <DHT.h>
#include <Adafruit_BMP085.h>
#include <RTClib.h>
//Pins
#define DHTPIN A0 // DHT 22 (AM2302)
#define vane A1
#define anemometer 2 // D2 Wind speed
#define rainTip 3 // pin D3 Rain bucket
#define led 13// Notification of SENDING DATA
#define DHTTYPE DHT22 // DHT 22 (AM2302)
//IPAddress SERVER(38,102,137,157); // numeric IP for wunderground.com
char SERVER[] = "rtupdate.wunderground.com"; // Realtime update server
//char SERVER [] = "weatherstation.wunderground.com"; //standard server
char WEBPAGE [] = "GET /weatherstation/updateweatherstation.php?";
char ID [] = "STATIONID";
char PASSWORD [] = "PASSWORD";
const float pi = 3.14159265; // pi, not apple, not pumpkin, not pizza, not even related to Raspberry Pi. http://www.raspberrypi.org/ This is the REAL PI for RPM/Wind speed calculations
// Radius from vertical anemometer axis to a cup center (mm)
const int radio = 60;
// (changing "Wait")changes the windspeed calculation "period" automaticly
const unsigned long Wait = 1500; // Amount of Time to wait till Re-connecting, Changing this also
const unsigned long period = Wait * 2; // Measurement period (miliseconds)
const unsigned long IDLE_TIMEOUT_MS = 500;
unsigned int counter = 0; // pulse count for wind sensor
unsigned int RPM = 0; // Revolutions per minute
unsigned int Sample = 0; // Sample number
unsigned int connections = 0; // number of connections
unsigned int winddir = 0.0; // Wind direction
unsigned int rainin = 0; // counter for Rain
unsigned int rainSample = 0; // counter for Rain Samples
float windspeedmph = 0/ 0.445; // Wind speed (m/s)
float windgustmph = 0; // Max wind speed
//---DEWPOINT
double dewPoint(double tempf, double humidity)
{
double A0= 373.15/(273.15 + tempf);
double SUM = -7.90298 * (A0-1);
SUM += 5.02808 * log10(A0);
SUM += -1.3816e-7 * (pow(10, (11.344*(1-1/A0)))-1) ;
SUM += 8.1328e-3 * (pow(10,(-3.49149*(A0-1)))-1) ;
SUM += log10(1013.246);
double VP = pow(10, SUM-3) * humidity;
double T = log(VP/0.61078);
return (241.88 * T) / (17.558-T);
}//---DEWPOINT
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,1,109);
EthernetClient client;
DHT dht(DHTPIN, DHTTYPE); // DHT 22 (AM2302)
Adafruit_BMP085 bmp; // BMP Sensor
RTC_DS1307 rtc;
void setup(void)
{
Serial.begin(115200);
Wire.begin();
rtc.begin();
//rtc.adjust(DateTime(__DATE__, __TIME__));//uncomment to reset the time during RECOPILE!
bmp.begin();
pinMode(anemometer, INPUT);
digitalWrite(anemometer, HIGH);
pinMode(rainTip, INPUT);
digitalWrite(rainTip, HIGH);
Serial.println(F(" Ethernet shield Wunderground Test!\n"));
dht.begin();// Connect the DHT22 sensor
Serial.println(F("\nInitializing..."));
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
Ethernet.begin(mac, ip);
}
Serial.println("Ready!");
Serial.println();
}
void loop(void)
{
DateTime now = rtc.now();
Serial.print(now.year());
Serial.print('/');
Serial.print(now.month());
Serial.print('/');
Serial.print(now.day());
Serial.print(' ');
Serial.print(now.hour());
Serial.print(':');
Serial.print(now.minute());
Serial.print(':');
Serial.print(now.second());
Serial.println();
//Clear the rainCount and maxwind every 24 hr
if ((now.hour() == 24) && (now.minute() == 00) && (now.second() <= 5)) {
windgustmph = 0;
rainin = 0;
}
//Clear the rainSample and maxwind every 30 seconds
if (rainSample >=10){
rainin = 0;//Clear the rainCount
rainSample = 0;// Clear the rain samples
windgustmph = 0; //clear Max wind speed
}
Sample ++;
rainSample++;
windvelocity();
RPMcalc();
WindSpeed();
Heading();
float tempf = dht.readTemperature(2); //Calc *F
float humidity = dht.readHumidity();
float baromin = bmp.readPressure()* 0.0002953;// Calc for inHg
float dewptf = (dewPoint(dht.readTemperature(2), dht.readHumidity()));
// max wind speed
if (windspeedmph > windgustmph) {
windgustmph = windspeedmph;
}
if (client.connect(SERVER, 80)) {
Serial.println("Sending DATA ");
client.print("GET /weatherstation/updateweatherstation.php?");
client.print("ID=");
client.print(ID);
client.print("&PASSWORD=");
client.print(PASSWORD);
client.print("&dateutc=");
client.print(now.year());
client.print("-");
client.print(now.month());
client.print("-");
client.print(now.day());
client.print("+");
client.print(now.hour()+ 5);
client.print("%3A");
client.print(now.minute()+ 2);
client.print("%3A");
client.print(now.second());
client.print("&winddir=");
client.print(winddir);
client.print("&windspeedmph=");
client.print(windspeedmph);
client.print("&windgustmph=");
client.print(windgustmph);
client.print("&tempf=");
client.print(tempf);
client.print("&rainin=");
client.print(rainin / 2.0 / 100.0);
client.print("&baromin=");
client.print(baromin);
client.print("&dewptf=");
client.print(dewptf);
client.print("&humidity=");
client.print(humidity);
//client.print("&action=updateraw");//Standard update
client.print("&action=updateraw&realtime=1&rtfreq=5.0");//Rapid Fire
client.println();
Serial.println();
Serial.print("Posting Sample # ");Serial.print(Sample);
Serial.print(" Rain Sample # ");Serial.println(rainSample);
Serial.print("wind dir= ");
Serial.println(winddir);
Serial.print("windspeed mph= ");
Serial.println(windspeedmph);
Serial.print("windgust mph= ");
Serial.println(windgustmph);
Serial.print("tempf= ");
Serial.println(tempf);
Serial.print("rain in= ");
Serial.println(rainin / 2.0 / 100.0);
Serial.print("baro= ");
Serial.println(baromin);
Serial.print("dew point= ");
Serial.println(dewptf);
Serial.print("humidity= ");
Serial.println(humidity);
Serial.println();
}
else {
Serial.println(F("Connection failed"));
return;
}
Serial.println("-------------------------------------");
Serial.println("Server Responce!");
unsigned long lastRead = millis();
while (client.connected() && (millis() - lastRead < IDLE_TIMEOUT_MS)) {
while (client.available()) {
char c = client.read();
Serial.print(c);
lastRead = millis();
}
}
client.stop();
Serial.println();
Serial.print("Waiting ");
Serial.print(Wait*2/1000.0);
Serial.println(" seconds.");
delay(Wait);// 30sec
//clearing the rain readings every 5 seconds
//clearing the rain readings every 5 seconds
Serial.println();
Serial.println("-------------------------------------");
}
void windvelocity(){
windspeedmph = 0;
counter = 0;
attachInterrupt(0, addcount, CHANGE);//anemometer
attachInterrupt(1, addrain, CHANGE); // Read the Rain tips Hall Effect
unsigned long millis();
long startTime = millis();
while(millis() < startTime + period) {
}
detachInterrupt(0);
detachInterrupt(1);
}
void RPMcalc(){
RPM=((counter*5)*60)/(period/1000); // Calculate revolutions per minute (RPM)
}
void WindSpeed(){
windspeedmph = ((2 * pi * radio * RPM)/60) / 1000;
}
void addcount(){
counter++;
}
void addrain(){
rainin++;
}
void Heading(){
float windDir =(analogRead(vane)* 5.00 / 1023.0); // Wind direction
if ((windDir > 4.94)||(windDir < 0.01))
(winddir = 0.0);// North
if ((windDir >= 0.02)&&(windDir < 0.30))
(winddir = 22.5);//NNE
if ((windDir >= 0.31)&&(windDir < 0.72))
(winddir = 45.0);//NE
if ((windDir >= 0.72)&&(windDir < 0.99))
(winddir= 67.5);//ENE
if ((windDir >= 1.00)&&(windDir < 1.25))
(winddir = 90.0);//E
if ((windDir >= 1.26)&&(windDir < 1.52))
(winddir= 112.5);//ESE
if ((windDir >= 1.53)&&(windDir < 1.91))
(winddir= 135.0);//SE
if ((windDir >= 1.92)&&(windDir < 2.40))
(winddir = 157.5);//SSE
if ((windDir >= 2.41)&&(windDir < 2.73))
(winddir = 180.0);//S
if ((windDir >= 2.74)&&(windDir < 2.96))
(winddir = 202.5);//SSW
if ((windDir >= 2.97)&&(windDir < 3.37))
(winddir = 225.0);//SW
if ((windDir >= 3.38)&&(windDir < 3.55))
(winddir = 247.5);//WSW
if ((windDir >= 3.56)&&(windDir < 3.85))
(winddir = 270.0);//W
if ((windDir >= 4.13)&&(windDir < 4.06))
(winddir = 292.5);//WNW
if ((windDir >= 4.07)&&(windDir < 4.32))
(winddir = 315.0);//NW
if ((windDir >= 4.33)&&(windDir < 4.93))
(winddir = 337.5);//NNW
}
I havent had steady luck with the Adafruit CC3000 WiFi BoB(Mammory Hawg!), but i tool with it from time to time as I have more than one AT328PU on perfbords.
I hope this heelps you out some.
Cheer's