Passive Infrared Sensor

Slides:



Advertisements
Similar presentations
Breadboard Power bus + (red) and – (blue) on left and right of breadboard abcde (green) are all connected in a row fghij (yellow) are all connected in.
Advertisements

Lab 3: Series & Parallel Resistors Only 9 more labs to go!! Potential V R, resistor Current, I water flow The energy can be extracted from the water if.
MICROCONTROLLERS MODULE 2 Programming, Controlling and Monitoring.
Living with the Lab Using Your Arduino, Breadboard and Multimeter EAS 199A Fall 2011 Work in teams of two!
© red ©
Voltage Drops Around Closed Loops 470  220  5V   220  living with the lab.
Or how to read those little resistors!
Designed by Emilius K..  A resistor is a passive two-terminal electrical component that implements electrical resistance as a circuit element.passivetwo-terminalelectrical.
Embedded Programming and Robotics
Using Your Arduino, Breadboard and Multimeter Work in teams of two! living with the lab 1 © 2012 David Hall.
Presented by Tim Surtell in association with
Understanding the Resistor Color Code
Resistors are available in many different values and the colour bands on them are used to indicate what value the resistor is. Looking at this resistor,
You will need the following parts from your kit: 1.Breadboard ohm resistor (brown, black, brown, gold) 3.1 LED (light emitting diode) 4.1 Potentiometer.
Gate Anode Cathode. You will need the following parts from your kit: 1.Breadboard ohms resistor (red, red, brown, gold) ohms resistor (brown,
Instrumental Analysis Electrical Components and Circuits.
Daily Sprint START In your own words describe the functions of the following: variable resistor photoresistor fixed resistor.
Experiments Day 1 & 2 Resistors, Potentiometers and Photocells.
Experiments Day 1 Resistors.. Electronic Technology Definition: The technology of using small amounts of electricity for controlling, detecting, collecting,
SCR (Silicon-Controlled Rectifier) Foundations of Technology SCR (Silicon-Controlled Rectifier) © 2013 International Technology and Engineering Educators.
Potentiometer Foundations of Technology Potentiometer © 2013 International Technology and Engineering Educators Association, STEM  Center for Teaching.
220  470  Gnd5V Currents Through Parallel Resistors 1 living with the lab © 2012 David Hall.
470  220  Gnd5V Currents Through Parallel Resistors 1 living with the lab © 2011 LWTL faculty team.
2 Resistors Chapter Topics Covered in Chapter 2
Voltage Drops Around Closed Loops 470  220  5V   220  living with the lab © 2012 David Hall.
Digital Multimeter (DMM) Used to measure the following: Voltage – DC and AC Current – DC and AC Resistance Capacitance Temperature – w/ extra probe Also.
Computer Hardware Technology
How an NPN Transistor Works
Two basic types Ceramic disk Electrolytic Has positive and negative sides Farads – unit of measure (F) Microfarads(uF) and picofarads (pF) Cans have value.
Resistance How to read the strength of a resistor.
Resistor Colour Code Why the Colour Code? The Colour code was developed to overcome two basic problems; Difficult to print and see numbers on a.
Daily Sprint START 1. If a computer uses 3A of current and is supplied with 120V of voltage, then what is the total resistance of the computer? 2. A circuit.
Electrical Resistance University High School. Conductors Possess a great ability of conducting electricity Contain free electrons that flow easily through.
Resistors Foundations of Technology Resistors © 2013 International Technology and Engineering Educators Association, STEM  Center for Teaching and Learning™
Using Your Arduino, Breadboard and Multimeter ME 120 Fall 2013 Work in teams of two!
Controlling an LED with a switch. 2 breadboard place where you can build electric circuits really quickly the magical breadboard.
Diode Foundations of Technology Diode © 2013 International Technology and Engineering Educators Association, STEM  Center for Teaching and Learning™ Foundations.
NOCTI Review Lesson 1 Objectives: Discuss resistor color band and determine resistor values and tolerance. Compute values using formulas for series, parallel,
Resistance. Resistor A resistor is part of an electric circuit that resists the flow of electric current. As current flows through a resistor, some of.
Building Circuits.
Python with Raspberry PI Kit
Experiment #1 Measurement of Resistance
Or how to read those little resistors!
Light Dependent Resistor
K.R.E SOCIETY’S Karnatak Arts, Science and Commerce college Bidar
How to read the strength of a resistor
UltraSonic Sensor VCC is the pin that powers the device, connect to 5V. Trigger is the pin that sends out the burst. Echo is the pin that outputs when.
Pulse Detector Ramiro Duarte, Clayton Greenbaum Frank Paynter
Simple LED circuit.
WORKSHOP LED CONTROL.
Session 3 DIY Moderate Project
Lighting LEDs with a RASPBERRY PI
Resistors (466) Chapter 14.
Resistance Resistance Gateway To Technology
RESISTOR COLOR CODE GUIDE
Internet-of-Things (IoT)
Digital Multimeter (DMM)
JC Technology Resistors.
RESISTANCE.
Arduino Part 4 Let there be more light.
What Color is it?.
How a PNP Transistor Works
How an NPN Transistor Works
Light Dependent Resistor
Camera Copyright (c) 2017 by Dr. E. Horvath.
Python with Raspberry PI Kit
Controlling LED with PWM
Electronics Resistance Practice Problems R LabRat Scientific © 2018.
2019 Investing Now Summer Program
Presentation transcript:

Passive Infrared Sensor The PIR Sensor detects motion Copyright (c) 2017 by Dr. E. Horvath

Passive Infrared Sensor Copyright (c) 2017 by Dr. E. Horvath

Copyright (c) 2017 by Dr. E. Horvath PIR Sensor Circuit Leads left to right on the back of the PIR Sensor Breadboard locations GND VCC OUT j1 j2 j3 breadboard location f2 jumper wire to 3.3 V PWR (Pin 1) breadboard location f3 jumper wire to GPIO 17 (Pin 11) breadboard location f1 jumper wire to GND (Pin 6). Connect the GND last. Remove the GND first, when taking the circuit apart. Copyright (c) 2017 by Dr. E. Horvath

Copyright (c) 2017 by Dr. E. Horvath PIR Sensor Circuit Copyright (c) 2017 by Dr. E. Horvath

Passive Infrared Sensor from time import sleep import RPi.GPIO as GPIO Import the GPIO library to interact with the GPIO GPIO.setmode(GPIO.BCM) Set to the Broadcom mode to access the pins by the functions PIR = 17 Monitor GPIO 17 GPIO.setup(PIR, GPIO.IN) try: while True: print("Waiting...") sleep(0.1) # Do not use up CPU cycles

Passive Infrared Sensor if GPIO.input(PIR) == 1: print("PIR detected") sleep(1) else: print("Waiting for passive infrared sensor") sleep(0.1) except KeyboardInterrupt: print(“Exiting ...”) finally: GPIO.cleanup() Set the pins back to a safe state

Copyright (c) 2017 by Dr. E. Horvath Sending emails import smtplib from email.mime.text import MIMEText fromaddr = 'Your email address' toaddr = 'Reciever email address' username = 'Your email address' password = 'Your password' Copyright (c) 2017 by Dr. E. Horvath

Copyright (c) 2017 by Dr. E. Horvath Sending emails Create a gmail account Go to https://www.google.com/settings/security/lesssecureapps Access for less secure apps Turn on Copyright (c) 2017 by Dr. E. Horvath

Copyright (c) 2017 by Dr. E. Horvath Sending emails msg = MIMEText('This Raspberry PI stuff is awesome') msg['Subject']='PYTHON WITH RASPBERRY PI ANOTHER TEST' msg['From'] = fromaddr msg['To'] = toaddr server = smtplib.SMTP('smtp.gmail.com:587') server.ehlo() server.starttls() server.login(username,password) server.send_message(msg) server.quit()) Copyright (c) 2017 by Dr. E. Horvath

