Raspberry Pi 3 + WiFi + Camera + PIR = home monitoring

Welcome,
I would like to introduce you to a simple and easy project that anyone can quickly build. For this purpose, I used Raspberry Pi 3 model B with built-in WiFi. This is home monitoring that can be turned on when leaving the apartment. When the alarm is armed (60 seconds after pressing the button) and detects movement, a photo will be taken, which will then be sent to the indicated email address. After sending the photo, the system waits 1 second (total intervals are a few seconds) and checks whether the movement is still detected, if so, the process of taking the photo and sending the message is repeated until the movement disappears.
For a project outside Raspberry Pi 3 you need:
- HC-SR501 PIR motion sensor, which should be connected to GPIO14 (5V is available on pin number 4),
- signaling diode (LED 3mm + resistor), which should be connected to GPIO16,
- a camera dedicated to Raspberry Pi, which should be connected to the dedicated connector located on the board,
- membrane keyboard, in which the selected character should be connected to the GPIO2 and GPIO3 pins
Now a few words of explanation. The membrane keypad 4x4 characters gives great possibilities, e.g. you can enter codes to activate and deactivate the alarm. Here, however, I used a simplified version in which I selected one button from the entire keyboard and it is he who is responsible for turning the alarm on and off. We decide which button is connected (connecting it properly). The alarm operation is signaled by a lit LED. If the alarm is turned off, the LED goes out.
Before starting the program, configure WiFi so that it can always connect to the network by itself. Alternatively, a cable can be used

Python code:
Code: Python
I warn you right away that I practically don't know Python so I know it could have been done better. I'm just learning the language in my free time

The housing and appearance of the device are shown in the pictures below (I know the tragic quality). Additional holes are for the camera and PIR mounting screws (I need to find some, this is temporarily stabilized by adhesive tape)



Comments
In the case of exactly one camera can and profitable while few cameras in this solution rather poor better is the recorder + IP cameras of the things that caught my eye: - what if there is no... [Read more]
Ultimately, I wanted to make only one camera that will monitor the entrance door along with the corridor. If I had to make several cameras, of course your idea would be much better. For the rest: ... [Read more]
nooo ok but how does everything behave? trying to send again? example: the IP connection has died, someone PIR is detecting something, the camera takes a picture, the script wants to send it - failed... [Read more]
If the photo fails to send, there are two possible cases: a) the motion is still detected so he takes a new photo and tries to send the new photo b) motion is not detected, then it does not take a... [Read more]
I would think about trying to send a recent or recent photo if no motion is detected :) I was interested a few years back and the number of disadvantages far outweighed the number of advantages... [Read more]
I think I'll add the option to resend because it's a good idea. From what I read, I also found that there are more disadvantages than advantages. However, some may be interested :) What to... [Read more]
because it is so-called off-topic and is inconsistent with the regulations? makes searching for information more difficult, because it is rather difficult to look for information about data transmission... [Read more]
Nice construction. As for motion detection, it can be done on a "webcam". Read about motion which, when motion is detected on the camera, automatically saves photos to the designated place. It... [Read more]
We discussed possible ways of powering and transmitting the signal, which is an inseparable element of monitoring :P It makes sense with a clogged email, in that case a cloud and a better disk is... [Read more]
An interesting project I am doing now, alarm for the garage, but on Arduino The cloud is a linden I mean dropbox, buy yourself a NAS and there you have 4 cameras as standard. When you configure it,... [Read more]
cloud is one thing, network disk is another they sum it up like this: people are divided into three groups: 1. those who do backups 2. those who will do backups 3. those who think they are... [Read more]
Why? Regular backups are different, and a copy of files in the cloud is different - they can coexist. [Read more]
Colleagues cloud is a network folder with synchronization placed on the NAS. Why do you think I have one disk? I have a cloud with full synchronization, you have a dropbox without a beckap and the... [Read more]
The cloud today because of the costs and profits associated with it is implemented quite often on one rack and in the same room with the marketing slogan "in the cloud safer". But everyone believes in... [Read more]
I noticed an interesting problem. Sometimes the system will arm or disarm itself. It is as if the state on the keyboard pin was unstable. A pull-up polarizing resistor would probably help (because I'm... [Read more]