Presentation is loading. Please wait.

Presentation is loading. Please wait.

Embedded Software Development with Python and the Raspberry Pi

Similar presentations


Presentation on theme: "Embedded Software Development with Python and the Raspberry Pi"— Presentation transcript:

1 Embedded Software Development with Python and the Raspberry Pi
Class 5: An Internet of Things Weather Station Example August 22, 2014 Jacob Beningo, CSDP © All Images and content in this presentation may not be used or copied without express written permission of the owner.

2 Course Overview Introduction to Python Python Fundamentals
An Overview of the Raspberry Pi Controlling Raspberry Pi Peripherals with Python An Internet of Things Weather Station Example

3 Session Overview An IoT Weather Station Example
The Personal Weather Station (PWS) Setup a PWS Account Temperature & Humidity Sensors PWS Application PWS Results Script Automation

4 The Personal Weather Station (PWS)
Thermometer Barometer Anemometer Hygrometer Wind vanes UV index Soil moistness And more!

5 The Personal Weather Station (PWS)

6 The Personal Weather Station (PWS)
Weather Underground Resources

7 Setup a PWS Account Registering at Weather Underground

8 Setup A PWS Account PWS Location

9 Temperature and Humidity Sensors
AM2302 (DHT22) Capacitive Humidity Sensor 0 – 99.9% +/- 2% Thermistor for Temperature -40 to 80 C +/- 0.5 C Digital Single Wire Read Sample Rate 0.5 Hz ( relatively slow!)

10 Temperature and Humidity Sensors
AM2302 (DHT22) Wiring Red (3.3V – PI Pin 1) Yellow (Data – PI Pin 7) Black ( Ground – PI Pin 6)

11 Temperature and Humidity Sensors
AM2302 (DHT22) Communication Protocol Manchester “like” encoding Bit-Bang GPIO using a low level C driver Installing the Low Level C Driver Wget -O bcm tar.gz

12 Temperature and Humidity Sensor
Installing the Adafruit DHT Python Driver git clone cd Adafruit_Python_DHT sudo apt-get upgrade sudo apt-get install build-essential python-dev sudo python setup.py install Test the Sensor sudo python AdafruitDHT.py 22 4 cd Adafruit_Python_DHT/examples Sensor Type GPIO 4

13 Personal Weather Station Application
Application Design Read DHT Sensor Delay 5 s Send Data Verify Sensor Data Invalid Prepare Weather URL String Convert Temperature

14 Personal Weather Station Application
Script Dependencies Why urllib? datetime.utcnow()

15 Personal Weather Station Application
Configuration datetime.utcnow()

16 Personal Weather Station Application
Reading and verifying the sensor datetime.utcnow()

17 Personal Weather Station Application
Web Connection datetime.utcnow()

18 Personal Weather Station Application
Web Connection Error Checking datetime.utcnow()

19 PWS Results It is live!

20 PWS Results

21 Script Automation Login Automatically Script start on login
sudo nano /etc/initab comment out 1:2345:respawn:/sbin/getty tty1 Add 1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1 Script start on login nano ~/.bashrc At the bottom add “sudo python /path/pws.py”

22 Going Further Download Template Materials for Web Tutorials YouTube
Python Doxygen Script Template Personal Weather Station Python Script Raspberry Pi Example Python Scripts Web Tutorials YouTube From under Blog and Articles > Software Techniques > Embedded Software with Python

23 Contact Information P.O. Box 400 Linden, Michigan 48451 : : : Jacob_Beningo : Beningo Engineering : JacobBeningo : Embedded Basics Jacob Beningo Principal Consultant © All Images and content in this presentation may not be used or copied without express written permission of the owner.


Download ppt "Embedded Software Development with Python and the Raspberry Pi"

Similar presentations


Ads by Google