YouTube Christmas Ornament

9,357

88

14

About: I'm a content creator. I make open source projects and videos for said projects. My goal is to create free and open knowledge for everyone.

YouTube is full of amazing content and just the other day I was reminded of this fact. I stumbled across some videos that are literally just hours of old 80s and 90s Christmas commercials. It suddenly gave me a great idea. What if there was a Christmas ornament you could hang on your tree and play old Christmas commercials all day long. Not only that but it could play any movie or any YouTube video. I set out to do just that.

Step 1: Watch the Video!

Step 2: Get the Parts and Tools.

Most of the parts can be found from Adafruit, with exception to the small speaker and the pocket magnifying card.

Parts:

Tools:

Step 3: 3D Print the Parts.

Take the files from thingiverse and 3D print them. My TV body warped a bit on the bottom, but my printer still needs some tuning.

Step 4: Solder on Any Needed Pins and Connections.

I added headers to the 5V and the GND on the powerboost, and I also soldered on a switch connecting the EN and GND pins. This allows you to turn off the powerboost and stop giving power to the Pi. Very handy.

Step 5: Add the Jumpers to the Components.

The Audio Amplifier Connections:

  • AMP VIN to PI 3.3V
  • AMP GND to PI GND
  • AMP DIN to Pi GPIO21
  • AMP BCLK to Pi GPIO18
  • AMP LRCLK to PI GPIO19

The LCD Connections:

  • LCD BACKLIGHT to PI GPIO23
  • LCD SCK to PI SCK
  • LCD MISO to PI MISO
  • LCD MOSI to PI MOSI
  • LCD CS to PI CE0
  • LCD RST to PI GPIO25
  • LCD DC to PI GPIO24
  • LCD VIN to PI 3.3V
  • LCD GND to PI GND

PowerBoost Connections:

  • PB 5V to PI 5V
  • PB GND to PI GND
  • Switch between GND and EN

Step 6: Setup the Pi.

Getting the Pi to use the screen was not straight forward, luckily I have figured it out for you, so if you use these steps and the exact same parts, It should work for you too.

Install Raspbian Jessie on an SD Card and update to the latest version.

You will want to enable SSH so you can talk to the Pi when its installed in the ornament.

Start with the Display:

You need to enable SPI on the pi which involves going into the config and turning it on. Enter:

sudo raspi-config

navigate to "Interfaces" then "SPI" and turn it to "Yes".

Now reboot the pi.

Next you need to enable FBTFT.

You need to edit /etc/modules-load.d/fbtft.conf

sudo nano /etc/modules-load.d/fbtft.conf

now add this to the file:

spi-bcm2835 fbtft_device

Next edit /etc/modprobe.d/fbtft.conf

sudo nano /etc/modprobe.d/fbtft.conf

and add this to the file:

options fbtft_device name=adafruit22a gpio=reset:25,dc:24,led:23 rotate=270 txbuflen=32768 fps=60 speed=80000000

sace the file and reboot the pi. The screen should now be setup as /dev/fb1. You will see that in the program

Setup the Audio:

Here is the Adafruit Tutorial.

To setup the I2S simply enter this command:

curl -sS  https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2samp.sh | bash

once its installed, reboot. Then run the same command again to test if the speaker is working!

Install the extra programs:

You will need to install a python library PyTube and a program mplayer.

PYTUBE GITHUB

To install mplayer:

sudo apt-get install mplayer

now test to see if your screen is working.

wget http://fredrik.hubbe.net/plugger/test.mpg
sudo SDL_VIDEODRIVER=fbcon SDL_FBDEV=/dev/fb1 mplayer -vo sdl -framedrop test.mpg

If you see a video playing, congrats! If not, check your wiring and check the code and the FBTFT documentation.

Step 7: Test the Python Script.

First get the python script from my GitHub here. https://github.com/IdleHandsProject/tv_ornament

If you have all of the proper libraries, when you run the script it should start the server and wait for a connection from another device on the network.

To pick a video, first search youtube and find the videos URL. Example:

https://www.youtube.com/watchv=aR50bch1JVU

Now take the video identifier:

aR50bch1JVU

and add it to the local ip of the raspberry pi, in your browser of any device on the network. Example:

192.168.1.109/aR50bch1JVU

Replace the above IP with the one of your pi.

