Skip to content

johnyHV/simpsonstv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The original project was created by the user buba447. Manual is here and source is here. Original 3D model is here

Second user created new 3D model for 4" Waveshare HDMI display. Original 3D model is here

Presentation video is here


Manual Content

  1. My changes
  2. 3D model
  3. HW parts
  4. HW construction
  5. Instalation
  6. Image
  7. How to use

My changes

My changes, all tested on the RPI ZERO:

  • added pause video, when is button not pulled.
  • added mute audio amplifier if is button not pulled
  • minor improvements to 3D models
  • added button to 3D model VCR
  • used different speaker
  • design improvement. is more solid
  • added space for USB port in the 3D model, and script for autocopy movie from USB mass storage devices to RPI
  • added feature "next movie" for right button on the VCR
  • added feature rewid 15second back for the left button on the VCR
  • added usb A connector for autocopy movie from USB flash drive to micro SD card
  • new scriprt and service for autocopy movie from USB stick to micro SD card
  • added second player script player-playlist.py. This script saving last played video, and after reboot can continue playing last video

TODO

  • add continue playing the last movie

3D model

My 3D model is stored on the Printables page


HW parts

  • 1k potentiometer here

  • 4" HDMI Waveshare LCD 800x400 here

  • HDMI connector DIY here

  • MINI HDMI connector DIY here

  • HDMI cable DIY here

  • audio amplifier PAM8302 here

  • capacitor 2.2uF/50V

  • screw M3 4x

  • switch 6x6mm 2x here watch out for the length of the button

  • micro USB connector here

  • PCB with micro USB connector here

  • magnet circle 6x2mm

  • 3mm LED

  • USB A connector here

  • Wires

  • long pin header 25mm, male, 2.54MM PITCH here


HW construction

Approximate schematic. Missing USB and LCD parts

Pinout

Power switch

POWER SWITCH PIN A -> GPIO26
POWER SWITCH PIN B -> GND

Audio amplifier

AUDIO AMPLIFIER SIGNAL -> GPIO19
AUDIO AMPLIFIER SHUT DOWN -> GPIO13
AUDIO AMPLIFIER POWER -> +5V
AUDIO AMPLIFIER GROUND -> GND

Buttons

BUTTON NEXT VIDEO PIN A -> GPIO6
BUTTON NEXT VIDEO PIN B -> GND

BUTTON XXX PIN A -> GPIO5
BUTTON XXX PIN B -> GND

LED

LED FOR INDICATE USB COMMUNICATION ANODE -> GPIO27
LED FOR INDICATE USB COMMUNICATION CATODE -> GND

Soldering and connecting components

  1. Connect switch to LCD display (for enable/disable blacklight). Switch the switch on the LCD to the off position

  1. Connect switch to RPI. for RPI pause information

- one switch pole to GPIO26
- second pole to GND
  1. Solder 4pcs long pin header male to RPI board, to connect power to LCD from RPI. long connectors are used for better air circulation, and cooling RPI. You can use heatsink for better cooling

  1. Connect speaker to potentiometer and audio amplifier.

  1. Connect audio amplifier to RPI

- A+ -> audio input -> RPI pin GPIO19
- A- -> audio GND -> RPI pin GND
- SD -> shut down -> RPI pin GPIO13
- Vin -> voltage input -> RPI pin +5V
- Gnd -> ground -> RPI pin GND

  1. Connect 2.2uF capacitor during A+ and GND pin, for a clearer sound

  1. Connect HDMI cable

8.current view of HW

  1. Micro USB connector female

  1. Micro USB connector male

  1. Button in VCR recorder. We need only 3 wire. One wire is common (GND). Second wire is for next movie, and next wire is for XXX function. solder and glue

  1. Soldering USB A connector for USB masstorage devices. We need an old micro USB cable or micro USB connector and solder 4 wires. VCC, DATA+, DATA-, GND

  1. Soldering LED for indication of copying files from USB stick to microSD card.

  1. And soldering LED to RPI PCB. When maximum output voltage from GPIO is 3.3V and maximum current is 16mA, then we don't need resistor for current limitation. But you can use it if you want
LED Anode -> GPIO27
LED Catode -> GND

  1. Stick the VCR to the top of the box with the super glue

  1. Stick the speaker holder to the box with the super glue

  1. Stick the PCB with micro USB connector to the box with the glue

  1. Stick the PCB with micro A connector to the box with the glue

  1. Stick the speaker to the box with the glue

  1. Now we can soldering wire from VCR to RPI PCB
Wire from button for next movie -> GPIO6
Common wire -> GND
Wire from button for XXX -> GPIO5

  1. Stick the LED to the box with the glue

  1. Stick the magnet to the box with the glue

  1. Connect micro USB connector with power supply to RPI

  1. Connect micro USB connector for USB stick to RPI

  1. Final pictures


