The Lazy Man's Germanium Tester

Started by Kevin Mitchell, October 06, 2021, 11:51:52 PM

Previous topic - Next topic

Kevin Mitchell

#40
Afterthought (more info on previous page) - I may have to double up some of the circuitry to avoid sending a negative polarity to the ADC due to user error. Or just be lazy and hope people read red labeled instructions  :icon_lol:
  • SUPPORTER

Kevin Mitchell

#41
Had a better idea. I've added another SPDT IC that is toggled by a comparator. So if the voltage from the buffer goes below 0v it trips the comparator which actuates the switch that determines the ADC's probe point - being pre-inverter or post-inverter. This means the measurement voltage will never go below 0v - depending on any offset characteristics of the chosen opamp. Even so, if the ADC does see below 0v it wouldn't be enough to damage the microcontroller.

https://tinyurl.com/yaa63t39


From here I can drop the PNP/NPN polarity switch altogether and just use another device-under-test socket to accommodate the different devices - keeping this as simple as I can without risking any damaging user errors which would be a massive design flaw.
  • SUPPORTER

Ben N

Quote from: Kevin Mitchell on January 26, 2022, 09:15:57 AM
This means the measurement voltage will never go below 0v - depending on any offset characteristics of the chosen opamp. Even so, if the ADC does see below 0v it wouldn't be enough to damage the microcontroller.
Why not just stick a Schottky in there for protection?
  • SUPPORTER

Kevin Mitchell

Quote from: Ben N on January 26, 2022, 09:37:40 AM
Why not just stick a Schottky in there for protection?
While that would add extra protection I fear it'll effect the measurement voltage. Besides, I believe there's protection diodes already in these microcontrollers - albeit, not as beefy.

Do you not like the automated routine?  :icon_rolleyes:
  • SUPPORTER

Ben N

That's not it, I just focused on what I could ponder with half a brain in the middle of my workday.  ;D
  • SUPPORTER

Kevin Mitchell

#45
Messed with it a little more for this neat circuit. Have at it.
https://tinyurl.com/y7kd26vn

I'm going to purchase some dual LED displays that will change color depending on what polarity device is being tested. Failure to insert a device properly should result in no display action (all LEDS off). I will be keeping the option to use normal less expensive displays with the same pinout - minus one anode pin. I still need to breadboard to verify - just waiting on the displays to arrive.

Power supply will be 9VAC, rectified to ~12v and converted down via adjustable regulators so we have a stable +/-9VDC supply.

So far with where the design is I literally have everything in my parts drawers minus the displays. All common parts though a long way from the simplicity of the OG circuit.
BOM so far

I also want to explore changing some of the Attiny85's pin configuration so I can free up the AREF pin. 5V resolution is not needed so if I can lower it while keeping it within the proper range I could improve the ADC resolution to monitor smaller voltage changes.
  • SUPPORTER

pinkjimiphoton

Quote from: Kevin Mitchell on October 06, 2021, 11:51:52 PM
I got lazy. And so can you!

I had breadboarded the germanium leakage and true gain tester from Geofex as I finally decided to order boxes of those recently popular new-old-stock Russian germanium transistors.
Because I absolutely hate math I had put together a spread sheet with the formulas ready to go! All I had to do was punch in the two measurements - open base voltage & closed base voltage.
Well apparently that was too much work for me and I got sick of it real quick. Numbers kept changing and results were slightly different each time I retyped the measurements

So the thought occurred to me early this afternoon, can I make an arduino do it? Turns out I can! And it's surprisingly accurate in comparison to the manual method.
Devices tested in this photo are MP39B - with noted gains between 20 & 60 according to our archives around the forum.


Before I draw up a schematic I will say that the parts in the photo are certainly overkill as the majority of both ICs & Arduino are unused. I had also kept some uneeded values in the code just in case I wanted to display them to manually to check the results against a DMM & my pre-formulated spreadsheet.

Here's my code for anyone interested. I'll try to put up a schematic tomorrow, but it's rather straight forward. The number .00488 is to convert the resolution of the 10-bit ADC @ 5 volts to the actual voltage (5/1024 =  ~0.00488).
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x3F, 16, 2);

