Skip to content

Used for a Rashberry PI sensor. The goal is to setup a simple program that polls a sensor installed on a rasberry Pi

License

Notifications You must be signed in to change notification settings

PeterPlatt/tempSensorMonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Temperature Sensor Monitor

Used for a Rashberry PI sensor. The goal is to setup a simple program that polls a sensor installed on a rasberry Pi

Steps

This assumes the following

  • Rasbian is installed on the Raspberry Pi
  • Adafruit AM2302 (wired DHT22) temperature-humidity sensor (ADA393) is installed on pin 18
  • A mongoDB instance is setup
  1. Install Python 2.6/2.7
    • sudo apt-get update
    • sudo apt-get install build-essential python-dev
    • sudo apt-get install python-pip
  2. Install Adafruit Python DHT Sensor Library
    • pip install Adafruit_Python_DHT
  3. Install PyMongo
    • pip install pymongo
  4. Set up dbconfig.py
    • variable name Purpose Notes
      MONGO_DB_HOST URL of host
      MONGO_DB_PORT Mongo DB Port
      MONGO_DB_NAME Mongo DB Name
      MONGO_DB_USER_NAME Mongo UN
      MONGO_DB_PASSWORD Mongo Password
      MONGO_DB_STATS_COLLECTION Mongo Collection Name
      SENSOR_LOCATION Location Of the Sensor Ex: Basement
  5. Setup cron job to run sensor
    • Edit current Cron jobs
      • sudo crontab -e
    • Set Polling time
      • Note the polling time should not be faster then every 2 seconds
      • This example conjob does it every 5 mins
        • */5 * * * * sudo python /home/pi/temperatureHumidSensor/sensorPoll.py

Sources

  1. Adafruit Python DHT Github page
  2. Rethinking temperature, sensors, and Raspberry Pi
  3. PyMongo Tutorial
  4. Adafruit AM2302 (WIRED DHT22) TEMPERATURE-HUMIDITY SENSOR page

About

Used for a Rashberry PI sensor. The goal is to setup a simple program that polls a sensor installed on a rasberry Pi

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages