Raspberry Pi Sends picture to an
email address to
alert of an intrusion
PIR Sensor detects
movement
PIR Sensor
Takes a
picture Camera
Added Annotation
to the design after
feedback
, Raspberry Pi Motion Detector Code
from gpiozero import MotionSensor
from picamera import PiCamera
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
import datetime
import time
import smtplib
#Email Addresses
FromAddress =
ToAddress =
#Finds Motion Sensor and Camera
PIRSensor = MotionSensor(4)
camera = PiCamera()
#Exit While loop
Tripped = True
#Wait Five Seconds
time.sleep(5)
while Tripped:
if PIRSensor.motion_detected:
print("Motion Detected")
#Take a Picture