{"id":16520069,"url":"https://github.com/pageauc/pi-motion-lite","last_synced_at":"2025-03-21T08:32:02.685Z","repository":{"id":24840154,"uuid":"28254991","full_name":"pageauc/pi-motion-lite","owner":"pageauc","description":"Raspberry Pi python motion detection using picamera python module","archived":false,"fork":false,"pushed_at":"2017-12-31T12:45:48.000Z","size":14,"stargazers_count":46,"open_issues_count":0,"forks_count":17,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-01T04:41:37.271Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pageauc.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-20T03:04:42.000Z","updated_at":"2025-01-05T17:19:34.000Z","dependencies_parsed_at":"2022-08-23T07:31:28.215Z","dependency_job_id":null,"html_url":"https://github.com/pageauc/pi-motion-lite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageauc%2Fpi-motion-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageauc%2Fpi-motion-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageauc%2Fpi-motion-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageauc%2Fpi-motion-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pageauc","download_url":"https://codeload.github.com/pageauc/pi-motion-lite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244126040,"owners_count":20402025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T16:49:29.295Z","updated_at":"2025-03-21T08:32:00.495Z","avatar_url":"https://github.com/pageauc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pi-motion-lite\n#### A Simple Raspberry Pi Computer Motion Detection Python Script\n\n### Introduction\nThis is a raspberry pi computer minimal motion detection python script for use\nin a users project. The script requires the picamera python module to be installed.\nIt uses piRGBArray data streams to detect motion (pixel differences).\nThis is a minimal code implementation for use in a users project.\n\n### Hardware\nRaspberry Pi computer pi zero, A, A+, B, B+, pi3, compute module Etc.\nRaspberry Pi camera module\n\nadditional support hardware eg SD card, PowerSupply, cables, etc.\nI will not list the details for setup since you can google for this information\ncheck out http://www.raspberrypi.org/downloads/ for one source of information.\n\nThis assumes you have a raspbian image installed and operational with\nthe picamera module installed and operational per raspi-config setup\n\n### Software\nThis code is available on github at https://www.github.com/pageauc/pi-motion-lite\n\nTo setup pi-motion-lite on your raspberry pi perform the following\nfrom a logged in putty ssh or pi desktop terminal session.\n\n    sudo apt-get install python-picamera\n    sudo apt-get install python3-picamera  # if running under python3\n    cd ~\n    mkdir pi-motion-lite\n    cd pi-motion-lite\n    wget https://raw.github.com/pageauc/pi-motion-lite/master/pi-motion-lite.py\n    chmod +x pi-motion-lite.py\n\nTo execute\n\n    ./pi-motion-lite.py\n\nor\n\n    python pi-motion-lite.py\n\nUse IDLE, nano or any other text editor to modify code for your project needs.\nadjust threshold and sensitivity to suit conditions.\n\nthreshold   - How Much a pixel needs to change before it is counted.\n              Normal value would be 10 but can be between 1 and 254\n              254 would be full black to white change.\nsensitivity - How Many pixels need to change before motion detected.\n              Higher value is less sensitive.  default=200\n              for 128x80 stream max value would be 10240 px\n\n#### Important\nIf you are using a previous Picamera python module and images are black\nor have problems with an older raspbian install, then update Raspberry PI\nfirmware per commands below. From a (putty) ssh login or monitor terminal\nexecute the following commands to upgrade to latest firmware.\nThis should resolve any picamera issues.\n\n    # Update Raspbian\n    sudo apt-get update\n    # Update RPI firmware\n    sudo rpi-update\n    # Hard boot to update firmware\n    sudo shutdown -h now\n\nNote the checkForMotion function uses the green (1) portion of the RGB stream for\npixel diff comparison. You might want to change the pixColor variable to Red(0) or Blue(2)\nin the checkForMotion function.\n\nLet me know what type of projects you implement with this.\n\nI also have pi-timolo python program on my github repository here\n\n    https://github.com/pageauc/pi-timolo\n\npi-timolo implements timelapse, motion detection and low light including auto detect of day, night, twilight\nchanges without the need for a clock or time calculation.  There are\nalso various previous versions that use raspistill rather than picamera python module\n\nClaude Pageau\nemail: pageauc@gmail.com","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpageauc%2Fpi-motion-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpageauc%2Fpi-motion-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpageauc%2Fpi-motion-lite/lists"}