Instalation

  1. Install OS to micro SD card. For install OS please use Raspberry PI installer here
  2. Create a file before inserting the micro SD card wpa_supplicant.conf in boot partition and add to file
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="NETWORK NAME"
    psk="NETWORK PASSWORD"
}
  1. Create a empty file ssh before inserting the micro SD card in boot partition. For enable SSH server after booting linux
  2. Now you can insert microSD card to RPI and power on. After booting is raspberry-pi automatically connected to WI-FI, with SSH server. After booting you can see IP at the home screen

Now we can use 2 method for instalation and configuration OS. First method is continue to steps 5 and more.

Second method is use scripts for install all neccesary package and configuring OS. This method skip steps 5 -> 18. Method is not fully tested, is only experimental.

sudo apt-get install git
cd ~
git clone https://github.com/johnyHV/simpsonstv
cd simpsonstv
sudo ./install_01.sh

After reboot RPI

cd simpsonstv
sudo ./ install_02.sh

If you use this method, then after previous commands please continue to step 19 .

  1. Update OS
sudo apt-get update
sudo apt-get upgrade
sudo rpi-update
sudo apt-get upgrade
sudo reboot
  1. LCD driver. go to /boot/config.txt and add next lines for enable LCD drivers. Save, and reboot RPI. Manual for installation manual is here
sudo nano /boot/config.txt

add to end file

hdmi_group=2
hdmi_mode=87
hdmi_timings=480 0 40 10 80 800 0 13 3 32 0 0 0 60 0 32000000 3
dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900
display_rotate=3
hdmi_drive=1
hdmi_force_hotplug=1
  1. LCD driver. Install drivers for LCD
git clone https://github.com/waveshare/LCD-show.git
cd LCD-show/
chmod +x LCD4-800x480-show
sudo ./LCD4-800x480-show
  1. Enable audio. add to file /boot/config.txt
sudo nano /boot/config.txt

add to end file

dtparam=audio=on
dtoverlay=audremap,enable_jack,pins_18_19
  1. Enable audio. Update file /etc/rc.local
sudo nano /etc/rc.local

add to end file, before exit 0 line

raspi-gpio set 18 op dl
raspi-gpio set 19 op a5 
raspi-gpio set 8 a2
raspi-gpio set 7 a2
  1. Update /boot/cmdline.txt
sudo nano /boot/cmdline.txt

my file contain

console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash fbcon=map:10 fbcon=font:ProFont6x11
  1. Install package to OS
sudo apt-get install omxplayer git mc screen rsync
  1. Clone repository
cd ~
git clone https://github.com/johnyHV/simpsonstv
cd simpsonstv
  1. Service. Service for management buttons
sudo cp simpsonstv/services/tvbutton.service /etc/systemd/system/tvbutton.service
  1. Service. Service for management video player
sudo cp simpsonstv/services/tvplayer.service /etc/systemd/system/tvplayer.service
  1. Update permission for script
sudo chmod +x /home/pi/simpsonstv/dbuscontrol.sh
  1. Version with USB. Service for auto copy files from USB mass storage devices to RPI flash drive.
sudo cp simpsonstv/services/tvautocopy.service /etc/systemd/system/tvautocopy.service
  1. Version with USB. Enable autocopy service
sudo chmod +x /home/pi/simpsonstv/autocopy.sh
  1. Service. Enable services
sudo systemctl enable tvbutton.service
sudo systemctl enable tvplayer.service
sudo systemctl enable tvautocopy.service

19. Reboot system

sudo reboot
  1. Now we need convert video file to mp4 format. For this exist python script encode.py stored in ~/simpsonstv/video/. Video file you can convert on RPI (but it's very tedious and slow) or on the your computer. You can use different SW for converting video file.
~/simpsonstv/video/
sudo python encode.py
  1. Copy video to RPI. Copy via network For example, you can use scp or winscp, for copy files via network sfp to RPI. Directory for video
~/simpsonstv/videos

Copy movie from USB. We need create a folder simpsonstv on the USB key in root, and store movies to this folder. After booting linux, and insert USB key is automaticly started script for copy movies from FLASH drive to micro SD card. the LED near the USB port lights up during the copying process. When copying is complete, the LED will turn off and you can disconnect the USB key

  1. Two player scripts There are currently two existing scripts for two-player functionality. The first script, player.py, is standard and plays random videos. The second script, player-playlist.py, saves the last played video, allowing the device to continue from where it left off after a reboot. If opting for the second script, it's necessary to rename the script
cd simpsonstv
mv player.py player-random.py
mv player-playlist.py player.py
sudo systemctl restart tvplayer.service

Image

We can download my RPI ZERO image from my gdrive. I don't tested if is this image compatible with ZERO W or ZERO 2 W

  • OS: raspberry-pi OS 32bit
  • username: pi
  • password: raspberry

How to use

TODO

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published