int pulsePin = 55;
int adcPin = A0;

float voltageA;
float voltageB;
float voltageLeak;
float voltageGain;

void setup() {
  lcd.begin();
  lcd.backlight();
  pinMode(pulsePin, OUTPUT);
}

void loop() {
  //read open base
  digitalWrite(pulsePin, LOW);
  delay(50);
  voltageA = analogRead(adcPin)*.00488;
  //read closed base
  digitalWrite(pulsePin, HIGH);
  delay(50);
  voltageB = analogRead(adcPin)*.00488;
 
  //print result
  voltageGain = (voltageB-voltageA)*100;
  lcd.clear();
  lcd.print("TGain = ");
  lcd.print(voltageGain, 1);
  lcd.print(" hfe");

  voltageLeak = voltageA/2472*1000000;
  lcd.setCursor(0, 1);
  lcd.print("Leakage = ");
  lcd.print(voltageLeak, 0);
  lcd.print(" uA");
}


That's it for tonight  8)

dude.... DEWD!!! i think i love you!!! long time!!! outstanding!
  • SUPPORTER
"When the power of love overcomes the love of power the world will know peace."
Slava Ukraini!
"try whacking the bejesus outta it and see if it works again"....
~Jack Darr

Kevin Mitchell

Thanks for your kind words, Pinkjim! However a few months late to the party  :P

The OP is a great resource for folks new programming with arduino. I was a bit rusty when I wrote it up but since then I've gotten better at writing efficient code. The final stand-alone version will be much more gratifying  8)
  • SUPPORTER

Kevin Mitchell

#48
Hey, gang.
Good news! I've rewritten my code for the ATTiny85 chip and made a couple alterations to the circuit - now completely powered by 5v. The lower voltage ensures that the MCU's ADC does not see voltages outside of it's supply range and also allows for an easier approach for switching polarity for testing NPN devices via a 3pdt switch. It also means the buffer was no longer needed.

The following details the value choices, formulas and means of programming the ATTiny85 chip. I've included much detail to answer any predictable questions and also help anyone unfamiliar with programming AVR chips.

Math overview
Circuit values:
With selected values of 5V for VD and 1M for the base resistor (bRes);
If we want to see 1V per 100hfe we must select the collector resistor; cRes = 1 / ((VD / bRes) * hfePerVolt)
Which is; 1 / ((5 / 1000000) * 100) = 2000 ohms

Calculations for data:
NPN conversion: If the polarity switch is on (pin low), openBaseV = VD - openBaseV and closedBaseV = VD - closedBaseV
Gain = closedBaseV * hfePerVolt
Leakage µA = openBaseV / cRes * 1000000
True Gain = (closedBaseV - openBaseV) * hfePerVolt

Code:
// The Lazy Man's Germanium Tester V2.0 - for ATTINY85 and 2x16 I2C LCD
// By Kevin Mitchell for the DIY stompbox community
// Please review the schematic drawing for full circuit details
// This sketch was last updated on 8/25/2024
#include <TinyWireM.h> // I2C Master lib for ATTinys which use USI
#include <LiquidCrystal_attiny.h> // for LCD w/ GPIO MODIFIED for the ATtiny85

// setting up I2C
// SDA is pin 5
// SCL is pin 7
#define GPIO_ADDR 0x3F // the address of i2c for LCD
LiquidCrystal_I2C lcd(GPIO_ADDR, 16, 2); // set address & 16 chars / 2 lines

// define pins
#define adcPin A3 // pin 2
#define pulsePin PB4 // pin 3
#define polarityPin PB1 // pin 6

// define values
#define VD 5 // supply voltage
#define bRes 1000000 // base resistor value
#define hfePerVolt 100 // desired gain per volt to observe
#define cRes 2000 // collector resistor value, picked for 100hfe per volt: 1 / (VD / bRes) * hfePerVolt)
#define adcMult 0.0048828125 // multiplier to convert the ADC's 10-bit resolution to a voltage value: VD / (2^10)

