Motion Activated Light

177 views
Skip to first unread message

Luke Carbonaro

unread,
Jun 20, 2022, 3:01:03 AM6/20/22
to motioneye
Hello Everyone!

I am quite new to MotionEyeOS so I apologise if this is a simple question, I just haven't been able to find an answer to it anywhere else.

I am building a security camera system as my senior major project in my design class for high school, and one of the features I need on this system is a motion activated light. Upon discovering that I can't find a way to do it online I planned to just hook a motion sensor up to a spare Arduino I had laying around. I would prefer not to use the Arduino however, as that's just adding another board to a system that's supposed to be as compact as possible.

I am using a Raspberry Pi Infrared Night Vison camera (as seen here) that's hooked up to a Raspberry Pi Zero, that is then connected over ethernet to a Raspberry Pi 3B+ with a USB hard drive as the server.

I was kind of banking on it being possible to program in a motion activated LED directly into MotionEye, but I'm yet to have seen it done before. I'm pretty sure there's already motion activation features in MotionEye, I just wonder if it's possible to solder an LED to a GPIO pin or the USB out or something. I'm hoping that you guys may be able to help me out on this one. I'm pretty experienced in Python, however I have a very strict time schedule to have this done by.

Thank you!!!

TL;DR: I need a way to automatically turn on an LED through motion activation in MotionEyeOS.

StarbaseSSD

unread,
Jun 20, 2022, 3:14:19 AM6/20/22
to motioneye
Settings, Motion Notification, Run a Command to turn on your light, Run an End Command to turn it back off.
Use Python 2.7 commands (until the next updates) if using mEOS, you can use Python3.x in mE on another OS.
Put your scripts in /data/usr, Variables in /data/varlib, confi files in /data/etc as they are all read/write file structures, most of the non-/data file systems are read only.
Let me know if this helps

Brett K

unread,
Jun 22, 2022, 11:21:37 AM6/22/22
to motioneye
Are there examples of these available?

StarbaseSSD

unread,
Jun 22, 2022, 11:33:04 AM6/22/22
to motioneye
Within limitations:
You cannot simply add python functions in mEOS as most of the system is read only, many are already there, though.
If you load RaspberryPiOS Lite, and motionEye, you can use Python 3 functions normally.
I did a simple search for "python raspberry pi toggle gpio pins"and came up with dozens of ideas.
Reply all
Reply to author
Forward
0 new messages