https://github.com/fire1ce/raspberry-pi-ld2410b-motion-display-control
https://github.com/fire1ce/raspberry-pi-ld2410b-motion-display-control
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/fire1ce/raspberry-pi-ld2410b-motion-display-control
- Owner: fire1ce
- License: mit
- Created: 2023-03-03T13:44:33.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-24T08:30:59.000Z (over 1 year ago)
- Last Synced: 2025-02-24T09:31:45.317Z (over 1 year ago)
- Language: Python
- Size: 256 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Raspberry Pi Display Control Based on Motion (PIR) Sensor
## Information
This script uses pin GPIO4(7) to read data from Motion (PIR) Sensor, Any 5v and ground for PIR Sensor


## Requirements
- python3-gpiozero
Can be install via apt
```bash
sudo apt install python3-gpiozero
```
## Install
This will install the script as `service` and it will run at boot
```bash
curl https://raw.githubusercontent.com/fire1ce/raspberry-pi-ld2410b-motion-display-control/main/install.sh | bash
```
## Uninstall
```bash
curl https://raw.githubusercontent.com/fire1ce/raspberry-pi-ld2410b-motion-display-control/main/uninstall.sh | bash
```
## Default Behavior
| **Condition** | **Behavior** |
| --------------------------- | ----------------------------------- |
| Motion while display is off | Turns on display for 60 sec |
| Motion while display is on | Resets the timer for another 60 sec |
| No motion > 60 sec | Turns off the display |
## Config
File
```bash
/usr/local/bin/motion-display-control.py
```
You can change Data Pin of the PIR Sensor at **gpio_pin** value
You can change Delay at **display_delay** value
Line
```python
motion = Motion(gpio_pin=4, display_delay=60, verbose=False)
```
Restart the service to apply changes
```bash
sudo systemctl restart power_button.service
```
## Debug
In order to allow verbose debug change the following
File
```bash
/usr/local/bin/motion-display-control.py
```
Line
Set **verbose** value to **True**
```python
motion = Motion(gpio_pin=4, display_delay=60, verbose=True)
```
Restart the service to apply changes
```bash
sudo systemctl restart motion-display-control.service
```
## Check if service is running
```bash
sudo systemctl status motion-display-control.service
```
## Contributors
Thanks to [Boris Berman
](https://github.com/bermanboris/raspberry-pi-ld2410b-motion-display-control) for the script rewrite from function to classes