A Retro Internet Radio

This is a Philco model 46-200 AM radio, built starting in the mid-40’s around a very common five-tube design. This US company, founded in 1892 in Philadelphia, got into radio manufacturing in the late ’20’s and became a leading maker within a decade. I really like the look of this little radio, and because so many were made, it was easy to find one on eBay.

IMG_1460

The most inexpensive examples you’ll find on eBay probably won’t work. They can be restored and if you’re interested in that, here’s a book on Amazon that will walk you through the process of troubleshooting and repairing radios made around a very common design used during this period.

I decided not to try to restore the radio but instead to convert it to an Internet radio while preserving the external appearance. This project is actually fairly simple, built around a Raspberry Pi (RPi) Model 3, an external amplifier, speaker, and a few other components that I’ll cover later. Here’s what the radio’s internals looked like before I started:

IMG_1461

The first step was to remove the original circuitry. Fortunately this is easy to do, as the radio was designed to be easy to service (tubes needed to be replaced eventually). Pull the tuning and volume knobs off the shafts on the front of the radio, undo a couple screws on the bottom, and the entire assembly comes out of the radio. IMG_0011

The clear plastic shield that covers the tuning dial was cracked, an easy repair using 1/16″ inch clear acrylic available from Amazon for a few dollars. Often these radios have cases made from bakelite (handle carefully) or early types of plastic, as I believe this case is. Superglue worked fine for attaching a new shield.

My next step was to assemble the actual replacement hardware for an internet radio, built around these components:

  1. Raspberry Pi Model 3, which has onboard Wifi, eliminating the need for a separate wifi USB adapter. This isn’t critical, but it is convenient. You’ll also need a microSD (I’d get at least 16GB capacity) card to serve as the RPi’s “hard drive” and a power adapter. Powering both the RPi and the audio amplifier requires around 2.5 amps of current, so you won’t be able to power this radio from a standard USB port. I’d recommend using an external power adapter like this one.
  2. An 5V audio amplifier with integrated volume control, like this one available from Amazon for ~ $9. 5V is key as that makes powering both the Raspberry Pi and the amplifier from a single 5V power supply easy.
  3. A rotary encoder like this from Amazon for ~ $3. This device converts the turning of the tuning knob shaft to a signal we can read on the RPi as the user changing stations, which preserves the original functionality of the radio.
  4. One relatively low power speaker. I used a larger speaker than was necessary (or even desirable) because I had it lying around, but you’ll get better results by matching the speaker’s rating to the amplifier you’re using. Something like this speaker from Amazon is ideal.
  5. A momentary pushbutton switch like this. Amazon sells them in bulk but you can find smaller quantities on eBay for less. If Radio Shack still existed, that’d be a great place to get most of these components in one go!

That’s it for parts. All together, this project cost me around $100. You could probably find a vintage radio for much less at garage sales, but I really liked the design of this model.

If you’ve got the RPi, microSD card and power adapter you can start by loading the software. I followed this excellent tutorial by Giles Booth with only a few minor changes to incorporate the rotary encoder and shutdown button. Follow this tutorial to get the RPi working as an Internet radio with the following changes:

    1. Connect the rotary encoder to the RPi using as follows: CLK -> GPIO 17 (pin 11),  DT ->GPIO 18 (pin 12), +3V -> Pin 1, GND -> Pin 6.
    2. Connected the momentary pushbutton switch to RPi pins GPIO 23 (pin 16) and ground (pin 25).
    3. Modified source code for the radio.py Python app. Note the NUMSTATIONS constant. You’ll want to change this to reflect the number of stations you’ve added to the mpc playlist.
!/usr/bin/env python
# Bare bones simple internet radio
# www.suppertime.co.uk/blogmywiki
import RPi.GPIO as GPIO
import time
import os

clk = 17
dt = 18
NUMSTATIONS = 7

GPIO.setmode(GPIO.BCM)
GPIO.setup(clk, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(dt, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)

# setup pin for shutdown button on GPIO 23 (pin 16)
GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP)

def Shutdown(channel):
     os.system("sudo shutdown -h now")

