Electronic – Which way round should D3 go

diodes

TL;DR

  • What is the purpose of D3?
  • Which is the correct orientation?
  • Does it depend upon its intended purpose (whether to protect the USB or the 7805)?

I have two ATtiny85 development boards, one is a DigiSpark and one is a generic mini development board.

As the schematics below show, they are essentially the same:

DigiSpark:

DigiSpark

Mini development board:

Mini development board

However there is one small but significant difference – the orientation of D3:

  • The DigiSpark has the anode to 5V and cathode to USB 5V;
  • the Mini Dev board has the anode to USB 5V and cathode to 5V.

I have tested and checked the orientation of D3, on both boards, with a diode tester and both of the schematics are indeed correct1, and both boards work from USB power, as required. However, the orientation of D3 on either board is opposite to that of the other.

For the Mini development board, I assume that the diode (with the anode connected to USB 5V) would protect the USB from externally connected VIN feeding back, via 5V. Would that be a correct assumption to make?

However, for the DigiSpark board:

  • How can the board be powered from USB, if the diode is blocking the USB 5V (anode to the 5V output of the 7805)?
  • Is D3 protecting the 7805 from USB power?
  • If so, then the USB is left unprotected (when an external supply is applied)?

For completion, here are annotated photos of the two boards, showing the component identifiers:

Annotated DigiSpark

Annotated DigiSpark

Annotated mini development board

Annotated mini development board

For full disclosure, these images come from my blog Digistumped?, which has some additional reasoning explained, which I don't need to go into here.

I have checked and metered out both boards and checked the components and their connections. All components are accounted for in the schematics… There are no hidden components (which aren't shown on the schematics) and no hidden traces/connections/contacts.

Footnote

1 I have searched and found links discussing the orientation, but none have a suitable explanation:

Diode D3 is not in reverse. as suggested in post#2 of digispark ATTiny85 not running on independent power:

Is D3 really connected as per the schematic? I think it should have the anode connected to the USB connector.

as this Bypass Digispark 5v 500ma current limit? post states

we can see that there is a diode that drops the voltage to the VIN pin on the board…as i understand it that pin is there to prevent external power from feeding back into the usb port…

See also Powering the Digispark and Power from USB connector, in particular this post:

I do think the schematic for the original digispark is wrong… the diode is pointing towards, the 5v, not away from it, so it is allowing the USB to provide power to the 5v pin, but preventing any power present on 5v from feeding into the 5v line. Just to be clear, this is the schematic I am looking at for the Digispark…

Best Answer

While researching something for a project of mine, I got the idea to reverse engineer the digispark USB connection for clues, and the D3 diode had me stumped for days, days! But I think I finally figured it out:

  • What is the purpose of D3?:

D3 is to protect your laptop from the things you're likely to be doing with a crazy cheap prototyping board kind of product.

  • Which is the correct orientation?:

It's backwards on the "DigiSpark" schematics. Anode should be on USB, cathode (|) on the "5V".

  • Does it depend upon its intended purpose (whether to protect the USB or the 7805)?

Yes. Possibly it could be nice to have another one to protect the regulator, but: costs, limited space, and your laptop is not going to try to fry your digispark or pendrive or other stuff, so why bother?

Exhibit A: The annotated Digispark picture from the question. Correctly identifies the terminals as USB 5V in the very corner, and 5V to the right. Looking closely, there's a hint of cathode stripes on the right. And K12 is upside down, if this is the same/similar diode to this SMD diode K12 that would also imply cathode on the right.

Exhibit B: This pcb layout confirms the terminals. Diode direction seems ambiguous to me, and I'm not sure how "official" this image is, but the paths agree with a Digispark I physically have, and the annotated picture. USB 5V is in the corner.

Digispark PCB layout

Exhibit C: Every photo of actual digispark I find where the orientation of the diode is discernible shows the same orientation with anode in the corner. (there are some 3d renders floating around that differ, I guess ignore them?)

Some examples: way different diode, but note direction image from GitHub youtube vid of a prototype using digispark (best visible around 1:40 mark) The one I have also agrees.

And, perhaps most importantly: main image on this actual digistump product page shows anode in the corner (connected to USB 5V), cathode strip indicator "towards the USB connector"

While trying to describe it I noticed a possible source of confusion, on the board the diode lies with cathode pointing towards the USB connector, but the PCB paths run under and around and the actual USB 5V is in the corner. Perhaps while drawing the schematics someone glanced at the board and drew it backwards?