Looking for help choosing a transistor

Thread Starter

gte

Joined Sep 18, 2009
363

Thread Starter

gte

Joined Sep 18, 2009
363
Well, school was canceled because of the snow, but I at least know where my classroom is. Sorry about the 2 posts, the forum wouldn't let me post those links in 1 post, said it was too many characters?

I have read volume 1 of the ebook, twice actually :), maybe I should start on volume 2.

Let me know what to order, and I'll order it, thanks!
 

SgtWookie

Joined Jul 17, 2007
22,230
I haven't forgotten you; had a busy evening yesterday and a busy day today.

Going through your parts list to work up a layout - don't see any potentiometer on your list yet though - you could pick up a trim pot or two from a local Radio Shack - is there one of those near you?
 

Thread Starter

gte

Joined Sep 18, 2009
363
Hey Sgt,

There is a radio shack near me, so if you have a catalog number I can get whichever part you suggest
 

SgtWookie

Joined Jul 17, 2007
22,230
You're going to need one 10k and one 100k trimpots.

10k: http://www.radioshack.com/product/index.jsp?productId=2062301

100k: http://www.radioshack.com/product/index.jsp?productId=2062302

OK, now for the schematic:



Board layout and board traces are attached.

Basically, you just adjust R3 to get about 4v on pin 2 of the 2903 comparator.

Then adjust R5 to get the trip levels that you want.
[eta]
2903 - 4v Hysteresis Trigger brd.pdf is a mirror image of what the board will look like after you do a dry transfer of the traces to the blank PCB.

Since the 2903's that you purchased are SMD's, I had to run all of the traces on the top layer, which requires that the board traces be mirror imaged for the transfer.

The other components can be inserted from the bottom of the board; that's the only way you'll be able to solder some of the components, like the caps and possibly the pots.
 

Attachments

Last edited:

Thread Starter

gte

Joined Sep 18, 2009
363
Wow, thanks Sgt!

Do you think I should order the non pcb comparators and test with it on the breadboard?
 

Thread Starter

gte

Joined Sep 18, 2009
363
Hi Sgt, (long time, no post I know :D )

I decided to wait until my EE course was done this semester to not only build this but understand what I am building and how it intricately works, and my course pretty much is over as of Tuesday.

We just learned about comparators and opamps and so it's fresh in my mind.

Although I now have a small grasp of how much I don't know about circuits, I understand the basics of this circuit but have a few questions.



To verify, as you said previous, R3 determines a threshold and R5 tweaks the comparators signal in so that when signal in goes above what R3 provides to the comparators inverting input, it will go VCC -1v and when signal in goes below R3, it will provide VEE -1v (or just ground in this case of DC) ? Is that correct?

You've also added in a 5.1v zener to keep voltage at 5.1v max going into R3, and you've added a 1uF capacitor in front of R5 to flatten/average the input signal going into R5? R1 is there to limit current from the ECU to chassis ground when it is at that state.

Now where I'm a little shaky on, the feedback resistor R4, which I believe creates the hysteresis. I believe it adds an extra path to ground for when the non inverted voltage is rising and approaching the inverting threshold (before switching over to the non inverting value) ... and provides a little extra positive voltage for when the non inverted voltage is falling and approaching the inverting threshold (before switching over to the inverting value). This in turn widens the band of where it will change from one state to the other state (symbolically) from | to | | depending on what the current state is will reflect which direction the hysteresis window will lean towards from center.

Is this correct?


I also made a discovery while measuring my ecu's output last month, which was that if I just provide a path to chassis ground, that is all the ecu is looking for, a 1 (as in 12vDC from the pull up resistor) or a 0 (as in no voltage because it has a path to chassis ground). That may simplify the circuit needed?



You're going to need one 10k and one 100k trimpots.

10k: http://www.radioshack.com/product/index.jsp?productId=2062301

100k: http://www.radioshack.com/product/index.jsp?productId=2062302

OK, now for the schematic:



Board layout and board traces are attached.

Basically, you just adjust R3 to get about 4v on pin 2 of the 2903 comparator.

Then adjust R5 to get the trip levels that you want.
[eta]
2903 - 4v Hysteresis Trigger brd.pdf is a mirror image of what the board will look like after you do a dry transfer of the traces to the blank PCB.

