# Raspberry Pi YouTube Boombox

## Overview

https://youtu.be/OZtc_96axzU

In this project we’re building a Raspberry Pi&nbsp;powered YouTube lofi radio player with Adafruit’s BrainCraft HAT!

We designed and 3d printed this case to house the electronics and features a built-in speaker and display!

&nbsp;

![raspberry_pi_hero-bernie-desk.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/901/medium640/raspberry_pi_hero-bernie-desk.jpg?1611613399)

The Pi is set up in kiosk mode and automatically plays any YouTube music stream. This uses digital I2S, so it's&nbsp;got high quality stereo output!

The BrainCraft HAT has everything you need to make an all-in-one YouTube player.

The built in joystick can be used to change the stations and adjust the volume.

This lets you quickly switch between different YouTube channels without having to use a keyboard or mouse.

You can also pause and play the video by pressing the button next to the joystick.

![raspberry_pi_hero-case-ports.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/869/medium640/raspberry_pi_hero-case-ports.jpg?1611587432)

![raspberry_pi_close-screen-btn.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/870/medium640/raspberry_pi_close-screen-btn.jpg?1611587794)

The case has access to all of the ports so you can get to the headphone jack if you wanna hook it up to a bigger sound system.

To keep the Pi nice and cool, we added holes on the side of the case for better airflow.

![raspberry_pi_hero-bernie-solo.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/871/medium640/raspberry_pi_hero-bernie-solo.jpg?1611588518)

## Parts
### Raspberry Pi 4 Model B - 4 GB RAM

