Posted on Leave a comment

Using Video Motion Detect Board

MewPro Video Motion Detect board is ready for purchase. This automatically does start/stop recording on GoPro Hero 3+ Black. And here is two demos and a How-To.


Demo Videos

In order to experiment with video motion detect, preparation of the following items should be enough:

Requirements

1. GoPro Hero 3+ Black
Older GoPro’s doesn’t work with MewPro. (GoPro Hero 4 Black must be OK, but we don’t promise this.)
2. MewPro board
SMD parts and Herobus connector are soldered.
Note: Don’t solder an Arduino Pro Mini to your MewPro board as its micro processor has not enough memory and is too slow to deal with video signal.
3. Teensy 3.x or GR-KURUMI
Our shop doesn’t sell these micro processor boards. Please purchase one of these items at somewhere.
4. MewPro VMD (Video Motion Detector) board
Necessary SMD parts are soldered.



Three boards 2-4 (MewPro, Teensy 3.x or GR-KURUMI, and VMD) are soldered to form a BacPac™.
teensyVMD-top
⇧ Teensy 3.1 w/ MewPro and VMD

And the BacPac™ is attached to the Herobus receptacle.
VMD-housing

Using the BacPac™ is fairly simple: Place GoPro and push the power button on. After 5 seconds (or pre-configured period of time) the motion detect algorithm starts; the BacPac™ keeps a watch on the composite video signal on Herobus™. If it finds a movement then it commands GoPro to start recording video, and if no more changes then it orders the camera to stop and waits for another motion.

We made two demo video using MewPro (The Video Motion Detector BacPac™ appeared in the following makings of corresponding demo is the final prototype of the production version):

Video 1:

⇧ Auto captured video by a movement of kitty. No trim, No edit.


⇧ Making of Video 1 (captured manually by a human using iPhone 5c)

Video 2:

⇧ Video 2: Auto captured video by a movement of kitty. No trim, No edit.


⇧ Making of Video 2 (captured manually by a human using iPhone 5c)


How To Use MewPro Video Motion Detector Board

The following are the photos of MewPro VMD board w/ SMD parts soldered:

text-VMD-board
⇧ Top view

text-VMD-bottom
⇧ Bottom view

Three SMD parts (U1, R4, R5) need not to be mounted if the companion board is Teensy 3.x. Also if the companion board is GR-KURUMI then solder jumpers on SJ3 and SJ4 are necessary. Schematics of the board is here. Through holes look like 600mil 28pin DIP are for Teensy 3.x and the ones 600mil 24pin DIP are for GR-KURUMI and MewPro board.

We designed the VMD board so that Teensy is mounted on the bottom (i.e., front side of GoPro) and GR-KURUMI on the top (i.e., back side of GoPro). Please investigate the following photos carefully and solder the three boards in correct directions.

c-teensyVMD-back
⇧ Teensy 3.x: View from GoPro back

c-teensyVMD-top
⇧ Teensy 3.x: View from GoPro front

c-kurumiVMD-back
⇧ GR-KURUMI: View from GoPro back

Note: Please don’t forget to solder two pairs of two pins and 2×5 pins red-circled in the above photos.

After soldering VMD board with Teensy or GR-KURUMI, and MewPro, connect it to PC and burn the MewPro application (To do so please refer the general instruction using MewPro).

In order to use VMD, it will suffice that the source code of MewPro application is modified at the following lines in MewPro.ino:

//********************************************************
// j_VideoMotionDetect: Video Motion Detector
// Video motion detect consumes almost all the dynamic memory. So if you want to use this then #undef all options above.
#undef USE_VIDEOMOTION
// The part of code utilizes the following library except GR-KURUMI. Please download and install:
// https://github.com/orangkucing/analogComp
//#include "analogComp.h" // *** please comment out this line if USE_VIDEOMOTION is not defined or GR-KURUMI ***

And change the lines like this:

//********************************************************
// j_VideoMotionDetect: Video Motion Detector
// Video motion detect consumes almost all the dynamic memory. So if you want to use this then #undef all options above.
#define USE_VIDEOMOTION
// The part of code utilizes the following library except GR-KURUMI. Please download and install:
// https://github.com/orangkucing/analogComp
#include "analogComp.h" // *** please comment out this line if USE_VIDEOMOTION is not defined or GR-KURUMI ***

