Preserve Data in a Mason Jar

Living in the South I’ve had a lifelong fascination with Mason jars. They’re used to preserve everything and have a uniquely nostalgic aesthetic.

Once I realized a Raspberry Pi would fit perfectly inside one, I decided the obvious use for it was preserving digital content. Having run BitTorrent Sync on a Raspberry Pi before, I knew it would be a stable platform to provide a synced backup of media from my MacBook and phone, and my wife’s MacBook and phone. In essence, we’d have a Mason jar that preserves our most cherished family memories: a Raspberry Preserve.

Raspberry Pi Preserve

By making this you’ll create a custom Raspberry Pi enclosure that runs BitTorrent Sync and uses Node.js to controls some LEDs. BitTorrent Sync works like Dropbox but doesn’t use a centralized server and is free dollars and freedy free cents.

If you are comfortable with configuring a Raspberry Pi via command line that’s probably the most technical part of the build. It basically involves getting NOOBS running, wiring up a few LEDs, and installing BitTorrent Sync plus Node.js with a few packages.

When you’re all done, just place your Raspberry Preserve somewhere on a shelf and relax knowing there is a copy of your most important memories right next to the tomatoes and cucumbers.

If you want to upgrade this project you could add a WiFi dongle to the Pi so there is one less cable to run and also to allow you to place it in locations that don’t have an Ethernet jack nearby.

Steps

Advertisement

Step #1: Create a Base

PrevNext
Preserve Data in a Mason Jar Using Raspberry PiPreserve Data in a Mason Jar Using Raspberry PiPreserve Data in a Mason Jar Using Raspberry PiPreserve Data in a Mason Jar Using Raspberry Pi
  • Start with a nice looking board that’s around ¾” thick and cut a 6” square. Sand it up and make it look kind of like a wooden Apple TV.
  • At each corner, come in about ½” to make a hole for the corner drawer knobs.
  • Take the lid of the Mason jar and place it top down in the center of the base. Drill a hole in the center of the lid into the base and secure it with a nut, bolt, and washer. About 1 ½” from the center drill a ¾” hole to run your wiring through.
  • The last thing you’ll need to drill are holes for the LEDs. Those can be just wherever you like. I placed them evenly apart in the remaining parts of the lid that didn’t already have holes in it.

Step #2: Attach Hardware

PrevNext
Preserve Data in a Mason Jar Using Raspberry Pi
  • Attach the corner knobs and the rubber feet to the corners.
  • Run the Ethernet cable, micro USB power cable, and hookup wire for the LEDs inside through the ¾” hole you drilled in Step 1.
  • Just hook up your Raspberry Pi to the micro USB power cable, the Ethernet cable, the 4 LED hookup wires to GPIO (general-purpose input/output) pins 17/18/22/23, and the shared LED ground wire to a ground GPIO pin.

Step #3: Wire up LEDs

PrevNext
Preserve Data in a Mason Jar Using Raspberry PiPreserve Data in a Mason Jar Using Raspberry PiPreserve Data in a Mason Jar Using Raspberry PiPreserve Data in a Mason Jar Using Raspberry Pi
  • Insert the four LEDs into their respective holes and secure them with a hit of hot glue.
  • You can also secure the Ethernet and micro USB cables with a metal bracket at this point.
  • You should have four GPIO pin control wires and one shared GPIO ground wire sticking out the bottom. Take your 330 Ohm resistors and wire one in between each GPIO control pin wire and the positive lead of an LED.
  • Do that for all four LEDs. All that’s left is to run the ground lead of all four LEDs back to the single ground wire that leads back into the Raspberry Pi’s ground GPIO pin.

Step #4: Install Software

