Johannes Smits
Published © GPL3+

Monitoring the doorbell

Get a text message with picture every time someone presses the doorbell.

IntermediateShowcase (no instructions)1 hour3,553
Monitoring the doorbell

Things used in this project

Hardware components

Raspberry Pi 1 Model B+
Raspberry Pi 1 Model B+
Any raspberry (or banana) pi will do
×1
G3MB-202P DC-AC PCB SSR In 12V DC Out 240 V AC 2A Solid State Relais Module
×1
MULTICOMP KBP204G Bridge Rectifier Diode
×1
7mm Inspection endoscope USB Camera
×1

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

image.png

Code

doorbellmonitor.py

Python
#!/usr/bin/python.

import RPi.GPIO as GPIO 
import time
import subprocess
import os

GPIO.setmode(GPIO.BCM)  
GPIO.setup(24, GPIO.IN, pull_up_down=GPIO.PUD_UP)

def erWordtGebeld(channel):
        returncode = subprocess.Popen("/usr/bin/fswebcam -c /opt/develop/deurmonitor.cfg", shell=True)
        print('Doorbell rang at ' + time.strftime("%a om %H:%M:%S"))

GPIO.add_event_detect(24, GPIO.FALLING, callback=erWordtGebeld, bouncetime=500)
print( "Deurbelmonitor is started at " + time.strftime("%A om %H:%M:%S") )
print( "Druk op Ctrl-C om te stoppen")

try:
        while True:
                time.sleep(3600)

except KeyboardInterrupt:
        print "Cleaning up..."
        GPIO.remove_event_detect(24)
        GPIO.cleanup()
        print "Done

Credits

Johannes Smits

Johannes Smits

2 projects • 11 followers

Comments