We are in the process of mounting a GoPro camera onto our latest robot. In our previous post we showed how we hacked into the GoPro and wired it up so that we could control it from the robot’s Arduino microcontroller. The next task was to design and machine a case for it. As usual, the CAD design work took longer than the actual machining. It was a fun and challenging little machining project. The end result isn’t perfect, but I think it came out pretty nice, and it will definitely serve the purpose. Our case needed to have these characteristics:
- Protect the GoPro and make it look cool on the robot.
- Provide slots for running the remote control wires.
- Cover up all the GoPro’s buttons so that museum participants and technicians can’t play with the buttons (and mess up the settings in the camera). The camera will be entirely controlled by the robot.
- Provide specialized tapped mounting holes for specific placement on the turret of our robot.
- Provide a lens cover to protect the GoPro’s lens.
- Provide space and protection for the HD transmission cable and modified USB cable plugged into the side ports.
FRONT VIEW OF CAMERA IN CASE
REAR SIDE WITH REMOVABLE PLATE
CORNER VIEW SHOWING HD CABLE AND USB CABLE PLUGGED INTO PORTS
EMPTY CASE BODY MACHINED ON CNC
REAR OF THE CASE BODY SHOWING WIRE SLOTS AND OTHER DETAILS
THREE COMPONENTS OF THE CASE (2 custom machined parts + a lens circle hacked from something else)
REAR VIEW – CAMERA IN CASE
Sometimes there are situations where it’s useful to control a GoPro by wired remote control and/or to integrate a GoPro into a DIY electronic project. This seems like it should be straight forward, but it’s not. I searched for a third party cable or module to plug into one of the GoPro’s ports, but as far as I can tell, there is nothing readily suitable on the market. So, in this post I describe how we hacked into a GoPro Hero 4 Black in order to integrate it into a robot we’re building.
First, we tried communicating through the Hero Port (the large port on the back of the camera). This seemed very promising. You can do some neat things with this port. But unfortunately, controlling the GoPro’s shutter button isn’t readily feasible because GoPro didn’t set it up as a simple digital pin. Instead, they created a proprietary communication protocol that they purposely do not publish. They don’t want people to hack into their cameras. Next we tried using the USB port, to no avail. Then we tried hacking into the wireless remote control, which we were able to do pretty easily, and it sort of worked, but it did not provide the speed and reliability we needed. So, in the end we went old school. We tore the GoPro apart, hacked into the case, and soldered wires to the button rings. It isn’t pretty or elegant, but it works. Here are the details of what we did:
1. First, we needed to integrate the GoPro’s power into our robot. We didn’t want to have a separate battery. So we removed the battery completely, plugged a mini USB cable into the USB port on the side of the GoPro, and hacked the other end. The Hero 4 will run entirely off a USB cable with no battery in it. If you cut open a USB cable, you’ll see four or five wires. Normally the red is positive voltage and the black is ground. If you don’t see a red and black, then Google USB wire color codes for further clues. We connected the red wire to the robot’s 5v regulated power rail. So now, when the robot has power, the GoPro has power. When the robot goes off, the GoPro goes off. Another option is to use a Switronix Battery Eliminator, if you would prefer to use the GoPro’s Hero Port.
2. Second, we needed to turn on and control the GoPro from the robot, specifically from an Arduino micorcontroller. Note: A GoPro does not turn on just because it has electrical power. In order to operate the camera, you need to press the Power/Mode button (on the front) and the Shutter/Select Button (on the top). The following instructions voids your warranty, causes irreversible damage to certain parts, and has an extremely high potential of turning your $500 GoPro into a mess of useless bits of metal, plastic, and electronics. Welcome to DIY hacking!
A. Use your fingernail or a prying tool to remove the front facade. It’s stuck down with adhesive and two little plastic clips on each of the four sides. This takes time and patience. The front plate is thin aluminum. Unless you’re very careful, you’ll end up bending it. You will probably be wanting to put the plate back in place when you’re all done, so be careful.
B. Next, use a small electronics screw driver to unscrew four screws to loosen the electronics.
C. Separate the case from the electronics at the port end first, carefully prying and wiggling until you are able to pull out the electronics. Again, this will take time and patience. Be careful.
D. As the electronics come out, you’ll see there are two main sub-assemblies connected by a thin, delicate orange flat ribbon. Try to keep the sub-assemblies together. If you fail at this, you’ll pull out the ribbon connector. It’s a major pain and risk to put that tiny thing back into place. However, it is doable. It took twenty minutes of fussing, but we managed to do it.
E. Use big snippers and other tools to cut away the top part of the case to expose the Shutter/Select button on the top. I wish there was a better way, but we could not find one.
F. Use your fingernail to scrape off the little white touch area beneath the Shutter/Selection Button.. Solder a wire to the tiny central circle (be very careful not to connect the outer circle to the inner circle). Run the wire to a relay controlled by your Arduino. Use the relay to close the circuit to ground using a digitalWrite command.
G. Do the same thing on the Power/Mode Button, which is on the front of the camera.
H. Replace the case and physically integrate the camera into your project. In our situation, we have machined a special aluminum case that we designed specifically to meet the needs of our particular project. When it’s all done, the mangled plastic GoPro case will not be visible in any way.
After doing the steps above, we now have two wires coming out of our GoPro. We’ll attach each wire to a little relay module, which in turn we will control with two digital pins on our Arduino. We’ll then use simple digitalWrite commands to operate the two relays, giving us complete control of the GoPro.
In the next post, I’ll provide some photos and explanation of the new case we machined for our wired GoPro. In the post after that, I’ll describe how we are using the GoPro on the robot to wirelessly stream HD 1080p/60 video to a monitor and a HD Goggles.