PrevNext
Preserve Data in a Mason Jar Using Raspberry Pi
  • On your laptop install BitTorrent Sync and set up a directory to share with your Raspberry Preserve.
  • Once the Raspberry Pi is powered up and connected to the network just SSH into it and install BitTorrent Sync and Node.js with a few packages. Detailed instructions can be found on GitHub.
  • The short of it is that you’ll have to manually add the latest BitTorrent Sync repo and then install and configure it through the built-in web GUI.
  • You’ll also need to install the latest Node.js in order for the BitTorrent Sync Node packages to work. To make use of the BitTorrent Sync package you’ll need to apply for a BitTorrent Sync API key.

Step #5: Test it out

PrevNext
Preserve Data in a Mason Jar Using Raspberry PiPreserve Data in a Mason Jar Using Raspberry PiPreserve Data in a Mason Jar Using Raspberry PiPreserve Data in a Mason Jar Using Raspberry Pi
  • Now that you’ve got BitTorrent Sync configured and your Node script listening for transfer activity it’s time to test it all out.
  • On any another device connected to the same BitTorrent Sync folder just drag a few files in and BitTorrent Sync should start making a copy.
  • The Node script should have noticed and started blinking LEDs too. When the transfer is complete the LEDs should just glow solid. That’s it!
Matt Reed

Matt Reed

