Ski Resort Desk Snow Meter (Snowbird)

by noelportugal in Circuits > Gadgets

3597 Views, 14 Favorites, 0 Comments

Ski Resort Desk Snow Meter (Snowbird)

DSC_0025.JPG
DSC_0006.jpg
DSC_0026.JPG
avatar_small.jpg
snowbird_homepage.png
snowbird_report.png
snowbird.jpg

As my snowboarding trip approaches, I find myself checking Utah Snowbird's snowcam (http://www.snowbird.com/snowcam.html) a few times a day, wishing for more snow to accumulate on my favorite ski resort.

So as a fun mini-project I decided to create my own Snowbird Desk Snow Meter! The Meter displays the snow accumulated in the past 24 hours and it gets updated hourly.




As a bonus feature I setup a Twilio phone line to call and get my personalized Snowbird snow report. Click Play below to hear what I get when I call my twilio number.



Materials

Module IO-204.jpg
A0016-2.jpg
Futaba S3003 Standard Size Servo.jpg
Here is my list of materials:

Building the Meter

DSC_0019.JPG
DSC_0010.jpg
DSC_0012.jpg
SnowCam_main.jpg
I based my design as close as I could to the actual snow measurement device that snowbird uses (http://www.snowbird.com/snowcam.html).

I got a logo of the resort from the site and printed it on regular paper. Then I cut out the "wings" out of colored paper.  I put everything together using double sided tape.

The tricky part was building the level. I kept thinking it would have been easier to use a regular circular meter, but this would make my project look different from what I wanted. I used some toy parts to create a level system that is actuated by the servo motor. Check the pictures for details.


Scheduler

512-Terminal-300x300.png
FileSheevaPlug with external drive enclosure.jpg
I used my Sheevaplug to run a very simple bash script that checks a PHP script that screen scrapes the http://www.snowbird.com/ site looking for the value of the snow total for the past 24 hours.

The Bash script will send the values using ioBridge Static Widget API to my ioBridge module.


PHP Script to screen scrape site:
----------------------------------------------------------------------------------------------------------------
<?php
// create curl resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, "http://www.snowbird.com/index.html");
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string
$output = curl_exec($ch);
// close curl resource to free up system resources
curl_close($ch);

$output = trim($output);
$twentyfour = explode('24hr:<b><font color="FBE075">',$output);
$twentyfour = explode('&quot;</font></b>',$twentyfour[1]);

echo $twentyfour[0];
?>
----------------------------------------------------------------------------------------------------------------


I added the for loop to gave it a little more "movement". First the level is set to the highest value, then it steps down until it reaches the real snow measurement.

Bash Script:
----------------------------------------------------------------------------------------------------------------
#!/bin/bash
inches=`curl -s http://mywebserver.com/24.php`
reset=`curl -s "http://www.iobridge.com/widgets/static/id=XXXXXXXXX&value=400"`
sleep 3
for ((i=13; i>=inches; i--));
do
        let pwm=$i*100
        let pwm=1700-$pwm
        new=`curl -s "http://www.iobridge.com/widgets/static/id=XXXXXXXXX&value=$pwm"`
done
----------------------------------------------------------------------------------------------------------------


IoBridge Setup

ioBridge.gif
A0016-2.jpg
I created a Static Widget to control my servo variable position. This widget accepts PWM values between 400 to 2100. Check ioBridge Wiki page for more information.


Bonus Feature: Twilio

115770480_300.jpg
PHP Script with Twilio output:
----------------------------------------------------------------------------------------------------------------
<?php
// create curl resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, "http://www.snowbird.com/index.html");
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string
$output = curl_exec($ch);
// close curl resource to free up system resources
curl_close($ch);

$output = trim($output);
$twentyfour = explode('24hr:<b><font color="FBE075">',$output);
$twentyfour = explode('</font></b>',$twentyfour[1]);

$fortyeight = explode('48hr:<b><font color="FBE075">', $output);
$fortyeight = explode('</font></b>',$fortyeight[1]);

$ytd = explode('YTD:<b><font color="FBE075">', $output);
$ytd = explode('</font></b>',$ytd[1]);

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<Response><Say>Snowbird Resort had " . $twentyfour[0] . " inches in the last twenty four hours, " . $fortyeight[0] . " inches in the last forty eight hours, and " .$ytd[0]. " inches year to date.</Say></Response>";
?>             
----------------------------------------------------------------------------------------------------------------

Conclusion

This meter can be adapted to measure anything that is available on the internet. In this case I ended up doing a screen scrape because I couldn't find a good weather API that just gave me the last 24 hour snowfall! Also it is possible to make it wireless if you use an MCU with some RF module like XBee.