Author Topic: PCB diy diodes - things calling themselves 1n4148  (Read 7088 times)

0 Members and 1 Guest are viewing this topic.

Offline AKmalamute

  • HHKB Scrub
  • Thread Starter
  • Posts: 837
  • Location: Western WA, USA
PCB diy diodes - things calling themselves 1n4148
« on: Sat, 16 November 2013, 19:51:25 »
So, decided to buy some odds and ends for when I can make my ergodox. Bought a pack of through-hole diodes because I couldn't find the SMD variant but this company's website is made of pain. Also good prices.

Yes I supposed I could just buy what the ergodox's site suggests but I like to shop around

So, scrolling to the middle of the page, I see a buncha SMD 1n4148's some of which are different because they're different brands, but some are "ultrafast, 75v" (and on sale) others are "switching diodes, 100v" and SOD-123F, SOD-123FL, sod-123-not-fl ...

Would a keyboard person help me understand what to avoid? Or can I buy anything that will fit calling itself a 1n4148 and not fry my USB port when I try to make it live ?

HHKB-lite2, Dvorak user

Offline dorkvader

  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: PCB diy diodes - things calling themselves 1n4148
« Reply #1 on: Sat, 16 November 2013, 20:34:31 »
I was just looking this up recently!

Massdrop were kind enough to put the full part number of the diodes they use on the ergodox assembly page. I can guarantee that these'll work. They are diodes inc part number 1N4148W-7-F
Mouser has them for $.063 each in qty 100. Expensive!
here they are on digikey

Looking at datasheets, I found out that most, if not all standard SOD-123 diodes should fit on the pads. The diodes that massdrop have are unusually short, so you may have some clearance issues (with taller diodes, like the ones below) if you go without a case. They will fit fine inside a massdrop or similar layer case.

Based on those findings, I noticed the following diodes on eBay $20 shipped for a thousand? I'm building a ton of keyboards? sure!
Now I don't normally trust random parts coming out of china, but these actually have a real manufacturer who has published a datasheet on them (the seller has them incorrectly listed as 1N4141WS, when in reality they are 1N4148W-T4 (by reading the picture). The T4 designation leads to the company galaxy diode, and I found a datasheet here

Edit: ebay listing had ended: updated
« Last Edit: Sat, 16 November 2013, 20:49:44 by dorkvader »

Offline 0100010

  • Posts: 1127
  • Location: DFW, TX, US
  • Not Sure
Re: PCB diy diodes - things calling themselves 1n4148
« Reply #2 on: Sat, 30 August 2014, 12:44:28 »
Old thread - I know.

Wanted to ask if there any additional pointers on what specs an 1N4148 diode should have for use with a keyboard?

Was looking at these on Mouser wondering if they are close enough?
  Quoting me causes a posting error that you need to ignore.

Offline dorkvader

  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: PCB diy diodes - things calling themselves 1n4148
« Reply #3 on: Sat, 30 August 2014, 13:19:51 »
4ns recovery time (on that diode you linked) is more than fast enough.

Actually, you can use just about any diode, the fast recovery 1N4148 types are just used because they are really common and cheap. I recommend getting cheap diodes from amazon/eBay because they perform more than well enough for KB use.

http://www.dribin.org/dave/keyboard/one_html/
^This guy briefly discusses diode use in part 9 (at the bottom)

Offline vvp

  • Posts: 886
Re: PCB diy diodes - things calling themselves 1n4148
« Reply #4 on: Sat, 30 August 2014, 13:45:36 »
Wanted to ask if there any additional pointers on what specs an 1N4148 diode should have for use with a keyboard?
It must handle reverse voltage of 5V easily.
Its forward voltage drop at about 0.1 mA must be less than 0.9 V. Better have there some reserve. Make it less than 0.8 V.

Was looking at these on Mouser wondering if they are close enough?
That diode specifies forward voltage drop only at 10 mA. And it is at most 1 V. But that is more than 0.8 V. From the data sheet, it is not clear it would work. My guess would be that yes but I'm not sure.

For example: 1N916B from this data sheet would be fine: http://www.farnell.com/datasheets/1716967.pdf
It specifies maximum forward voltage drop of 0.73 V at 5 mA. That is less than 0.8 V, so it is good for sure.

Is there a diode which recovery time would not be good enough? ATmega at 16 MHz means maximum recovery time 1/16e6 = 62.5 ns. I'm not even sure there is such a slow small signal diode. OK, I searched and you are right. There actually exist small signal diodes which are slower than 62.5 ns. They are rare but they exist.

Am I missing something?

Offline AKmalamute

  • HHKB Scrub
  • Thread Starter
  • Posts: 837
  • Location: Western WA, USA
Re: PCB diy diodes - things calling themselves 1n4148
« Reply #5 on: Sat, 30 August 2014, 16:08:52 »
All kinds of answers to all of my questions!

It turns out, as I recall, I built my ergodox with SOD-323 packaging, and I've since bought a 500-pack of through-hole diodes for $2.50 shipped but I haven't tested any (first 101 intended for my 7-bit phantom, though!) all of which were classified as 1N4148.

 And that had been my real question, which is "can I use anything that's sold as 1N4148?  It sounds like I can simply because voltage drop aside, keyboards have pretty insignificant expectations.

HHKB-lite2, Dvorak user

Offline 0100010

  • Posts: 1127
  • Location: DFW, TX, US
  • Not Sure
