Saturday, April 26, 2014

More from Pelham Hall - Tablet Preamp Project

I am on call this weekend (covering for a colleague) so I am not going anywhere.

I was going to take a trip to Radio Shack to get the RCA Jack, cable, etc. to make a interface cable to the receiver when I realized that I have those in various places around the shack. So off I went to pull out, hack up, and wire in one side of a stereo RCA cable (note that I am working on one channel right now).

I pulled out my old DENON Stereo Receiver and one of the MINI ADVENT Stereo speakers. Dusting off was the first order of business but they wired up quickly and I had the MP3 preamp driving the CD Line input of the stereo to the single speaker. Next was to try my phone, and then finally the Tablet.

Below is a picture of the set up with the MP3 player and the Receiver. This set up also has the preamp powered by a 12VDC Brick, with the ATX power source removed.







After adjusting some levels and listening to the output of the receiver, I think I will alter the design slightly to give myself more gain (just feeback resistor values). The design already has a variable resistor such I can set the level when in place in the living room.

Waiting for my parts order to come in......Just about ready for figure out final design, connectors, packaging, etc.











PELHAM HALL
I am designing a small interface between a Tablet headphone Jack and the AUX Line-in RCA plug on a Stereo Receiver. This is to facilitate my Mom listening to the Newark Jazz station in her living room via the internet. Her apartment in New Rochelle faces northeast so she cannot receive over the air signals from NJ.
I first had to install a wireless Router in her spare bedroom where her Cable Modem and Computer reside. Next, I bought a $50 Android Tablet that can run the WBGO App. The tablet was connected to the WiFi from the Router, the app was loaded everything worked, except for the distance. As I got closer to the Living room Stereo, the Wifi signal faded and the app stopped playing. I will tackle the distance problem later. This was just a Proof-of-Concept that the connection would function and her computer still reached the internet.

Interface Planning
The next challenge is to convert the Tablet headphone jack signal into something that can plug into the AUX input (Line Level) on her Stereo.
·          

  • Took an old Stereo unit, gutted it, and placed a ATX PC Power Supply in it (on the left) to provide +/-5VDC, +/-12VDC, and +3.3VDC for the prototyping
  • Pulled out my old MP3 player as an audio source
  • Re-used the Tuner from that Stereo unit to access the headphone jack of the MP3 Player (to the right of the player)
  •  Built a single stage, 4x gain, audio preamp (Breadboard)



4/21/14
After completing my old stereo unit retrofit to a multi-voltage power supply, I turned my attention to the components I would need to set up a test bed:
  1. Stereo audio source with 3.5mm Headphone jack output – OLD MP3 Player
  2. Breadboard for prototyping – In House Proto Board
  3. 3.5mm plug cable to the termination point – Sandbox Component
  4. 3 Pin Termination for the Left/Right/Ground from the 3.5 mm – AM/FM Tuner from the Stereo Unit
  5. 3 Pin wiring from the termination to the breadboardIn House wiring
  6. +12VDC wires from the ATX source to the breadboard  In House wiring
  7. Oscilloscope to measure the signals  In House

After assembling these components and breaking out the old trusty Soldering station, I got everything wired up and tested. The MP3 Player had a number of full albums on it, which is working out fine for having varying audio levels.

I Googled looking for some small Op Amp circuits and chose a few that looked useable. Since my plan is not to have to use a dual supply, the amp would need an offset such that I could use the +12VDC from my supply. The Proto Board is already equipped with a +5VDC regulator, so I began at that step down, assuming I would need to go to 12V eventually.


4/25/14

With the base amp set up working at about 2x gain, I started to map out what the final amp would look like if I had all the correct component values. Obviously, using a noisy switching Power Supply from my ATX source is not going to show me reasonable noise levels, but I know the final solution would contain a small brick power source that would be sufficiently quiet for this purpose.

I figured I could get by with a single inverting Op Amp stage with a variable gain of 4. For testing, a LM741CN would do and I had 5 pieces in stock. Jameco had a number of parts that would be helpful during this design phase so I went ahead and ordered some parts: 


Number                               Item Description
26403                    TRANSISTOR,MPF102,JFET,TO-92
2131039                RESISTOR, 610 PACK E12-SERIES
853599                  SEALED,CERMET,3/8IN,25TURNS
2168131                @JACK,AUDIO,STEREO,3.5MM,BLACK
2200954                PLUG,AUDIO,STEREO,3.5MM,MALE
24539                    IC,LM741CN,DIP-8


Testing Dynamic Range

While the initial design seemed to be reasonably dynamic, I knew I would need a stable sine wave source of multiple frequencies to really see if there were any flaws in my design. I wanted to make sure my choice of components would accurately reproduce the standard audio frequency range without distortion or noise.
I had used a piece of Freeware in the past called “Audacity” to record sounds and save WAV files. From memory, the app could also generate sine wave tones. After installing the code and getting it to put out single frequency tones, I searched around for a way to generate a sweep. Apparently, Audacity can import script files (called Plug-ins) written in xLisp and a language called Nyquist to control the sweep. The first thing found was this code, called “Frequency Sweep”, written in Nyquist:

;nyquist plug-in
;version 1
;type generate
;name "Frequency Sweep..."
;action "Producing frequency sweep..."
;info "by Adam Pope and Paul Schimmel"

;control startf "Start Frequency (Hz)" real "" 20 20 20000
;control endf "End Frequency (Hz)" real "" 20000 20 20000
;control duration "Duration (secs)" real "" 30 1 300
;control level "Level (dBFS)" real " " 0 -40 0
;control type "Sweep scale [1=Linear, 2=Exponential]" int "" 2 1 2

(if (= type 2)
(scale-db level (fmosc 0 (pwev startf duration endf))) (scale-db level (fmosc 0 (pwlv startf duration endf))) )

This code allowed me to set variables inside of Audacity for start and end frequencies, duration of the run, etc.


However, the sweep runs once and stops so it looks like I might have to learn some Nyquist programming in order to make audio a continuous sweep. This will put me outside of my comfort zone but it is not like this is the first time I have had to learn a language and write code in order to test hardware I designed and built.

Learn to use your tools
After referencing some Nyquist programming guides and testing to loop commands, it was clear I would need to understand the current code better in order to make this work.

4/26/14
After more playing with no success, I looked through the menu items in Audacity and…low and behold…there was a menu item in the “Transport” menu called “Loop Play”, which does exactly what I need. Now, I have a continuous sweep tone generator that is fully configurable as to Low->High Frequency range, duration of the sweep, and level. I plugged my 3.5mm extension cable into the audio out jack on my USB port replicator and plugged the Termination plug into that.

I had to play with the duration and volume levels, but soon I had a nice 400hz-8000hz sweep into and out of my Preamp. On first blush, I had no serious bandwidth issues to deal with. Whatever noise is present is fairly low.

Next is to get a RCA cable and set up my old Stereo to see how it sounds.