1. We will be in Read Only mode (no new threads, replies, registration) starting at 9:00 EDT for a number of hours as we migrate the forums to upgraded software.

# Resistance drift and multivoltage circuity

Discussion in 'The Projects Forum' started by mcdpekala, Sep 19, 2008.

1. ### mcdpekala Thread Starter New Member

Sep 2, 2008
4
0
Hey all,
I am having a problem with resistance drift with regard to temperature in one of my circuits. The problem is that as the temperature increases or decreases, the resistors change value and the circuit dynamic change. The changes are within tolerance mind you and I have already got a few ideas to help this kind of drift (matching resistors and passive measures), but I was wondering if anyone had any ideas for ways to combat this, both actively and passively.

Another issue I am having is coupling a 12v high amp (not really 'high' amp, but high enough that I am worried it will blow out my uC) transistor to a 5V uC output pin. I haven't really started on looking up different buffering techniques yet or working through ideas I have so this is kinda a preliminary question just to get started. I was hoping that you guys might give me some more ideas.

2. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
Use precision metal film resistors. Make sure that the power rating of the resistors is at least twice that of the expected power dissipation. P=EI, or Power in Watts = Voltage x Current in Amperes. If you want less drift, use even higher power rated resistors.

For your 12v high current line, you can use a logic-level power MOSFET controlled by your uC to switch it on and off. One such example is an IRLZ24; it can handle a Vdss up to 55v, and can switch up to 17A with a Rds(ON) of around 0.1 Ohms.

A uC cannot directly interface with 12v. Many uC's have "clamping diodes" on their inputs to limit the maximum voltage to just a bit over Vdd and just a bit under Vss. However, those clamping diodes won't take much current, and will get hot in a hurry.

It would help to know what you are really trying to accomplish.

3. ### beenthere Retired Moderator

Apr 20, 2004
15,808
295
If your temperature drift is within limits and your signal is digitized, then you can always measure the temp and linearize from a calculation. Matching components for null drift is pretty time-consuming, plus you need a selection of components to swap for the match.

You second question is very vague. Can you drop the gain? Add a diode clamp?

4. ### mcdpekala Thread Starter New Member

Sep 2, 2008
4
0
Okay, so what I have is a PIC microcontroller set to 5V. I want to generate a PWM signal from this PIC to run an array of devices that operate off of 12V. The PWM signal is slow (~1Hz with 50% duty at its greatest speed) and as such I am not really worried about signal problems. What I am driving is a group of BJT transistors (PNP and NPN) which have voltages from 14 to 10V at their emitters and some sort of load at the collector.

The issue is I have a 0V to 5V digital signal coming out of this PIC and I want to bring it up to a level where I can actually switch the transistors without having to worry about the possibility of blowing out the PIC or blowing out one of the transistors. Right now I am using a non inverting amplifier through an op amp. It works but I was curious as to other methods of doing this sort of thing since I can imagine this kind of thing has been looked at a great deal.

5. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
Logic level MOSFETS would be far more efficient. A PIC can source/sink 25mA from each pin, so to protect the uC, use at least a 200 Ohm resistor to limit the source/sink current (5v/25mA=200 Ohms). The current to the gate of a MOSFET will be momentary, as they effectively have near infinite resistance. However, you must charge/discharge the gate capacitance.

The next step down would be to use Darlington transistors, such as TIP120, TIP122, TIP142, etc. Since they are BJT's, they will dissipate more power than MOSFETs. I suggest using a larger resistor such as 470 to 1k Ohms, as the base current will be constant as long as the Darlington is turned on.

Most typical opamps have lower current source/sink capability than your uC does. Many can't output voltages down to the ground rail, either. Unless you're using a rail-to-rail opamp or using bipolar supplies, you're likely shooting yourself in the proverbial foot.

Also, op amps aren't designed to be run in open-loop mode. I don't know if you're using the opamps strictly as a buffer (output connected to inverting input), or if you're running them in open-loop (no feedback to the inverting input). If the latter, you are stressing the opamps, and they won't likely last long.

The easiest way to interface items to a uC is to use an N-ch logic level MOSFET, with the uC driving the gate through a resistor, the source connected to ground, and the drain sinking current from the load.

If you are sourcing current, then you'll have some fiddling around to do. One easy way to interface such items is to use optoisolators, such as the old standby 4N25. The uC drives the LED in the optoisolator via a resistor, and the transistor is used to drive your semiconductor device.

[eta]
It would help a great deal if you would post a partial schematic of what you have now, from the output pin of the uC, through your opamp and the BJT's, including the load(s). The types of loads can be very significant.

Last edited: Sep 19, 2008
6. ### mcdpekala Thread Starter New Member

Sep 2, 2008
4
0
Right now I am using a non inverting amplifier setup with a feedback resistor and a gain of ~2.5. I thought about using a MOSFET, but I didn't have any handy so I kinda cludged this thing together with an LM324. Same thing with the optoisolator.

I didn't think a Darlington pair was applicable to this kind of problem since I needed to amplify the signal (though now that I think about it, it seems right). I'll try that and see if it works better.

7. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
Well, a transistor starts conducting when Vbe is between 0.6 and 0.7v. Current in the collector is basically dependent upon current in the base. It's not a terribly linear relationship as Ic goes up.

However, Darlingtons multiply the gain of the 1st transistor by the gain of the 2nd. a TIP120 has a typical gain of around 1,000; but as Ic increases towards saturation, hFE decreases. But if you supply the base with 12mA, you should get around Ic=3A; but you'll have a significant voltage drop between the collector and emitter at that current.

That's another great thing about MOSFETs; they have such a low Rds(on) that there is practically no voltage drop between the drain and source - when properly sized to the load.

8. ### mcdpekala Thread Starter New Member

Sep 2, 2008
4
0
Alright, so I fixed that issue to my satisfaction by using a Darlington pair and now the buffers are far better then the amplifier that I was using.

As for the resistance drift issue I spoke about before, the reason I mention it is because I am using a reversed biased Zender diode and two resistors to hold a 5V source. I do this because the battery I am using to power the PIC goes from 12V to 10V over the course of the 30 minutes I drive the thing around. I notice that depending on the temperature the voltage reference shifts and that is not good because it shifts the operating point of a comparator input I am using and may damage my PIC since I am sourcing the power for the PIC from the 5V I generate from this line. Aside from using a Zener and a chip to maintain a 5v source voltage, is there any other method to generate a constant voltage that may not be as susceptible to such resistance drift?

Granted, I am aware of switching regulators but I'd rather stay away from them due to thier complexity.

9. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
I see. Zeners are somewhat stable, but they depend on having a pretty constant current through them to stay in the linear region. If you have less than about 20mA current going through a 5.1V Zener, it's not going to be particularly linear.

You'd be better off to use a 7805, or LM317. A 7805 is a fixed +5V regulator that'll handle up to 1A output current. It has a +V input, ground, and output pins. You should use a 0.1uF and 10uF caps on the output for good transient response.

An LM317 is an adjustable output positive regulator, with three terminals; input, adjust, and output. It requires two resistors to adjust the output voltage. It also needs caps on the output. Use a 120 Ohm resistor from the output to the ADJ terminal, and a 500 Ohm trim pot from the ADJ terminal to ground, pre-set to 360 Ohms. Then power it up and adjust the pot until you get exactly 5v out. Then put a dab of nail polish on the pot's screw to keep it from turning. Just a tiny dot will hold it.