Hardware Reference
In-Depth Information
Objective complete - mini debriefing
Using the simple concept explained earlier, it is possible to control any appliance (by
interfacing some control device such as the power switch tail to Raspberry Pi's GPIO pins).
It is also possible to read sensor states as well as track any special informaion. For example,
it is possible to track the status of a package that is expected to be delivered. USPS provides
status of shipments that can be displayed on the web page (for more informai on on APIs,
check out https://www.usps.com/business/web-t ools-apis/welcome.htm ).
In all these examples, we reviewed control appliances using Raspberry Pi within a local
network. In the later task of this project, we will review controlling the device from anywhere
over the Internet.
Turning on a lawn sprinkler only
when there is no rain forecast!
This example was inspired by a comment on an aricle related to Home Automaion using
Raspberry Pi. The commenter menioned:
The only home automaion that I'm interested in (and sill haven't seen) is something
that'll turn off my lawn sprinklers if it's rained a certain amount in the preceding days
or if it's raining on the day that the sprinklers are programmed to go on.
We decided to whip up a quick example that would turn on the sprinkler when it is not going
to rain on a paricular day.
Prepare for lift off
In order to check the weather forecast, we need to make the python-weather-api library
(the library is distributed with MIT license). We will make use of the NOAA API. The library
can be downloaded using the wget command:
wget https://launchpad.net/python-weather-api/trunk/0.3.8/+downlo ad/
pywapi-0.3.8.tar.gz
The source files are available in a compressed folder. The contents of the compressed file can
be extracted as follows:
tar -xvzf pywapi-0.3.8.tar.gz
Once extracted, the library can be installed as follows:
python setup.py build
sudo python setup.py install
 
Search WWH ::




Custom Search