[Raspberry Pi 4 Model B - 4 GB RAM](https://www.adafruit.com/product/4296)
The Raspberry Pi 4 Model B is the newest Raspberry Pi computer made, and the Pi Foundation knows you can always make a good thing _better_! And what could make the Pi 4 better than the 3? How about a&nbsp;_faster_ processor, USB 3.0 ports, and updated Gigabit Ethernet chip with...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4296)
[Related Guides to the Product](https://learn.adafruit.com/products/4296/guides)
![Angled shot of Raspberry Pi 4](https://cdn-shop.adafruit.com/640x480/4296-11.jpg)

### Adafruit BrainCraft HAT - Machine Learning for Raspberry Pi 4

[Adafruit BrainCraft HAT - Machine Learning for Raspberry Pi 4](https://www.adafruit.com/product/4374)
The idea behind the BrainCraft HAT is that you’d be able to “craft brains” for Machine Learning on the EDGE, with Microcontrollers & Microcomputers. On&nbsp;ASK AN ENGINEER, our founder & engineer chatted with&nbsp;Pete Warden, the technical lead of the mobile,...

In Stock
[Buy Now](https://www.adafruit.com/product/4374)
[Related Guides to the Product](https://learn.adafruit.com/products/4374/guides)
![Video of a white hand hovering a coffe mug over a Adafruit BrainCraft HAT thats connected to a Raspberry Pi 4. Display detects that its a coffee mug. ](https://cdn-shop.adafruit.com/product-videos/640x480/4374-00.jpg)

### 2x20 Socket Riser Header for Raspberry Pi HATs and Bonnets

[2x20 Socket Riser Header for Raspberry Pi HATs and Bonnets](https://www.adafruit.com/product/4079)
Give yourself a lift with this 2x20 female socket header that has _slightly longer than usual pins_. You can plug this into your Raspberry Pi GPIO port and then plug a HAT or Bonnet or Phat on top.

Especially useful for Bonnets that have slim headers on the bottom, but you want...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4079)
[Related Guides to the Product](https://learn.adafruit.com/products/4079/guides)
![Angle shot of a 2x20 Socket Riser Header for Raspberry Pi HATs and Bonnets](https://cdn-shop.adafruit.com/640x480/4079-01.jpg)

### Speaker - 40mm Diameter - 4 Ohm 5 Watt

[Speaker - 40mm Diameter - 4 Ohm 5 Watt](https://www.adafruit.com/product/3968)
Hear the good news! This speaker&nbsp;is a great addition to any audio project where you need a&nbsp;4 Ohm impedance and 3W or less of power.

At **40mm diameter** it has a more square-ish shape, but a smaller face. Sound quality and volume are nicely sandwiched between our...

In Stock
[Buy Now](https://www.adafruit.com/product/3968)
[Related Guides to the Product](https://learn.adafruit.com/products/3968/guides)
![Angled Shot of the Speaker - 40mm Diameter - 4 Ohm 3 Watt.](https://cdn-shop.adafruit.com/640x480/3968-03.jpg)

### JST PH 2-Pin Cable - Female Connector 100mm

[JST PH 2-Pin Cable - Female Connector 100mm](https://www.adafruit.com/product/261)
Red and black tinned wires with a 2-pin JST PH connector on the end. 4" / 100mm long. Matches up nicely with our Lipoly chargers!

[We have the socket 'mating' version of this cable](https://www.adafruit.com/product/3814) over here, <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/261)
[Related Guides to the Product](https://learn.adafruit.com/products/261/guides)
![Top view shot of a red and black JST PH 2-Pin Cable to Female Connector - 100mm.](https://cdn-shop.adafruit.com/640x480/261-01.jpg)

### Full Size Wireless Keyboard with Trackpad

[Full Size Wireless Keyboard with Trackpad](https://www.adafruit.com/product/2876)
The quick brown fox jumps over the lazy dog. &nbsp;The quick brown fox jumps over the lazy dog. &nbsp;The quick brown fox - sorry! We were practicing our typing ON THIS AWESOME KEYBOARD.

With slim chiclet keys, this 'normal size' keyboard is the perfect on-the-go accessory to...

In Stock
[Buy Now](https://www.adafruit.com/product/2876)
[Related Guides to the Product](https://learn.adafruit.com/products/2876/guides)
![Full Size Wireless Keyboard with Trackpad connected to Raspberry Pi](https://cdn-shop.adafruit.com/640x480/2876-03.jpg)

# Raspberry Pi YouTube Boombox

## 3D Printing

## Parts List

STL files for 3D printing are oriented to print "as-is" on FDM style machines. Parts are designed to 3D print without any support material. Original design source may be downloaded using the links below.

- BrainTube-screen.stl
- BrainTube-case.stl
- BrainTube-tripod.stl
- BrainTube-speaker-grill.stl
- BrainTube-speaker-cone.stl
- BrainTube-speaker-ring.stl

![raspberry_pi_3d-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/885/medium640/raspberry_pi_3d-parts.jpg?1611604533)

[Edit Design](https://a360.co/39dQu7f)
[Download STLs](https://www.thingiverse.com/thing:4739213)
## Slicing Parts

Slice with settings for PLA material. The parts were sliced using CURA using the slice settings below.

- PLA filament 215c extruder
- 0.2 layer height
- 10% gyroid infill
- 60mm/s print speed
- 60c heated bed

![raspberry_pi_slice.gif](https://cdn-learn.adafruit.com/assets/assets/000/098/886/medium640thumb/raspberry_pi_slice.jpg?1611604745)

# Raspberry Pi YouTube Boombox

## Assemble

## Press Fit Speaker Holder

The speaker ring part fits into the cutout on the **BrainTube-Case** part.

## Speaker Grill

Fit the **Speaker-Grill** part into the **Speaker-Cone** part.

![raspberry_pi_speaker-ring.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/887/medium640/raspberry_pi_speaker-ring.jpg?1611605105)

![raspberry_pi_speaker-grill.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/888/medium640/raspberry_pi_speaker-grill.jpg?1611605191)

## Add Raspberry Pi to Case

Place the Pi over the standoffs and align the board with the port openings on the case. Put the 2x20 Socket Riser Header onto the Pi pins, and then put the BrainCraft HAT onto the riser pins.

## Speaker

Solder the speaker wires to the JST female connector. Use heat shrink to insulate the connections&nbsp;

![raspberry_pi_speaker-attached.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/889/medium640/raspberry_pi_speaker-attached.jpg?1611605599)

## Screen Case

The front cover is fitted over the HAT with the speaker cable fitted through the slit on the HDMI port opening.

Add gaffers tape or kapton tape to insulate the speaker magnet. The Speaker press fits into the ring.

Align the speaker cone over the speaker wires and then press fit over the speaker.

![raspberry_pi_snap-close-case_1.gif](https://cdn-learn.adafruit.com/assets/assets/000/098/890/medium640thumb/raspberry_pi_snap-close-case_1.jpg?1611605734)

![raspberry_pi_speaker-tape-press-fit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/891/medium640/raspberry_pi_speaker-tape-press-fit.jpg?1611605913)

![raspberry_pi_hero-case-ports.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/892/medium640/raspberry_pi_hero-case-ports.jpg?1611606944)

## Optional Tripod Install

Use three M3x8 screws and a [3/8" to 1/4" Adapter Screw](https://www.adafruit.com/product/2392) to attach any tripod compatible mount.

![raspberry_pi_tripod-holes.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/902/medium640/raspberry_pi_tripod-holes.jpg?1611613934)

![raspberry_pi_tripod-mounting.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/903/medium640/raspberry_pi_tripod-mounting.jpg?1611613966)

![raspberry_pi_tripod-mounted.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/904/medium640/raspberry_pi_tripod-mounted.jpg?1611614176)

# Raspberry Pi YouTube Boombox

## Set up Raspberry Pi

## Set up SD card

Attach an HDMI monitor, like our [3D Printed portal monitor](https://learn.adafruit.com/portable-5in-monitor-with-hdmi)&nbsp;to set up the Pi OS.

Use the official Raspberry Pi Imager to burn the latest OS on a SD card. Download the imager below:

![raspberry_pi_monitor-setup.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/893/medium640/raspberry_pi_monitor-setup.jpg?1611607214)

[Download Raspberry Pi Imager](https://www.raspberrypi.org/software/)
## Enable SSH

After all updates are complete, enable SSH. Follow the step here for instructions:

- [raspberry-pi-setup](https://learn.adafruit.com/adafruit-braincraft-hat-easy-machine-learning-for-raspberry-pi/raspberry-pi-setup#step-3-log-in-and-enable-internet-3071709-4)

## Install Blinka Libraries&nbsp;

Follow the step below to set up the Blinka libraries:

- [Blinka Setup](https://learn.adafruit.com/adafruit-braincraft-hat-easy-machine-learning-for-raspberry-pi/blinka-setup#)

![raspberry_pi_monitor-setupB.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/894/medium640/raspberry_pi_monitor-setupB.jpg?1611610767)

## Configure Audio, Fan and Display

Follow the links below to set up the Voicecard, Fan Service and Display module software:

- [Audio Setup](https://learn.adafruit.com/adafruit-braincraft-hat-easy-machine-learning-for-raspberry-pi/audio-setup#install-voicecard-software-3071738-2)
- [Fan Service Setup](https://learn.adafruit.com/adafruit-braincraft-hat-easy-machine-learning-for-raspberry-pi/fan-service-setup#)
- [Display Module Setup](https://learn.adafruit.com/adafruit-braincraft-hat-easy-machine-learning-for-raspberry-pi/display-kernel-module-install#)

Check these steps if you encounter audio or display issues:

[Display Module Troubleshooting](https://learn.adafruit.com/adafruit-braincraft-hat-easy-machine-learning-for-raspberry-pi/kernel-module-troubleshooting)

![raspberry_pi_blinka-display-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/098/895/medium640/raspberry_pi_blinka-display-install.jpg?1611611234)

## Install Kiosk-mode Script

Use the kiosk-mode script to enable fullscreen video playback:

- [Kiosk-mode Install](https://learn.adafruit.com/lofi-hip-hop-raspberry-pi-radio-braincraft/configure-your-raspberry-pi#install-the-kiosk-mode-script-3079810-8)

## &nbsp;

## Edit Playlist&nbsp;

Follow these steps to add your own streams:

- [Edit Playlist](https://learn.adafruit.com/lofi-hip-hop-raspberry-pi-radio-braincraft/choosing-your-own-videos#step-3080394)

![raspberry_pi_hero-bernie-solo.gif](https://cdn-learn.adafruit.com/assets/assets/000/098/897/medium640thumb/raspberry_pi_hero-bernie-solo.jpg?1611612018)


## Featured Products

### Adafruit BrainCraft HAT - Machine Learning for Raspberry Pi 4

[Adafruit BrainCraft HAT - Machine Learning for Raspberry Pi 4](https://www.adafruit.com/product/4374)
The idea behind the BrainCraft HAT is that you’d be able to “craft brains” for Machine Learning on the EDGE, with Microcontrollers & Microcomputers. On&nbsp;ASK AN ENGINEER, our founder & engineer chatted with&nbsp;Pete Warden, the technical lead of the mobile,...

In Stock
[Buy Now](https://www.adafruit.com/product/4374)
[Related Guides to the Product](https://learn.adafruit.com/products/4374/guides)
### Raspberry Pi 4 Model B - 4 GB RAM

[Raspberry Pi 4 Model B - 4 GB RAM](https://www.adafruit.com/product/4296)
The Raspberry Pi 4 Model B is the newest Raspberry Pi computer made, and the Pi Foundation knows you can always make a good thing _better_! And what could make the Pi 4 better than the 3? How about a&nbsp;_faster_ processor, USB 3.0 ports, and updated Gigabit Ethernet chip with...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4296)
[Related Guides to the Product](https://learn.adafruit.com/products/4296/guides)
### Speaker - 40mm Diameter - 4 Ohm 5 Watt

[Speaker - 40mm Diameter - 4 Ohm 5 Watt](https://www.adafruit.com/product/3968)
Hear the good news! This speaker&nbsp;is a great addition to any audio project where you need a&nbsp;4 Ohm impedance and 3W or less of power.

At **40mm diameter** it has a more square-ish shape, but a smaller face. Sound quality and volume are nicely sandwiched between our...

In Stock
[Buy Now](https://www.adafruit.com/product/3968)
[Related Guides to the Product](https://learn.adafruit.com/products/3968/guides)
### 16GB SD Card with Buster Lite

[16GB SD Card with Buster Lite](https://www.adafruit.com/product/2820)
This is a 16GB microSDHC card&nbsp;that is pre-programmed to contain Raspbian Buster Lite - released in September of 2019.

[Raspbian](http://www.raspbian.org/) is a free operating system based on Debian optimized for the Raspberry Pi hardware. An operating system is the set of...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/2820)
[Related Guides to the Product](https://learn.adafruit.com/products/2820/guides)
### Full Size Wireless Keyboard with Trackpad

[Full Size Wireless Keyboard with Trackpad](https://www.adafruit.com/product/2876)
The quick brown fox jumps over the lazy dog. &nbsp;The quick brown fox jumps over the lazy dog. &nbsp;The quick brown fox - sorry! We were practicing our typing ON THIS AWESOME KEYBOARD.

With slim chiclet keys, this 'normal size' keyboard is the perfect on-the-go accessory to...

In Stock
[Buy Now](https://www.adafruit.com/product/2876)
[Related Guides to the Product](https://learn.adafruit.com/products/2876/guides)
### 2x20 Socket Riser Header for Raspberry Pi HATs and Bonnets

[2x20 Socket Riser Header for Raspberry Pi HATs and Bonnets](https://www.adafruit.com/product/4079)
Give yourself a lift with this 2x20 female socket header that has _slightly longer than usual pins_. You can plug this into your Raspberry Pi GPIO port and then plug a HAT or Bonnet or Phat on top.

Especially useful for Bonnets that have slim headers on the bottom, but you want...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4079)
[Related Guides to the Product](https://learn.adafruit.com/products/4079/guides)

## Related Guides

- [Raspberry Pi Care and Troubleshooting](https://learn.adafruit.com/raspberry-pi-care-and-troubleshooting.md)
- [Adafruit BrainCraft HAT - Easy Machine Learning for Raspberry Pi](https://learn.adafruit.com/adafruit-braincraft-hat-easy-machine-learning-for-raspberry-pi.md)
- [Using Google Assistant on the BrainCraft HAT or Voice Bonnet](https://learn.adafruit.com/using-google-assistant-on-the-braincraft-hat.md)
- [Machine Learning 101 with Lobe and BrainCraft](https://learn.adafruit.com/machine-learning-101-lobe-braincraft.md)
- [Basic TensorFlow Object Recognition on any Computer or iOS device with Google Colab](https://learn.adafruit.com/basic-tensorflow-object-recognition-in-the-cloud-google-colab.md)
- [Raspberry Pi + Teachable Machine = Teachable Pi](https://learn.adafruit.com/teachable-machine-raspberry-pi-tensorflow-camera.md)
- [BrainCraft Camera Case](https://learn.adafruit.com/braincraft-camera-case.md)
- [Build an ML Package Detector with Lobe](https://learn.adafruit.com/build-an-ml-package-detector.md)
- [Python Edge Speech Recognition with Voice2JSON](https://learn.adafruit.com/edge-speech-recognition-with-voice2json.md)
- [Running TensorFlow Lite Object Recognition on the Raspberry Pi 4 or Pi 5](https://learn.adafruit.com/running-tensorflow-lite-on-the-raspberry-pi-4.md)
- [diy lofi hip hop raspberry pi radio](https://learn.adafruit.com/lofi-hip-hop-raspberry-pi-radio-braincraft.md)
- [Build an ML Rock Paper Scissors Game with Lobe](https://learn.adafruit.com/lobe-rock-paper-scissors.md)
- [Air Quality Monitor and Case](https://learn.adafruit.com/aqi-case.md)
- [LED Drone Matrix](https://learn.adafruit.com/led-matrix-drone.md)
- [Guardian Robot – Zelda BOTW](https://learn.adafruit.com/guardian-robot-zelda-botw.md)
- [Webcam Cover-Up Lego brick with Adabot Mini Fig](https://learn.adafruit.com/lego-webcam-cover.md)
