Skip to main content
Topic: Dangerous component/part tester (Read 301790 times) previous topic - next topic

Re: Dangerous component/part tester

Reply #75
[quote author="ian"]I'm obviously missing something key - that seems to just count till the pin goes low?[/quote]

And it should work in theory.
If you connect an inductor to ground with a pull-up resistor the current will ramp up.
The greater the current, the greater the voltage drop on the resistor will be, at some point in time, it will drop enough for the pin to read low.

Re: Dangerous component/part tester

Reply #76
That makes sense, thanks for the explanation.

@RJSC - I guess the thing that stumps me is that no additional math is needed to get uH value? I guess maybe that is why 470 is an important value, but they actually seen to use 100 in the code.
Got a question? Please ask in the forum for the fastest answers.

Re: Dangerous component/part tester

Reply #77
[quote author="ian"]@RJSC - I guess the thing that stumps me is that no additional math is needed to get uH value? I guess maybe that is why 470 is an important value, but they actually seen to use 100 in the code.[/quote]

Thats the mystery...
I'm very good with conceptual and qualitative thinking, but math and asm, not quite so...

Re: Dangerous component/part tester

Reply #78
[quote author="RJSC"]If it works, 1USD extra in parts is not bad, if we're not trying to make big profits, it just adds 1 USD to the final price.[/quote]
Good point. Perhaps there will be only one P channel MOSFET needed in the 100Ohm channel. Rest of cahnnels max power consumption few nA to 5mA max. And yes, an N channel also needed for the test pin pulldown as we'll be using it to discharge capacitors, and we don't want much current through uC pin.

EDIT:
For understanding inductors this link has good information (you have to read every page by 'next page',,,, 'next page')
http://www.allaboutcircuits.com/vol_2/chpt_6/1.html
Still learning
-Arup

Re: Dangerous component/part tester

Reply #79
Arup you totally inspired me. I made an inaccurate but highly repeatable cap measurer with the Bus Pirate :) I'll have it in a video tomorrow.

I started to bread board something up, but then decided it was easier to try with the Bus Pirate. You can try it to with the attached firmware.

I used AUX and CLK.

BP AUX->100K resistor->cap + pin
BP CLK->20R resistor->cap + pin
BP GND->cap - pin

Use the attached firmware. The f function has been modified to measure capacitance and report A) clock ticks, and B) estimated value based on X/1480. In reality the divisor is 33% too large due to breadboard capacitance. 1uF-100uF are 33% off. at 100nF it is spot on. What is super amazing is how repeatable it is. Every time the same number of ticks.

What happens:
Setup 32 bit timer
ground the + side of the cap with both pins
flip the 20R pin input
flip the 100K pin high to charge the cap
wait until 20R input is high, then stop timer
The count varies by capacitance.

It seems highly subject to reply on pin thresholds to determine the charge level. ADCs are too slow. I think a comparator with 2.5volt reference would be perfect for most parts. You could them even charge a big cap at high current with a PNP.

The 100uF takes seconds to measure. I think a good part of the autoranging is a timout that moves to a smaller R value charging resistor if the small values take too long.

I wonder how much calibration can be done with a couple precision resistors on board, and a short to measure spare capacitance.

I used a breadboard so there is significant base capacitance. I followed the superprobe model (the source suggest time for spare capacitance). Arup's variable R is probably better for autoranging, but harder to calibrate.

All I did in the source was replace bpFreq(void):
Code: [Select]
void bpFreq(void){

        static unsigned int j,k;
        unsigned long l;

        if(AUXmode==AUX_PWM){
                //bpWline(OUMSG_AUX_FREQ_PWM);
                BPMSG1037;
                return;
        }
//R100K is CLK
//R20 is AUX
        //bpWstring(OUMSG_AUX_FREQCOUNT);
        BPMSG1038;
        //setup timer
        T4CON=0;        //make sure the counters are off
       
        //timer 4 internal, measures interval
        TMR5=0x00;
        TMR4=0x00;
        T4CON=0b1000; //.T32=1, bit 3

        PR5=0xFFFF;//most significant word
        PR4=0xFFFF;//least significant word
        IFS1bits.T5IF=0;//clear interrupt flag

//setup pins
//R100K=output;
IODIR&=(~CLK);
//R100K=grouind;
IOLAT&=(~CLK);
//R20=output
IODIR&=(~AUX);
//R20=ground;
IOLAT&=(~AUX);
bpDelayMS(500);

//R20=input     
IODIR|=(AUX);
//R100K=high;
IOLAT|=(CLK);
        //start timer4
        T4CONbits.TON=1;
        //wait R20
        while(BP_AUX==0);
//stop timer
        T4CONbits.TON=0;

        //spit out 32bit value
        j=TMR4;
        k=TMR5HLD;
        l=k;
        l<<=16;
        l+=j;

        bpWlongdecf(l);        // this function uses comma's to seperate thousands.
        bpWstring(" ticks");       
        bpWBR;                     
l=l/1480;
        bpWlongdecf(l);        // this function uses comma's to seperate thousands.
        bpWstring(" nF");   
        bpWBR;

//setup pins
//R100K=output;
IODIR&=(~CLK);
//R100K=grouind;
IOLAT&=(~CLK);
//R20=output
IODIR&=(~AUX);
//R20=ground;
IOLAT&=(~AUX);
bpDelayMS(500);

        T4CON=0;        //make sure the counters are off


}
Got a question? Please ask in the forum for the fastest answers.

