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

50K39713

Intro: 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!

13 Comments

Nice integration of hardware. Would love to see if anyone has an open source solution for video overlay. I have a need for displaying serial data overlaid on HD video in real time (or at least saved as an HD video with a transparent layer) that will allow me to render the final video rather easily.

There's always Python with PIL (or Pillow if using Python 3). That way you could make it look however you like.

Loved this!! The video is so good! Can't believe you hit 49 mph - that's almost 80km/h :O

Thanks! Drift triking is a relatively new sport but I am really into it. If you liked that video here is one from a few months ago when the datalogger was less complete, but I was at an actual event in Burke VT so you can see some other trikes. I hit 55 on this free run and in the races we were hitting 60mph+
https://www.youtube.com/watch?v=0UTo0Q5ZmWI

Wow that's got to feel fast being so close to the ground! Thanks :)

I can't believe someone did a project that is just what I need!

I use a Garmin VIRB cam on my bicycle, and the edit software that comes with it allows me to plop gauges on the screen for a number of parameters. However I am working on a system to log brake rim temperature. It would be great to be able to add a gauge for that on my videos.

On this ride, brake temperatures get over 200F. Using your logger I will be able to see just how much over 200F the temps get, and where.

https://www.youtube.com/watch?v=MBYg36UtR3s

Awesome, definitely post a video if you build one. A quick tip though before you swap sensors and mess with the code - if you decide to omit the gps sensor (as your device already does GPS) you will need to write a snippet of code to fill a time column using relative time from the Arduino. Currently it logs UTC from the GPS and this is what is used for sync. Also I have the code blinking the sync light after satellite fix is achieved, but before first line of data is written. Good luck with your build, and if you have any questions about the code feel free to ask. PS I want to ride that hill!!

Great work. You put a lot of effort into that.

Thanks for the link. I spent about 8 hours with Dashware before giving up, but I see the example videos on their site so it must be possible to get similar results. I have also tried track addict on my iPhone, but I have not been able to merge the data with a gopro video which is why I started this project. If I have any success with Dashware in the future I will add an update - thanks again

This is cool! I'd love to see a sample video if you have one!

Thanks! In the first step there is a link that says example video.