Month: August 2015

µC Prototype JFET Vpp/Idss Tester — scalable to 20-50+ at a time Phase I: The 4 Little JFETs That Could

I previously tested all my 2SK170 and 2SJ74 JFETs by hand with a simple circuit, it’s illustrated well at the Fetzer Valve page, which is a great resource on making a very simple JFET amplifier that somewhat mimics a tube sound. The schematic is near the bottom of the page. I used a DPDT switch and tested two JFETs at a time, then logged the results in a spreadsheet and put the JFETs on a roll of tape with a start number and end number corresponding to the ID in the spreadsheet.

Clearly I needed a way to automate this as some projects will need to many matched JFETs, or I’ll at least need to know their basic characteristics since they have a ridiculously wide manufacturing tolerance. This was a bit of a pain when I went to build my Discrete Class-A all JFET opamp on a breadboard. Side note: Sounds awesome as the initial input for my modular guitar amplifier project and drives the Fetzer Valve circuits into crunchy distortion, especially when the presence caps are engaged!

So I took the schematic and scaled it up. I used a Seeed relay shield attached to an ARM Cortex M3 based Arduino Due. An Arduino Uno would’ve also worked, but the Due has more ADCs and higher precision. This is just a prototype for a larger version, and a proof of concept. It tests 4 JFETs at a time since there are only 4 relays.

The relay shield acts the same as the SPDT switch shown to switch between Vpp and Idss measurement. Sending “R” to the Arduino over serial changes modes, and it just consistently prints out the measured values. I had tried to use the SPDT switch to trigger an interrupt, but I didn’t have any hardware debounce and the interrupt triggers were actually causing the µC to freeze up for some reason. I didn’t look into it and just figured it’d be easier to read the serial input.

The code is very simple and available on GitHub at https://github.com/fdimitri/Arduino_DUE_JFET_Tester. I set the relay pin low or high to measure Vpp or Idss then perform a few measurements and average them. The Due has a bunch of on-chip SRAM so storing 16 samples from 12 ADCs with 16 bit precision (12 bit with 4 bits of padding) doesn’t hurt in the least at 384 bytes of RAM of our 96kB total.

(Not shown: 9v battery source)

I used 1% metal film resistors so I could basically ignore calibration, though you could easily use 10% and measure them then set a calibration factor FOR EACH ADC. I’d rather spend a few extra bucks and deal with a maximum ~2% error factor.

The relays make a satisfying click as they all switch in synchronization. The JFETs are driven with what ever voltage I need, if you expect your values to exceed 3.3v on a Due you’ll have to add a voltage divider to your sampling line, and they’ll have to be very high resistance to not interfere with the JFET — which can also reduce sampling accuracy, ironically. You could also adjust the sense resistor in the circuit. I’ll post schematics with higher power JFETs to illustrate different tactics for dealing with high current JFETs or ones with a high Vgs(off)/Vpp.

The source voltage for the JFETs doesn’t affect Vpp/Idss to such a degree that I had to modify anything, Vpp never exceeds ~1.3v, and Idss never exceeds ~1.5v (which equates to 15mA) with my 2SK170s. You can also test P channel JFETs, but you have to modify a few things to do so. Again, I’ll be posting complete schematics for each type and what to do with high Vpp/Idss devices. The second version is going to use 24 relays and an extra 8 channel 10 bit ADC so I can measure 20 JFETs at a time.

I like to let them sit in each mode for a few minutes to stabilize temperature (as they’re rather) before actually recording the readings. All of these things are going to go into the software, and support for the Seeed boards will remain for a simpler JFET tester (even up to 3 boards if you’re up to wiring them) — however I really recommend the 8 relay boards with optocouplers that you can buy on eBay. The optocouplers protect your precious µC pins from anything as you trigger the relays.

Feeding the JFETs with 3.3v gave me wonky readings, and 5v wasn’t much better. 9v gives me pretty much the same readings as 30v with some small variance, so I’d recommend a 9v feed. You should protect your ADC inputs with at least Zeners (I didn’t).. or some type of break switch (ie any transistor).

So Phase 1: 4 Relays, Using 4/12 onboard 12 bit ADCs
Phase 2: 16 Relays, using 12/12 onboard 12 bit ADCs
Phase 3: 24 Relays, using 12/12 onboard 12 bit ADCs + external chip with 8 10 bit ADCs
Phase 4: Use RadioShack 276-170 boards with JFET sockets installed instead of breadboards (Two sections of 47 columns, 5 rows). That will easily give me 22 JFETs per board
Phase 5: Add more I2C ADCs and relays to test ~50 JFETs at a time for easy cataloging
Phase 7: Switch to STM32F429, test 100 JFETs at a time with many I2C ADCs (or use a hilarious amount of relays as a huge multiplexer instead of a massive ADC array — which also has the advantage of sounding really cool)

Since the Arduino Due is basically a monster as far as micros go, we won’t run into any issues with lack of RAM or PROM storage. Do you know how insane 96kB is when you came from 8kB and less of RAM? Granted it’s not as much as an improvement as the processor itself.. but still very nice! Of course I cheated back in those days and hooked up 64kB SRAM.. in banks.. and bank switches happened between task switches, so each process/task had its own bank of 32kB of RAM for the heap. But that’s a story for another day, and I digress!

I may also port the project to my STM32F429 Discovery board. It has 256kB of RAM with another 8MB on the PCB accessible and addressable through the external bus, along with a 320×240 touch-screen LCD. That would be an entirely new program, of course as unfortunately the STM32F boards are not really supported under Arduino (though apparently some work is being done for some of them.. the F429 is not one of those devices).

Between that and maybe an easier navigation device (track ball off a Blackberry? Joystick?) it’d certainly be a more impressive looking and easier to use tester. I know I don’t need that much RAM for this application, but I can’t argue with more specs 🙂 It also has a trio of I2C busses for hooking up LOTS of ADCs! It also sports I2S.. which means.. more ADCs!

And my secret end goal? To make a single ended JFET output stage to drive a small guitar amp.. shh! I’m gonna need lots of these things to drive a few amps into a speaker!

Me vs my 2006 Audi A4 Quattro 2.0T Part II: The Tale of Stuck Bolts, and the S3 K04 Turbo That Doesn’t Really Fit On An Audi B7 A4

DISCLAIMER: This is mostly a rant, not a how-to. I’ll post a “how I did it,” later — you know, once I actually do it. A good resource for the S3 K04 turbo on a B7 A4 and the parts you will need is available at Audizine Thread: S3 turbo on A4 2.0 Tfsi DIY:ish, there’s some good information on that post and of course throughout Audizine’s forums.


So, the Audi saga continues. After finding out I needed a water pump I ordered a timing set with the pump as it’s driven off of the timing belt on the VW/Audi 2.0T. I realized I had to take the nose of the car off, that’s everything forward of the fenders — core support, bumper, bumper support, headlights. I wasn’t fully prepared for how much of a pain that would be on a 2006 Audi with some stuck bolts.. but I did get it off, and I actually had access to the engine.

Changing the thermostat was now a possibility, so I decided to do that at the same time. As you may have read from Me vs my 2006 Audi A4 Quattro 2.0T Part I, Audi likes to make everything out of plastic. I actually couldn’t get one of the hoses free from the thermostat without possible damaging it, so I simply grabbed a pair of channel locks and crushed the thermostat. The pieces came easily out of the hose, and I didn’t have to buy yet another $110 hose (this one is semi-accessible without massive disassembly so I didn’t replace it for peace of mind).

After a few hours in the heat taking the car apart I decided to do something a little less intensive — I looked at my turbo caked in heavy oil deposits, and decided to match the S3 K04 turbo up to it. I had read that you needed a diverter valve relocation kit, but I could easily fabricate that. I wanted to make sure all the outlets were in the right spot.

They were not.

Of course they weren’t.


So here’s what APR offers as a K04 conversion package, with the outlets in all the same spots so you can reuse your factory hoses. I have a feeling they machine the K03 housing to accept the K04 compressor impeller.

You pay lots of money for one with outlets in the stock locations!

Note how the turbo outlet (the pipe exiting the bottom of the turbo) points basically downward. The S3’s K04.. faces FORWARD! I didn’t do that much research, so I had no idea that I was getting myself into some fabrication.

Now take a look at the S3 turbo — you can see the long squiggly compressor outlet tube that they’ve fabricated and welded directly into the bolt-on turbo flange. You have to do that AND relocate the diverter valve. That tube is actually a good place to put the valve.

But I digress.


Further research after the fact showed what I should have known in the first place. Now my car will be apart longer since I’m not going to take the entire front end off again to change the turbo when that decides to bite the bullet next month. Of course now that I’m doing the turbo, my Tiptronic transmission will die. Mark my words. I bet it’s because of something made out of plastic, too.

Thankfully the inlet is in roughly the right spot and the exhaust manifold is actually part of the turbo, so I know it bolts up to the engine. The exhaust outlet is in the right spot, but I later found out the outlet flange bolt pattern is larger. That will necessitate some modification either to the turbo or the catalytic converter’s flange.

If fabrication scares you, if you don’t have a TIG welder, or access to a small machine shop — stay far away from the actual S3 turbo. The coolant and oil lines will bolt up easy enough, and obviously it’ll go right on the engine. But there’s no readily available turbo to intercooler charge pipe for putting an S3 K04 on an A4. Which means you have to cut up some pipe and do some welding (directly to the turbo’s outlet flange).


But the title says something about bolts, you say? Right. Audi had this great idea where they would put Allen-head bolts through the crank pulley into the crank, all the different types of bolts on this car befuddles me. They go from Allen to “Triple-Square” (12 point extrusion, similar to Allen) to Torx to good old fashioned hex head and 12 point bolts. Go figure.

Anyway, as my luck would have it I stripped two of those Allen head bolts. Considering the tight confines of the crank pulley and the fact that there were no edges to hit with an impact hammer or other tool I simply welded a 3/8″ bolt on to the first bolt and used a 9/16″ socket and the impact gun to drive it. It broke the weld at first, I couldn’t get good weld penetration due to the area constrictions. I ran it again and did my best to get a good weld around the circumference of the bolt.

