Security camera application

  1. Introducing the applied technology of security cameras with Doppler sensor RCWL-0516 and module camera
  • Switch between photos during the day and video during the night using the Module Camera or Web Camera.
    ― Sufficient lighting is required for nighttime videos, but photographic images can be recognized even if they are relatively dark.
  • Distributed processing is realized by two separate Raspberry Pis for Module camera connection and Doppler sensor connection.
  • Appropriate names for Inputs 1 and 3, here “security sensor” and “remote control”

DIO_settings

  • DIO contorl1 Action: High-> Low Module camera photo mail Remote control Action: High-> Low Module camera video mail set respectively

DIO contorl1

  • The setting of the Raspberry Pi to which the Module camera is connected is complete.
  • Next, set the Raspberry Pi to which the Doppler sensor RCWL-0516 is connected.
  • Named “Camera valid” for time control to Output4, Output4 is reflected in Iutput4 by inverting the output of Iutput4 and direct connection Output4

DIO_settings

  • DIO contorl1 Action: High-> Low of security sensor, reset registration only, counter generation only, Action does not set anything

DIO contorl1

  • Switch “Camera enabled” between 18:00 and 06:00 in Auto process.

DIO contorl1

  • Add in editor to the end of the /usr/bin/dio0low script automatically generated by Action: High-> Low of the security sensor with DIO contorl1
  • Meaning is that Input4 of json data is High-> Module Execute dio0low of Raspberry Pi to which the camera is connected, if Low, execute dio2low
    [iot00f:root#] vi /usr/bin/dio0low
    1
    2
    3
    4
    5
    6
    ENABLE=`cat /www/remote-hand/.di_read_data.json |jq -r .di3`
    if [ $ENABLE = “high” ];then
    pepoalexado iot02f remote hand dio0low
    else
    pepoalexado iot02f remote hand dio2low
    fi
  • Addition, you can get the output information of Output4 below, so you may judge with this
    1
    2
    3
    [iot00f:root#] cat /www/remote-hand/.di_read_data.json |jq -r .do3
    low <-result
    high or low

Security camera

  1. Use as a security camera with Doppler sensor RCWL-0516 and module camera.
  • Since the output 0-3.3v of RCWL-0516 cannot be directly connected to the gpio input of Raspberry Pi, connect it after level conversion safely with a photo coupler.

rcwl-0516_bord

  1. Send photo and video emails with the security camera when the Doppler sensor is activated.

secure_camera_image

I/O event settings

  1. DIO Control-1
  • Sets the operation to start when the input terminal changes from High to Low or Low to High.
  • There are two tabs to set the operation to start.
  • On the first tab, you can set to start operations, reset counters, and view logs.
DIO_Control-1
  1. DIO Control-2
DIO_Control-2

Environmental gas sensor BME680

  • Temperature / humidity / barometric pressure / gas sensor module BME680 is operated by Rasberry pi.
  • Download bme680.h, bme680_defs.h from Github Bosch Sensortec.
  • Download pepobme680.tar.gz from the osdn site.
    1
    2
    cc pepobme680.c bme680 -o pepobme680
    ./pepobme680
    It keeps outputting the following contents to /www/remote-hand/tmp/.pepobme680 about every 10 seconds.
    Date and time, temperature, humidity, atmospheric pressure, gas resistance
    1
    2
    [iot02f:root#] cat /www/remote-hand/tmp/.pepobme680
    2021/01/29/17:13:48,10.3,62.7,1016.1,5089877
    BME680 environmental gas sensor to display a graph

Save settings

  • Save settings
    Set the login user password to save (save various settings), restart, and initialize.configuration_save

Automation settings

  • Automatically run with Linux cron
    • Set to start / stop every minute.
    • For example, you can set input conditions.
    • When the room temperature rises, turn the fan for a certain period of time.
    • Turn on or off the light with outdoor brightness.
    • Can be set between 1 and 300,000 milliseconds.
auto_process

gmail settings

  • Mail settings (when using gmail)
    • It is a setting for command response with gmail
    • You can operate IOT-House commands and responses remotely via Gmail.
    • Command output terminal High / Low, response input terminal High / Low status, temperature, humidity, barometric pressure, air quality values, graphs, photos, videos, etc.
    • Checks new emails every Email check interval hourly, executes the keyword content that matches Subject (keyword), and returns a response.gmail_settings
  1. Email settings tab
  • You can operate IOT-House commands and responses remotely via Gmail.
  • Command output terminal High / Low, response input terminal High / Low status, temperature, humidity, barometric pressure, air quality values, graphs, photos, videos, etc.gmail_command

Mail command
To: dokokanodareXX@gmail.com
Subject: iot009
Body: none
Mail Response
From:root <dokokanodareXX@gmail.com>Date: Tuesday, September 22, 2020 10:53 10:53To:dokokanodareXX@gmail.comSubject:iot009 IOT-House report
Body: Continued below
==input list==
1:火事です=high
2:扇風機スイッチ=low
3:Input3=high
4:出力4と接続=high
5:Input5=none
6:Input6=none
7:Input7=none
8:Input8=none
9:防犯センサー=high
10:Input10=high
11:Input11=high
13:屋外照度=high
14:Input14=none
15:Input
15=none
16:Input16=none
17:CPU温度=high
18:部屋の温度=low
19:部屋の湿度=low
0:外気温度=high
21:外気湿度=low
22:気圧=high
23:ガス=high
24:空気=low
==output list==
1:換気扇=high
2:電気=low
3:Outnput3=low
4:入力4と接続=high
5:Outnput5=none
6:Outnput6=none
7:Outnput7=none
8:Outnput8=none
9:ななちゃん天井電灯
10:冷房
1:エアコン
12:暖房
13:天井電気
14:サーキュFAN
15:散水ポンプ=low
16:Outnput
16=none
17:玄関電灯=low
==Other Command==
21:CPU Temperature
22:GPIO Temperature&Humidity
23:No1 Camera Movie
24:No1 Camera Picture
25:No2 Camera Movie
26:No2 Camera Picture
27:No3 Camera Movie
28:No3 Camera Picture
29:Module Camera Movie
30:Module Camera Picture
31:Twlite Temperature&Humidity
32:CPU Temperature&Graph
33:GPIO Temperature&Graph
34:GPIO Humidity&Graph
35:Twlite Temperature&Graph
36:Twlite Humidity&Graph
37:GPIO Pressure&Graph
38:GPIO Gas&Graph
39:GPIO IAQ&Graph
40:GPIO Last Hour CSV Data

Request temperature graph
To: dokokanodareXX@gmail.com
Subject: iot009 33
Body: none
Mail Response
From:root <dokokanodareXX@gmail.com>Date: Tuesday, September 22, 2020 12:53 10:53To:dokokanodareXX@gmail.comSubject:iot009 IOT-House report
Body : GPIO Temperature Graph Report
shot_gpio_temp_grap

basic setting

  1. Access http://HOST_NAME.local or http://HOST_NAME with a web browser and log in.
    username: remote
    password: hand
  2. On the DIO Setting tab, set the input and output terminal aliases, IRkit, monaural wireless module, modem, and so on.
  • Output settings

    shot2020-09-19 13 07 11
  • Input settings

    input_settings
  1. Email settings(when using gmail)

    gmail_settings
  2. Save settings
    Set and save login user and password (save various settings)

    configuration_save

Input settings

  • Input name setting
  • Name the input, the name you set is to make it easier to understand with other settings.
  • Set the input alias, temperature, humidity and case analog value slices on the DIO Setting tab.
input_settings

Output settings

  • Output name setting
    • Name the output, the name you set is to make it easier to understand in other settings.
output_settings