WeatherStation
weatherstation
package. The script to run it is weather.station.reader
init
method of the class weatherstation.SDLWeather80422
.
final Pin ANEMOMETER_PIN = RaspiPin.GPIO_16; // <- WiringPi number. GPIO 15, #10 final Pin RAIN_PIN = RaspiPin.GPIO_01; // <- WiringPi number. GPIO 18, #12 SDLWeather80422 weatherStation = new SDLWeather80422(ANEMOMETER_PIN, RAIN_PIN, AdcMode.SDL_MODE_I2C_ADS1015); weatherStation.setWindMode(SdlMode.SAMPLE, 5);
low
to high
.
It is easy from this kind of code to feed a WebSocket server (running on the RPi, even an A+ can run nodejs, without feeling it) and render the data to whoever can get connected on its network:
There is also an HTML5 rendering of the same data:
Real time data. You have to be in the same wireless network as the Raspberry PI.
This is where an Internet Of Things (IoT) server can be an asset. See the Photon section about that.
Mounted on its acrylic plate, with a Raspberry PI A+.
First presentation on the roof, Ocean Beach, San Francisco, CA. Notice the hatch in the roof, made for the occasion... |
With a "housing" for the Raspberry PI ;) |
A rendering of the data logged by the Raspberry PI.
Accessible live from here.
A Photon in the picture
The Photon is a small and cheap IoT board provided by Particle.
The cool thing is that is also includes access to a server that can be used in a real-time mode, from anywhere on the Internet.
The project also contains a Photon sketch (weather-station-http-client.ino
) that runs on a Photon.
It pings the Raspberry PI to get the data (the node server running on the Raspberry PI can return a json object that represents the currant situation), and feeds the Particle IoT server.