Al Short
Published © MIT

WAVEbuoy

The WAVEbuoy is a arduino lamp connected to the internet that displays the current wave height of any of the NDCBs network of wavebuoys

IntermediateShowcase (no instructions)2,179
WAVEbuoy

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Resistor 100k ohm
Resistor 100k ohm
×1
RGB Diffused Common Cathode
RGB Diffused Common Cathode
×3

Story

Read more

Schematics

Circuit

Code

UNO Code

Arduino
Here is the arduino code. Just change the link to your local buoy listed here on the Google map.

http://www.ndbc.noaa.gov/

Not all of them have the 'Significant Wave Height' variable so check first.

With a slight edit you can also pull data from any location covered at magicseaweed by using the 'Swell' variable

http://magicseaweed.com/syndicate/rss/index.php?id...

Replace the id=1 in the link to your local spot the id can be found by visiting the spot on msw and looking in the link.
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
char serverName[] = "ndbc.noaa.gov";
EthernetClient client;
int red=7,green=8,blue=9; // PWM pins initialized to pass values of RGB
float waveheight; // float value that holds wave height
void setup()
{
  Serial.begin(9600);
  pinMode(red   ,OUTPUT);
  pinMode(green ,OUTPUT);
  pinMode(blue  ,OUTPUT);
  if (Ethernet.begin(mac) == 0)
  { // start ethernet using mac & IP address
    while(true) ;
  }
  delay(2000); // give the Ethernet shield 2 second to initialize
}
void loop()
{
  if (client.connect(serverName, 80)>0) {
    client.println("GET http://www.ndbc.noaa.gov/data/latest_obs/62081.rss");
  }
  if (client.connected()) {
    if(client.find("Significant Wave Height:"))
    {//look for the wave height and pass the value to variable
      waveheight = client.parseFloat();
  }
  else{
    digitalWrite(13,HIGH);
  }
  //The code below lights up RGB module light depending on the wave height
   if ((waveheight>=0)&&(waveheight<3))
   {
     analogWrite(red   ,0  );
     analogWrite(green ,0  );
     analogWrite(blue  ,255);
   }
   if ((waveheight>=3)&&(waveheight<8))
   {
     analogWrite(red   ,0);
     analogWrite(green ,255 );
     analogWrite(blue  ,0);
   };
   if ((waveheight>=8)&&(waveheight<100))
   {
     analogWrite(red   ,255 );
     analogWrite(green ,0);
     analogWrite(blue  ,0);
   }

  client.stop();//Disconnect
}
}

Credits

Al Short

Al Short

2 projects • 2 followers

Comments