I heard you liked threads so we put bolts on your bolts so you could..

It zipped right out. Bingo! The next one should be even easier, right?

Wrong!

It worked great for the first bolt, the second one was not so happy. I tried a 1/4″ bolt this time so I could actually sit it inside the existing stripped bolt. Sounds like a good idea, right? I was able to get a much better weld this way.. unfortunately this bolt I was welding it to was also a little more stuck than the last one, so the 1/4″ shank  simply snapped. I had more of a problem now since I also had to deal with the 1/4″ stub with a weld around most of it.

I welded a nut to what was left of the bolt. That weld snapped.

Then I remembered something great (and that I rarely have to resort to). I had recently bought a set of cheapo sockets that were basically junk – they broke easily. They were on sale for like $4, but even junk tools can have a purpose. This one was about to find out what its was.. because being a regular socket was certainly not it.

I cut three deep V grooves into the cracked socket with the bench grinder so I now had 3 prongs attached to the 3/8″ drive base. It fit fairly well over the existing weld material.

I welded it up as good as I could and popped the impact driver on it, and out it came.

I still have to figure out how I’m going to get the large crankshaft bolt out which doesn’t want to seem to budge with my impact driver. Of course nothing about this car is easy!

But hey, now I can’t forget why I hated Audi.

Disclaimer #2: I actually kind of like the car, I just hate working on it as it was apparently engineered by people on massive doses of hallucinogens.

Disclaimer #3: Excuse my writing and rants, I’m running on little sleep.

Me vs my 2006 Audi A4 Quattro 2.0T Part I

The last month has been trying with this vehicle.. I hated Audis earlier in life, to which most people for some reason thought I was jealous. I wasn’t. There was a reason.

And this is the month that I’m reminded of it.

Quick background: I bought the car about 10 months ago and have had no problems with it aside from a miniscule coolant leak and some squealing from the turbo. Those things I was willing to put up with until it was warmer out. I ordered an S3 turbo which is a K04, I believe slightly smaller than the one on my 2007 Solstice GXP — but much bigger than the stock K03 and the same price as the puny stock one. And who could argue with more power, right? And I really don’t mind working on my own cars so long as I’m not fixing them. If I’m UPGRADING them, that’s a different story, right? So it got warm out.

So it all started when I went to put UV dye in my coolant system to track down this little leak that left no puddles or obvious signs, it was extremely slow. I hop in the car and go to drive it to get it good and hot and try to see if I can get my UV light and find some signs of the leak. Can you guess what happened within the next 15 minutes?

The car overheated. Quickly. I put the heat on, and that wasn’t working which told me I had just lost a massive amount of water. I was very close to home and decided to risk the 1/4 mile trip with as little throttle as possible. Audi likes to do this cool thing where they make everything out of plastic. Like coolant flanges on that bolt on to the back of the engine in a nigh-unreachable spot and connect the motor’s coolant passages to the heater hose and upper radiator hose and god knows what else.

Plastic is awesome.

Plastic is awesome.

 

This little piece of plastic took hours. And they break. All the time. Awesome design, Audi! It’s a cheap part, I think I paid around $20. Then I paid $100 for a new heater hose that connects to it just for peace of mind, and about $15 on another hose that’s about 4″ long (it’s probably one of the more expensive 4″ pieces of black hose you’ll run into).

So I somehow get the coolant flange in there and manage to get the hoses on it, I bolt the cam-driven vacuum pump back on and the high pressure fuel pump — I buy another emissions related hose and that sets me back $75 as the clips on mine broke. The PCV valve which is plastic, of course (and no it’s not a Positive Crankcase pressure Valve, it’s Audi’s ridiculous idea of Crankcase regulation) has nice hot oil fumes coming up into it — which make the plastic very brittle. I’ve already replaced it, but it seems to break with minimal pressure. Guess it’s getting changed again. I find out my valve cover is made of plastic and there’s a screw with the head broken off in it that holds the PCV valve..

I remember why I hate Audi.

I start the car, take it for a drive, everything seems to be OK until I get about 10 miles out.. the car slowly starts overheating. I try to bleed the outrageous coolant system. It doesn’t help. I notice there’s no water flow unless you rev the engine.. with a bled system a sure sign of a bad water pump. Which means you get to take the entire nose of the car off so you can change the TIMING BELT DRIVEN WATER PUMP!

Yay.

Did I mention the OE water pump impeller is made of plastic and all the replacements are cast iron? Gee, I wonder why.

Thanks Audi. Clearly I was just jealous all these years. The cuts all over my hands are a testament to that. I’m so glad I finally own some kind of Audi.

In all seriousness though, it seemed to be very reasonably priced for a comfortable “AWD” (It’s not really AWD, don’t let that Quattro stuff fool you — the rear diff is open!) vehicle, and I couldn’t drive my daughter around in snowy weather in a rear wheel drive car with large tires — because they just act like big sleds and you don’t get to go anywhere.

This story continues with a horrible tale of a timing belt replacement.

And I ask myself — why did my 1979 Firebird need less maintenance and why was it literally over one hundred times faster to fix mechanical issues on it?