float openBaseV;
float closedBaseV;
String polarityDisp;

// Custom display Characters
byte split[] = {
  B01100,
  B00110,
  B01100,
  B00110,
  B01100,
  B00110,
  B01100,
  B00110,
} ;
byte beta[] = {
  B11110,
  B10010,
  B10100,
  B10010,
  B10001,
  B10001,
  B11110,
  B10000
} ;
byte microAmp[] = {
  B00000,
  B00000,
  B10001,
  B10001,
  B10001,
  B10011,
  B11101,
  B10000
} ;

void setup() {
  lcd.init();
  lcd.noBacklight();
  delay(100);
  lcd.backlight();
  lcd.clear();

  lcd.createChar(0, split);
  lcd.createChar(1, beta);
  lcd.createChar(2, microAmp);

  lcd.setCursor(1, 1);
  lcd.write(1);
  lcd.print("=");
  lcd.setCursor(7, 0);
  lcd.write(0);
  lcd.setCursor(7, 1);
  lcd.write(0);

  // define digital pins - they are inputs by default
  pinMode(PB4, OUTPUT);
  pinMode(polarityPin, INPUT_PULLUP); // enable internal pullup for stabilization
}

void loop() {
  // get open base voltage
  digitalWrite(pulsePin, LOW);
  delay(5);
  openBaseV = analogRead(adcPin) * adcMult;

  // get closed base voltage
  digitalWrite(pulsePin, HIGH);
  delay(5);
  closedBaseV = analogRead(adcPin) * adcMult;

  // polling the polarity switch status
  if (digitalRead(polarityPin) == 1) {
    polarityDisp = "PNP";
  } else {
    polarityDisp = "NPN";
    openBaseV = VD - openBaseV;
    closedBaseV = VD - closedBaseV;
  }

  // checking if a device is installed
  if (openBaseV == 0 && closedBaseV == 0) {
    lsPrint(8, 0, "  TEST  ");
    lsPrint(8, 1, "  READY ");
  } else {
    uint16_t leakage = openBaseV / cRes * 1000000;
    uint16_t trueGain = (closedBaseV - openBaseV) * hfePerVolt;
    rsPrint(13, 1, (String) trueGain);
    rsPrint(13, 0, (String) leakage);
    lsPrint(9, 0, "L=");
    lcd.setCursor(14, 0);
    lcd.write(2);
    lcd.print("A");
    lcd.setCursor(9, 1);
    lcd.write(1);
    lcd.print("=");

    // display maintenance
    if (leakage < 10) {
      lcd.setCursor(12, 0);
      lcd.print(" ");
    }
    if (trueGain < 10) {
      lcd.setCursor(12, 1);
      lcd.print(" ");
    }
    if (leakage < 100) {
      lcd.setCursor(11, 0);
      lcd.print(" ");
    }
    if (trueGain < 100) {
      lcd.setCursor(11, 1);
      lcd.print(" ");
    }
    lcd.setCursor(14, 1);
    lcd.print(" ");
  }
  if (gain < 10) {
    lcd.setCursor(4, 1);
    lcd.print(" ");
  }
  if (gain < 100) {
    lcd.setCursor(3, 1);
    lcd.print(" ");
  }

  uint16_t gain = closedBaseV * hfePerVolt;
  rsPrint(5, 1, (String) gain);
  lsPrint(2, 0, polarityDisp);
  delay(500); // slow the refresh/loop rate

}
// for printing strings from left to right
void lsPrint(uint8_t curX, uint8_t curY, String str) {
  char charBuf[16];
  str.toCharArray(charBuf, 16);
  for (int ind = 0; ind < str.length(); ind++) {
    lcd.setCursor(curX + ind, curY);
    lcd.print(charBuf[ind]);
  }
}
// for printing strings from right to left
void rsPrint(uint8_t curX, uint8_t curY, String str) {
  char charBuf[16];
  str.toCharArray(charBuf, 16);
  for (int ind = 0; ind < str.length(); ind++) {
    lcd.setCursor(curX - ind, curY);
    lcd.print(charBuf[str.length() - (ind + 1)]);
  }
}
You may download the included libraries here
Know that the liquid display library may not work with all I2C drivers for a variety of reasons. After many trials the noted library is the only one that had worked for me.
This is the ATTiny85 core used for the bootloader - internal 8MHz is my preference. For arduino IDE on windows, copy the address to Arduino->File->Preferences and paste in "Additional Boards Manager URLs:" Then find & download it through Arduino->Tools->Board->Boards Manager.
https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

