Sound Should Just Come Out Of It

I think going forward I should do a better job of talking around what we’re working on from a technical point of view, until such time as it’s okay to talk about what we’re doing from a principles, rituals and practices point of view. And, also — sometimes in the thick of a design-making-schematic-and-hot-air-baking fire-fight, I do something that I”ll likely have to do again, but without a good, thorough practice of writing things down to remember I, like..forget.

Here’s the thing. I’m making a little tiny audio device. It’s tiny and meant to be simple to use. Like Russell taught me — the thing about audio? You should be able to just turn it on and sound comes out.

I like that rule. That’s what radios used to do before all the knobs, settings, configuration preferences, long vertical scrollable lists and Internet connections fucked things up. You turn the little serrated rotary dial and *click* — radio sound. At worse? Static. But sound started. No swipes. No multi-finger gestures. No tyranny of the 10,000 hours of music & sound in the palm of your hand..and no idea what you want to hear.

There’s something lovely about that that is just pragmatic from an IxD and UX design point of view. I’m not being nostalgic.

So — translating this principle and making it active and not just a sweet, essentialist sounding statement into the guts of the things we’re making, I spent most of yesterday pondering how to make Ear Freshener exhibit and embody and be an exemplar of this design rule. Even to the point of saying, on-off switch.


Yeah, well — the Ear Freshener has the advantage of being a plug-y thing. No speaker. It’s an intimate audio headphone thing. You’d only expect sound out of it when you plug in your headphones. Otherwise — it’s just a little thing that’s quite opaque. There’s only the tell-tale 3.5mm hole that indicates — audio/sound/plug-in-y-ness.

So — simple enough. I decided that plugging-in should equal sound-coming-out. That means that the plug action should turn the actual electronics on. In the world of audio connectors, CUI, Inc. is the go-to operation — along with what I’m sure is a thriving, teeming “ecosystem” of knock-off competitors who may even produce a superior product. They make all sorts of audio connectors for the world of audio devices. There’s a collection of them that have more than the three connectors that are necessary for a Tip Ring Sleeve style stereo audio signal, including the SJ-43614 which is a 3.5mm plug with four signals. The extra one switches from floating (not connected to anything) to ground (or the “sleeve” of the connector, which is normally connected to ground) when you plug a plug into it.

Brilliant. Something changes when you plug the plug into the SJ-43614. One of those signals on that connector gets shorted to the GND rail of the circuit.

Now..what to do with that state change in order to turn the whole circuit on and make sound come out of it with no fuss, no muss.

I pondered and scritched and screwed my face and looked for the answer somewhere on the ceiling over there. I thought of lots of overly-complicated things (as it turns hindsight..) like using a low-power comparator to activate the chip-enable pin of the little 200mA step-up switching regulator I’m using so I can run the circuit off a single 1.5V battery cell.

In that over-designed scenario the NCP1402 step-up regulator is effectively the power supply for the circuit, which wants at least 3.0 volts to operate properly (and draws about 40mA). I can get an NCP1402 hard-wired to output 3.3v, although I may get the 5v version to have a bit more headroom with volume. In any case, this chip is fab cause you can take a little 1.5v cell and it’ll tune up the voltage. Of course, it’s not 100% efficient. Nominally, it’s about 80-ish% efficient at 40mA. lose a little, but you can’t get something (5v) for nothing (1.5v) without giving up something in the trade.

NCP1402SN50T1 efficiency versus output current

So, I have a 1.5v battery of some sort which sits behind the NCP1402. The NCP1402 has an active high chip-enable (CE) pin that turns the chip on — effectively powering the rest of the Ear Freshener circuit. In my overly-complicated scenario, I figured I could use a comparator to sense when the 3.5mm plug had been plugged-into because that one switched pin would go from floating to ground. If I had a simple little 10k resistor between the positive 1.5v side of the battery, the comparator inputs could go on either side of that resistor, with the IN- of the comparator on the side of the resistor that would get shorted to ground when the plug is plugged in. And then the IN+ of the comparator would go on the side of the resistor that is connected directly to the positive side of the 1.5v battery. When the plug goes in, the IN- of the comparator goes to GND, the 10k resistor has a little, negligible-y minuscule current draw and the voltage difference between IN- and IN+ causes the output of the comparator to saturate to pretty close to IN+, or +1.5v. The NCP1402 chip enable would trigger (specs say anthing about 0.8v means “enable” and anything below 0.3v means “disable”) and the whole thing would turn on.