Since the 2903's that you purchased are SMD's, I had to run all of the traces on the top layer, which requires that the board traces be mirror imaged for the transfer.

The other components can be inserted from the bottom of the board; that's the only way you'll be able to solder some of the components, like the caps and possibly the pots.
 

SgtWookie

Joined Jul 17, 2007
22,230
Hi Sgt, (long time, no post I know :D )

I decided to wait until my EE course was done this semester to not only build this but understand what I am building and how it intricately works, and my course pretty much is over as of Tuesday.

We just learned about comparators and opamps and so it's fresh in my mind.

Although I now have a small grasp of how much I don't know about circuits, I understand the basics of this circuit but have a few questions.
Good that you took a course. Keep at it; there's lots of stuff to learn. :)

To verify, as you said previous, R3 determines a threshold
Yes. D1 establishes a relatively constant 5.1v when R2 supplies current.
Since D1 is a 5.1v Zener, and your nominal input voltage will be around 13.8 when the engine is running, you will have (13.8v-5.1v)/470 = 18.2mA flowing through R2, which should be plenty to establish the Zener voltage. It would be better if R2 were a constant current circuit supplying a constant 20mA. R3 will have 0.51mA flowing through it, leaving 17.69mA to flow through the Zener.

and R5 tweaks the comparators signal in so that when signal in goes above what R3 provides to the comparators inverting input, it will go VCC -1v
Where did you get Vcc-1v?
The comparator has an open-collector output. If it is not sinking current, then you basically have a voltage divider made up of R1 (3.9k) to V+, and R4 (330k) to whatever voltage happens to be on the high side of R5. It'll measure about 99% of +V with no load on the output.

and when signal in goes below R3, it will provide VEE -1v (or just ground in this case of DC) ? Is that correct?
When the comparator is sinking current, the output (with no load) will measure below 200mV, but not lower than ground.

You've also added in a 5.1v zener to keep voltage at 5.1v max going into R3,
The Zener provides a reasonably stable voltage reference.

and you've added a 1uF capacitor in front of R5 to flatten/average the input signal going into R5?
R6/C2 basically make up a low-pass filter.
R1 is there to limit current from the ECU to chassis ground when it is at that state.
R1 limits the amount of current that the comparator output has to sink to about 3.54mA.

Now where I'm a little shaky on, the feedback resistor R4, which I believe creates the hysteresis.
Yes.
I believe it adds an extra path to ground for when the non inverted voltage is rising and approaching the inverting threshold (before switching over to the non inverting value) ... and provides a little extra positive voltage for when the non inverted voltage is falling and approaching the inverting threshold (before switching over to the inverting value). This in turn widens the band of where it will change from one state to the other state (symbolically) from | to | | depending on what the current state is will reflect which direction the hysteresis window will lean towards from center.

Is this correct?
If the comparator output is off (not sinking current), the output will be near +V, which will tend to pull the noninverting input higher.
If the comparator output is on (sinking current) the output will be near 0v, and it will tend to pull the noninverting input lower.

I also made a discovery while measuring my ecu's output last month, which was that if I just provide a path to chassis ground, that is all the ecu is looking for, a 1 (as in 12vDC from the pull up resistor) or a 0 (as in no voltage because it has a path to chassis ground). That may simplify the circuit needed?
Not really. It's pretty minimal as it is.

R3 sets the threshold value.
R5 actually adjusts the hysteresis, as well as allowing the input level to be attenuated. If R5 is adjusted so that the wiper is at the top of the pot, hysteresis will be minimal and the input level will be at maximum. The lower the pot is set, the more the input signal will be attenuated, and the more hysteresis the circuit will have.

This was to give you a reasonable degree of flexibility, without the circuit being too complex.
 

Thread Starter

gte

Joined Sep 18, 2009
363
Hi Sgt!


Last night my professor said I could come in and use the schools oscope, power supplys and sig gens to build the circuit on the bench. I believe i have gotten the voltage averager to work, but for some reason my comparator did not want to work yet?

I changed the value of c2 to 20uF, else it was spiking too high and that came from trial and error.


