I'm planning to assemble a circuit this weekend; it is basically an attiny85 with a USB interface. The circuit is well known on the internet; see for instance this schematic:


(Image taken from http://codeandlife.com/2012/03/03/diy-usb-password-generator/)

Now, currently I don't have any zener at home; I hope the local supply has them, but couple of times they didn't have even the most basic components, so there is some risk I will not be able to have them by the WE. So, here comes the question.

Can I substitute the two zeners with two blue leds? I know that the zeners have a steeper curve, so I will not have stable 3.6V (or better, a slightly lower voltage) on the lines, but... Is this really a problem for USB lines?

I read question LED as Zener: is this a good way to lower the BOM cost?, and there the main concerns were about the stability of the voltage (and in that case they were not an issue). Do you think there can be issues with USB? Did you already try that?

Thank you

  • 4
    \$\begingroup\$ The zeners are not strictly necessary, for a one off project you might get away without them. Using LEDs can help, bear in mind they are there to protect the micro, not to regulate anything: they basically short to ground any voltage above 3V6. \$\endgroup\$ Commented Aug 31, 2017 at 8:14
  • 3
    \$\begingroup\$ As Vladimir writes, the zeners are adding extra protection. So you can just leave them out or you could replace them with a string of diodes (in forward !). A standard 1n4148 has a forward voltage of around 0.6 V so if you use 6 in series then you can use that instead of the 3.6 V zeners. That would give more predictable protection in my opinion. \$\endgroup\$ Commented Aug 31, 2017 at 8:33
  • 1
    \$\begingroup\$ The forward voltage of a LED is much less controlled than a zener diode's voltage rating. The zener diode will be tested by the manufacturer to guarantee that it meets the specification. For a LED I expect that it will only be checked that it lights up. If a LED is cheaper and if your application can work with the LED's unpredictable forward voltage and speed is not an issue (a LED might be slower than a zener) then yes, you can save cost and use an LED. But in general you should not blindly replace a zener with a LED, only do that when circumstances allow it. \$\endgroup\$ Commented Aug 31, 2017 at 8:39
  • 1
    \$\begingroup\$ Thank you all for the comments. I'm answering all of them singularly because I can't cite more than one person in each. @VladimirCravero, I think the zeners are there to protect the USB rather than the micro (micro is powered at 5V, the USB specs have a lower voltage on D+ and D-) \$\endgroup\$
    – frarugi87
    Commented Aug 31, 2017 at 11:26
  • 2
    \$\begingroup\$ Actually, the OP is correct, the Zeners are there to protect USB host from ATtiny85 driving 5V on data lines. \$\endgroup\$ Commented Aug 31, 2017 at 17:07

2 Answers 2


Yes, for a USB Low-Speed applications 3-V LEDs can be used in this schematics.

Actually, in this case these Zeners serve some USB functionality, and their main purpose is not ESD protection but voltage limiting. Reason is that this MCU is powered from +5V supply directly, without any 3.3V regulator. At 5V the ATtiny I/O drivers have about 25 Ohms, and would drive hard to 5V, which is not what USB needs nor likes. The signals should be limited to 3.3 - 3.6 maximum in order to not to fry the USB host. That's why the schematics uses the insane 68 Ohms in-series resistors, and 3.6V Zeners. The data signal clipping don't need to be precise, so 3-V LEDs will be okay, and even add some fun illuminating USB traffic.

In the past the USB interface used to be tolerant to direct contact with +5V. With modernization in silicon technology and integration of USB physical interfaces (PHYs) into low-voltage 22 and 14 nm silicon (where transistors are barely 1-V tolerant), the requirement to hold 5V on data lines was eliminated. So the USB lines better be protected from DIY devices like this ATTiny projects.

  • \$\begingroup\$ Thank you for your contribution. Luckily I found the zeners (and since I was in a hurry I did not experiment with the LEDs). When I have time I'll also try with LEDs on the two pins and a USB hub to experiment if it is ok to use them. For the moment, thank you! \$\endgroup\$
    – frarugi87
    Commented Sep 4, 2017 at 10:14

You really shouldn't need the Zeners at all. Their purpose seems to be only voltage clamping. They can help clip some ringing if someone uses a out of spec cable, but they generally shouldn't be needed.

It appears the processor is running directly from the USB nominal 5 V power. Perhaps the Zeners are to clip the 5 V to the 3.3 V level required of the USB signals. I don't know about the ATiny parts, but the Microchip PIC 18s with a USB peripheral deal with the USB signal voltages directly. Some even have a LDO in them so that the part can run straight from the USB power.

The fact that the circuit doesn't include a bypass cap between Vcc and ground at the processor throws suspicion on the whole thing and put everything else in the same publication, web page, or whatever, in question. In other words, this was clearly not done by somebody competent. Run away.

  • 3
    \$\begingroup\$ Olin, This is an example of bit-banging low-speed USB, where computing enthusiasts skipped even on 3.3V regulator. So the GPIO pins are running from 5-V rail, and therefore 3.3V clipping is needed. One shouldn't confuse this ATtiny with PIC18, where they have a dedicated USB PHY bonded to dedicated pins, all perfectly certifiable to USB standards. \$\endgroup\$ Commented Sep 1, 2017 at 20:44
  • \$\begingroup\$ @AliChen in fact skipping the 3.3V regulator is not used because of speed issues (the attiny does not support 16.5MHz at 3.3V, only at 5V; the first versions using an attiny2313 used it out of specs - 12MHz @ 3.3V is not supported) \$\endgroup\$
    – frarugi87
    Commented Sep 4, 2017 at 10:07
  • \$\begingroup\$ @frarugi87, thanks for the clarification, duly noted. \$\endgroup\$ Commented Sep 4, 2017 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.