LEDs Color Maximum Voltage (check datasheets) Red 2V Green/Yellow/Orange 2.2V Blue/White 3.7V Violet 4V Ultraviolet 4.4V Infrared 1.6V

Copyright (c) 2017 by Dr. E. Horvath Ohm's Law V = IR Voltage = Current * Resistance Current – measured in Ampheres Use mA in the lab 1000mA = 1A 1mA = 0.001A Resistance – measured in Ohms Copyright (c) 2017 by Dr. E. Horvath

Copyright (c) 2017 by Dr. E. Horvath Ohm's Law Maximum current on any GPIO pin 16mA Output from a GPIO pin is 3.3 V 3.3V – 2.2V = 1.1V 2.2V to power the green LED V = IR 1.1V = 16 * 0.001 * R R = 1.1/(16 *0.001) = 68.75 Ohms for maximum brightness The minimum you should use is 100 Ohms Use higher resistance over 1KOhm when experimenting Copyright (c) 2017 by Dr. E. Horvath

Copyright (c) 2017 by Dr. E. Horvath Compute the Current I = V/R I = 1.1/R R is your resistor's value in Ohms Refer to the color chart Copyright (c) 2017 by Dr. E. Horvath

Copyright (c) 2017 by Dr. E. Horvath Resistor Color Chart Copyright (c) 2017 by Dr. E. Horvath

Four Band Resistor Code Bands 1 and 2 First Digit and Second Digit Black 0 Brown 1 Red 2 Orange 3 Yellow 4 Green 5 Blue 6 Purple 7 Gray 8 White 9 Band 3 Multiplier or Number of Zeroes Black * 1 Brown * 10 Red * 100 Orange * 1,000 Yellow * 10,000 Green * 100,000 Blue * 1000,000 Purple * 10,000,000 Gray * 100,000,000 White * 1,000,000,000 Gold *0.1 Silver * 0.01 Copyright (c) 2017 by Dr. E. Horvath

Four Band Resistor Code Band 4 Percent Tolerance Black - Brown 1% Red 2% Orange - Yellow - Green 0.5% Blue 0.25% Purple 0.1% White - Gray - Gold 5% Silver 10% No color 20% Copyright (c) 2017 by Dr. E. Horvath

Copyright (c) 2017 by Dr. E. Horvath Connecting an LED Light emitting diode (LED) connections Longer lead is positive (anode) breadboard location j24 Shorter lead is negative (cathode) breadboard location j22 470 Ohm Resistor breadboard location i30 breadboard location i24 breadboard location h30 jumper wire to GPIO 22 (Pin 15) breadboard location f22 jumper wire to GND (Pin 9) Copyright (c) 2017 by Dr. E. Horvath

Copyright (c) 2017 by Dr. E. Horvath Connecting an LED Copyright (c) 2017 by Dr. E. Horvath

Copyright (c) 2017 by Dr. E. Horvath Turning on an LED import RPi.GPIO as GPIO green_led = 23 GPIO 23 GPIO.setup(green_led,GPIO.OUT) Set the pin to be an output GPIO.output(pin_number,True) Turn on the LED sleep(interval) GPIO.output(pin_number,False) Turn off the LED GPIO.cleanup() Set the GPIOs back to a safe state Copyright (c) 2017 by Dr. E. Horvath