{"id":32443590,"url":"https://github.com/silentwoof/pico_laser_tripwire","last_synced_at":"2025-10-26T03:02:34.519Z","repository":{"id":307353854,"uuid":"493810342","full_name":"SilentWoof/Pico_Laser_Tripwire","owner":"SilentWoof","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-21T20:23:57.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-21T22:21:36.575Z","etag":null,"topics":["alert-system","diy-security","embedded-systems","home-automation","iot","laser-tripwire","ldr-sensor","led-strip","light-detection","micropython","pio","raspberry-pi-pico","sensor-trigger","state-machine","ws2812"],"latest_commit_sha":null,"homepage":"","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/SilentWoof.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-18T20:08:23.000Z","updated_at":"2025-10-21T20:24:01.000Z","dependencies_parsed_at":"2025-07-30T21:29:15.418Z","dependency_job_id":"61d44860-c1e2-4643-904c-f56ddc47c8e3","html_url":"https://github.com/SilentWoof/Pico_Laser_Tripwire","commit_stats":null,"previous_names":["silentwoof/pico_laser_tripwire"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SilentWoof/Pico_Laser_Tripwire","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilentWoof%2FPico_Laser_Tripwire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilentWoof%2FPico_Laser_Tripwire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilentWoof%2FPico_Laser_Tripwire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilentWoof%2FPico_Laser_Tripwire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SilentWoof","download_url":"https://codeload.github.com/SilentWoof/Pico_Laser_Tripwire/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilentWoof%2FPico_Laser_Tripwire/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281051353,"owners_count":26435741,"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","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["alert-system","diy-security","embedded-systems","home-automation","iot","laser-tripwire","ldr-sensor","led-strip","light-detection","micropython","pio","raspberry-pi-pico","sensor-trigger","state-machine","ws2812"],"created_at":"2025-10-26T03:01:26.827Z","updated_at":"2025-10-26T03:02:34.512Z","avatar_url":"https://github.com/SilentWoof.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pico Laser Tripwire 🚨💡\n\nA Raspberry Pi Pico-based laser tripwire system that detects changes in ambient light using an LDR sensor and triggers a visual alert with LEDs. Designed for creative projects, desk setups, or simple security triggers.\n\n## Features\n\n- 📷 Light detection via photoresistor (LDR)\n- 🔘 Switch-activated desk light (on/off)\n- ⚡ LED fade-in/out alert sequence\n- 🧠 Smart alert triggering using lux percentage threshold\n- 🖥️ Debug info printed in the console\n\n## Hardware Required\n\n- Raspberry Pi Pico  \n- LDR (photoresistor GL5516)  \n- WS2812 LED strip (64 LEDs)  \n- Toggle switch  \n- Jumper wires  \n- 10 kΩ resistor (used for LDR voltage divider)  \n- Light source (preferably a laser diode 5 V / 5 mW)\n\n## Circuit Notes\n\nThe LDR is wired in a voltage divider configuration with a 10 kΩ resistor connected between GPIO26 and GND. This setup ensures stable analog readings by pulling the ADC pin low when ambient light is minimal. As light increases, the LDR’s resistance drops, raising the voltage at GPIO26 and increasing the ADC value. This configuration allows the system to detect light interruptions (e.g., a laser beam being broken).\n\n## Circuit Diagram (Text Representation)\n\n```\n  +3.3V\n    |\n   [LDR]\n    |\n   |----\u003e GP26 (ADC)\n    |\n [10kΩ Resistor]\n    |\n   GND\n\n  Switch:\n  [Toggle Switch]\n     |\n    GPIO14\n     |\n    GND\n\n  WS2812 LED Strip:\n  GPIO22 ---\u003e DIN on LED strip\n  +5V    ---\u003e VCC on LED strip\n  GND    ---\u003e GND on LED strip\n```\n\n## 3D Printed Files\n\nIncluded are 2 .3mf files that can be printed on a 3D printer.  \nThe files are a 6 mm tube for the laser emitter, and another tube for the LDR.  \nThe tubes help to regulate the ambient light to eliminate false positives.\n\n## Pin Configuration\n\n| Component           | GPIO Pin |\n|---------------------|----------|\n| Photoresistor       | 26       |\n| LED strip (WS2812)  | 22       |\n| Switch              | 14       |\n\n## Light Detection Logic\n\nThe system reads light intensity from the photoresistor and converts it into a percentage. If light levels drop below `trigger_value` (default `50.00`%), an alert is triggered through LED color fading.\n\n## LED Color Logic\n\n- Desk light color: Soft white (`255, 160, 135`)\n- Alert start: Bright red fade to original state (on or off)\n\n## How It Works\n\n1. 💡 LDR monitors ambient light continuously.  \n2. 🖲️ The switch toggles the desk light, but does not interfere with alert logic.  \n3. 📉 If the light drops below the threshold, the system initiates an alert.  \n4. 🌈 LEDs change to red then fade from red to white (Lights are On).  \n5. 🌈 LEDs change to red then fade from red to black (Lights are Off).\n\n## Setup \u0026 Running\n\n1. Connect all components to the Raspberry Pi Pico.  \n2. Ensure the LDR and 10 kΩ resistor form a voltage divider between 3.3 V and GND, with the midpoint connected to GPIO26.  \n3. Flash the `laser_trip.py` script onto the board.  \n4. Open serial monitor for debugging output.  \n5. Watch LEDs respond to light changes and switch input!\n\n## Credits\n\nCreated by [SilentWoof](https://github.com/SilentWoof)  \nInspired by practical light-sensitive triggers and LED control using PIO on the Pico.\n\n---\n\nEnjoy tinkering with this light-activated tripwire project! 🛠️✨","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilentwoof%2Fpico_laser_tripwire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilentwoof%2Fpico_laser_tripwire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilentwoof%2Fpico_laser_tripwire/lists"}