GPIO.add_event_detect(23, GPIO.FALLING, callback = Shutdown, bouncetime = 2000)

counter = 0
clkState = 0
dtState = 0
clkLastState = GPIO.input(clk)

# read station number from text file
f = open('/home/pi/station.txt', 'r')
station = int(f.read())
f.close

os.system("mpc play " + str(station))

try:
     while True:
         #take a reading from the rotary encoder
         clkState = GPIO.input(clk)
         #if the last reading is different, user turned the dial
         if clkState != clkLastState:
             station += 1
                 if station > NUMSTATIONS:
                     station = 1
             print(str(station))
             os.system("mpc play " + str(station))
             f = open('/home/pi/station.txt', 'w')
             f.write('%d' % station)
             f.close
         #update previous rotary encoder setting
         clkLastState = clkState
         #slight pause to debounce the rotary encoder 
         time.sleep(0.05)
finally:
     GPIO.cleanup()

Following Giles’ tutorial and using the modified code above, your Internet radio should be functional. Here’s what mine looked like with everything wired together:

IMG_1469

It’s a bit of a mess, but that will get sorted out once the new hardware is installed in the case. Note that I used a mini audio jack and a stereo patch cable to attach the RPi audio out to the amplifier input. The rotary encoder and shutdown button connect directly to the RPi’s GPIO pins. Not shown here, but later, I attached an LED, with a 300 ohm resistor in series, powered off a GPIO pin, to illuminate the tuning dial. Using a clear LED, with enough resistance, creates a nice, vintage yellow glow.

I cut a 1/4″ thick piece of plywood to serve as a base for mounting the components. The board is sized for fit inside the case and to not move around. 3D-printed brackets are used to attach the original turning dial display, rotary encoder, audio amplifier and speaker to the base.

IMG_1488IMG_1489

With everything installed in the cabinet, here’s the final result:

IMG_1503

IMG_1508

And here’s what inspired this project in the first place!

IMG_1502

Any questions please hit me up in the comments.

Polaroid’s Blast from the Past

This is Polaroid’s new OneStep 2 instant camera, introduced in September 2017. You might be thinking that Polaroid went out of business a few years ago, and you’re right: the original Polaroid company, founded in 1937, went bankrupt in 2001. A successor “Polaroid” company was subsequently created, then also went bankrupt by 2008.

Polaroid-OneStep-2-Promo--768x768

The present-day company, started as the “Impossible Project” in 2008, bought Polaroid’s assets and intellectual property. This company was renamed “Polaroid Originals” last year. The original aim of the Impossible Project was to continue manufacturing Polaroid’s instant film, initially in a former Polaroid factory in the Netherlands.

You might remember the original version of this camera, if you were old enough in 1977. It was simple to use, with minimal controls, a fixed-focus lens, and was a best-seller for a time.

Here’s the new OneStep 2 camera next to the original:

Polaroid-OneStep-Two-Gens-enh-1024x512

It’s nice to see that Polaroid Originals kept the design of the new camera faithful to the original. Using the new camera is a great nostalgia trip and brings back lots of memories. If you haven’t taken pictures with a film camera recently, you’ll be surprised by how much light the film needs for decent exposure (hence the enormous flash unit on the Polaroid5 new camera), the lack of clarity and relatively shallow depth-of-field. Here’s a shot taken outdoors with lots of light. Indoors you’ll easily get underexposed pictures.

For fans of the format, none of this matters. The fact that this is chemical film, where the exposure develops before your eyes (although you’re supposed to keep the photo covered while it’s developing and NEVER SHAKE IT!), and that you’re left with a kind of picture that hasn’t changed in decades, is a huge attraction.

This being a maker blog, I’ve got a tie-in: a 3D-printable picture frame for these pictures. You can download the 3D model in .STL format here.

IMG_0961

 

The $29 Digital Picture Frame, from Amazon

Amazon regularly puts the Kindle Fire 7 tablet on sale for $29, a bargain for what you’re getting: a compact tablet with a fast, quad-core processor, 8 GB of built-in storage, expandable to 256 GB and, most importantly for this build, a 1,024 x 600 pixel display.

