Showing posts with label audio. Show all posts
Showing posts with label audio. Show all posts

Wednesday, March 12, 2014

Tiny, Portable Turntable Strobe


I love turntables. The very idea is simultaneously insane and an awesome feat of engineering. 

Microscopic grooves in a rotating disc of plastic vibrate a minuscule, precisely ground chunk of diamond stuck on a tiny metal tube with magnets attached, inducing tiny currents in a cartridge coil, subsequently amplified up the wazoo. Somehow, instead of sounding like garbled crap, the reproduced sound is quite excellent on a decent system.

But how fast does the record spin? That's the purpose of my project, an extremely accurate, compact turntable strobe. An LP is supposed to spin at 33-1/3 RPM. Many probably don't. Not precisely. And the voices in my head like precision.

Introducing Pocket Turntable Strobe

Some turntables, like my Realistic Lab 400 above, have strobes built in that run off mains frequency to illuminate precisely spaced platter markings that appear to stand still when the platter speed is just right. Except the mains frequency varies and is only 60Hz on average.

Compare to my Turntable Strobe, which uses a quartz crystal and ATtiny25 to flash a white LED at 60.0±0.03Hz (30ppm absolute accuracy plus 20ppm temperature variation). Use it with platter strobe markings or speed check disks that you can find online. 

Turntable Strobe with speed check disc
It uses a tiny 3V, CR1225 battery which, combined with not-quite-Vcc output from the ATtiny25, produces barely enough voltage to dimly light a white LED. Adding four components makes the strobe burns bright as below, right. 

Same circuit, same LED, CR2032 left, CR1225 right
What sorcery is this? A Dickson charge pump.

From Jonathan Thompson's Web Journal [link]
The circuit is simple, requiring two capacitors and two diodes and one of the pins on the microcontroller for the clock signal. The result is a higher voltage supply (4.2V unloaded) that can brightly illuminate the high intensity, 5mm LED through a 1K current limiting resistor. I'll provide more detail on this circuit in an upcoming article.

Diagrammed in Upverter
Another trick to minimize complexity and parts count is that the microcontroller directly sinks current from the LED. You may object, claiming it's unsafe given the LED circuit is powered by a voltage exceeding the Vcc+0.5V limits of the ATtiny. Rules are meant to be broken, provided you have sufficient understanding of their purpose and how things work. I'll show you why it's safe in another upcoming article.

Meanwhile, if you want one, they are for sale.

Thursday, May 6, 2010

Working with Vacuum Tubes


I've got an update for you on the vision system cliffhanger... tomorrow.

Today, let's talk about vacuum tubes.  In need of a bit of a break from robotics, I decided to tackle troubleshooting my Knight KG-250 vacuum tube (valve) amplifier.

With a new set of "Winged C" Russian 6Ф3П (6F3P) output tubes installed (equivalent to the stock 6BM8 tubes), I fired it up and... oh no!  Red plating!  That's bad!

6F3P vacuum tube very similar to 6BM8

What the heck is red plating you may ask?  It's simply thermal overload of a tube, manifested visually. Being housed in glass, you can see the guts of vacuum tubes. The guts are metal: plate (anode), grid, and cathode. When too much current is drawn through the tube than can be dissipated, the metal parts get very hot. Red hot. Literally dull cherry red hot. The visible, outer plate glows red. Hence, red plating. That much heat reduces the tube's lifespan significantly.

Being a solid state kind of guy, the world of vacuum tubes is a little bit foreign but somewhat familiar, too. We know about anodes and cathodes from solid state diodes. And we can understand your basic tube as roughly analogous to a Junction Field Effect Transistor (JFET). Voltage controls the current flow. And there are still resistors and capacitors in the circuits. Basic electrical troubleshooting still applies. But there's a twist. Most of the old tube gear uses point to point wiring, rather than printed circuit boards.

The machine had been previously refurbished, with new capacitors and resistors on the power supply and amplifier circuits. So verifying the wiring of components to the output tube sockets was the first troubleshooting task and it immediately revealed several big wiring errors.  Once fixed, the little amplifier powered up and played music -- no redplating! Yay!

 Knight KG-250 fed by iPod and CD Player

Next up in the fixit queue is my old home theater receiver. It's been broken for years and I figured it was about time I dive in and either fix it or give up and strip it for parts. Robot parts, most likely. :)

Thursday, March 27, 2008

Say What?

Here's how to interface an ancient, 80's era, General Instruments SP0256-AL2 speech synthesizer chip to a Basic Stamp 2 so you too can give your robot the gift of virtually unintelligible, vintage, synthetic speech! (Listen closely to the audio clip and you can almost make out, "Hello world")

Audio Clip

Data Sheet:
See previous SP0256-AL2 post to download the data sheet.

Circuit Diagram:
sp0256-al2.sch


Note: the LM386 amplifier circuit provided in Robot Builder's Bonanza just wouldn't work. It differed slightly from the one presented in the data sheet. The data sheet circuit is pictured above, but with the addition of a giant 100uF power decoupling cap; the LM386 was apparently drawing enough current with the speaker attached to cause the BS2 to reset similarly to prior motor control problems. A somewhat smaller cap doesn't seem to work -- more investigation needed. The potentiometer above is actually not installed yet; a resistor is in place to prevent clipping that was showing up on the o-scope.

The Code:
SP0256AL2.bs2

' {$STAMP BS2}

' {$PBASIC 2.5}

' SP0256-AL2 Speech Chip
' Control Code

' Text: HELLO WORLD.
' Phoneme: HH EH LL AX OW (PAUSE) WW ER1 LL PA2 DD1 (PAUSE)
' Octal: 033 007 055 017 065 003 056 063 055 001 025 004

' Dec: 27 7 45 15 53 3 46 51 45 1 21 4

text DATA 27,7,45,15,53,3,46,51,45,1,21,4,0
ptr VAR WORD
char VAR BYTE

setup:
' P7 <- SBY ' P6 -> 'ADL
' P0-P5 -> Data

DIRL = %01111111
HIGH 6

ptr = text

PAUSE 2000

go:
' Set char to the next phoneme
' Send it

READ ptr,char
DEBUG DEC char, CR
IF char <> 0 THEN cont
END
cont:
GOSUB pout
ptr = ptr + 1
GOTO go

' Phoneme Output
pout:

' Now just set OUTL P6='ADL=1, (P0-P5) = phoneme byte

OUTL
= char | %10000000
DEBUG BIN ? OUTL

' And set P6='ADL=0 for 2usec to tell the chip to read
PULSOUT 6,1

' Wait for P7=SBY (standby) to indicate chip is done speaking
notdone:
IF IN7 = 0 THEN notdone
RETURN

Quick Code Explanation:
The data sheet goes into this in detail, but in short: the program puts the 6-bit phoneme data on data lines A1-A6, then pulses ^ALD low for a short time to let the chip know data is ready, then polls SBY until it goes high, then repeats until it runs out of phonemes.

That's it. This is just a prototype so there's lots more to do before this becomes useful. For example, wouldn't it be nice if a handy dandy AVR of some flavor could front end this chip and accept data over serial and/or I2C? Maybe even do true TTS?