Here's the simplified schematic - no decoupling caps and the unused pins of the CD4066BE are floating. Just as the original, you may also use a CD4016BE.
Connections:
VCC is 9V and GNDD is 0V.
2x16 LCD with "I2C backpack" requires 5V, 0V, SCL & SDA.  When programming the MCU make sure that the SCL and SDA pins are not installed.
ISP programming (I use Arduino as ISP or a USBTinyISP module) - requires 5V, 0V,  MISO, MOSI, SCK and reset.




Since I don't have any NPN germaniums on-hand to test I have the resistors to 0V, emmiter to 5V and the "polarityPin" floating. To test NPN, the polarityPin & emitter must be tied to 0V with the resistors to 5V. The code will account for the change so that it displays the specs appropriately.
Here's the breadboard preview while testing a few different PNP germanium transistor.
No DUT

OC76

1T308B (1T308V)

МП39Б (MP39B)

  • SUPPORTER

ElectricDruid

I think you're ready to build your own Peak Atlas!

Kevin Mitchell

Quote from: ElectricDruid on August 25, 2024, 01:29:49 PMI think you're ready to build your own Peak Atlas!
That's actually a bit of inspiration on this take - but over $100 less expensive  :icon_rolleyes:. I'm going to 3D print a custom case and have a set of 3 test hook clips that plug in via a stereo jack.

Previous post updated with code & libraries.
  • SUPPORTER

sinthmart

#51
Today I accidentally acquired (I took them from where they were lying around as unnecessary) two old Soviet germanium transistors. P5V, manufactured in 1963. They were just lying in a closet with obsolete electronic parts at a friend's. Who is not interested in them and got them from another person.
Surprisingly, the transistor tester showed their gain factor for one of them as 216, and for the other 311 (!!) Although according to technical characteristics, their standard figure is 32-200.
I suppose that some electronics engineer once, in the 70s, saved them for himself as unique, and then they lay in boxes for about 50 years. And now I can make a real, authentic germanium fuzz out of them))

They look like this:
I am interested in inventing and making sound devices.

Kevin Mitchell

#52
Nice! I have yet to come across a germ with such high gain.
For example, I have 100 MP39B which have published gains of 20 to 60, albeit likely before leakage deduction.
Out of the whole lot I only have one with ~35 true gain, and a few just under while the rest were in the low 20s.

Even in a gold mine it's a miracle to find a nugget.
  • SUPPORTER

mozz

Lot of Russian germanium transistors gain spec (on the sheets) is at a higher current. Most tested how we test them are usually at the lower end of the spec.
  • SUPPORTER

Kevin Mitchell

Quote from: mozz on September 09, 2024, 04:04:10 PMLot of Russian germanium transistors gain spec (on the sheets) is at a higher current. Most tested how we test them are usually at the lower end of the spec.
Ah yes, a very valid point. The downside is the specs I'm mentioning were on a listing for fuzz transistors - kind of misleading if one didn't know any better.
A week or so ago I was looking at a listing for soviet germs and they claimed to had used an incredibly expensive and dated transistor tester - printed results on receipt paper.

And I'm over here shooting 5 microamps into the base hoping to contrasts.
So, for our 9v effects it's best to assume the lower range then  :icon_wink:
  • SUPPORTER

sinthmart

#55
But of course, a regular digital transistor tester, as they say, does not show the real gain of germanium transistors. And it is necessary to check the gain in a special way, described in the article on selecting transistors for fuzz face

https://i.ibb.co/cw6fvq4/image.png