This tablet, combined with Amazon’s Prime Photos service and companion app, makes an excellent digital picture frame. Minus the frame, of course. That’s where 3D printing comes in, since printing a frame to house the tablet is easy. Here’s the finished product:
IMG_0756

The model files for the picture frame are here on Thingiverse.com. I’ve uploaded both a single .STL (model) file to print the frame as one piece (requires a large format printer) or as four separate pieces, for smaller printers. For the sample shown, I had to print the frame as separate pieces, then super-glue them together. There’s also a separate model file for a small stand.

IMG_0722

I use Amazon’s Prime Photos page to upload photos from my picture collection, and the companion app on my iPhone to automatically upload photos to Amazon’s cloud storage. Uploaded photos then appear in the Photos app on the tablet; choosing “slide show” starts a running presentation of random pictures. No other software is needed for this.

The end result: a $29 digital picture frame, courtesy of Amazon.

A Better 360 Camera (Samsung Gear 360)

Gear-360_Key-3This is Samsung’s newer (2017) version of their Gear 360 camera, an update from the not-very-old 2016 model. The rapid pace of development of these 360 cameras quickly drives down the price of new models.

As I write this, this camera is selling on eBay, from reputable buyers and in new condition, for less than $100 USD. I think that’s amazing given the capabilities and image quality of this device. It captures 15 megapixel still images and 4K video (4,096 px by 2,048 px) at 24 frames-per-second. Keep in mind, however, that the video is mapped over an almost-complete sphere, so 4K video won’t be nearly as sharp as viewed on a smaller area 4K display.

Here’s a sample image; for a better experience, view this page on a tablet so that the image pans as you move your device in a circle.

One issue with this camera at launch was poor support for iOS devices, but that seems to have been addressed with firmware updates and newer versions of the companion iOS app. I’ve had no problems using this camera with both my iPhone SE and recently, the iPhone X.

Finally, a tip: good 360 images and videos benefit from the camera being level to the ground. I use a small, portable tripod that doesn’t have a built-in bubble level. So in the spirit of this blog, I designed a clip-on level that attaches to any tripod around 21mm in diameter, is easily 3D-printed, and uses inexpensive bubble levels sourced from eBay, like this one available for $.99. If you want to print the clamp yourself, here’s a link to the model on Thingiverse.com.

tripodbubblelevel

Trying Out 360 Photos and Videos

This is LG’s 360 camera. I got one for around $70 at a discount (it originally retailed for around $200) to try out 360 photo and video. The camera has two lenses, one on either side that amazingly, capture a full 360 field-of-view.

LG_360_Cam

This camera does capture “HD” images, but when the image is projected to a full 360 view (which is kind of misleading; the view area is an almost complete sphere, not just a 360-degree cylinder), the resolution ends up significantly lower. Also, a special viewer is required that adds the ability to pan and tilt over the view area. Without a special viewer, the image looks like this (note the extreme distortion at the top and bottom of the image):

DIAE2089

I found an excellent WordPress 360 viewer add-in called “WP-VR-view” by Tumanov Alexander. If you’re viewing this page in a compatible web browser — any current version of Microsoft’s Edge browser, or Google Chrome, Apple Safari or Mozilla’s Firefox should work — you should be able to swipe the image in any direction.

I’ve since upgraded to Samsung’s Gear 360 (2017 model) which has even better specs. Stay tuned for more pics!

The Computer HP Wouldn’t Let Steve Wozniak Build

85m

In the mid-1970’s Steve Wozniak was designing his own hobbyist computer that would become Apple’s first model, the Apple I. He was working at Hewlett-Packard and offered HP the rights to his design. His managers at HP turned down his offer, and Steve eventually ended up leaving HP to join Steve Jobs and help launch Apple Computer.

HP’s refusal might have been based, in part, on a lack of interest due to a competing product they were developing internally, called “Capricorn”, that would later become the HP 80- series of personal computers, starting with the HP-85. As told by the excellent book “Fire in the Valley”, a small group of engineers at HP in Cupertino, California, began designing a new personal computer as an extension of HP’s existing calculator line. As this project was getting started, it was moved to HP’s facility in Corvallis, Oregon. While many engineers at HP were reluctant to move to Corvallis, Steve Wozniak very much wanted to be part of the team designing this computer and might have joined the HP Corvallis team. But this was not to pass: later that year, in October, after HP had turned Steve Wozniak away from Project Capricorn, Mike Markula made his famous visit to Steve Job’s parent’s garage to see the new Apple I computer.

