Embedded Software Development with Python and the Raspberry Pi

Slides:



Advertisements
Similar presentations
Weather Instruments These instruments are vital for collecting weather data. You will be tested on identification and function.
Advertisements

Presented by W1BAW Bruce Wattendorf. What is a Raspberry PI A $35 computer with out a monitor, keyboard, mouse but they all can be added.
Embedded Programming and Robotics Lesson 19 Raspberry Pi Programming in C 1.
Remote Temperature Sensor and LED Control By: Man Nguyen Edwin Oilvos Osama Hassan.
Raspberry Pi Training Truman College Goals of our Training Today Unbox and boot up the Raspberry Pi (RPi) Learn how to access the desktop graphical.
Weather Instruments Can you name any instruments or tools used to predict or describe weather?
Embedded Programming and Robotics
Data logging – Weather forecasting case study. Weather forecasting –How it used to be done  Traditionally weather forecasting relied upon the use of.
Weather forecasting –How it used to be done Traditionally weather forecasting relied upon the use of large numbers of different places in the country sending.
IoT: Windows 10 & Raspberry Pi By: Mitchel Sellers.
Bonus EV3 Programming Lessons By Droids Robotics LEGO MINDSTORMS and Raspberry Pi IR Light controller.
Bonus EV3 Programming Lessons LEGO MINDSTORMS ev3dev and Raspberry Pi IR Light controller.
Presented by: © 2015 Jacob Beningo All Rights Reserved Writing Portable and Robust Firmware in C September 2, 2015 Jacob Beningo, CSDP Class 3: Uart Driver.
Configuring Drupal Information Systems 337 Prof. Harry Plantinga.
Presented by: © 2015 Jacob Beningo All Rights Reserved Writing Portable and Robust Firmware in C September 4, 2015 Jacob Beningo, CSDP Class 5: Robust.
Embedded Software Design Week V Python Lists and Dictionaries PWM LED 1-Wire Temperature Sensor.
Embedded Software Design Week II Linux Intro Linux Kernel.
SCRATCH Weather Dashboard
Lecture 7 Datalogger Programming Using Arduino – Part 2
Workshop on Raspberry Pi 3
Embedded System Design Techniques™:
Weather Instruments.
What are they? What do they do?
What are they? What do they do?
IoT 101 with Raspberry Pi and Azure
Dr. Kyung Eun Park Summer 2017
What are they? What do they do?
Computer System Laboratory
Embedded Software Development with Python and the Raspberry Pi
PHYSICS PROJECT WITH A RESEACH BASIS 5c
Running your own web server
Embedded Software Development with Python and the Raspberry Pi
RASPBERRY PI WORKSHOP.
The Linux Operating System
Software Quality Assurance
DHT11 Temperature and Humidity Measurement
Configuring Kali Machine
Printers.
Internet-of-Things (IoT)
An Introduction to Embedded Software Architecture and Design
Baremetal C Programming for Embedded Systems
Internet-of-Things (IoT)
An Introduction to Embedded Software Architecture and Design
Weather Instruments.
Thursday, May 21, 2015 Castle Learning Week # 38
Weather Basics.
Writing Portable and Robust Firmware in C
Writing Portable and Robust Firmware in C
February 26, 2015 Jacob Beningo, CSDP
Baremetal C Programming for Embedded Systems
Weather Instruments.
What are they? What do they do?
Baremetal C Programming for Embedded Systems
What are they? What do they do?
Weather Instruments.
What are they? What do they do?
An Introduction to Embedded Software Architecture and Design
Implementation of Embedded OS
Weather Day 2 Weather Day 2.
An Introduction to Embedded Software Architecture and Design
What are they? What do they do?
What are they? What do they do?
What are they? What do they do?
An Introduction to Embedded Software Architecture and Design
Embedded System Design Techniques™:
February 24, 2015 Jacob Beningo, CSDP
What are they? What do they do?
What are they? What do they do?
IoT System Development with Raspberry Pi and Django
Robot and Crickit HAT © Copyright 2019 by Dr. Elizabeth I. Horvath and Dr. Eva A. Horvath 1.
Presentation transcript:

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.

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

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

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

The Personal Weather Station (PWS)

The Personal Weather Station (PWS) Weather Underground Resources http://www.wunderground.com/weatherstation/about.asp http://wiki.wunderground.com/index.php/PWS_-_Personal_Weather_Stations http://wiki.wunderground.com/index.php/PWS_-_Upload_Protocol

Setup a PWS Account Registering at Weather Underground

Setup A PWS Account PWS Location

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!)

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

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 http://www.airspayce.com/mikem/bcm2835/bcm2835-1.36.tar.gz -O bcm2835-1.36.tar.gz

Temperature and Humidity Sensor Installing the Adafruit DHT Python Driver git clone https://github.com/adafruit/Adafruit_Python_DHT.git 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

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

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

Personal Weather Station Application Configuration datetime.utcnow()

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

Personal Weather Station Application Web Connection datetime.utcnow()

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

PWS Results It is live!

PWS Results

Script Automation Login Automatically Script start on login sudo nano /etc/initab comment out 1:2345:respawn:/sbin/getty 115200 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”

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 www.beningo.com under Blog and Articles > Software Techniques > Embedded Software with Python

Contact Information P.O. Box 400 Linden, Michigan 48451 : jacob@beningo.com : 810-844-1522 : 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.