Click the image to expand it and make it easier to read. This is the lousy, over-designed circuit.

How convolutedly and moronically clever is that, especially when you stop to think (as I did, after proudly building the schematic) that you could just use that pin from the plug shorting to ground as a way to close the GND rail of the whole circuit. I mean..if you disconnect the NCP1402 from GND, it should turn off. Basically, it’d have no complete, closed, power supply circuit. It’s as if you pulled the battery out — or half of the battery out. Or ripped out the ground wire.

Anyway. It was clever to get all busy with a comparator and stuff. Simple’s better, though.

This is the simple, no-brainer one that eliminates the need for several additional components.

That’s it. I like the principle and I like even better the fact that I can translate a lovely little design principle into action — materialize it in a circuit that exhibits a fun little unassuming behavior. I can imagine this’d be a bit like wondering if the light stays on in the fridge after closing the door, you know?

So sound stops coming out, the circuit powers down and you no longer need an on-off switch. Stop listening? Turn off. So much nicer than long-press, id’nt it?

Why do I blog this? Cause I need to capture a bit more about the production of this little Ear Freshener-y gem.


Here’s my update on the power circuit. I hope it works. I added two transistors in place of the comparator. The idea here is that the transistor on the right would switch the CE of the step-up switching regulator. When the base goes low — i.e. when the 3.5mm plug is plugged in — the switch opens and CE gets switched to roughly VBATT and enables the step-up regulator. For the transistor on the left, plugging in opens the transistor and VBATT gets connected to the step-up regulator and it, like..steps-up VBATT to VCC. When the plug gets pulled out and floats at VBATT, the two transistors saturate and are on. So on the right, CE is at Vce or effectively ground and shuts the step-up regulator off. The transistor on the left does similar and VBATT drops over R6 and VBATT_SWITCHED is at GND and there’s no longer any supply to step-up, even if the step-up regulator were enabled.

That’s the idea.

We’ll see. I haven’t computed the values for the discretes around the transistors as of yet.

Related — I’ve just sent off the PCB to get fabricated. It’ll be a 2-off prototype. I’m using AP Circuits for the first time because my usual go-to guys Gold Phoenix are off for the Chinese New Year and I need to get this done for some building & testing next week.

But I think I mucked up the CAM data files I sent them, which appear to be slightly different from Gold Phoenix. They want other stuff, like the NC Tool list which I’ve never sent to Gold Phoenix. I guess we’ll see what they say.
Continue reading Sound Should Just Come Out Of It

DS1803 Digital Potentiometer

I’ve been fussing with this digital potentiometer, the DS1803 by Maxim. They’re “digital” because you can control the resistance over its range programmatically, by sending it commands over a 2-Wire (I2C/TWI) serial interface. So, that means that I can hook it up to some microcontroller, like the Arduino, and adjust the resistance in a little program. I chose this one in particular because it can operate at either 3V or 5V, which is convenient, and it comes in a few different models with various resistance ranges. I’m using the DS1803-010, which means it has a range of 0-10K Ohms.

I created a little PCB with two DS1803s on it. Each DS1803 has two potentiometers on it, so I’ve got four on this board. The code for controlling the DS1803 is pretty straightforward. Each one is addressable over the 2-Wire interface, but because we have two on the same interface, I had to configure one to listen to a slightly different address. The details are in the specification sheet, but basically you hardwire the three lines A0, A1, A2 (see the schematic above) to change the address. Effectively you can have up to 8 individually addressable DS1803s on one interface.

In the Arduino source code example below I am only talking with one DS1803 at address 0x28. (if I was talking to to the second one in the schematic, its address was 0x29.) Here I’ve hooked up a logic analyzer to the interface to just make sure we’re communicating. The code below simply adjusts the potentiometer incrementally upward.


// Control the DS1803 Digital Potentiometer

#include <Wire.h>

void setup()
  Wire.begin(); // join i2c bus (address optional for master)

byte val = 0;

void loop()
  Wire.beginTransmission(0x28); // transmit to device 0x28)
  Wire.send(0xAA);            // sends instruction byte,
                               // write to potentiometer-0
  Wire.send(val);             // sends potentiometer value byte
  Wire.endTransmission();     // stop transmitting

  val++;        // increment value
  if(val == 150) // if reached 64th position (max)
    val = 0;    // start over from lowest value