Posted on Leave a comment

Teensy 3.x w/ MewPro and Motion Detection

More detailed articles will be published soon in this blog. Since there was a request for information about GoPro motion detection, I’m writing this very quickly.


Materials
The following hardwares and softwares I used.

  1. GoPro Hero 3+ Black
  2. MewPro board + MewPro application
  3. Teensy 3.1
  4. EL1883 sync separator
  5. Schematic to connect Teensy 3.1 and EL1883 w/ MewPro

IMG_5976
⇧ Motion Detect BacPac Side A: EL1883 (center left), Teensy 3.1 (bottom), and GoPro Herobus connector (top)

IMG_5975
⇧ Motion Detect BacPac Side B: MewPro board (trial product version) and Teensy 3.1

IMG_5977
⇧ Motion Detect BacPac fits into GoPro housing


Motion Detection
Basic ideas came from nootropic design Video Experimenter shield. They used LM1881 and the analog comparator of Atmel processor. I did almost the same thing using GoPro, EL1883 and the analog comparator of Teensy 3.1 (The most difficult part was to control GoPro from Herobus). Composite video signal is captured as binary frames (i.e., intensity is compared at the analog comparator in Teensy, if it is greater than the fixed threshold record 1, otherwise 0). In this way bit rate attained is 1 pixel/microsecond.

The following is a video capture of Serial Monitor connected to Teensy, showing debugging info: Powering on GoPro (by using MewPro ‘@’ command), initializing GoPro to output composite video (by using I2C command “VO”), and captured image output for debugging purposes. Actual capture is done every time the comparator interrupt (on both rising and falling edges) occurs; in the interrupt handler, the comparator output at that moment is also considered and if the comparator output is 1 then we record two bits of “01” (rising edge) otherwise “10” (falling edge); in the debug output even and odd frames are added (that’s why we sometimes notice the digit “2” while watching the following video).

Current motion detection algorithm implemented in MewPro application is very simple: Compare the pixels of adjacent frames; if the difference is large then something has moved.


Product PCB will be available within next week, and you will be able to buy it. Some more video demos are coming, too. So stay tuned.