Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Reverse engineering the Mac ‘breathing’ LED (adafruit.com)
94 points by aitor on June 18, 2011 | hide | past | favorite | 47 comments


And the product that they were reverse engineered for, the iCufflinks

http://www.adafruit.com/icufflinks

Quite appealing if you ask me, if a bit bulky for cufflinks :)


Does the "made in North America" thing really adds any value to that item?


No, but it’s good marketing. Nothing wrong with that.

Funny story: At the end of the 19th century Great Britain pushed for all products to be branded with their country of origin, not to market their products better but for protectionism – to make it easier for customers to recognize real or perceived knock-offs.

That works if those other countries really make inferior products but it backfires when other countries make products of equal or better quality. “Made in Germany” (for example) then becomes a mark of quality, not inferiority.


These days a lot of it is due to localism. A lot of people would rather avoid buying stuff that's already circumnavigated the globe three times before it reaches them.

It applies more to food I guess, but the principle is the same.


The customers win, either way. They are informed and have a choice. It's not only quality, its also supporting the national economy. E.g. you might buy a made in Germany washer, or you might buy a made in US one, to support local economy and to prevent the outflow of money, even thou it is of lower quality (I'm not saying that it really is).


Yes, that was normal in Italy too during fascism. Protectionism has always been a great popularistic argument and that's why I am surprised to see it on a geeky product like that. One would think that the user of battery powered cufflinks wouldn't care about that.


Apple does this on all of their products with "engineered in California"


I'm not sure why you think geeks unilaterally oppose protectionism (or that we'd even call it protectionism). Seems like a broad, inaccurate generalization.

Personally, I like keeping money in the local economy when it makes sense to.


Because hackers are usually curious people, with many interests; chances are they study some economics and found that this kind of 'protectionism' doesn't make much sense.

But yes, you're right, it's quite an assumption. On a parallel (OT) note, I have no idea whether there is a political bias amongst geeks. I've read some pool from NSF a few years ago and it was quite impressive how scientists tend to be left wing/liberal, why engineers tend to be right wing/conservative. So politically speaking there's probably two kinds of geeks but how about two kind of hackers?


> ... this kind of 'protectionism' doesn't make much sense.

This is obviously open to some debate; your condescending declarations of certainty are grating and rude.


A lot of products state that they're "Made in [Europe or UK]", but they are actually manufactured in some Eastern country (most frequently China, Taiwan or Malaysia). Still, the mark is not a lie, as the product was engineered/designed in named country (but manufactured in another).


For many people (concerned with keeping American manufacturing viable) it is probably a big selling feature.


I suspect the waveform is so non-sinusoidal because the eye is approximately log-sensitive. So if you want something to look sinusoidal, you should really physically output exp(sin(w*t)+c), which looks approximately like the output on the scope.


Exactly right.

A couple years ago someone asked me to build him a product that would simulate sunrise: basically just gradually fade up a few high-power LEDs. The only thing I found that worked was a very gradual logarithmic-type fade. Even so, I had to prolong the curve at the low end. It turns out that human vision can detect small changes at low light levels, but at high brightness it takes a big step change to register.

Probably old-hat to trained lighting engineers, but I learned a lot doing such a seemingly simple project.


The LED or SIL (Status Indicator Light), is controlled by the Mac's SMC. You can fiddle with how it operates by setting the relevant keys using IOKit.

http://www.parhelia.ch/blog/statics/k3_keys.html gives details on some of the Mac's LSx SMC keys.



The article is like 3 sentences, one of which says this.


IANAL, but the patent, as I read it, if for a "A sleep mode indicator apparatus for a laptop computer, said apparatus indicating to users that said laptop computer being in sleep mode" or "A status indicator apparatus for an electronic device, said apparatus indicating to users of said computer a certain status". Since the cuff links doesn't communicate any kind of state, I don't think the patent applied. Copyright for the design sounds more plausible, as they're clearly designed to look like something from a Mac.


> Since the cuff links doesn't communicate any kind of state

They could be connected to brain-wave analyzers so they could indicate you are asleep.


Must be nice to have an oscilliscope.


If you're doing simple digital work, you can get a hell of a lot of functionality for a lot less.

I'm a huge fan of the Saleae Logic (http://www.saleae.com/logic). It does 8 lines of digital scoping @ 24 Mhz PLUS protocol decoding (I2C/SPI/CAN/Serial) for under $150. That's 5% of the cost of a Tek or Agilent scope. And the GUI is lightyears better than those other companies.