Creative Technologist at redpepper in Nashville. Stop by and say hi at mcreed.com!


  • This project looks cool, but one question what ABOUT cooling? Wouldn’t the Raspberry Pi get pretty hot inside the jar?

    • Jens

      Raspberry Pi’s don’t tend to get too hot and most of the time, don’t even require a heat sync. I would say that as long as it’s in a cool, dry area, it should be fine.

    • Rita3679
    • Jacobm001

      The RPi is an embedded device that’s actually designed to run in enclosed spaces. So long as your SOC isn’t passing 85 deg C, you’re fine.

    • John Daniels

      You could always seal the jar nice and tight and put an inert oil inside the jar if you had serious overheating problems and wanted to take this a step further.

      • Nice! that could look pretty amazing too!

      • Chris

        John, asked another guy below what type of oil – he didn’t know. Do you have any pointers?

        • John Daniels

          Sorry… I haven’t checked my disqus notifications in a little while. I’m glad you figured out the mineral oil solution. I’m pretty sure I’ve seen people use corn oil on full sized computers and they said that other than a popcorn like smell, there were no problems with the operation of the computer.

      • Chris

        So I did some looking around and it looks like mineral oil is the way to go because it is non-conductive but making it look like a lava lamp most DIY recipes call for something that would cause a short. But mineral oil and a couple of LED’s could be pretty neat looking.

    • I’ve been monitoring this because I honestly didn’t consider the heat aspect. I know from past experience with Pis they run pretty cool. The temp has held between 54-56’C for over a month at normal ambient room temp. Maybe adding intake and exhaust fans underneath would be a fun upgrade. The other thing I might do is underclock the processor when setting up the Pi just for good measure.

  • John Daniels

    Seems fun, but if this is a backup device, where is it backing the files up to? It seems like the idea is that they get backed up to the RPi, but where? The microSD? A USB jump drive? A USB jump drive RAID cluster? Some externally mounted external HDD? I currently have a 32GB microSD in my Pi, and I thought that was probably a bit overkill, but that’s not nearly enough for any backup purposes. Anyone got any answers?

    • Aristarco Palacios

      Someone please, answer this guy ’cause I have the same questions. Is the RPi serving just as a bridge to use the storage in the connected devices? Like in the other project? Then it is not a “Preserve” but a “Bridge” or an “enabler.”

    • Hi there, yes, the files are stored on the Pi’s local SD card therefore capacity is limited to whatever size card you put in it. I originally wanted to have a mirrored version of my family’s photos and videos that are on my macbook and phone so 32GB was fine starting out. Eventually this will run out but by then SD cards will be a little cheaper. If you’re wanting to do major backing up in the 100s of GB range then SD obviously will get pretty expensive quick.

      With BitTorrent sync if I take a new photo on my phone or drop a photo into a specific directory it will immediately sync a copy to the Preserve onto the SD card. It’s somewhat of little novelty experiment but I honestly do use it daily. If I were smart I’d put another one of these offsite at work or a relative’s house just to have an offsite sync as well. cc @aristarcopalacios:disqus

  • lilliana

    you think John `s blog is flabbergasting… yesterday I bought a gorgeous Mitsubishi Evo since getting a cheque for $4484 this-past/4 weeks and-in excess of, 10/k last-month . with-out a doubt this is the easiest-job Ive ever had . I started this 8-months ago and almost immediately was bringin in more than $82, p/h .

  • lilliana

    ※⁂⁂⁂※ you think John `s blog is flabbergasting… yesterday I bought a gorgeous Mitsubishi Evo since getting a cheque for $4484 this-past/4 weeks and-in excess of, 10/k last-month . with-out a doubt this is the easiest-job Ive ever had . I started this 8-months ago and almost immediately was bringin in more than $82, p/h .

    You Can See It Out This Link.◠.◠.

    ♦◈ ◐ http://www.DollersEarm/IncomeMoney/toAlltime.com

    Click ☰☲☴☶☷☱☲☴☵☶☷☷☱☲☴☵☶☰☱☲☳☵☶☷☰

  • lkjlkj59

    <<<<<>>>>>i like me makezine…….

    ……………….. Find Get More </b

  • JuanitaOMcFadden

    Your first choice makezine Find Here

  • Eric Near

    Super legit Matt! I have been building an arcade box with my B+ and the Edimax Wifi USB adapter is a good buy. I thought also it might be fun to build a ZFS JBOD array with a few tiny thumb drives if you had the space. Too many ideas, not enough time!!

  • Paul Hurm

    Add two or three different density, colored oils to the jar, hope it produces just a little heat and have a Raspberry Pi Lava Lamp!

    • Chris

      What types of oils would be good for doing that?

      • Paul Hurm

        Sorry, I don’t know, I have never actually done it. My comment was just a weird idea that popped into my head. I’ll bet somewhere out there is a tut on making your own Lava lamp but I can’t give any more suggestions besides that.

        • Paul Hurm

          Part of the reason this popped into my head is that I am a ham radio guy. When testing transmitters you can use a dummy antenna that is filled with transformer oil to absorb the heat from the radio signal you are testing. This type of oil does not conduct electricity so should not affect any circuitry that is immersed in it. Only problem here is that for a lava lamp you would want to be sure to have several different densities or oil and then have some method to color the oil. Again, I have no detailed suggestions about doing this. If you happen to proceed with this idea it might make for an interesting post!

          • Chris

            Thanks. I’ll look around and see what I can find.

          • ajax jones

            Just run a search for transformer oil and check that all cables are silicon sealed in situ to avoid leaks.

          • John Daniels

            I know this is 3 months old, but just FYI most lava lamps use oil and wax. The lamp heats the wax which causes it to melt and float. When it cools it sinks. You wouldn’t want wax solidifying in there (I wouldn’t think), so you would definitely need to find 2 different oils with different specific gravities. However, they would probably not be different enough to make much of a difference. They’d probably just swirl together and make brown oil until it cools and they separate back out. I’m just speculating, so I would also be very interested in seeing if this works.

            I suppose for a proof of concept you could take any two oils with different specific gravities, inert or not, and heat them with low heat and see what effect it has. Likely inert oils with similar properties will react in a similar way. Perhaps if you put some type of heatsink on the top, the oils might cool at sufficiently different rates and they would stay separated. Anyone with any degrees or experience in fluid dynamics have any insight?

  • kami789

    we best makezine give you chance … Online Job Help

  • Johnny Gnash

    Viva la Mason Jar!

    You should enter this in the instructables.com Preserve It contest.

  • Clayton Holloway

    10 points for using Raspberry Pi, minus several thousand for using iGarbage.