DIY

Vintage radio with a dial and gear of world war II

Винтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныThe goal of this project is to make an old radio work device. But not just the radio, and to reproduced radio broadcasts in those years.
Let’s see a small video.
For the project, the wizard will use a Rasberry Pi. However, it does have its flaws, in this case, the lack of a sound card and analog inputs. To solve it will use the Adafruit amplifier I2S 3W class D – MAX98357A, and MCP 3002.
Another problem is that if an incorrect shut down of the Pi, then the next time it can not be loaded. This problem is solved by installing the module On / Off Shim.
Tools and materials:
-Old radio;
-Sandpaper;
-Lac;
-Heat shrink tube;
The Raspberry Pi Is Zero;
-Sound mono I2S module;
Module On / Off Shim;
Speaker;
-Power supply unit;
Chip MPC3002;
Led;
A resistor 270R;
-Button off;
Step one: radio
Radio master bought on ebay for 15 pounds.
Винтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныTook it apart. Designed and printed on a 3D printer a new chassis.
Винтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныStep two: hull repair
Now I need to restore the wooden case. First, the master tried to just clean it and keep the old appearance, but the coating was in such a state that I had to strip the hull completely.
Varnish and old paint it is removed with Nitromors. Then sanded the hull with sandpaper.
All loose pieces of veneer glued with wood glue. Chips filled with glue and sawdust. After drying, sanded the body and coated finishing material. The fabric covering the speaker master was removed and soaked overnight in detergent. Then washed and rinsed.
Винтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныMetal parts are cleaned using ultrasonic cleaner. Scale polished.
Винтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныStep three: the Raspberry Pi is Zero
Then he sets Raspberry and i2S. According to him, the use of this module is the best solution in this case.
Винтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныStep four: scale
Old the scale the master shot and scanned. Processed the image in a graphics program and replaced with frequency in the years from 1939 to 1945. Printed the image. Also replaced the old plastic glass.
Винтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныStep five: ADC
As already mentioned master set MPC3002, which converts analog input to 10-bit value.
In a network there are many codes for MPC3008, which is a 4-channel device, unlike the dual channel MPC3002. But the master found the code and MPC3002. You can download it here.
In this case, one channel for volume and another for selecting a date.
Винтажный радиоприемник со шкалой и передачами времен Второй мировой войныStep six: food
To enable and disable the device, the wizard uses in the scheme Pimoroni ON / OFF. To enable once you click the button for safe shutdown press and hold it for some time.
Wizard button mounted in the rear of the case. Mounted LEDs for indication of operation of the device.
To power the device, the wizard uses poverbank.
Винтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныStep seven: build
After installing all the parts the device has been placed in the body. Has handles.
Винтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войныStep eight: code and sound files
The wizard uses MP3 files. Such files during the Second world war many on the website Archive.org.
From the website was copied and transferred to the directory PI in most of the news in those years.
To operate the device you need to install the mpg123 player as well as the code. In the configuration must be enabled i2s and SPI. Code the wizard put in the directory / home / pi / volume /

#!/usr/bin/env python 
# WW2 Radio - software to read MCP3002 ADC and convert to volume and year adjustment 
# Ouput via i2S amplifier 20/10/2018 - Ajax Jones 
# Code fragments supplied from https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp/raspberry-pi-usage 
# MCP 3002 Python https://github.com/CaptainStouf/Adafruit-raspi-python/blob/master/Adafruit_MCP3002/MCP3002.py 

import RPi.GPIO as GPIO, time, os 
from os import listdir 
import subprocess 
from time import sleep 
import random 
GPIO.setmode(GPIO.BCM) 

# read the SPI data from MCP3002 chip the, 2 possible adc's (0 and 1) 
def readadc(adcnum, clockpin, mosipin, misopin, cspin): 
 if ((adcnum > 1) or (adcnum < 0)): 
 return -1 
 GPIO.output(cspin, True) 
 GPIO.output(clockpin, False) # start clock low 
 GPIO.output(cspin, False) # bring CS low 

 commandout = adcnum << 1; 
 commandout |= 0x0D # start bit + single-ended bit + MSBF bit 
 commandout <<= 4 # we only need to send 4 bits here 

 for i in range(4): 
 if (commandout & 0x80): 
 GPIO.output(mosipin, True) 
 else: 
 GPIO.output(mosipin, False) 
 commandout <<= 1 
 GPIO.output(clockpin, True) 
 GPIO.output(clockpin, False) 

 adcout = 0 

 # read in one null bit and 10 ADC bits 
 for i in range(11): 
 GPIO.output(clockpin, True) 
 GPIO.output(clockpin, False) 
 adcout <<= 1 
 if (GPIO.input(misopin)): 
 adcout |= 0x1 
 GPIO.output(cspin, True) 

 adcout /= 2 # first bit is 'null' so drop it 
 return adcout 

