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.

…read more

Source:: Hackaday