Transistor as Variable Resistor

Discussion in 'General Electronics Chat' started by wmgehl, Sep 9, 2009.

  1. wmgehl

    wmgehl Thread Starter Member

    Joined:
    Jul 21, 2009
    Messages:
    12
    We have a 2 wire (+/-) dimmer input to a ballast that presents about 11V unloaded. Onto these terminals we hook up a simple circuit that basically consists of a NPN transistor (+ to collector, - to emitter) and a manual rheostat (one end to collector, the other to the base) which is used very successfully to vary the voltage across these terminals between 1 and 10V.

    I am aware that the NPN is operating in the active region as a variable resistor where full resistance of 470K between C and B puts about 0.35V on the base (for 10V across CE) and least resistance puts 0.5V on the base (for 0.5V acorss CE).

    The idea now is to replace the manual pot with a digital pot controlled by a microcontroller and I have done that. But the digital pot I need to use is half the ohmage of the original manual pot (200K) and the best I can get out of the circuit for V range is 0.5V to 7.5V. Adding a second digital pot in series (to get the full original pot resistance) makes it worse as, I assume, that the base current through the NPN is affected by these DP ICs. So this is where the fun starts.

    I've replaced the NPN with a darlington pair to try to enhance the current gain and thereby get the full V range back but this has not worked. I even tried two darlington pairs and the best I can get is 0.5V to 9.3V with the original high R manual pot. I've tried all kinds of configurations and biasing as well but no success on the high end of the V range. I'm not sure why this circuit will not go far enough into cutoff to be fully turned off and present the full V range at the terminals??

    So two requests here:

    - can anyone offer any guidance/advice on how to make this circuit work using a digital pot (of lesser ohmage than the original rheostat)?

    - can anyone suggest alternatives (like how do I use a JFET or MOSFET for this particular circuit)?

    I appreciate any help. Thanks.
  2. hgmjr

    hgmjr Moderator Staff Member

    Joined:
    Jan 28, 2005
    Messages:
    9,030
    Location:
    Tennessee, USA (GMT-6)
    What is the part number of your NPN transistor?

    hgmjr
  3. wmgehl

    wmgehl Thread Starter Member

    Joined:
    Jul 21, 2009
    Messages:
    12
    Originally used BC817-25 and then switched to a heavier BD-235. Both work equally as well in the manual pot circuit.
  4. hgmjr

    hgmjr Moderator Staff Member

    Joined:
    Jan 28, 2005
    Messages:
    9,030
    Location:
    Tennessee, USA (GMT-6)
    Can you post a diagram of the circuit in the configuration that works?

    hgmjr
  5. wmgehl

    wmgehl Thread Starter Member

    Joined:
    Jul 21, 2009
    Messages:
    12
    Here is a sketch of the schematic.

    Attached Files:

  6. hgmjr

    hgmjr Moderator Staff Member

    Joined:
    Jan 28, 2005
    Messages:
    9,030
    Location:
    Tennessee, USA (GMT-6)
    Can you shed light on the purpose of your circuit?

    hgmjr
  7. wmgehl

    wmgehl Thread Starter Member

    Joined:
    Jul 21, 2009
    Messages:
    12
    This is a dimmer control circuit for a lighting ballast. See my first post.
  8. hgmjr

    hgmjr Moderator Staff Member

    Joined:
    Jan 28, 2005
    Messages:
    9,030
    Location:
    Tennessee, USA (GMT-6)
    There are a couple of things that you will need to look at concerning the digital potentiometer (DP). Consult the datasheet for the DP you are using and see what maximum voltage is allowed across the DP. The other parameter that you need to check is the maximum current it can withstand. You are probably exceeding one or both of these limitation in the circuit you have.

    If you can supply the DP's part number I will be happy to assist you in checking these maximum limits.

    hgmjr
  9. hgmjr

    hgmjr Moderator Staff Member

    Joined:
    Jan 28, 2005
    Messages:
    9,030
    Location:
    Tennessee, USA (GMT-6)
    Since you are planning to use a microcontroller then there is another approach you may want to consider.

    Assuming that the microcontroller you have selected has an internal A-to-D then your could use a resistor divider that is connected across your ballast. You could then feed the output of the resistor divider into the A-to-D input so that you could measure a voltage that was proportional to the voltage across the ballast. Based on the voltage you measure you could then use the PWM feature of the microcontroller to feed an RC lowpass filter. You would feed the output of the lowpass filter to the gate of a mosfet such as the 2N7000. By adjusting the duty-cycle of the PWM signal feeding the mosfet through the lowpass filter, you could adjust the Rds(on) of the mosfet. This would form a feedback loop that would allow your microcontroller to periodically measure the voltage across the A-to-D and then adjust the duty-cycle of the PWM output signal to correct any error between the desired voltage across the ballast and the actual voltage measured by the microcontroller.

    hgmjr
  10. wmgehl

    wmgehl Thread Starter Member

    Joined:
    Jul 21, 2009
    Messages:
    12
    Thanks for your input hgmjr. Sorry for the delay in response.

    Regarding the use of microcontroller PWM, that was my first plan.....but then my boss handed me the variable R circuit we have always used and said to adapt that to the MCU first (its made to work well with the ballasts).

    No problem on current spec through the DP (base circuit uA) but, yes, I was exceeding the voltage spec on the DP R ends. Started out respecting that but got away from it in the effort. Still, the DP seems to work OK anyway! But some new developments as follows.

    I needed to reduce the pot size required down to something like 50K or 100K max (lots of digital pots available in this range - very few available higher than 100K) and I needed to add isolation too. So I used the pot in a V-divider on the input of an optocoupler having a transistor output where its emitter feeds a darlington pair. This reduced the pot required to 50K.

    The next step was to reduce the voltage dropped across the pot to 5V or less so that I could replace it with a digital pot and be within the DP's max V across its R pins. To do that I've got the 50K pot in a V-divider on the base of a NPN which has a fixed R on its emitter (to ground) and the optocoupler input diode on its collecter. The idea was to have variable current source (variable by base voltage) driving the optocoupler and this reduced the Vdrop across the 50K pot to a maximum of 3V (using 5V supply).

    See attached schematic.

    So I've got the right size pot, the proper voltage range across the pot and the isolation. And when I test the circuit using the manual pot the results are not linear but they do show a nice arc between end points on a graph which I can correct (linearize) easily with the MCU. That said, I realize that temperature variations are likely to skew the graph even more so I'll need to temp-compensate somehow, I assume.

    However, the problem remains that when I replace the 50K pot with the 200K digital pot that I've been using (still waiting on my 50K pot) and use it from 0 to 50K ohms the results get way, way non-linear - which is the same problem that I wrote about in the first post in this thread!! The more things change the more they stay the same!

    Granted I have only 1/4 of the DP steps available which doesn't give me too many data points but I can still tell the linearity is worse. I thought that the DP in the base circuit of the current source would help this problem, but not so.

    Any ideas on how to linearize this circuit with the digital pot replacing the discrete 50K pot? And how to temp-compensate? Or any other suggestions/comments?

    Attached Files:

Similar Threads: Transistor Variable
Forum Title Date
General Electronics Chat book for transistor modelling Aug 24, 2014
General Electronics Chat Need 1W NPN and PNP transistor suggestion... Aug 21, 2014
General Electronics Chat Transistor Amplification and PUT questions Aug 12, 2014
General Electronics Chat Question about Bipolar NPN Transistor -2N2222 Aug 10, 2014
General Electronics Chat eBook, Vol 3, Chapter 4 :The Transistor as a switch. Jul 28, 2014

Share This Page