Introduction: StatCache - an Arduino 'blackbox' Datalogger for Adding on Screen Display Gauges to Your Videos

This project includes instructions on how to build the device as well as a link to the project code on github that will need to be uploaded for it to run.

An Arduino based datalogger for the purpose of syncing data with video to create an on screen display.

In other words, you are riding your (bike, sled, trike, car, feet, board, etc.) and you have a portable action camera such as a gopro hero, and you want to put a dashboard of gauges on the video that tell you all relevant information about the ride.

Check out an example video I made here:

Example Video

What you will need:

Arduino Mega 2560

Adafruit Ultimate GPS logging shield

Adafruit 10 DOF sensor

Micro SD card

5V USB battery

USB cable

Adafruit Neopixel Jewel (to use another led light you will have to change code)

Jumper wires

*Optional but recommended

USB breakout adapter

GPS antenna adapter micro to SMA

GPS antenna

Arduino case and anti vibration mount

Plastic standoffs and mounting hardware

Small plastic bubble level

10K Potentiometer

6mm Tactile button

Magnetic shielding foil

Pelican 1050 or other case to house everything

Tools:

Soldering iron / solder

Needle nose pliers

Wire cutters / strippers

Electric tape

Razor

Screw Drivers

Dremel or drill press

File

Step 1: Solder Headers Into GPS Shield

Solder all the header pins into the GPS logger shield.

For a great tutorial on soldering, check out https://www.instructables.com/id/How-to-solder/

Step 2: Solder Jumper Wires to the 10 DOF Sensor

You will need to solder the 3V, GND, SDA, and SCL of the 10 DOF with jumper wires that are at least 3 inches long. It is advisable to use color coded wires, I only had jumper wires of length in this one color at the time so I just made sure to mark them.

Step 3: Mount 10 DOF Sensor

It is optional to mount 10 DOF in magnetic shielding foil, but it must be mounted firmly to GPS shield prototype area. Keep in mind the final orientation of your hardware as you intend to mount it, and note the x, y, and z axis labeled on the sensor.

Step 4: Add Lights

Solder jumper wires 3 - 5" long to the Neopixel Jewel's 5V, GND, and Data Input terminals. If you are planning to use a potentiometer and/or a button solder an extra wire to the 5V (not shown).

Step 5: Solder Wires for I2c Connection

Solder jumper wires to tx and rx on the bottom of GPS shield oriented as shown.

Step 6: Connect Sensor and Light to Shield

Solder GND and 3V jumper wires from 10DOF to GND and 3V on underside of GPS shield.

Solder 5V jumper wire from Neopixel Jewel to 5V on underside of GPS shield.

Step 7: Assemble the Mount

Put together the Arduino case and the anti-vibration mount then attach them together. I used plastic standoffs to attach the two mounts, and put another set of standoffs on the anti-vibration plate to later mount it to the inside of the case.

Step 8: Plug in the Shield and Wires

Plug in the shield, connect tx from shield to rx on Mega, connect rx from shield to tx on Mega, connect scl from 10 DOF to scl on Mega, connect sda from 10 DOF to sda on Mega.

Step 9: Bubble Level

Attach bubble level. Make sure it is exactly level with the 10 DOF.

Step 10: Case Adapters

Attach antenna adapter and USB breakout.

Step 11: Drill the Case

Measure and drill case to accept breakout and antenna adapter. Drill at least one small hole on the top and bottom to ventilate the pressure and temperature sensor. Drill another hole if you plan to mount the pot / button. A flat file will help to make the square hole for the usb breakout.

Step 12: Pot and Button (OPTIONAL)

Insert wire through case for button and potentiometer. I used a jst connector pair, and soldered jumper wires for Mega pins 12, 14 and GND, and soldered 5V to Neopixel 5V on its backside. I found a steel bracket in the hardware store that the pot fit through perfectly. I bent the bracket into a Z shape using a vice, and checking to make sure the pot shaft was now parallel to the steering tube. I made a pulley wheel for the pot using the dremel chuck like a lathe, rapped a concave headset spacer in grip tape on the outside and silicon tape on the inside. Found the perfect o-ring to fit around the pulley and headset spacer and clamped my bracket using muffler clamps which I then wrapped in silicon tape so they cant cut me. Clamped it down, slipped the o-ring over. It is a good idea to mark center on your pulley but you should do this when running the pot calibrate sketch. The code for the button is such that you want the lever to contact the button when you let go, and not contact the button when the brake is in use. Mount the button properly and do not compromise your brakes!

Step 13: Antenna, Cable and Card

Insert SD card, connect USB cable and battery, and GPS antenna.

Step 14: Axis Label

Print XYZ axis label if desired. The image I provided here should fit perfectly over the label on a Pelican 1050.

Step 15: Optional Hardware

If you decided to use potentiometer or button:

Mount the potentiometer with a pulley around your headset stack or steering column. Mount button on brake lever or pedal so that back ‘hammer’ of lever strikes button when released and button does not impede brake use.

Step 16: Specific Mounting

Depending on what you are planning to mount the box to, there are various ways it can be mounted, just be sure it is mounted firmly with minimal vibration occurring.

Step 17: Download Github Repository, Arduino IDE

Download the software for the device at https://github.com/fluxaxiom/Stat_Cache and follow the instructions to install. If you don’t already have it, you will need to download and install Arduino IDE a free program you can download at https://www.arduino.cc/en/Main/Software.

Step 18: Capture Data

After calibrating the device by following the instructions on github, go for a ride!

I do not have an open source solution for combining the data and video yet, but I am currently using Race Render 3 (paid software) and getting excellent results. I will update the tutorial if this changes.

I will post updates as I edit code and improve the overall design. This is a work in progress and I appreciate any input. I plan on experimenting with other hardware as well. Please add a video link to comments if you make the device and go on a ride, and thanks for checking out my first instructable!