I did not have time to swap 2903's out, but maybe I ordered a variation of the 2903 that won't work for me?

595-LM2903P
http://focus.ti.com/lit/ds/symlink/lm2903.pdf

It looks like the "P" afterwards just designates a certain operating temperature? Or it stands for "plastic inline dual package" ?




I got the vcc -1 and vee -1 from a comparator tutorial I was reading online. I'm guessing the vee portion was for an AC circuit and in a DC circuit it would just be ground or very near ground as you said.

With a low pass filter, does that mean it allows low frequencies to pass by? I noticed last night that when I turned the frequency down to less than 100hz the voltage would spike up and down, but when I turned it up past 100hz it would flatten the ripple quite nicely. Do you know why this happened? (I've attached a picture of the signal Hz sample from my vehicle below.)

I'll try and get the comparator working (not sure what I did wrong) tonight












Good that you took a course. Keep at it; there's lots of stuff to learn. :)


Yes. D1 establishes a relatively constant 5.1v when R2 supplies current.
Since D1 is a 5.1v Zener, and your nominal input voltage will be around 13.8 when the engine is running, you will have (13.8v-5.1v)/470 = 18.2mA flowing through R2, which should be plenty to establish the Zener voltage. It would be better if R2 were a constant current circuit supplying a constant 20mA. R3 will have 0.51mA flowing through it, leaving 17.69mA to flow through the Zener.


Where did you get Vcc-1v?
The comparator has an open-collector output. If it is not sinking current, then you basically have a voltage divider made up of R1 (3.9k) to V+, and R4 (330k) to whatever voltage happens to be on the high side of R5. It'll measure about 99% of +V with no load on the output.


When the comparator is sinking current, the output (with no load) will measure below 200mV, but not lower than ground.

The Zener provides a reasonably stable voltage reference.


R6/C2 basically make up a low-pass filter.

R1 limits the amount of current that the comparator output has to sink to about 3.54mA.


Yes.

If the comparator output is off (not sinking current), the output will be near +V, which will tend to pull the noninverting input higher.
If the comparator output is on (sinking current) the output will be near 0v, and it will tend to pull the noninverting input lower.



Not really. It's pretty minimal as it is.

R3 sets the threshold value.
R5 actually adjusts the hysteresis, as well as allowing the input level to be attenuated. If R5 is adjusted so that the wiper is at the top of the pot, hysteresis will be minimal and the input level will be at maximum. The lower the pot is set, the more the input signal will be attenuated, and the more hysteresis the circuit will have.

This was to give you a reasonable degree of flexibility, without the circuit being too complex.
 

Attachments

Thread Starter

gte

Joined Sep 18, 2009
363
Ok Sgt,

I have my voltage averaging/flattening portion of the circuit working perfect. Progress has been made! :D


Here it is at idle at a nice 1.3xVDC on my oscope, which matches my DMM reading so it's a good average:)





Here it is at the condition change point, voltage on the oscope also matches my DMM





My problem is now the comparator circuit.

I have the LM2903 comparator and I'm feeding 13.75vDC to Vcc, DC ground to Vee, 6.92vDC to 1IN- and the output of the voltage flattener to 1IN+.

I need the comparator to go to ~VCC when the voltage on 1IN+ is above the 1IN- constant reference voltage and I need it to go to ~ Vee and sink all voltage/current on Vout when then voltage on 1IN+ is below the 1IN- constant reference voltage.

Right now when 1IN+ is lower than 1IN- the voltage on Vout is at about 5.7vDC, which I'm not sure why?





^ The LM2903 pin out
 

Attachments

Thread Starter

gte

Joined Sep 18, 2009
363
I know we've talked about different designs ... could I use a BJT with the pull up connected to the collector, the emitter to ground and 2 diodes inline to the base to eat up the ~1.35v

This is my idea, would this work? It looks like it would take about 2v to overcome the diodes and BJT base diode and turn the transistor on?


 

Attachments

Thread Starter

gte

Joined Sep 18, 2009
363
I did try and build your circuit, but the opamp portion needs to change I believe, (although there's a good chance I've done something wrong) as I can't get the comparator to go to Vee when 1IN+ is lower than 1IN-. To help keep things simplistic on my breadboard since I'm so green and still learning, I temporarily set the zener and hysterisis components aside. Also through trial and error I found that (2) 10uF capacitors in place of C2 averaged the square wave DC better.

I don't know how much current the comparator needs to sink but it appears it needs to drop the voltage value to 0vDC to make the ecu happy, I will have to try and measure that with my DMM. It doesn't make sense that it'd be much current considering its function as a simple pull up resistor? In your circuit the pull up is represented by R1/3.9k, correct? I'm hoping I can calculate resistance and therefore current, or measure current and calculate resistance.

Do you concur with this line of thought? If so I'll try and get some current measurements tomorrow.
 

SgtWookie

Joined Jul 17, 2007
22,230
OK, it would've been easier to change R6 from 10k to 200k rather than changing the 1uF cap to two 10uF caps. It wouldn't have changed the physical size, either.

Also, it is a "low pass filter" or "integrator circuit", not a "voltage flattener". I don't know where you got the "flattener" stuff from, but please try to learn the correct terminology.

The circuit might need to operate a relay. In that case, you will need a beefier output circuit. Adding a couple of transistors should fix that up, but we need to know what kind of current the ECU needs.

Instead of trying to measure the current with your DMM directly, use a 1 Ohm resistor from the ECU to ground, and measure the voltage across the resistor. Since I=E/R, your voltage measurement across a 1 Ohm resistor will be the current in Amperes. This is much less risky than using a meter to measure current.
 

Thread Starter

gte

Joined Sep 18, 2009
363
I can alter the resistor values if that is preferred. I guess it makes sense now that you've suggested to restrict current with a larger value resistor, but at the time I had a saw tooth signal and I had some spare 10uF capacitors?

Just to make sure I understand, something that averages an AC signal or an oscillating DC signal (in this case a DC square wave) is called a low pass filter?

I'll see if radio shack has a 1ohm resistor and I will measure current as you've recommended ... great idea! :)