(If you are to use GR-KURUMI, keep the last line above untouched.)

Note. There are two threshold parameters of sensitivity in j_VideoMotionDetect.ino as well as some code fragments for debug. Please refer the comments written in the file.

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.

Posted on Leave a comment

GoPro from CANON Timer Remote Controller

Canon TC-80N3 is an advanced cable remote controller for EOS cameras. This post is to connect TC-80N3 and GoPro.

Requirements

  • GoPro Hero 3+ Black
  • MewPro + Arduino Pro Mini 3.3V (Teensy 3.x or GR-KURUMI are also usable but we’re not going to show how-to in this post)
  • Canon Timer Remote Controller TC-80N3
  • some wires and solder

Theory
Basically TC-80N3 consists of two independent switches for shutter and focus. It remotely make corresponding circuits inside your camera CLOSE or OPEN. The difference between a mechanical switch and TC-80N3 is it bounces or not. To learn about contact bounce (aka “chatter”) see, for example, Wikipedia. Because TC-80N3 is specially crafted for shutter so that doesn’t bounce we can directly connect it to one of interrupt pins (INT0 or INT1) of Arduino Pro Mini without any additional circuits or software debounce routines.


Proprietary Connector
In order to connect TC-80N3 to Arduino its proprietary connector (N3-plug) may be an obstacle. If you don’t mind cutting your TC-80N3 cable then go to the next section “Connection”.

There are some places where N3-plug converters are purchasable:

These cables convert N3-plug to 2.5mm stereo phone plug (male connector), then you can easily find a receptacle that can mates with it.


Connection
The signals inside both TC-80N3 and its conversion cable are clearly explained in this article.

Then we solder the shutter signal to INT0 and the ground to GND as follows:
shutter-small
(The focus signal can be remained open.)


Software Mods
Open MewPro sketch in your Arduino IDE. Find the following lines in MewPro.ino file:

//********************************************************
// e_Shutters: One or two remote shutters without contact bounce or chatter
#undef USE_SHUTTERS

And change the lines like this:

//********************************************************
// e_Shutters: One or two remote shutters without contact bounce or chatter
#define USE_SHUTTERS

This enables to compile two routines in e_Shutter.ino (one is the interrupt handler and the other is the initializer attaching the handler to the actual signal pin (INT0)).


Then connect FTDI temporary header and USB cable to your PC, and install the software to Arduino Pro Mini.
That’s all. Enjoy!

Posted on Leave a comment

How To Use MewPro and Its Application

We will show you how to use a first time MewPro. Basics to control GoPro camera will be explained. No external sensors involved (Maybe in following posts, we can show you some examples of sensor usages).


Prerequisites

In order to use MewPro as a GoPro controller you need the following hardwares:

GoPro Hero 3+ Black
Neither previous editions nor Hero 3+ Silver work with MewPro. Hero 4 Black will be expectedly supported but we don’t promise this. (Update: Hero 4 Black/Silver are supported by MewPro 2/Cable. Please refer recent posts for them.)
MewPro
SMD parts, Herobus connector and Arduino Pro Mini 3.3V 8MHz are soldered. If you want to use a higher performance microcontroller then Teensy 3.1 and GR-KURUMI are supported by the MewPro application.
Arduino Pro Mini Temporary FTDI Header
If you buy a MewPro from our shop the header is included in the package.
Sparkfun FTDI Basic Breakout – 3.3V and USB cable
Use 3.3V version of the breakout board. Any compatible board should work.


Remark: If you use Teensy 3.1 in the place of Arduino Pro Mini then you don’t need Temporary FTDI Header and/or Sparkfun FTDI board; and please consider to buy our Arduino Pro Mini / Teensy 3.1 Conversion Board.

Teensy Warning: If you use Teensy 3.1 with MewPro, please cut the PCB pattern between VUSB and VIN (On the a-lot-of-pad-side of Teensy board there is the special slit between pads to do so). Because MewPro uses RAW input from GoPro battery (about 3.8V). So if you connect VUSB (5V) to MewPro’s RAW then GoPro’s battery pin will become 5V. This will destroy your GoPro.