I am interested in inventing and making sound devices.

mozz

That's real gain, but more importantly 1330ua of leakage.
  • SUPPORTER

sinthmart

#57
Yesterday I tried to comprehend the arithmetic and calculations of the article on selecting transistors for FF, but it seems my old brain is no longer enough to understand such calculations ((
here is this article:http://www.geofex.com/article_folders/ffselect.htm#:~:text=To%20test%20the%20total%20gain,and%20the%20amplified%20base%20current.

Maybe someone has a link to an article with a different explanation? With a different approach? Which might be within my power?
Recently I assembled a circuit that helps to accurately determine the cutoff current in a field-effect transistor. To select suitable specimens. I was able to do this)) I had enough intelligence for this. But germanium transistors(...
Of the devices, I have a modern transistor tester, a digital multimeter, a pointer multimeter (not very accurate anymore), a frequency meter.
I am interested in inventing and making sound devices.

Kevin Mitchell

#58
Ohms law is all you really need. I've included a breakdown of the formulas used in my last update.

There isn't much explanation on the math behind the value choices in the article.
The explanation that I would like to see is how the suggested collector resistor value of 2.472K was figured. I believe it's derived from the ballpark value of typical conductance of germanium devices which was briefly mentioned - where it's noted that the real base current is 4.046uA while the math without such consideration is 9 / 2,200,000 = ~4.091uA. This vague value is not considered within my math. Without such consideration the collector resistor would be ~2.444K according to my breakdown. I'm sure the difference would be considered negligible for our purpose - we are not to expect perfect results in either case, only reasonable estimates.

Edit: I'll cover it again. You can modify values to fit your situation.
Punching these formulas in an excel sheet will make it much easier for you - or just build my tester  ;)

These values are predetermined and are of my own choice - you can make these whatever you'd like or rather, measure your parts & supply as best you can and adjust the values within the formulas.
VD = 5.00V
Base Resistor = 1M
Resolution target is 1V per 100hfe.

We need to find out how much current the base is getting with the 1M resistor connected.
5 / 1,000,000 = 0.000005 which is equal to 5 microamps

Then we use that to figure our collector resistor for 1V per 100hfe results
1 / (0.000005 * 100) = 2,000 which is how I got a 2K resistor using my selected values.

From here we use the formulas provided in the article - as follows.
For general gain we close the base resistor, measure around the collector resistor and multiply by our predetermined resolution target.
So if it reads say 1.286V, that's 1.286 * 100 = 128.6hfe

But we want true gain, so we take a measurement while the base resistor is not connected for leakage.
With the base open, let's say the voltage around the collector resistor is 0.186V - that's leakage in volts. For leakage current we divide by the resistor value.
0.186 / 2000 = 0.000093 Amps, or 93uA

For true gain, simply subtract the open voltage measurement from the closed voltage measurement and multiply by our target resolution
(1.286 - 0.186) * 100 = 110hfe
  • SUPPORTER

sinthmart

#59
I found out that a friend has an old pointer device (I think it's a factory one) for checking old transistors (he says that you can even connect headphones there to listen to the gain) and I'm thinking of contacting him to check my germanium transistors. But, I have two more questions for the manufacturers of germanium fuses.
1 - Does it happen that even those precisely selected using a special device and these unpleasant formulas)) need to be selected by ear? To choose from them, the best-sounding germanium transistors? Like those of the famous rock bands of the 70s?
And is it possible to select transistors using a digital transistor, and then by selection, plugging different copies into the transistor connectors on the board?
2 - And are there any samples of the best germanium fuse on the Internet? Sounding recognizably like the 60-70s?

(I've listened to a lot of fuzz faces and the like on YouTube, but it's not always the sound of that old, recognizable 60-70s specificity. Often it's just fuzz. Average. Something in between, germanium-silicon, general dispersion.
And Germanium fuzz, for me personally, is: itchy, flat, with a predominance of a narrow band of high-mid frequencies, with a click in the attack. As if the sound is passing through a lock, through a damper, through an edge, through an obstacle.)
I am interested in inventing and making sound devices.