I'd like to use a solid state device rather than a relay, if possible?


OK, it would've been easier to change R6 from 10k to 200k rather than changing the 1uF cap to two 10uF caps. It wouldn't have changed the physical size, either.

Also, it is a "low pass filter" or "integrator circuit", not a "voltage flattener". I don't know where you got the "flattener" stuff from, but please try to learn the correct terminology.

The circuit might need to operate a relay. In that case, you will need a beefier output circuit. Adding a couple of transistors should fix that up, but we need to know what kind of current the ECU needs.

Instead of trying to measure the current with your DMM directly, use a 1 Ohm resistor from the ECU to ground, and measure the voltage across the resistor. Since I=E/R, your voltage measurement across a 1 Ohm resistor will be the current in Amperes. This is much less risky than using a meter to measure current.
 

SgtWookie

Joined Jul 17, 2007
22,230
I can alter the resistor values if that is preferred. I guess it makes sense now that you've suggested to restrict current with a larger value resistor, but at the time I had a saw tooth signal and I had some spare 10uF capacitors?
I see.
If you go up in capacitance, the physical size of the capacitor increases. This can be a problem with board space. If you increase the value of a resistor, you usually decrease the wattage requirement for the resistor, so the higher Ohm value resistor can actually be smaller than the one it's replacing.

Just to make sure I understand, something that averages an AC signal or an oscillating DC signal (in this case a DC square wave) is called a low pass filter?
Yes, a low-pass filter, also an integrator. These are covered in our E-books.

Filters: http://www.allaboutcircuits.com/vol_2/chpt_8/index.html

I'll see if radio shack has a 1ohm resistor and I will measure current as you've recommended ... great idea! :)
Pick up a pack of these:
http://www.radioshack.com/product/i...0&filterName=Type&filterValue=Power+resistors
10W 1 Ohm power resistors.
If you try to test current with too low of a resistor wattage rating, you may wind up with burned fingers.

I'd like to use a solid state device rather than a relay, if possible?
The relay I'm speaking of is inside the ECU. You can't change it. I'm speculating that it's a relay that requires more current than the comparator is capable of sinking.
 

Thread Starter

gte

Joined Sep 18, 2009
363
Hi Sgt,

Believe it or not, as of yesterday I had just finished reading Volume 2, chapter 7 :D and so today I started on chapter 8.

I can't remember where I picked up "voltage flattener" but it'll be low pass filter from now on.

I got the resistor you spoke of, as coincidentally I had a burned thumb and index finger from the exact situation you saved me from tonight (thank you!).

My read out on the DMM was .03vDC, so it appears I would need something capable of sinking 30milliamps or a little greater. Does this seem approximately inline with the ~13.2 dropping to ~5.9vDC while using the LM2903?




I see.
If you go up in capacitance, the physical size of the capacitor increases. This can be a problem with board space. If you increase the value of a resistor, you usually decrease the wattage requirement for the resistor, so the higher Ohm value resistor can actually be smaller than the one it's replacing.


Yes, a low-pass filter, also an integrator. These are covered in our E-books.

Filters: http://www.allaboutcircuits.com/vol_2/chpt_8/index.html


Pick up a pack of these:
http://www.radioshack.com/product/i...0&filterName=Type&filterValue=Power+resistors
10W 1 Ohm power resistors.
If you try to test current with too low of a resistor wattage rating, you may wind up with burned fingers.


The relay I'm speaking of is inside the ECU. You can't change it. I'm speculating that it's a relay that requires more current than the comparator is capable of sinking.
 
Last edited:

Thread Starter

gte

Joined Sep 18, 2009
363
No I see why changing the resistor value to 200k and leaving the capacitor value at 1uF would have given me the same results as leaving it at 10k and replacing the 1uF with a 20uF(total) capacitance value :)



I think this part sums it up nicely!

By definition, a low-pass filter is a circuit offering easy passage to low-frequency signals and difficult passage to high-frequency signals.

  • A low-pass filter allows for easy passage of low-frequency signals from source to load, and difficult passage of high-frequency signals.
  • Inductive low-pass filters insert an inductor in series with the load; capacitive low-pass filters insert a resistor in series and a capacitor in parallel with the load. The former filter design tries to “block” the unwanted frequency signal while the latter tries to short it out.
  • The cutoff frequency for a low-pass filter is that frequency at which the output (load) voltage equals 70.7% of the input (source) voltage. Above the cutoff frequency, the output voltage is lower than 70.7% of the input, and below the cutoff frequency, the output voltage is higher than 70.7% of the input.


By definition, a high-pass filter is a circuit offering easy passage to high-frequency signals and difficult passage to low-frequency signals.

  • A high-pass filter allows for easy passage of high-frequency signals from source to load, and difficult passage of low-frequency signals.
  • Capacitive high-pass filters insert a capacitor in series with the load; inductive high-pass filters insert a resistor in series and an inductor in parallel with the load. The former filter design tries to “block” the unwanted frequency signal while the latter tries to short it out.
  • The cutoff frequency for a high-pass filter is that frequency at which the output (load) voltage equals 70.7% of the input (source) voltage. Above the cutoff frequency, the output voltage is greater than 70.7% of the input, and below the cutoff frequency, the output voltage is lower than 70.7% of the input voltage.
 

SgtWookie

Joined Jul 17, 2007
22,230
Believe it or not, as of yesterday I had just finished reading Volume 2, chapter 7 :D and so today I started on chapter 8.
Good. :)

I can't remember where I picked up "voltage flattener" but it'll be low pass filter from now on.
Excellent. ;)

I got the resistor you spoke of, as coincidentally I had a burned thumb and index finger from the exact situation you saved me from tonight (thank you!).
Ouch! :( Well, when you are experimenting, keep in mind what kind of heat might be generated by connecting various items across a supply voltage. The resistors I suggested would support being connected across a 12v system only for a short period of time.

My read out on the DMM was .03vDC, so it appears I would need something capable of sinking 30milliamps or a little greater. Does this seem approximately inline with the ~13.2 dropping to ~5.9vDC while using the LM2903?
Yes, it does. It will require the addition of a pair of transistors (one PNP, one NPN) to provide sufficient current sinking for the ECU.
 

Thread Starter

gte

Joined Sep 18, 2009
363
Ok, I'm going to reread the transistor section and try and figure out how the transistor portion of the schematic should be on my own, and maybe you can critique it when I'm done? :)
 
Top