Re: Dangerous component/part tester

Reply #80
I guess I'll need a few precision capacitors to calibrate it? Maybe it is better to tackle it with better reference and precision resistors...

Next I'd like to see if I can make up a a transistor detector with the Bus Pirate.
Got a question? Please ask in the forum for the fastest answers.

Re: Dangerous component/part tester

Reply #81
Yeah I was also thinking the same to use a comparator as ADC is slow. (Co-Incidence)
But at the same time the inductor thing is eating my head. If I add the sub-hardware of LM311 based LC meter projects lying around the web, then the part in the AVR will be only frequency measurement. So at one arrow three birds are hunted,
1. Capacitor, 2. Inductor, 3. Frequency meter
At that approach some real accurate callibration should be done also.

And yes Ian, about the variable resistance based approach's callibration: That's easy since calculations are done in floating point variables, we can multiply with some calibration constant in each level's results.
For example if we consider the resistor check, there the pullup resistor value multiplies by 10 when ADC>4.5V. So the 100Ohm scale is used for upto 900Ohm DUT, for 900Ohm->9KOhm DUT the 1KOhm pullup is used and so on.
Similarily for 1pf to 99pf the 1M pullup, 100pf to 999pf 100K pullup, 1nf to 99nf 10K pullup, 100nf to 9.9uF 1K pullup, above 10uF 100Ohm pullup. 5 precision capacitor falling in the 5 ranges will be measured and according to that the calibration factor for every range will be determined.
So, there are 5 ranges, and you may already guessed that more ranges give more accuracy. :)
The ranges' selection will be done using a timeout feature, else for short terminals, our MCU will hang forever.
Still learning
-Arup

Re: Dangerous component/part tester

Reply #82
GO IAN GO!

You could use the extra AUX pins for switching other resistors.

Re: Dangerous component/part tester

Reply #83
I've been going over this one for NPN/PNP:
http://viewvc.coremelt.net/viewvc/avr/s ... iew=markup

They use a circuit like this.
Got a question? Please ask in the forum for the fastest answers.

Re: Dangerous component/part tester

Reply #84
Daveshah sent me a PM asking for the eagle files of the transistor tester I have built.
Warning: PCB must be completed!

[attachment=0]

Re: Dangerous component/part tester

Reply #85
Thanks for the transistor tester files. Will be very useful to sort through my large pile of unknown components.

Re: Dangerous component/part tester

Reply #86
MickM you ever consider making pro boards with iTead or SEEED?

Re: Dangerous component/part tester

Reply #87
I was looking to mobile phone display pinouts, and found accurate capacitance meter. http://www.module.ro/capacitance.html

Re: Dangerous component/part tester

Reply #88
[quote author="MickM"]... am very very bad at smd.
...
Mick M.[/quote]

this might sound silly but did you use flux? I always thought it was just I was bad at soldiering SMD but after watching a few of Ians vids hes always adding a TON of flux I decided to buy some. I bought ome good flux and some cheap flux off ebay. As soon as my cheap flux arrived I tried it and it was amazingly easy! thats with the cheap flux, i know it doesnt seem like it would make a difference but MAN DOES IT!. One method I did was flux on the board and very lightly put some solider on the pads; then put some more flux down on that and place the SMD ic; then heat each pin (or multiple pins at once) from the top and it seems to heat the pins enough and the flux lets it suck up onto the pin. It really works pretty well. Without the flux the soldier just doesnt want to play nice..

Whats most amazing is like the awnser to everything when soldiering SMD is more flux. Bridge? Oh flux it a bit and drag or wick it, with a little more flux... Pin not secure? Just put some flux on it and heater up!... oh no soldier on a header hole? Flux it! and Sucks it! It just seems to make the soldier go where you want it to go using ur mind or somthing, thats the only explanation..

Re: Whats next for dangerous prototypes

Reply #89
[quote author="arhi"] http://www.mikrocontroller.net/articles ... stortester[/quote]

I was waiting for some app to compile for past few hours so I breadboarded this baby. Works like a charm :D ... I had some issues programming atmega8 with avr dragon, I lowered the clock down to 1MHz and darn thing didn't want to see the atmega8 so I used 2 other programmers I have with same problem, then I returned back to dragon and tried even slower clock, darn atmega8 works when it goes down to 250kHz.

Another bad news, atmega8 don't have a debugger on chip :(

Anyhow, this baby works way better then I assumed (and even without reference on ADC5, it complains that battery is week but who cares) ... will have to look at the source when I have to wait next compilation for few hours :) ... looking at the schematic first time I assume he use ADC5 for reference (you can notice that original schematic use 5.1 zener) but it looks like ADC5 only measure if battery capacity is ok and nothing else