th monitor

Upload: dan-m-stone

Post on 01-Jun-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Th Monitor

    1/27

    http://cdn.instructables.com/FE0/9Y6L/HOSP3Z6L/FE09Y6LHOSP3Z6L.LARGE.jpghttp://cdn.instructables.com/FE0/9Y6L/HOSP3Z6L/FE09Y6LHOSP3Z6L.LARGE.jpghttp://cdn.instructables.com/FAT/O04O/HOSLKHJ0/FATO04OHOSLKHJ0.LARGE.jpghttp://cdn.instructables.com/FE0/9Y6L/HOSP3Z6L/FE09Y6LHOSP3Z6L.LARGE.jpghttp://cdn.instructables.com/FE0/9Y6L/HOSP3Z6L/FE09Y6LHOSP3Z6L.LARGE.jpg

  • 8/9/2019 Th Monitor

    2/27

    OK, Instructables is really having some strange issues, Once again the Introdisappeared, now the history is gone, and I've had to recreate the Intro from aPDF download.

    I had some issues with Kingston SD Cards, but the SanDisk cards I'm usingnow have run for weeks without issues, so I'm changing the parts list to reflectthat.

    Also, after some 49 days, 16 hours, the display flatlines, as the readingroutines start returning the same number over and over again. A reboot clearsit, so just reboot once a month until I figure out what's up.

    Over the past summer, my vacation home had a small water leak for threemonths, and I realized that had I been measuring the humidity in the effectedarea, I'd haveseen it go to 100% for a long time and I could have dispatched someone to fixthe small problem before it became a big one.

    And since I've been playing with Raspberry Pi computers for a while now, andsaw an inexpensive temperature/humidity sensor on AdaFruit, I had all thepieces I neededto implement an inexpensive network-connected monitor.

    http://cdn.instructables.com/FAT/O04O/HOSLKHJ0/FATO04OHOSLKHJ0.LARGE.jpghttp://cdn.instructables.com/FAT/O04O/HOSLKHJ0/FATO04OHOSLKHJ0.LARGE.jpghttp://cdn.instructables.com/FAT/O04O/HOSLKHJ0/FATO04OHOSLKHJ0.LARGE.jpg

  • 8/9/2019 Th Monitor

    3/27

    The Bill Of Materials (BOM):1) Raspberry Pi Model B2) Case3) SD Card

    4) Temperature/Humidity sensor5 ) Power Supply (I use PoE splitters, but any 5V 1A Micro-USB supply willwork)I used the following exact parts, but obvious substitutions can be made tomatch local conditions and the state of your junk box. Shipping and theavailability of bundlesmay effect your final price.$35.00 RPi http://www.newark.com/raspberry-pi/raspbrry-modb-... $ 8.12 Case http://thepihut.com/products/classic-raspberry-pi... (5.99 Euros)$ 6.99 SD Card (Sandisk, not Kingston)$15.00 Sensor http://www.adafruit.com/products/393 $15.99 PoE Splitter http://www.newegg.com/Product/Product.aspx?Item=N...

    And a few other miscellaneous things like hand tools, soldering iron, hot meltglue gun, small pieces of plastic wood, etc.Step

    Step 1: Physical assembly

    http://www.newark.com/raspberry-pi/raspbrry-modb-512m/model-b-assembled-board-only/dp/43W5302http://www.newark.com/raspberry-pi/raspbrry-modb-512m/model-b-assembled-board-only/dp/43W5302http://www.newark.com/raspberry-pi/raspbrry-modb-512m/model-b-assembled-board-only/dp/43W5302http://thepihut.com/products/classic-raspberry-pi-casehttp://thepihut.com/products/classic-raspberry-pi-casehttp://thepihut.com/products/classic-raspberry-pi-casehttp://www.adafruit.com/products/393http://www.adafruit.com/products/393http://www.adafruit.com/products/393http://www.newegg.com/Product/Product.aspx?Item=N82E16833997213http://www.newegg.com/Product/Product.aspx?Item=N82E16833997213http://www.newegg.com/Product/Product.aspx?Item=N82E16833997213http://cdn.instructables.com/F2Y/MPB3/HOSOPC1R/F2YMPB3HOSOPC1R.LARGE.jpghttp://cdn.instructables.com/F2Y/MPB3/HOSOPC1R/F2YMPB3HOSOPC1R.LARGE.jpghttp://cdn.instructables.com/F2Y/MPB3/HOSOPC1R/F2YMPB3HOSOPC1R.LARGE.jpghttp://www.newegg.com/Product/Product.aspx?Item=N82E16833997213http://www.adafruit.com/products/393http://thepihut.com/products/classic-raspberry-pi-casehttp://www.newark.com/raspberry-pi/raspbrry-modb-512m/model-b-assembled-board-only/dp/43W5302

  • 8/9/2019 Th Monitor

    4/27

    http://cdn.instructables.com/FI1/56AO/HOSVZUE6/FI156AOHOSVZUE6.LARGE.jpghttp://cdn.instructables.com/FDS/2C0N/HOSLXG5O/FDS2C0NHOSLXG5O.LARGE.jpghttp://cdn.instructables.com/FI1/56AO/HOSVZUE6/FI156AOHOSVZUE6.LARGE.jpghttp://cdn.instructables.com/FI1/56AO/HOSVZUE6/FI156AOHOSVZUE6.LARGE.jpg

  • 8/9/2019 Th Monitor

    5/27

    http://cdn.instructables.com/FDS/2C0N/HOSLXG5O/FDS2C0NHOSLXG5O.LARGE.jpghttp://cdn.instructables.com/FDS/2C0N/HOSLXG5O/FDS2C0NHOSLXG5O.LARGE.jpghttp://cdn.instructables.com/FJW/CNP1/HOSVZUE2/FJWCNP1HOSVZUE2.LARGE.jpghttp://cdn.instructables.com/FDS/2C0N/HOSLXG5O/FDS2C0NHOSLXG5O.LARGE.jpg

  • 8/9/2019 Th Monitor

    6/27

  • 8/9/2019 Th Monitor

    7/27

    Split the case, find the hardware bag inside, and set the rubber feet aside forlater.

    Attach the Raspberry Pi to the case bottom with the supplied hardware.

    Remove the GPIO knockout with a razor blade or Xacto knife and snap thetwo case halves together.

    To keep the power dissipation of the power supply and Raspberry Pi from

    effecting the sensor readings, I cut a piece of Azek plastic lumber about 1.1 x2.4 x 0.75 inches as a standoff.

    Heat up your hot-melt glue gun and stack the parts as in the picture. You'llhave a few seconds to make the alignment perfect before the glue sets, so getthe alignment close before you press the parts together. Be careful not to useso much glue that it extrudes from the edges of the seams or extrudes into thecase, where it might interfere with the SD card connector.

    1) Glue the sensor to the standoff

    2) Glue the standoff to the top half of the case. Be careful not to block the LED

    http://cdn.instructables.com/FG9/EQ81/HOSLK9HW/FG9EQ81HOSLK9HW.LARGE.jpghttp://cdn.instructables.com/FG9/EQ81/HOSLK9HW/FG9EQ81HOSLK9HW.LARGE.jpghttp://cdn.instructables.com/FG9/EQ81/HOSLK9HW/FG9EQ81HOSLK9HW.LARGE.jpg

  • 8/9/2019 Th Monitor

    8/27

    cutouts on the one side or the ribbon cable cutout for the camera on the otherside.

    3) Glue the case bottom to the top of the PoE adapter. Make sure the "LAN

    Out" connector is on the same side as the Raspberry Pi Ethernet adapter.4) Stick the 4 rubber feet to the bottom of the power adapter.

    5) Ensure the voltage-output selection switch is set to 5V. Put a dab of hot-melt glue in the switch to prevent it from being changed and destroying yourRaspberry Pi.

    Step 2: Electrical Assembly

    http://cdn.instructables.com/FX4/X56B/HOSOPC1N/FX4X56BHOSOPC1N.LARGE.jpghttp://cdn.instructables.com/FB6/F63L/HOSKU286/FB6F63LHOSKU286.LARGE.jpghttp://cdn.instructables.com/FX4/X56B/HOSOPC1N/FX4X56BHOSOPC1N.LARGE.jpghttp://cdn.instructables.com/FX4/X56B/HOSOPC1N/FX4X56BHOSOPC1N.LARGE.jpg

  • 8/9/2019 Th Monitor

    9/27

    http://cdn.instructables.com/FB6/F63L/HOSKU286/FB6F63LHOSKU286.LARGE.jpghttp://cdn.instructables.com/FB6/F63L/HOSKU286/FB6F63LHOSKU286.LARGE.jpghttp://cdn.instructables.com/FHQ/W4EB/HOSLKHHK/FHQW4EBHOSLKHHK.LARGE.jpghttp://cdn.instructables.com/FB6/F63L/HOSKU286/FB6F63LHOSKU286.LARGE.jpg

  • 8/9/2019 Th Monitor

    10/27

    http://cdn.instructables.com/FHQ/W4EB/HOSLKHHK/FHQW4EBHOSLKHHK.LARGE.jpghttp://cdn.instructables.com/FHQ/W4EB/HOSLKHHK/FHQW4EBHOSLKHHK.LARGE.jpghttp://cdn.instructables.com/FH7/9E5C/HOSVZUDX/FH79E5CHOSVZUDX.LARGE.jpghttp://cdn.instructables.com/FHQ/W4EB/HOSLKHHK/FHQW4EBHOSLKHHK.LARGE.jpg

  • 8/9/2019 Th Monitor

    11/27

    http://cdn.instructables.com/FH7/9E5C/HOSVZUDX/FH79E5CHOSVZUDX.LARGE.jpghttp://cdn.instructables.com/FH7/9E5C/HOSVZUDX/FH79E5CHOSVZUDX.LARGE.jpghttp://cdn.instructables.com/FPU/THU8/HOSLKHHB/FPUTHU8HOSLKHHB.LARGE.jpghttp://cdn.instructables.com/FH7/9E5C/HOSVZUDX/FH79E5CHOSVZUDX.LARGE.jpg

  • 8/9/2019 Th Monitor

    12/27

    The White wire from the sensor is a spare ground, and is not needed. Cut itoff inside the sensor case, being careful not to cut any of the other wires.

    Braid the other three wires to keep them together, and cut them off about 3.5inches long.

    Prepare a 5-pin single inline female connector (cut fromhttps://www.sparkfun.com/products/115 or equivalent), and solder the wires toit:

    1) Red (+3.3V)2) No Connection3) No Connection4) Yellow (Data)5) Black (Ground)

    Plug the connector into the GPIO on the Raspberry Pi so that pin 1 on theconnector (red wire) is on pin 1 of the GPIO connector (label P1 on the board,upper right in the picture). Note that the Red wire is on GPIO Pin 1 (+3.3V),the Yellow wire is on GPIO pin 7 (GPIO 4), and the Black wire is on GPIO Pin9 (Ground).

    http://cdn.instructables.com/FPU/THU8/HOSLKHHB/FPUTHU8HOSLKHHB.LARGE.jpghttp://cdn.instructables.com/FPU/THU8/HOSLKHHB/FPUTHU8HOSLKHHB.LARGE.jpghttp://cdn.instructables.com/FPU/THU8/HOSLKHHB/FPUTHU8HOSLKHHB.LARGE.jpg

  • 8/9/2019 Th Monitor

    13/27

    Tuck the excess wire into the case.

    Use a short CAT5 cable (something like

    http://www.monoprice.com/Product?c_id=102&cp_id=10232&cs_id=1023201&p_id=7505 ) to connect the LAN OUT on the PoE splitter and the RaspberryPi Ethernet jack. Twist it up to make it stay close to the case.

    Take the PoE output cable and a Micro-USB connector or cable and solderthem together. If using an AdaFruit http://www.adafruit.com/products/1390Micro-USB connector, wire it up as shown athttp://learn.adafruit.com/assets/12402 , if using a cut-off cable, determine +5and Gnd wires with a multimeter. Note that the TP-Link wire with the whitestripe is POSITIVE.

    Step 3: Raspberry Pi software setup

    http://cdn.instructables.com/FHZ/JUYC/HOUFZIBT/FHZJUYCHOUFZIBT.LARGE.jpghttp://cdn.instructables.com/FHZ/JUYC/HOUFZIBT/FHZJUYCHOUFZIBT.LARGE.jpghttp://cdn.instructables.com/FHZ/JUYC/HOUFZIBT/FHZJUYCHOUFZIBT.LARGE.jpg

  • 8/9/2019 Th Monitor

    14/27

    Getting the basic Raspberry Pi software up and running has beendocumented elsewhere, but basically, go to:http://www.raspberrypi.org/downloadsdownload the latest NOOBS (v1.3.2 as of this writing)

    Format the SD card using the SD card tool athttps://www.sdcard.org/downloads/formatter_4/Unzip the NOOBS file and put the contents at the root of the SD card.Insert the SD card into the Raspberry PiConnect a keyboard, monitor, mouse, and LAN cable to the Raspberry Pi andconnect the power supply (when you plug the PoE splitter into the LAN cable,the Raspberry Pi will power up).

    Select the Raspian distribution and install it.While that's installing, select English-US keyboard, which autoselects USKeymap

    On first boot, the raspi-config utility will run.Select Console Login as the default on bootChange Locale to en_US UTF-8Set timezone for your locationSet keyboard to Generic 105-key, English USEnable the camerachange the hostname to something memorable (I used 'rpithon' for Raspberry

    Pi Temp/Humid On Net)set 16M memory split as we'll be running headlessEnable SSHreboot

    Now you can either continue to use the console or ssh to it from anothermachine. From my Mac I can just say:ssh pi@rpithonand log in using the password 'raspberry'. If your router doesn't do the DNS tohelp you find 'rpithon' then make note of the IP address on the console anduse that instead.

    Update everything (this will take a while):

    sudo apt-get updatesudo apt-get upgradesudo rpi-update

    and reboot

    Since this is going to be a LAN-only device, I get sick of playing "Mother May

  • 8/9/2019 Th Monitor

    15/27

    I?" with sudo, and I want to avoid any permissions problems with theadditional software, so let's enable the root user and delete the pi user:

    sudo passwd root

    repeated twiceexit

    log back in as root user (or ssh root@rpithon) using the password selectedabove

    remove pi user:

    deluser -remove-home pi

    I prefer Emacs, and don't want all the X-Windows stuff, so:

    apt-get install emacs23-nox

    Tell it to check the disk (SD Card) every time it boots:

    tune2fs -c 1 /dev/mmcblk0p6

    emacs /etc/ssh/sshd_config

    change X11Forwarding to noUseDNS noClientAliveInterval 60

    service ssh restart

    Step 4: Setting up LAMP server (web server)

    http://cdn.instructables.com/FDQ/L9L1/HOUFZID3/FDQL9L1HOUFZID3.LARGE.jpg

  • 8/9/2019 Th Monitor

    16/27

    So we want to be able to see the graphs we'll be generating (below), so weneed to install a LAMP server.

    LAMP: /Linux/Apache/MySQL/PHP&Perl

    Linux is the operating system you are using (Raspian is a version of Debian,which is one of the common flavors of Linux)

    Apache is the name of the web server softwareMySQL is a SQL (Standard Query Language) database interface. Databasessound really scary, but they are easy to use for simple things once you getused to them.

    PHP and Perl are programming languages that are commonly used withwebsites, though we'll be using the Raspberry Pi standard Python for graphing

    http://cdn.instructables.com/FDQ/L9L1/HOUFZID3/FDQL9L1HOUFZID3.LARGE.jpghttp://cdn.instructables.com/FDQ/L9L1/HOUFZID3/FDQL9L1HOUFZID3.LARGE.jpghttp://cdn.instructables.com/FDQ/L9L1/HOUFZID3/FDQL9L1HOUFZID3.LARGE.jpg

  • 8/9/2019 Th Monitor

    17/27

    the data and 'creating' the website.

    apt-get install apache2 php5 mysql-client mysql-server vsftpd

    This takes a while to install. Midway through it'll ask you for a MySQLpassword, pick one memorable, I'll use 'password' for this tutorial.

    Now you should be able to browse to http://rpithon (or http:// ifthe DNS doesn't work) and see a demo web page. Try to edit/var/www/index.html and see if your changes show up when you refresh thewebpage.

    Step 5: Ez_setup, MySQL, matplotlib

    ez_setup is a Python program that loads some nice addons (think of it as apt-get on steroids)

    wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.pypython ez_setup.py

    These next steps install some integration between Python and MySQL:

    apt-get install python-mysqldbapt-get install libmysqlclient-deveasy_install MySQL-python

    We'll be using the wonderful, powerful, and free(!) matplotlib for graphing ourdata, though we won't be using much of its power.

    apt-get install libblas-dev liblapack-dev python-dev libatlas-base-dev gfortranpython-setuptools python-scipy python-matplotlib

    Step 6: WiringPi - GPIO interface

    http://cdn.instructables.com/FDK/HP7I/HOUG6APU/FDKHP7IHOUG6APU.LARGE.jpghttp://cdn.instructables.com/F2Y/61LK/HOUG8KCV/F2Y61LKHOUG8KCV.LARGE.jpghttp://cdn.instructables.com/FDK/HP7I/HOUG6APU/FDKHP7IHOUG6APU.LARGE.jpghttp://cdn.instructables.com/FDK/HP7I/HOUG6APU/FDKHP7IHOUG6APU.LARGE.jpg

  • 8/9/2019 Th Monitor

    18/27

    Gordon Henderson has created a wonderful programming interface for theGPIO pins, including some drivers for the esoteric interface that ourTemperature/Humidity sensor uses. See http://wiringpi.com/ for more details.

    git clone git://git.drogon.net/wiringPicd wiringPi./buildcd examplesemacs rht03.c (change the line #define RHT03_PIN 0 to #define RHT03_PIN7 for the GPIO pin we're using)make rht03./rht03(you should get continuous temperature and humidity readings)

    now we know our hardware is working, let's write our own program...

    Step 7: Set up a database and a table

    So we have database software, but there's no database, or tables, so let'screate them:

    Open the MySQL command interface:

    mysql -ppassword

  • 8/9/2019 Th Monitor

    19/27

    [...]

    Create a new database, called Monitoring

    mysql> create database Monitoring;Query OK, 1 row affected (0.00 sec)

    Select that as our current database

    mysql> use Monitoring;Database changed

    Create a single table in the database called TempHumid, which will containthe Unix Epoch (seconds since 1970) and Temperature and Humidityreadings

    mysql>create table TempHumid (ComputerTime INTEGERUNSIGNED,Temperature DECIMAL(5,1), Humidity DECIMAL(5,1));Query OK, 0 rows affected (1.70 sec)

    Done with MySQL, exit back to the command prompt.

    mysql> exit

    ByeStep 8: Add readings to the database

    Because the timing is tight on the sensor protocol, we're going to use C codeto communicate with the sensor and add readings to the database.

    So go to the root user's default directory:

    cd ~

    copy the Makefile (instructions on how to build the code we're going to create)

    cp wiringPi/examples/Makefile .

    emacs makeFilechange the two lines below to match this:

    INCLUDE = -I/usr/local/include,/usr/include/mysql

    LDFLAGS = -L/usr/local/lib,/usr/lib/arm-linux-gnueabihf -lmysqlclient -lpthread-lz -lm -lrt -ldl

  • 8/9/2019 Th Monitor

    20/27

    Now copy th.c (included here) into your default directory. Change thepassword on line 68 from "password" to whatever you chose as the MySQLpassword.

    When you compile it:

    make th

    you'll get a couple of warnings about declarations of exit, but it'll work fine.

    Now you can run the program by typing:

    ./th

    It waits for a 60-second interval (minute) to end, then reads the sensor, insertsthe time and sensor readings into the database, and loops forever.

    Once we have that working properly, we want it to start whenever theRaspberry Pi starts up:

    emacs /etc/rc.localinsert:

    /root/th >> /root/th.log &

    before the line that reads "exit 0"

    reboot and see if th.log grows by one line per minute:

    tail -f th.log

    You can confirm that the data is getting into the database with:

    mysql -ppassworduse Monitoring;select * from TempHumid;

    You should get a list of all values in the database.

    th.c 3 KB

    Step 9: Graph data from the database

    http://www.instructables.com/files/orig/FV1/SE8A/HOSLXFJA/FV1SE8AHOSLXFJA.chttp://www.instructables.com/files/orig/FV1/SE8A/HOSLXFJA/FV1SE8AHOSLXFJA.chttp://www.instructables.com/files/orig/FV1/SE8A/HOSLXFJA/FV1SE8AHOSLXFJA.chttp://www.instructables.com/files/orig/FV1/SE8A/HOSLXFJA/FV1SE8AHOSLXFJA.c

  • 8/9/2019 Th Monitor

    21/27

    We're going to use Python for pulling readings out of the database and graphthem with matplotlib. Log in as root.

    Set up the directory structure we'll be using:mkdir Graphcd Graphmkdir graphics

    copy GraphTH.py into the Graph directoryChange the password on line 40:DBconn = mdb.connect('localhost', 'root', 'password', 'Monitoring')to match the MySQL password you set previously.You can also set on line 81 to match your desired locationname

    Try running it:

    python GraphTH.py

    It will get the last 24 hours of readings from the database, reorganize the data,

    http://cdn.instructables.com/F28/E8B1/HOUG1FCP/F28E8B1HOUG1FCP.LARGE.jpghttp://cdn.instructables.com/F28/E8B1/HOUG1FCP/F28E8B1HOUG1FCP.LARGE.jpghttp://cdn.instructables.com/F28/E8B1/HOUG1FCP/F28E8B1HOUG1FCP.LARGE.jpghttp://cdn.instructables.com/F28/E8B1/HOUG1FCP/F28E8B1HOUG1FCP.LARGE.jpg

  • 8/9/2019 Th Monitor

    22/27

    throw out obvious bad data, create a graph of the results, and copy TH.png to/var/www so you should be able to see a new graph time you runGraphTH.py at http://rpithon/TH.png

    Now we want this to run every minute, so:export EDITOR=emacscrontab -e

    Add the line:* * * * * /usr/bin/python /root/Graph/GraphTH.py >> /root/Graph/GraphTH.logat the bottom of the file.

    Now GraphTH.py should run every minute, and if you updatehttp://rpithon/TH.png (or http:///TH.png you should see itchange about once a minute.

    In the example above I covered the sensor with a damp Kleenex while it driedas a test.

    GraphTH.py 3 KB

    Step 10: Monitor more than one location

    http://www.instructables.com/files/orig/FV1/QMSB/HOUGGUUM/FV1QMSBHOUGGUUM.pyhttp://www.instructables.com/files/orig/FV1/QMSB/HOUGGUUM/FV1QMSBHOUGGUUM.pyhttp://cdn.instructables.com/FGR/EWQN/HOUFXLE5/FGREWQNHOUFXLE5.LARGE.jpghttp://www.instructables.com/files/orig/FV1/QMSB/HOUGGUUM/FV1QMSBHOUGGUUM.py

  • 8/9/2019 Th Monitor

    23/27

    So I built five of these boxes for various locations, and on the LAMP server ofone of them, added the following TH.html

    Temperature and Humidity readings

    http://cdn.instructables.com/FGR/EWQN/HOUFXLE5/FGREWQNHOUFXLE5.LARGE.jpghttp://cdn.instructables.com/FGR/EWQN/HOUFXLE5/FGREWQNHOUFXLE5.LARGE.jpghttp://cdn.instructables.com/FGR/EWQN/HOUFXLE5/FGREWQNHOUFXLE5.LARGE.jpg

  • 8/9/2019 Th Monitor

    24/27


    Temperature and Humidity


    Sensor locations:



    White - A Room

    Green - Another Room

    Blue - A Place To Monitor

    Purple - Another Place


    Orange - Somewhere Else

    Graphs are updated every minute.

  • 8/9/2019 Th Monitor

    25/27

    so now I can point my browser at: http://rpithon-wht/TH and see all of thegraphs updated every minute.

    Step 11: Extras - Camera

    http://cdn.instructables.com/FLX/D8J4/HOSLK9G9/FLXD8J4HOSLK9G9.LARGE.jpghttp://cdn.instructables.com/F0B/ESNY/HOUG52V9/F0BESNYHOUG52V9.LARGE.jpghttp://cdn.instructables.com/FLX/D8J4/HOSLK9G9/FLXD8J4HOSLK9G9.LARGE.jpghttp://cdn.instructables.com/FLX/D8J4/HOSLK9G9/FLXD8J4HOSLK9G9.LARGE.jpg

  • 8/9/2019 Th Monitor

    26/27

    You remember how we enabled the camera module when we installed theRaspian operating system? Now we can add a Raspberry Pi Camera module:

    $25 http://www.newark.com/raspberry-pi/rpi-camera-board/add-on-brd-camera-module-raspberry/dp/69W0689

    Just feed the camera cable through the slot in the top case and plug it into theconnector on the Raspberry Pi as per the instructions athttp://www.raspberrypi.org/camera using the connector next to the Ethernet

    port, with the tinned leads pointing away from the Ethernet connector.

    I used another piece of Azek to position the camera with some hot melt glue,but there are obviously a lot of options.

    Now you can use the camera module to let you see into the area you aremonitoring for temperature and humidity. From another computer you can dosomething like:

    ssh root@rpithon 'raspistill -o image.jpg'scp root@rpithon:image.jpg .

    http://cdn.instructables.com/F0B/ESNY/HOUG52V9/F0BESNYHOUG52V9.LARGE.jpghttp://cdn.instructables.com/F0B/ESNY/HOUG52V9/F0BESNYHOUG52V9.LARGE.jpghttp://cdn.instructables.com/F0B/ESNY/HOUG52V9/F0BESNYHOUG52V9.LARGE.jpg

  • 8/9/2019 Th Monitor

    27/27

    Or have a cron job save a new file to the webserver on a regular basis!

    In addition to the camera, there are lots of other peripherals and functions youcan add to the Raspberry Pi, let your imagination guide you!