Halloween is right around the corner and just about every Halloween project needs some kind of motion sensor. Historically, we’ve used IR and ultrasonic sensors but [Makers Mashup] decided to use an ESP32-Cam as a motion sensor in his latest animatronic creation. You can see a video of the device and how it works below.
The project is a skull that follows you around with a few degrees of motion on a stepper motor. There’s a 3D-printed enclosure to make the hardware assembly easy. The base software was borrowed from [Eloquent Arduino].
The algorithm is pretty simple. The code grabs a frame of video and divides it into 10 vertical zones, one for each degree of motion for the stepper motor. It creates an array with the values from each of the 10 columns. In that way, the code can detect changes in one zone and move to track that motion.
In addition to the skull, the camera also is seen driving a large inflatable eyeball. While an IR or ultrasonic ranger wouldn’t have much range, the eyeball can easily track people on a distance sidewalk as long as they are in frame. The downside? You do need the scene to be lit. To fix that, there’s a $30 IR floodlight that will cure that. Who wants a brightly lit Halloween project?
This technique would be a no-brainer if you have to put a camera into your device anyway. Even if you don’t need a camera, the price is low enough and you get some interesting benefits like the increased range.
If you want to put an ESP32-Cam on wheels, check this robot out. These devices are even easier to use now that there is a programming board readily available for it.
this particular module has been on my maybe list for some time now. i hear its not actually very good at video, but im glad it still has its uses.
I was just thinking this morning, that I had a project that could benefit from a barcode scanner, and I bet it could do that too. Think I’ll probably use it as a motion sensor for Halloween though because hooking into my video doorbell is being a pain again, and I have a motion triggered project too.
Awesome spook factor!
Painting with eyes that follow you, here I come!
Not to put him down but he has to build some eyelids, that thing is bloodshot!!
LOL, I was going for an Eye of Sauron look but couldn’t find a better eye. I will see about getting a jumbo bottle of Visine. 😂
Where do I download the code? I’d like to see how it works to adapt to my project.