Re: PCB diy diodes - things calling themselves 1n4148
« Reply #6 on: Sat, 30 August 2014, 16:25:13 »
Wanted to ask if there any additional pointers on what specs an 1N4148 diode should have for use with a keyboard?
It must handle reverse voltage of 5V easily.
Its forward voltage drop at about 0.1 mA must be less than 0.9 V. Better have there some reserve. Make it less than 0.8 V.

Was looking at these on Mouser wondering if they are close enough?
That diode specifies forward voltage drop only at 10 mA. And it is at most 1 V. But that is more than 0.8 V. From the data sheet, it is not clear it would work. My guess would be that yes but I'm not sure.

For example: 1N916B from this data sheet would be fine: http://www.farnell.com/datasheets/1716967.pdf
It specifies maximum forward voltage drop of 0.73 V at 5 mA. That is less than 0.8 V, so it is good for sure.

Is there a diode which recovery time would not be good enough? ATmega at 16 MHz means maximum recovery time 1/16e6 = 62.5 ns. I'm not even sure there is such a slow small signal diode. OK, I searched and you are right. There actually exist small signal diodes which are slower than 62.5 ns. They are rare but they exist.

Am I missing something?

That statement - must be lass than .8V forward voltage drop.  The diode linked above that massdrop recommended for the Ergodox has a forward voltage drop of 1.25V.

Why does forward voltage drop matter?
  Quoting me causes a posting error that you need to ignore.

Offline vvp

  • Posts: 886
Re: PCB diy diodes - things calling themselves 1n4148
« Reply #7 on: Sat, 30 August 2014, 19:04:02 »
That statement - must be lass than .8V forward voltage drop.  The diode linked above that massdrop recommended for the Ergodox has a forward voltage drop of 1.25V.
Why does forward voltage drop matter?

When talking about forward voltage drop it is important to also tell at which forward current it is specified. If the massdrop diode would have 1.25V drop at 0.1 mA (which is something I have hard time to believe) then it would be significant problem since ATmeaga32u4 may not be able to detect key presses. Silicone diodes should have voltage drop somewhere around 0.7 V for small currents. 1.25 V sounds like it is at some high current or some really crappy diode.

Actually I should have always used 0.25 mA instead of 0.1 mA because the internal pull-ups can be as low as 20 kΩ. (0.1 mA corresponds to internal pull-up of 50 kΩ which is the upper range).

The reason why key press detection problems would happen is that when you press a key then a pulled-up input line gets shorted to ATmega32u4 low output(*) through the key switch and the diode (in series with the switch). So the input line would have voltage of the diode forward voltage drop (at the current from the input pull-up). And this small voltage must be recognized as logical zero (low) by ATmega32u4. Electrical characteristics of ATmega32u4 page 378 states that this is guaranteed when the input voltage is at most 0.2*Vcc-0.1V = 0.2*5V - 0.1V = 0.9V

So if you want your keyboard super reliable with even the worst ATmega32u4 then select diodes with lower voltage drop than 0.9V, better 0.8V to have some reserve.

(*) Another problem is that ATmega32u4 low output can be as high as 0.5 V at 5 mA. If such a high current would be used for matrix scanning then your maximum diode forward voltage drop is only 0.4 V at 5 mA (which would mean you need a germanium diode instead of silicon). I measured ATmega32u4 output voltage at logical low and current of 1 mA. It was something like 40 mV (or was it 40 μV? ... I do not recall). Of course this is true only for the particular chip I had. I did not find this datum in the specification.

Offline 0100010

  • Posts: 1127
  • Location: DFW, TX, US
  • Not Sure
Re: PCB diy diodes - things calling themselves 1n4148
« Reply #8 on: Sat, 30 August 2014, 22:56:09 »
The massdrop diode (1N4148W-7-F) has this listed for forward voltage drop :

I f --> V fm
150ma --> 1.25V
50ma --> 1.0V
10ma --> 0.855V
1.0ma --> 0.715V

The one I was looking at (1N4148-B) only gives a value for one rating:

I f --> V fm
10ma --> 1.00V

Only one way to know for sure if it would work.  Think I'll keep looking at more data sheets for the moment.
  Quoting me causes a posting error that you need to ignore.

Offline Hak Foo

  • Posts: 1270
  • Make America Clicky Again!
Re: PCB diy diodes - things calling themselves 1n4148
« Reply #9 on: Sun, 31 August 2014, 00:50:53 »
I just ordered some off-brand 1N4148s -
http://www.ebay.com/itm/161155321616?_trksid=p2060778.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
now I don't know what to expect... there's no data card whatsoever.

I figured "I'll probably need <200, but 500 gives me a bunch of spares, and the difference in delivered price is marginal.
Overton130, Box Pale Blues.

Offline vvp

  • Posts: 886
Re: PCB diy diodes - things calling themselves 1n4148
« Reply #10 on: Sun, 31 August 2014, 06:41:04 »
I f --> V fm
10ma --> 0.855V
1.0ma --> 0.715V
The massdrop diode is good enough.

Almost all small signal diodes you can buy will be good enough.
But there exist some diodes which could be too slow.
There maybe even does not exist a diode which would have too high forward voltage at currents below 5 mA. At least I do not find any which would have forward voltage specified at such a low currents and it was more than 0.8 V at the same time.

One way how it could be a problem is when you would have your logical low output pin of ATmega32u4 loaded too much (e.g. too small pull-up or LED diodes connected to the matrix scanning outputs too) and its voltage would go up nearer to 0.7 V (@ Vcc=5V, I=10mA) maximum specified in the ATmega32u4 data sheet.

So, as dorkvader indicated, it may be more important to check that recovery time is below 62.5 ns than to check forward voltage drop.