Looks very nice, and seems made by people smart enough to make the software multi-platform (Linux/Mac/Windows) and ship to (most of) Europe without customs hassles.

Haven't fiddled with hardware lately, but I'm tempted to get one for old times sake (today came across the logic probe I made with a LED, resistor, plastic pen and sewing needle back in my student days ;-).


A nice touch is that you can download and play with the GUI (using faked waveforms) to check it out.


Actually, they just released a new model, the Logic16

http://www.saleae.com/logic16/

In addition to the existing 8 25MHz channels on the Logic, it adds two channels that can go up to a 100MHz and 4 channels up to 50MHz. At $300, it remains quite a steal.


I just used one of the Saleae instruments for the first time the other week (I'd had my eye on them for quite a while before that) and it's great. Personally I sometimes want to look at analog signals, or signals that are a bit faster than what the Saleae can handle, so for me it is more of a complement to a scope (which I do already own) but for people with slightly different needs I can easily see how it could handle most everything they might otherwise use a scope for.


What really steams me is what companies like Tek charge for the protocol analyzer options on their scopes.


A friend of mine recommended this:

http://gadgetfactory.net/logicsniffer/index.php?n=LogicSniff...

It's less "producty" but seems functional


$600 buys you a good rigol


That's my next electronics-related purchase; Rigol seems to make very nice little units.

If you're just a hobbyist, though, the DSO Nano v2 is actually a great little device:

http://www.seeedstudio.com/depot/dso-nano-v2-p-681.html?cPat...

It also has a newer replacement which is significantly more useful, the DSO Quad:

http://www.seeedstudio.com/depot/preorder-dso-quad-4-channel...

I was given the Nano v2 as a present, and for quickie low-frequency testing, it's fantastic.


I still have my Micronta (Radio Shack) logic probe. 22-303. Works like a charm in a quick debug situation.


Or the digital way: on the Commodore 64 disk drive (the 1541), you'd flip a bit of a certain memory-mapped location to switch the LED on or off. Doing this a variable amount of times per second would result in a smoothly fading led. Not sure if anyone ever made a sinusoidal fade, but there were demo's with the LED following the beat of the music.


Pulse width modulation (PWM) is a pretty common technique. This article seems to be more about measuring the actual waveform Apple uses. It even says that the PWM used in the original introduced artifacts into the measured waveform.


I saw someone do exactly this with a 1541 at a party in the summer of 1990: up, down, up, down. It didn't quite do Apple's special rhythm, naturally, but it was quite a shock the first time I saw it.


Sounds like quite a party.


Not sure if you're being sarcastic, but the OP probably refered to a demo party (http://en.wikipedia.org/wiki/Demoparty), aka "copy party".

In other words, a place where someone showing off a diskdrive indicator light taken over for other purposes is totally on-topic.


It would put you right to sleep.


Something like PWM?

I bet Macs don't generate analog voltages to fade the LED, it would be expensive.


LEDs also don't change brightness with voltage, they do with amperage and usually have an optimal amperage for the LED's design. Brightness can be controlled many ways, the most common way is to use Pulse Width Modulation. It's also a common power saving technique.

http://www.reuk.co.uk/LED-Dimmer-Circuit.htm


The patent they reference in the article states that the LED's current is PWMed, where the modulation function is sinusoidal.


Cool; I suppose you could get the same results with a webcam and a little image processing.


You would need a frame rate 2x the fastest PWM cycle. Nyquist-Shannon and etc...


Hmm why can't you construct the signal amplitude from webcam image? You don't have to capture it as digital signal...


Yeah, it's not necessarily to perfectly reconstruct the LED's signal, only the average amplitude over a relatively long period of time. Like, just sample the color of a certain pixel on each frame.


If the LED being used has a perfectly linear current-to-brightness curve then sure, it's possible. Most high-brightness LEDs, however, do not.


But you could just map the current-to-brightness curve of your own LED and reconstruct the necessary PWM signal using that. Actually that'd be a good way to go anyway, since that curve may differ from the one on Apple's LED.


Generating a PWM signal based on a particular LED's characteristics is similar to designing the gain of an amplifier circuit around a particular BJT's beta. It's just not done. That's also the whole reason behind controlling LED brightness through PWM. By PWMing the drive current, you can ensure that the LED is being driven far into its conducting region, and therefore not relying on controlling dimness by varying current around the LED's "knee" (which literally is different for just about every LED in existence, even same part numbers). This way you also avoid other stuff like wavelength shifts that tend to occur near the knee.


It would be more like at least 10x the PWM frequency, if you wanted to see a square waveform.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: