Voltage Regulation: Zener Diodes vs. LEDs

I was prototyping a circuit on a piece of veroboard using SMD components and I needed a 2V supply from my FTDI cable. Of course I didn’t have any SMD regulators handy, so I thought I would use the simplest regulator – a zener diode. But it’s not like I have a 2V zener diode lying around either, so I thought maybe I could use an LED instead, since its forward voltage is close to 2V (for the red/green ones).

A zener regulator is set up like this:

The concept is simple: zener diodes are specially designed to have a specific breakdown voltage (in my case 2V) when put in reverse. The result is a 2V voltage drop across the diode, and hence, Vout. Since I didn’t have a zener diode, I thought I would use a regular LED in its place, but placed in forward bias (so that it lights up).

When I tested the circuit however, I realised the voltage drop across the LED was less than 2V. I missed an important point: the current-voltage curve.

Observe the LED current-voltage curve on the left and the zener diode current-voltage curve on the right. You will notice that the zener diode has a steeper curve compared to the LED. Apparently to avoid blinding myself, I had limited the LED current to about 10mA. I missed the fact that at 10mA the voltage drop across the LED is now only ~1.8V. To get 2V across the LED, you need at least 20mA, which would be too bright as an always-on indicator.

This also answers a question I previously had of whether I can use an LED in place of a zener diode for crude voltage regulation. One of the techniques used by VUSB devices to limit the D+ and D- voltage is to use a pair of 3.6V zener diodes (solution B). The SparkFun AVR Stick uses blue LEDs so that they also double as activity indicators, but from the user comments, it is clear that this causes problems.

If you want to use an LED for voltage regulation, remember to check the current-voltage curve.

Mac Battery Firmware Hacking

Charlie Miller reverse engineers the Mac battery firmware updater, sniffs battery communications on the SMBus, writes an IDA processor plugin (in IDAPython) for the CoolRISC 816 processor in the bq20z80, and mucks around with the its firmware.

All the source code and presentation materials are provided.

[via Dangerous Prototypes]

Coloured iteadstudio PCBs

Good news everyone! iteadstudio is offering coloured PCBs at a lower cost.

After I had my very first set of PCBs manufactured, I was thinking of making my next set of PCBs in a different colour. However I found the price difference to be quite big and might just stick with plain old boring green instead.

Now that they’ve announced their new offering, I’d definitely go for a different colour for my next batch. They’ll be offering 8 boards instead of 10 (which is not a problem at all for me), and fixed thickness of 1.6mm and HASL finish – all for an extra US$5 more than their base PCB service. Their available colours are blue, white, yellow, red and black.

[via Dangerous Prototypes]

My First Arduino

I finally bought myself an Arduino Uno this week.

“Wait a minute… then what have you been using?” I hear you ask. Previously I had access to an Arduino Duemilanove, and used it to burn the Optiboot bootloader onto an ATmega168 that I had. The Duemilanove board used an FTDI chip which had additional pins brought out to an unsoldered header marked as X3. Following this guide by Kimio Kosaka, I downloaded the precompiled avrdude for Windows and used it to program the ATmega168 via the X3 header.

The end result was a bare-bones Arduino that ran on a 12MHz crystal. The reason for 12MHz was because that was the maximum “safe” clock speed at 3.3V, which I used for a university project and have been using ever since. You can see it below, driving a HD47780 parallel LCD.

However, it’s a real chore to hook this up, especially since everything on the breadboard like the crystal, FTDI header and reset button and pullup resistor are all inserted like any other component. It is more convenient to have a ready-built board for prototyping, where you don’t have to worry about the Arduino components.

If you haven’t gotten an Arduino board yet, I highly suggest you get one. If you would like to hook it up on the breadboard similar to what I did, at least get the Really Bare Bones Board (RBBB) Kit.

Reducing power usage on the iCufflinks’ ATtiny4

I came across this very nice article which documents steps taken to reduce the power usage on the ATtiny4 used in the iCufflinks.

The process managed to shave off about 315 μA, which boosts battery life quite a bit:

The overall effect this has on the product is that the 24 hour time between battery changes can be upped to 38 hours. That is a pretty good power savings for the day.

It’d be great if this was incorporated into the products.

I do disagree on one thing though, which is cutting away the data points used for the PWM. Unless the output was measured with an oscilloscope and produces the same breathing pattern, I would very much keep the data since the additional space gained is not used for anything else.

If you don’t know what iCufflinks are, watch the video below.