The Pi will now grab the youtube video and download it to the pi, after its done downloading it will automatically start playing. Warning some videos can take awhile to download, but once you download them once, you don't have to do it again.

Step 8: Assemble the TV Ornament

Now that everything seems to be working, its time to put it all together!

This is the time you use the plastic magnifying card mentioned before.

In the "screen" area of the 3D printed part there is a recess to bend the magnifying card and hold it in place. This will give the effect of an old CRT screen! Cut the card to approximately 60x38mm being careful not to make it too small. Keep checking fitment so that it wedges into the front to allow it to curve and stay in place.

Keep all of the jumpers connected while assembly, and be very careful of the SD card!

Next you will want to screw the screen into the housing, the pins of the screen go on the left. I only put in the two top screws, good enough.

Next install the powerboost on the right wall of the tv, making sure that the switch goes through the opening for it. The charging plug goes in the top.

Now carefully put the pi on the bottom of the tv, I used a bit of double sided tape on the bottom, but I imagine it wasn't necessary as nothing is able to move.

Finally use some double sided tape to hold on the amp to the top and place the speaker in the mess of wires, if its a metal speaker, make sure its not in contact with any components or parts on any of the circuit boards.

Step 9: Hang It on Your Tree!

Step 10: Play Some Videos!

You can play anything you want on this. Christmas movies, Christmas TV shows, the fireplace video, but my favourite is playing 90s christmas commercials. This was the reason I designed it in the first place. Something very nostalgic about them.

Step 11: Support These Projects!

If you think I have earned it, please consider subscribing to my YouTube Channel. I will be doing a lot more cool open source projects like this one in the future, and I would love for you to join along.

Sean Hodgins YouTube Channel

If you want to support me on the next level, and have some cash to spare. Please check out my Patreon. The more patrons I receive, the more complicated and intricate projects I can develop and share to the world. I want to make cool stuff, and make that cool stuff free and public for everyone else to make as well.

Sean Hodgins on Patreon

Raspberry Pi Contest 2017

Runner Up in the
Raspberry Pi Contest 2017

Share

    Recommendations

    • Toys Contest

      Toys Contest
    • Make it Glow Contest 2018

      Make it Glow Contest 2018
    • PCB Contest

      PCB Contest

    14 Discussions

    what a great idea, and a nicely explained Instructable. I don't know how I missed it when it came round but it's a great project for me for jnext December.

    0
    None
    pjf200

    11 months ago

    This is a great project. I can't wait to build it.

    But about the battery, did that come with the 1000c Lipo power supply on Adafruit or did you have to buy that separately?

    1 reply
    0
    None
    pjf200pjf200

    Reply 11 months ago

    Ok, ordered the battery separately since it didn't come with the power supply from Adafruit. Found what I hope is the right one on Amazon since Adafruit is out of stock: Adafruit 328 Battery, Lithium Ion Polymer, 3.7V, 2500mAh

    0
    None
    JohnT32

    11 months ago

    Hi Sean, I am having issues completing this project and could you some details. I could use a sketch of the pinouts as my test only displays a lit tft. Also, I used git clone to add the githubs to the pi but could use a step-by-step on setup and run of the python. Really appreciate this project dude!

    0
    None
    MobileWill

    11 months ago

    Hi,

    Did you print with supports? Seems a bit wide to chance printing without supports.

    0
    None
    desertsniper

    11 months ago

    would it be possible to have it powered by a custom power connector from a the sting of lights on the tree?

    0
    None
    chunkysteveo

    1 year ago

    What's the frame rate like on the TFT? It looked a little choppy on the video? Really great idea though, so many uses, and you could expand on your work with a "static" or "test card" default image, volume "knob" to the amp, etc. Really cool!

    0
    None
    DenM3

    1 year ago

    Bro, this is one of the Best instructables I've seen so far. You've got awesome talent.

    0
    None
    Alexiades

    1 year ago

    Jajaja very cool idea! You can reuse the idea for Halloween with scary movies XD.

    0
    None
    bekathwia

    1 year ago

    Great idea, and just enough GIFs!

    0
    None
    HP_II

    1 year ago

    One suggestion - a volume or mute button.

    0
    None
    HP_II

    1 year ago

    This is the best thing I have seen all year!

    0
    None
    phil46

    1 year ago

    Cool! I like your use of videos and annotations in your project description. Very nice.