# Use these pinouts for the raspberry pi is zero 
SPICLK = 11 
SPIMOSI = 10 
SPIMISO = 9 
SPICS = 8 

# set up the SPI interface pins 
GPIO.setup(SPIMOSI, GPIO.OUT) 
GPIO.setup(SPIMISO, GPIO.IN) 
GPIO.setup(SPICLK, GPIO.OUT) 
GPIO.setup(SPICS, GPIO.OUT) 

# Note that bitbanging SPI is incredibly slow on the Pi as its not 
# a RTOS - reading the ADC takes about 30 ms (~30 samples per second) 
# which is awful for a microcontroller but better-than-nothing for Linux 

# list year , this retrieves a list of files from the specified directory and returns the list 
def list_year(radio_year): 
 war_dir = '/home/pi/radio/WWII_News_'+radio_year 
 mp3_files = [ f for f in listdir(war_dir) if f[-4:] == '.mp3' ] 
 if not (len(mp3_files) > 0): 
 print "No mp3 files found!" 
 return mp3_files 

print "--WW2 Radio ---------------------------------------------------------------" 
last_read = 0 # store the last position of the volume pot 
last_year = 0 # store the last position of the frequency pot 
tolerance = 5 # allow a small tolerance so slight movement of the pots doesnt cause a change 

while True: 
 trim_pot_changed = False 
 year_pot_changed = False 

 for adcnum in range(2): 
 ret = readadc(adcnum, SPICLK, SPIMOSI, SPIMISO, SPICS) 
 if (adcnum == 0): # read the pot for the year selector to see it has moved 
 year_adjust = abs(ret - last_year) 
 if ( year_adjust > tolerance+10): 
 year_pot_changed = True 

 if (year_pot_changed): # Values for the if-then checks can be made after its built 
 subprocess.call(['killall', 'mpg123']) # kill any running MP3 
 sleep(0.1); 
 if ret <=50: 
 war_year="1939" 
 elif (ret >50 and ret <150): 
 war_year="1940" 
 elif (ret >=150 and ret <250): 
 war_year="1941" 
 elif (ret >=250 and ret <350): 
 war_year="1942" 
 elif (ret >=350 and ret <450): 
 war_year="1943" 
 elif (ret >=450 and ret <550): 
 war_year="1944" 
 elif (ret >=550): 
 war_year="1945" 

 # save the value of the pot for the next time around the loop 
 last_year = ret 
 print ("Playing from "), 
 print (war_year), 
 print (" number of files="), 
 war_dir = '/home/pi/radio/WWII_News_'+war_year+'/' 
 play_list = list_year(war_year) 
 num_of_files = len(play_list) 
 print num_of_files 
 play_file = random.randint(1,num_of_files) # randomly select one of the files to play 
 war_mp3 = war_dir + play_list[play_file] 

 subprocess.Popen(['mpg123', war_mp3]) # Use mpg123 as the player for the audio 
 sleep (0.1); # provide a slight pause before continuing 


 if (adcnum == 1): # read the volume pot 
 pot_adjust = abs(ret - last_read) 
 if ( pot_adjust > tolerance): 
 trim_pot_changed = True 

 if ( trim_pot_changed ): 
 set_volume = ret / 10.24 # convert 10bit adc0 (0-1024) pot value into a 0-100 volume level 
 set_volume = round(set_volume)# round out decimal value 
 set_volume = int(set_volume) # cast volume as integer 

 # Use the value from the pot to send a level to the amixer prog 
 print 'Volume = {volume}%' .format(volume = set_volume) 
 set_vol_cmd = 'sudo amixer cset numid=1 -- {volume}% > /dev/null' .format(volume = set_volume) 
 os.system(set_vol_cmd) # set volume 

 # save the potentiometer reading for the next loop 
 last_read = ret 

 # A pause after changing the volume so we dont act on too many changes if the pot changes fast 
 time.sleep(0.5)

To restart when you start the device you need to run the following command

sudo crontab-e p>

Then enter

@reboot python /home/pi/volume/year.py & p>

On the next boot it should work.
In principle, everything is ready, the plans of the master of homebrew to make another radio transmission for years and the “space race” between the USSR and the USA. Starting from the launch of Sputnik and ending with the moon landing.
Винтажный радиоприемник со шкалой и передачами времен Второй мировой войныВинтажный радиоприемник со шкалой и передачами времен Второй мировой войны

Source:

usamodelkina.ru

Show More

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
Close

Please disable your ad blocker

We know you are here for the stories. Not the ads. But we need the ads to keep the lights on. So please whitelist Buzzon.live.
Cookie Box Settings