In the early 80’s, while a student at Crescent Valley High School in Corvallis, I joined HP’s Explorer program for students, where we’d spend time after school with HP engineers at the Corvallis campus. The first IMG_1933personal computer I got to use was the new HP-85.

Out of a sense of nostalgia I bought this HP-85 in great condition on eBay.

While the HP-85 had some innovative features, such as the built-in CRT display, thermal printer, tape drive for program storage and expansion slots, the specifications were not necessarily ahead of the market at the product’s introduction in 1980. With an initial price of $3,250, only 8 K of memory, a small display (32 columns x 16 rows of text — not exactly a “retina” display!) and limited storage (217 kilobytes per tape cartridge using the built-in drive), the HP-85 fell behind the state-of-the-art into the 80’s.

The HP-85 was manufactured at the HP Corvallis, Oregon campus; it was fun to walk into the facility and see these computers and HP’s calculators (HP’s Ink Jet printers hadn’t been invented yet) being made. The machines were assembled by hand and, if you look closely at the picture below, you’ll see the workers’ initials where they signed off their assembly step. There are also signatures on the inside of the case. The quality is amazing: this little PC still runs after almost 40 years!

IMG_1907So having gone through the trouble of finding this old computer, what can you do with it? Not much, other than write your own programs or run existing software. There’s no hardware or software support for modern networking protocols. The tape drive no longer works, as the rubber capstan wheel has deteriorated. While this can be relatively easily repaired, there are actually much better solutions for loading and running programs on the computer.

One solution, called “HPDrive” (available here), developed by Ansgar Kueckes, emulates a variety of HP-85 compatible floppy disk drives in software on a host PC. This is the approach I took, running the HPDrive emulator on a Windows 10 PC. I’m still amazed that two computers, separated by almost 40 years of progress, can still communicate!  This miracle of technology is made possible by HP’s long-running support for their own HP Interface Bus (HP-IP) protocol, used originally to connect measuring and scientific equipment to other devices. HP chose this protocol for external expansion in their first personal computer.

HP85_ad_1980

The link above has the details, but basically you install (after finding one on eBay!) an HP 82937A HI-IB interface cartridge in one of the HP-85’s open expansion slots (along with a ROM drawer cartridge populated with the 16K memory expansion and Mass Storage ROMs), a compatible HP-IB card in your PC (I’m used a National Instruments 488.2 PCI interface card, also found on eBay). Running the HPDrive program on the host PC makes that computer appear to the HP-85 as a connected floppy drive. You “point” the HPDrive software to an existing .hpi file, which stores the contents of a floppy disk; typically containing either a number of freely available application packs for the HP-80 series of computers, or any software you write yourself, in BASIC. For those interested, the gory details of how this all works is documented on this page of Ansgar’s web site.

IMG_1935

So what is using an almost 40-year-old PC like? If you’re with me this far, I made s short demo video of three Application Pack programs: an adaptation of the classic ’70’s “Star Trek” game, written by Mike Mayfield and friends in 1971 on a mainframe computer at UC Irvine, a golfing game to show that yes, graphics were possible — sort of — on the HP-85 and finally, an “amortization” program for doing time-value-of-money calculations. This all looks quaint today, but you have to think back to the 70’s, when this was still novel stuff.

World’s Smallest Game Console?

IMG_2670

Adafruit’s new “Joy Bonnet” for the Raspberry Pi Zero, together with a 3D-printed case, and a little bit of soldering, makes for an easy micro gaming console project, based on the open-source RetroPie/EmulationStation software. Here’s the finished project:

IMG_2664

While the Raspberry Pi Zero (actually the “W” model in this case with on board WiFi and Bluetooth connectivity) isn’t nearly as powerful as the latest Raspberry Pi Model 3, it runs NES, SNES, and Atari game console emulators just fine.