Softwares:

Arduino IDE 1.5.7 beta or newer
Older versions of Arduino IDE have bugs in Wire library that cause MewPro unusable.
MewPro Application
This is an open source software (MIT license). You can modify and distribute it as you like.


Remark: If you use Teensy 3.1 or GR-KURUMI, you must be a wizard or witch so maybe you know what is required a kind of softwares instead of above mentioned Arduino IDE.


Connection

Install Arduino IDE on your PC and launch it. In Arduino IDE [File]→[Open...]→ then open MewPro.ino.

Remark: MewPro.ino contains the following files as tabs; a_Queue.ino, b_TimeAlarms.ino, c_I2C.ino, d_BacpacCommands.ino, e_Shutter.ino, f_Switch.ino,g_IRremote.ino, h_LightSensor.ino, i_PIRsensor.ino, and j_VideoMotionDetect.ino. If you like to see what will be happen inside of your Arduino Pro Mini you could read any of them.

Connect MewPro to your PC w/ FTDI board and the temporary header.
IMG_5942
Then connect them to GoPro Hero 3+ Black.
IMG_5943

In Arduino IDE application, select [Tools]→[Board]→[Arduino Pro or Pro Mini], [Tools]→[Processor]→[ATmega328 (3.3V, 8MHz)], and [Tools]→[Port]→[(the port where you connected the FTDI cable)]. Then “Verify” the MewPro sketch and “Upload” it to Arduino Pro Mini board.

Remark: If you are using Teensy 3.1 c_I2C.ino will fail to compile. Just change the first four lines to
#if defined(__MK20DX256__) // Teensy 3.1
#include <i2c_t3.h> // *** please comment out this line if __MK20DX256__ is not defined ***
#else // Arduino Pro Mini
//#include <Wire.h> // *** please comment out this line if __MK20DX256__ is defined ***


Control GoPro

Open “Serial Monitor” in Arduino IDE window (click the the top right “magnifier” icon). Set [57600 baud] using the bottom right pulldown, [Newline] the middle pulldown, [Autoscroll] the left box checked.

11.57
Type ‘@‘ (one letter representing at sign) in the input area of Serial Monitor, and hit return key.

12.00
The message “camera power on” is shown and your GoPro Hero 3+ Black turned its power on.

The messages on “Serial Monitor” shows communication details between Arduino and GoPro. If this is the first time to connect your MewPro to GoPro then repeated erroneous “>01 08” is shown again and again. This is because the I²C EEPROM on the MewPro board is not properly initialized yet. So let’s type another one letter command ‘!’ (exclamation mark) in the input area of Serial Monitor, and hit return key.

12.001

Then other messages come from GoPro.
12.002
“role change” means that the role as a BacPac™ has been changed. This time the role is “master” (to understand the roles and modes of Dual Hero BacPac™ please refer our previous post).

In “master” role, we can’t push the shutter botton. But we can get composite video signal out of Herobus connector by using “VO1” command, which “master” MewPro automatically send to GoPro as shown in messages of above screenshot.

Next change the role to “slave”. To do this, type the one letter command ‘!’ again. The command ‘!’ toggles the role between “master” and “slave”.
12.003
12.010

You can see in the above screenshot various information is obtained from GoPro camera.

Now I²C EEPROM on your MewPro board is properly set to “slave” role. In the role we can push the shutter button of GoPro as usual. So we recommend using MewPro in this role.

Now we almost do every thing on GoPro from Arduino. Details of I²C commands are listed in our earlier post.

Try typing “SY1”. Then “SY0”. (Start recording! Stop recording!!)

If you finished type “PW0”. (This should power off your GoPro.)

Enjoy!


Final Note: “SY1” command fails if the mode is different to the mode when GoPro is power on. That is if you change camera’s mode manually by using mode/power button of the camera body or “CM” (SET_CAMERA_MODE) command, then “SY” command will fail. This is due to GoPro firmware so please don’t blame MewPro. In order to workaround this restriction, use “DM” (SET_CAMERA_DEFAULT_MODE) command and set your camera to desired mode and “PW0” (power off). After this, try ‘@‘ (power on) and “SY1“.