CURRENT ISSUE

Contests

bottom corner

Feature Article



Issue #203 June 2007
Video-Based Motion Sensor
Third Prize Atmel AVR Design Contest 2006
by Naubert Aparicio

A mixed-signal design and a lot of creativity helped Naubert build a handy video-based motion sensor. With just an analog front end and an Atmel ATmega88, this system is able to detect movement in real time.

Start | System Overview | System Design | Hardware Design | Software Design | Sources & PDF

Divide and conquer is a well-known strategy that you can use when designing your systems. In vision sensing, the strategy is normally used to simplify algorithms separating the sensing process from the signal-interpretation process. More sophisticated smart sensors can be developed to manipulate the raw data and provide more elaborate information to a higher-level system. My mOtiOn system is one of these smart sensors. Featuring just one Atmel ATmega88 microcontroller, it can interpret a video signal and report movement in real time at the sensor level.

Several past projects have demonstrated that AVR microcontrollers can be used for image processing. In some of the projects, a digital camera generated a video signal, and a stream of digital information was sent to a microcontroller for processing. I decided to follow a different route. I eliminated the digital camera and the video-encoder chip and manipulated an analog video signal directly to significantly reduce the cost of the sensor. You can purchase a small, analog CCTV camera for less than $20. Real-time analog video conversion to digital frames of 320 × 240 pixels with 8-bit resolution requires a sampling rate of about 6 MHz and a memory subsystem able to sustain a bandwidth of 2 MBps. Although Atmel AVR microcontrollers are fast (about 20 MIPS), processing the signal directly at that speed would exceed the available CPU power required to perform the motion-detection algorithms. I also didn’t want to increase the cost by adding external memory, which would be needed to store the frames at a rate of 2 MBps.

To be able to process the video in real time and stay under budget, the system compresses the frames first before sending them to the CPU. I bet you have seen the “matrix block” effect, which is used when a TV producer doesn’t want you to see part of a scene (i.e., the face of a person being interviewed). When you see the effect, you can clearly see when the protected scene is moving because the blocks adjust their color and intensity according to the covered object’s movement. The motion sensor applies the same effect on the incoming video signal before processing it. It compresses the analog frames and converts them to 12 × 15 averaged brightness block matrices, which are very easy to process and demand fewer CPU resources. Because the compression has to occur before the video signal enters the CPU, I used a mixed-signal design with an analog video preprocessing block to achieve it.

Next

 


bottom corner