Continue to Site

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.

  • 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.

Design an adjustable voltage switch

Status
Not open for further replies.
Ron,

I can't seem to find this answer. When the output of U4 Pin 7 is at 10v (high), is the coil of the relay "on" or "off". I was testing and the way I see it, when the voltage at the Base is '0' the relay is energized, and I read 12v across the coil. But when the voltage at the Base is 10v, then the relay is de-energised. So my assumption is when voltage is applied to the base of the transitor, it "opens" up the collector to emitter path to ground, like a switch.
Correct?

Stu
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.
 
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.

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
 
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?
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.
 
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.

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

Stu
 
Here's my latest version, incorporating all the changes we talked about on PMs. I didn't include the .asc file, but you can easily modify one of your previous schematics if you want to simulate it.

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
 

Attachments

  • Boost Circuit 2.asc
    3.8 KB · Views: 225
Last edited:
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
Check out post #114 (or read this):
I just checked the datasheet. It says to tie both input pins to GND.
Actually, it will work either way.
 
From post #99 (referring to the schematic on that post): :)
The pot that used to set the threshold for when the input is rising now sets the threshold (range≈3.3V to 4V) for when the input is falling. The pot that looks like the hysteresis pot now sets the threshold for when the input is rising (range≈4.4V to 4.9V).
I explained all this before, but I know stuff like that gets lost in the noise.

Using your schematic as reference, the adjustment procedure is as follows:
1. First, set the 500k pot to its minimum (wiper to left end on schematic).
2. Apply +5V to the MAP input.
3. Check to be sure that pin 1 on the LM393 is low (≈0V).
4. Adjust the 1k pot so that the voltage on its wiper is 3.65V (or whatever you want it to be).
5. Set the 500k pot wiper to the other end (max resistance).
6. Set the MAP input to a voltage below that on the wiper of the 1k pot (somewhere between 0V and 3.65V - not critical), then run it up to the desired threshold (e.g., 4.7V).
7. Adjust the 500k pot slowly until pin 1 goes high.
8. Run input up and down slowly to see that pin 1 switches when the MAP voltage crosses the two thresholds you just est (3.65V and 4.7V, or whatever).
If this doesn't work, You may not hear from me until tomorrow. I'm going out gold prospecting today.:)

BTW, your LED is still upside down, and you have two R4's (the pots).

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
 

Attachments

  • Boost Circuit 2.asc
    3.8 KB · Views: 198
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
How much hysteresis will you need? Better yet, what should the threshold voltage drop to when the unit "fires"?
 
How much hysteresis will you need? Better yet, what should the threshold voltage drop to when the unit "fires"?

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
 
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
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?
 
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?

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:
Is the schematic of your board posted? If so, which post #? If not, please post it here.
 
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
 

Attachments

  • New BAP circuit Feb.jpg
    New BAP circuit Feb.jpg
    91 KB · Views: 234
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
My plan was to show you how to modify your most current board:
I was trying just modify these new boards I had made with changing a part here and there.
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,
Is the schematic of your board posted? If so, which post #? If not, please post it here.
Let me know what you want.
 
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.

My plan was to "modify" the Most Current board here. NOT the one I just posted. That one stinks ha..ha..

Stu
 
OK, this should work. It sets the threshold at 3V, with no hysteresis.
 

Attachments

  • Map switch 3 no hysteresis sch.PNG
    Map switch 3 no hysteresis sch.PNG
    26.8 KB · Views: 294
OK, this should work. It sets the threshold at 3V, with no hysteresis.

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
 

Attachments

  • rpm%20switch%20-%20board%20layout.jpg
    rpm%20switch%20-%20board%20layout.jpg
    87.5 KB · Views: 237
  • rpm%20switch%20circuit%20v3.gif
    rpm%20switch%20circuit%20v3.gif
    13.8 KB · Views: 239
Status
Not open for further replies.

Latest threads

Back
Top