To build this console-in-a-controller, you’ll need the following parts:

  1. Raspberry Pi Zero W  — Adafruit usually shows out-of-stock, but just sign up at the “notify me” link and they’re usually back in stock in a couple days or so.
  2. Adafruit’s Joy Bonnet game controller shield.
  3. 40 Pin 2 x 20 Header GPIO Jumper I/O Connector For Pi Zero (search for these on eBay, usually available for around $2.45 with free shipping).
  4. 8 GB or larger Micro SD card.
  5. Mini HDMI to HDMI adapter or adapter cable — the Raspberry Pi Zero’s HDMI connector is a mini connector; not the more familiar full-size connector.
  6. Recommended: a PC board stand-off. The Joy Bonnet game controller shield connects to the Raspberry Pi Zero via the 40-pin GPIO block on one side of the PCB. That leaves a ~ 5 mm gap between the two boards on one side. With all the button-mashing you’ll be doing, you’ll want the stand-off to keep the two boards aligned. These stand-offs are cheap, buy them on eBay for a few dollars for a set.

That’s it for the parts. I’ll cover assembling the parts first, then the software configuration.

Start by soldering the 40 pin GPIO block to the Raspberry Pi Zero. The Joy Bonnet shield already had a connection block attached to the PCB, so once you’ve soldered the pin block to the Pi, you just press the controller shield onto the RPi pin block.

IMG_2623

It helps to have a tool like below to hold the PCB and a magnifying glass to see the pins clearly. If you solder the pins correctly, the solder will flow into the hole around the pin connection, and you’ll have a nice, shiny bit of solder around the base of the pin.

Important: the pins on the PCB block are a bit on the long side, so you’ll want to trim them as close to the RPi PCB as possible, so that the Pi board will fit into the bottom case part.IMG_2636

Next, you’ll want to trim a PC stand-off to about 5 mm in length, to act as a support between the two circuit boards, on the side of the RPi PCB opposite the GPIO header. Fasten the stand-off using a screw to the top side of the Joy Bonnet PCB. Here’s a picture to better illustrate this. This picture shows the screw attached on the bottom of the RPi board, but that’s a mistake; it’ll interfere with the stand-offs I designed into the case.

Also, I ended up using a screw with a lower head height, but that’s not really critical.

With this done, you’re ready to print the case, or order from an online print service, or make use of a 3D printer at a library, participating UPS store, etc. I’ve uploaded the STL files to Thingiverse here.  The case was designed using Autodesk’s 123D Make CAD software to dimensions that allow for some tolerance between different printers. If the case is a little too small or large, try scaling the model files by a few percent. This case is designed with thick walls to withstand rougher handling.

IMG_2660

Once all parts are printed and fit tested, you might want to sand or file the join edges between the case halves for better adhesion. Since I printed the parts in PLA plastic, super glue works well to bond them together, as shown above.

Next up: loading the software onto the Micro SD card. Start with the latest RetroPie image. Make sure you download the appropriate image file — in this case for the Pi Zero — directly from the RetroPie web site. If you’re using Windows, you’ll want to use software like Win32DiskImager to write the image file you’ve just downloaded to the SD card.

Connect a keyboard, display, and power to your RPi and boot up. If it works, the Raspbian OS will load first, then run EmulationStation, and finally RetroPie. Exit RetroPie to get to the console. It’s easier at this point if you configure your RPi for wireless connectivity. This article explains how. When you’ve got your RPi connected to your wifi network, come back here.

Next, you need to install some custom software and configure RetroPie to use the Joy Bonnet as an input device. Adafruit has a page with the steps here; but basically you’re running a script from the console, with your RPi connected to the Internet.

Reboot again and RetroPie should recognize your button presses. Of course, at this point you haven’t transferred any game images, so none of the emulators appear as options. I find it easiest to obtain the RPI’s IP address from within the app, under “Settings”, then use WinSCP (or equivalent for Windows) to transfer the ROM images you own to the appropriate emulator folder on the RPi.

That’s it! Enjoy some classic gaming on a console that fits in your pocket.

IMG_2663