A miniature TV based on the Simpsons TV by Brandon Withrow.
- Pi Zero or Pi Zero W
- Adafruit Mono 2.5 W Audio Amplifier
- 1.5' 4ohm 3W Audio Speaker
- SD Card (8GB or higher)
- Micro USB DIP Breakout Board
- Micro USB Male Cable
- 1K Trim Potentiometer
- Micro Push Button Switch
- Composite Screen Use sudo mod wiki to figure which one you want to get and how to mod them to use 5V
- (Optional)Toggle Switch
- (Optional)Powerboost 500C
- (Optional)LiPo Battery 2200mAh
- (Optional)3D Printed Parts
Your videos must be encoded into the H264 format with a height of 480 pixel. this should not be done on the Pi for it would take a long time to get it done. A simple way of doing this first installing FFMPEG then copying the script encode.py, collect all your videos in the same folder as the encode.py script, and running the python program. The script will loop through all of the video and encode them one by one, & the videos will be placed in a new sub folder called ‘encoded’. If you want to copy your videos via USB, you should move the encoded folder into a thumb drive.
- Install the Raspberry Pi Imager.
- Insert SD Card.
- Select you SD Card From "Storage" button.
- From "Operating System" button navigate through "Raspberry Pi OS (Other)" and select "Raspberry Pi OS Lite (Legacy)".
- A cog wheel now appears in the bottom right click on it and set the hostname to "raspberrypi", enable ssh and set the username as "pi" & the password as "raspberry".
- If you're using a Pi Zero W then enable "Configure Wireless LAN" and add your Wifi's ssid and password.
- IMPORTANT: Double Check to Make Sure You Select The SD card. If you accidentally select, an external hard drive that is plugged into your computer, the next step will erase that hard drive. Once checked click on ‘Write’.
- After the image is written to the SD card remount (Eject and re-insert) it to your computer.
- Open the mounded device named "boot".
- If you're using a pi Zero W, check if there is a file called "wpa_supplicant.conf" if not then make a file with that name and insert the following code (Replacing ssid and password with your wifi SSID and password):
country=US ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="NETWORK NAME" psk="NETWORK PASSWORD" }
- Open the file "config.txt" using any text editor other that notepad and place at the bottom:
dtoverlay=dwc2
dtparam=audio=on
dtoverlay=audremap,enable_jack,pins_18_19
disable_splash=1
- Open the file "cmdline.txt" using any text editor and place the following after "rootwait":
modules-load=dwc2,g_ether
. This allows USB ethernet. - Find "console=tty3" & change it to "console=tty1". This sends the Login prompt to another nonexistant screen.
- Find "fsck.repair=yes" and remove it. This stops forced Filesystem consistency checks after booting.
- Add
consoleblank=0 logo.nologo quiet splash
to the very end of the line. This removes the text & Pi logos at the start of booting. - Create a file with the name "ssh" and without any file extension.
- Save and Close any open files.
- Power on the pi by connecting it to the computer’s USB.
- Launch putty, Command line or terminal and type:
ssh [email protected]
If that doesn’t work you'll have to figure out the Pi's IP and usessh pi@[IP ADDRESS]
or watch this video to try and trouble shoot. - If you're using a normal pi you'll need to share your computer's internet with the Pi.
- Enter the password,
type sudo raspi-config
and change the default password. - Update the Pi with
sudo apt-get update
. - Upgrade the Pi with
sudo apt-get upgrade
.
- If you want to copy the videos via the USB method then type
sudo apt-get install usbmount
otherwise skip to step 10. - We will now edit a file using the
sudo nano /lib/systemd/system/systemd-udevd.service
command. - Scroll down using the Down arrow key, and find the code "PrivateMounts=yes" and change that "yes" to a "no", then exit using CTRL+X and the pressing Y.
- Next we will be installing omxplayer, but before that we need to install git using
sudo apt-get install git
. - Since Omxplayer cannot be installed with apt-get anymore, we will be using a legacy version. start by going into the main directory using
cd ~
. - Download the archived omxplayer Debian file with
wget http://archive.raspberrypi.org/debian/pool/main/o/omxplayer/omxplayer_20190723+gitf543a0d-1_armhf.deb
. - Install the .deb file with
sudo dpkg -i omxplayer_20190723+gitf543a0d-1_armhf.deb
. - Then install the dependencies
sudo apt-get -f install
. - Lastly delete the omxplayer .deb file with
rm omxplayer_20190723+gitf543a0d-1_armhf.deb
. - Test if omxplayer is properly installed with
omxplayer
, to get out of omxplayer type CTRL+C.
- To the GitHub repository to the Pi use
git clone https://github.com/SaifSabban/MiniTV
.
- Install the Linux framebuffer image viewer with
sudo apt install fbi
. - Create our splash screen command file using
sudo nano /lib/systemd/system/splashscreen.service
. - Copy and paste the following into the editor, changing the splash screen to the one you want to use:
[Unit]
Description=Splash screen
DefaultDependencies=no
After=local-fs.target
[Service]
ExecStart=/usr/bin/fbi -d /dev/fb0 --noverbose -a /home/pi/MiniTv/Extra/SplashScreens/NTSCTestCard.png
StandardInput=tty
StandardOutput=tty
[Install]
WantedBy=sysinit.target
- Update your Pi with
sudo apt-get update
then enable the splash screen withsudo systemctl enable splashscreen
- go to the videos directory
cd ~/MiniTv/videos
. - Plug in the USB and type on the command line
sudo cp -R /media/usb/encoded/. ~/MiniTv/videos
.
- Move the video files to a folder called "videos".
- On you computer's command terminal type in
scp -r C:/Users/[DIRECTORY]}/videos [email protected]:/home/pi/MiniTv
replacing [DIRECTORY] with your actual directory. - You will be asked to if you want to save the device's hash, type "YES".
- Enter your Pi's password. and wait for the transfer to finish.
- Create and edit the start up file for the buttons program by first typing
sudo touch /etc/systemd/system/tvbutton.service
thensudo nano /etc/systemd/system/tvbutton.service
. - Copy and paste the following into the editor:
[Unit]
Description=tvbutton
After=network.target
[Service]
WorkingDirectory=/home/pi/MiniTv/
ExecStart=/usr/bin/python /home/pi/MiniTv/buttons.py
Restart=always
[Install]
WantedBy=multi-user.target
- Create and edit the start up file for the buttons program by first typing
sudo touch /etc/systemd/system/tvplayer.service
thensudo nano /etc/systemd/system/tvplayer.service
. - Copy and paste the following into the editor:
[Unit]
Description=tvplayer
After=network.target
[Service]
WorkingDirectory=/home/pi/MiniTv/
ExecStart=/usr/bin/python /home/pi/MiniTv/player.py
Restart=always
[Install]
WantedBy=multi-user.target
- Finally, type in
sudo systemctl enable tvbutton.service
thensudo systemctl enable tvplayer.service
to have the two begin at start up. - Shutdown the Pi with
sudo shutdown -h now
and build the rest of the TV.
- These composite screens usually have 4 pins which correspond to Power, GND, AV1 & AV2
- These screens are expecting 12V power. Some screens work with both 12V and 5V, but if they don't then follow the guide from this wiki to convert your screen
- Remove the current wires and connect wires to Power, GND, & AV1 (Preferably with the colours red, black & white, respectively).
- Solder a wire to the middle right pin of the button, and another to the bottom right pin. Orientation of the button doesn't matter.
- Solder a Wire to pin A+ on the mono amplifier, and another 2 to ground and V+.
- Connect A- to Ground.
- Solder a wire to the center of the potentiometer, and another to the right side.
- Connect on wire from the potentiometer to the speaker, the other to the amplifier, and solder a wire from the remaining pin from the speaker to the amp.
- Solder the circuits to the appropriate pins:
- If you want to opt not to have your TV battery powered, then Solder the appropriate wires from the USB cable to the Micro USB dip board, and skip to assembly. Other wise go the next step.
- If you've decided to have a battery in the system, then perfom the following:
*Solder the Data wire of your USB cables to the Micro USB dip board.
*The GND wire from the Micro USB cable to any GND pin on the powerboost, and the 5V wire to the 5V pin.
*Solder one pin from the toggle switch to the EN pin of the power boost, and the other switch poin to any GND pin.
*Solder the GND pin from the Micro USB dip board to any GND pin on the powerboost, and the 5V pin on the USB board to the USB pin on the powerboost.
*Plug the Battery to the JST connector, making sure the pins are in the correct order.
This section is still under development, for now you can follow the rest of the guide from Brandon Withrow's guide.