Introduction: YouTube Christmas Ornament

Picture of YouTube Christmas Ornament

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.

Picture of 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.

Picture of 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.

Picture of 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.

Picture of 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.

Picture of 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.

Picture of 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

Picture of 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!

Picture of Hang It on Your Tree!

Step 10: Play Some Videos!

Picture of 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!

Picture of 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

Comments

chunkysteveo (author)2017-12-12

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!

DenM3 (author)2017-12-10

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

Alexiades (author)2017-12-10

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

bekathwia (author)2017-12-09

Great idea, and just enough GIFs!

HP_II (author)2017-12-09

One suggestion - a volume or mute button.

HP_II (author)2017-12-09

This is the best thing I have seen all year!

phil46 (author)2017-12-08

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

MillennialDIYer (author)2017-12-07

Great idea, but too many GIFs!

About This Instructable

4,256views

57favorites

License:

Bio: M.a.Sc in Mechanical Engineering. Pretty much designing a new circuit board every day, and I have made a few inventions of my own ... More »
More by seanhodgins:YouTube Christmas OrnamentArduino Neural Network Robot3D Printed Pumpkin Bokeh Cover
Add instructable to: