1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Design an adjustable voltage switch

Discussion in 'General Electronics Chat' started by stuhagen, Sep 27, 2008.

  1. Roff

    Roff Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    7,757
    Likes:
    89
    Location:
    Idaho, USA
    Bipolar transistors (NPN, PNP) are off when no base current flows. They are on when sufficient base current flows. The base-emitter junction looks like a diode. When Vbe (base to emitter voltage) is less than ≈0.7V, the transistor will be off, and no current will flow from collector to emitter. In your circuit, the base voltage of the 2N2222 is approximately at 0V when the comparator - input exceeds the + input, due to an internal NPN at the output of the LM393 which diverts the current through R8, the 3.9k resistor, to ground. When the + input exceeds the - input, the transistor internal to the LM393 will turn off, allowing the current through R8, to flow into the base of the 2N2222. The base voltage will rise to ≈0.7V, and ≈1.87mA of base current will flow ((8V-Vbe)/3.9k=1.87mA). This current will get multiplied by the transistor current gain, saturating the transistor (Vce(sat)<0.2V). This will energize the relay.
    So - for the second section of the Lm393, when the + input > - input, the relay is energized.
     
  2. stuhagen

    stuhagen Member

    Joined:
    Aug 13, 2008
    Messages:
    209
    Likes:
    0
    OK then this makes sense. I was'nt sure about whether the transistor was on or off when the base was at 0.7 or 0.0

    I want to simplify what you have said, mostly because I think you were only talking about one side of the comparator.

    On U2 (pin 2&3). When Pin 2 (-) is low to vset, then Pin #1 is 10v. Then Pin 5 (+) will be high (10v) in referance Pin 6 (-). (Divider shows Pin 6 at 4v). So then Pin 7 output is 0v. This means the 2n2222 base voltage is 0v. So the relay is off.

    If I switch Pins 5&6...then Pin 5 (+) will now be Low 0v to Pin 6 and then Pin 7 will be 10v. This will drive the 2n2222 base voltage to 0.7v this triggering the relay.

    Did I get it right?

    Stu
     
  3. Roff

    Roff Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    7,757
    Likes:
    89
    Location:
    Idaho, USA
    Why are you talking about 10V? The schematic says 8V. If you try to use 10V, the circuit may not work unless the engine is running (alternator is spinning). I know that this is generally not a problem, but will you ever want to test the circuit when the engine is not running?

    When pin 2 is low, and you have swapped pins 5 and 6, pin 5 will be at 4V, and pin 6 will be ≈8V. Pin 7 will be at 0V, and the relay will be off.
    When pin 2 goes high (4.7V), pin 6 will be 0V, pin 5 will still be at 4V, so pin 7 will go open circuit to GND. This allows R8 to source current to the base of the 2N2222, energizing the relay. The base voltage of the 2N2222 will be ≈0.7V.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. stuhagen

    stuhagen Member

    Joined:
    Aug 13, 2008
    Messages:
    209
    Likes:
    0

    Perfect. Sorry about the 10v thing, I wasnt paying attention. This answers ALL my questions. (-:

    Stu
     
  6. stuhagen

    stuhagen Member

    Joined:
    Aug 13, 2008
    Messages:
    209
    Likes:
    0
    Did I mess up? Or is this in error. In your post #112 Does U2b that is unused need to have the (-) pin go to GROUND? Or to 8V?. You show 8v here, but my final post #124 I show (-) going to ground. My proto boards are in and I have both Pins on U2b (5 & 6) going to ground. oops?

    Stu
     

    Attached Files:

    Last edited: Jul 9, 2010
  7. Roff

    Roff Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    7,757
    Likes:
    89
    Location:
    Idaho, USA
    Check out post #114 (or read this):
    Actually, it will work either way.
     
  8. stuhagen

    stuhagen Member

    Joined:
    Aug 13, 2008
    Messages:
    209
    Likes:
    0
    Pfew...that's good. Maybe I knew that anyways~!
     
  9. stuhagen

    stuhagen Member

    Joined:
    Aug 13, 2008
    Messages:
    209
    Likes:
    0
    Just tested the final unit and it works perfectly. Although I had no 200K resistors, so I used a 220K and it didnt seem to cause any issues. It doesnt "re-trigger" anymore.

    I have a question. If I wanted to modify this a bit so it triggers down lower, like 2.8v to 3.2v range, what R values would you recommend for R6, R9? I would like to keep the 2 pots at the same value since I have 10ea of those (if possible). I am going to test this somewhere else. The trigger voltage there is more of a "switch" type. It runs at 2.0v then jumps straight to 4v. So I am picking something in the middle as the trigger volt.

    Stu
     

    Attached Files:

  10. Roff

    Roff Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    7,757
    Likes:
    89
    Location:
    Idaho, USA
    How much hysteresis will you need? Better yet, what should the threshold voltage drop to when the unit "fires"?
     
  11. stuhagen

    stuhagen Member

    Joined:
    Aug 13, 2008
    Messages:
    209
    Likes:
    0
    Well, the voltage is very stable at 2.0v with little to no variance. Then the ECU sends a flat 4.0v signal at a specific engine rpm level, not a ramp up voltage, to trigger an internal function. So as long as the hysteresis doesnt go below 2v then I guess it really doesnt matter. I would be concerned it I use like 3.7v on the high side, or like 2.3 v on the low side becuase that's pretty close. Once the circut triggers, I would guess that a .5v hysteresis is sufficient. When the system goes back, it immediately drops from 4.0v to 2.0v. This signal is not linear. Almost like a switch. Hence why I was thinking around 2.8 to 3.4 or something with a .5v hysteresis.

    Stu
     
  12. Roff

    Roff Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    7,757
    Likes:
    89
    Location:
    Idaho, USA
    With a digital input from the ECU, you shouldn't need hysteresis, or any pots. A simple comparator with a 3V threshold should be fine.
    Are you driving a relay, or a VSV? Should the load (relay, vsv) be energized or deenergized when the input is high?
     
  13. stuhagen

    stuhagen Member

    Joined:
    Aug 13, 2008
    Messages:
    209
    Likes:
    0
    Yes, I want this circuit to be in the "off" state at 2.0v. More for fail safe so if the circuit fries, I will maintain the "stock" configuration, When it sends the 4.0v trigger signal, I then want to drive a typical 30A relay. Then the relay will switch over to an aftermarket high volume Fuel Pump. When the 4.0v voltage then drops to 2.0v the relay will de-energise, which puts the car back to standard operation. A simple voltage divider as a referance would probably work out the best. I was trying just modify these new boards I had made with changing a part here and there. Hence why I asked about the R values. I had 10 proto boards made for the above circuit so I have extras to play with.

    Stu
     
    Last edited: Jul 14, 2010
  14. Roff

    Roff Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    7,757
    Likes:
    89
    Location:
    Idaho, USA
    Is the schematic of your board posted? If so, which post #? If not, please post it here.
     
  15. stuhagen

    stuhagen Member

    Joined:
    Aug 13, 2008
    Messages:
    209
    Likes:
    0
    This is the circuit I was using for awhile. But it has failed on me. It also wasnt doing what I wanted. I think. I wanted the relay to be de-energized at the 2.0v operation. As I remember, I had to swap Pin 87/87a on the relay because It was opposite of what I wanted. I am revisiting this because of all the new knowledge I have gained on hysteresis. As you can see in this schematic, there wasnt any components for it. So the circuit was oscillating at transition. I thought it was due to a snubber, so I added that. However, it did work for awhile, but I ditched it cause it was un-reliable. Now I want to re-visit the design and try again.

    Stu
     

    Attached Files:

  16. Roff

    Roff Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    7,757
    Likes:
    89
    Location:
    Idaho, USA
    My plan was to show you how to modify your most current board:
    If you want to modify the board you posted in your previous post, we can try that. If you want to modify your most current board,
    Let me know what you want.
     
  17. stuhagen

    stuhagen Member

    Joined:
    Aug 13, 2008
    Messages:
    209
    Likes:
    0
    My plan was to "modify" the Most Current board here. NOT the one I just posted. That one stinks ha..ha..

    Stu
     
  18. Roff

    Roff Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    7,757
    Likes:
    89
    Location:
    Idaho, USA
    Hopefully, the third time's the charm:
    PLEASE?
     
  19. stuhagen

    stuhagen Member

    Joined:
    Aug 13, 2008
    Messages:
    209
    Likes:
    0
    Just use Post #148 as the one I want to modify. "Boost Circuit 2" This is the one I want to use as many parts as possibly, or similar to, to achieve my new request in Post #152
     
  20. Roff

    Roff Well-Known Member

    Joined:
    May 16, 2003
    Messages:
    7,757
    Likes:
    89
    Location:
    Idaho, USA
    OK, this should work. It sets the threshold at 3V, with no hysteresis.
     

    Attached Files:

  21. stuhagen

    stuhagen Member

    Joined:
    Aug 13, 2008
    Messages:
    209
    Likes:
    0
    Cool, that makes things simple. Do you happen to know anything about the LM2917 Frequency to Voltage converters? They are suppose to be able to take Tacho signals and convert it to a linear voltage output. Another project I am trying. It is the same as these types here, but using RPM signal for triggering rather than the map sensor. The attached is from another guy in the car tinkering business. I wasnt quite able to convert this to a standard 8-Dip 2917. I think all the components will work for my usage except I wanted my range more like 3000-6000rpm range.

    Stu


    Stu
     

    Attached Files:

Share This Page