Low Cost PCB's Low Cost Components

Author Topic: Understanding transistors  (Read 5220 times)

0 Members and 1 Guest are viewing this topic.

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 3129
  • Country: us
Re: Understanding transistors
« Reply #25 on: May 19, 2017, 11:10:06 AM »
Well, you're right, there will be comments...

There is no way this circuit is going to work.

The outputs of the 74LS595 can, at most, get to 5V and the transistor emitters can only get to 0.7 volts less or 4.3 volts.  The rest of the supply voltage will be dropped across the transistor.

It looks like Q3 just sends the emitter directly to ground which is ok but I don't see where that does much with the diode.  ETA:  If the idea is to send 5V to the diode, get rid of the ground connection.

It would have helped enormously if you had told us the application earlier.

Your original 2 transistor circuit is much better because the PNP will deliver the proper voltage while the NPN will interface with the logic.

You need to account for the diode voltage drop (0.7V) so you won't get 14V, you will get 13.3V or, actually about 0.2V less if you can somehow get the transistor into saturation, which you can't when driving the base to just 5V.

ETA:  It might help to know which EEPROMs you plan to program so we can see if the dropping resistors will provide enough current.
« Last Edit: May 19, 2017, 11:16:50 AM by rstofer »
 

Offline bitman

  • Regular Contributor
  • *
  • Posts: 107
  • Country: us
  • Open Source Guy jabbing with Electronics
Re: Understanding transistors
« Reply #26 on: May 19, 2017, 11:36:05 AM »
http://www.onsemi.com/pub/Collateral/P2N2222A-D.PDF
http://s680.photobucket.com/user/sorgil613/media/Elelctronics%20Components/Transistors/PN22222-h.jpg.html

Here are two datasheets of variants from the same manufacturer with the opposite pinout. It comes down to the exact manufacturer and part number. The 2N2222A is actually a metal can transistor. Many manufacturers called the plastic TO92 variant PN2222A with the emitter on pin1 or in the case of Onsemi (Motorola in the old days) P2N2222A for the version with the collector on pin1.
Thanks - it was pretty clear that the model number by itself wasn't enough. If it helps, here's a closeup of my 2222As.  My very basic test circuit that works is the second image. As you can see, from the bewel side of the transistor, the collector is on the right, and the emitter is on the left.

Quote
One way of checking is to check the emitter-base and  collector-base diode junctions with a diode mode on a multimeter. The emitter-base junction will have a lower voltage because it is more heavily doped.
Thanks - I'll keep that in mind and do some measurements.

Quote
If you reverse the emitter and the collector, you will end up with a much lower gain transistor and also the emitter-base junction when used as a collector-base junction breaks down like a zener at 5V to 9V.
And that's when you lost me - not sure what the gain in this context is. I know there's an amplification part of the transistor on the current side. Is that what you mean by gain?
 

Offline bitman

  • Regular Contributor
  • *
  • Posts: 107
  • Country: us
  • Open Source Guy jabbing with Electronics
Re: Understanding transistors
« Reply #27 on: May 19, 2017, 11:55:43 AM »
Well, you're right, there will be comments...
Figured - the positive result I'm hoping for is more knowledge. In the end, the circuit isn't that important (it will help in a bigger project I want to deal with later).  And given this is by far over my head (should be pretty clear by now) I think I found an EEPROM that just works off 5v that I can fully control from the Arduino (AT28C640).

Quote
There is no way this circuit is going to work.

The outputs of the 74LS595 can, at most, get to 5V and the transistor emitters can only get to 0.7 volts less or 4.3 volts.  The rest of the supply voltage will be dropped across the transistor.

It looks like Q3 just sends the emitter directly to ground which is ok but I don't see where that does much with the diode.  ETA:  If the idea is to send 5V to the diode, get rid of the ground connection.
Thanks - what I need to figure out is how to read that into the diagram. I picked large resistors since I didn't want to push any extra current along the way. The Q3 is a small circuit I have showing I can pull to ground and turn off things by applying voltage to the base. Since I need to drop to 0v for READ, I thought I could use the diode in the same manner allowing the ground to be exposed to the output pin.

Quote
It would have helped enormously if you had told us the application earlier.

Your original 2 transistor circuit is much better because the PNP will deliver the proper voltage while the NPN will interface with the logic.
Sorry about that. I thought just explaining the actual issue without going into a long writeup about "unrelated" stuff would be helpful. I think I finally got KiCAD to do at least something useful, so I can at least produce better diagrams now explaining/visualizing what I'm doing.  In the end, I'm just playing with logic circuits and controllers. I thought my need for "fancy" stuff for a few well placed caps, a few resistors and at worst a transistor or two. Nothing beyond that, albeit learning about inductors and other components is mighty interesting but so far I don't have any applications I can use that for. Maybe that will come one day.

Unfortunately I got a hold of of a W27C512 (as I put on the diagram) for EEPROM and it uses multiple voltages to signal operation so I found myself having to do more than just the single/dual component thing.

Quote
You need to account for the diode voltage drop (0.7V) so you won't get 14V, you will get 13.3V or, actually about 0.2V less if you can somehow get the transistor into saturation, which you can't when driving the base to just 5V.

ETA:  It might help to know which EEPROMs you plan to program so we can see if the dropping resistors will provide enough current.
The EEPROM model was in the sheet but why KiCAD puts it on the side like that and not in the middle, I don't know.  Thanks for giving me a lot to think about. Yeah, I totally missed that the diodes drops the voltage too. Still not sure I get the transistor drop, but given they're related that sorta makes sense.

I think the next stop for me is reading a book :)
Thanks again.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 3129
  • Country: us
Re: Understanding transistors
« Reply #28 on: May 19, 2017, 01:58:37 PM »
If you want to switch from the high side (like delivering a specific voltage to a pin), use a PNP transistor.
If you want to switch from the low side (like turning on an LED in the collector circuit), use an NPN transistor.

But, even though the PNP will work as a switch, a uC (or whatever) can't stand the required base voltage to turn it off.  That's why your original circuit would work well.  The NPN was controlling the base of a high side switch.  When the NPN was off, the 10k resistor held the PNP base high so no current would flow.

There are a couple of transistor relationships that are worth knowing:  There must be about 0.7V difference between the base and emitter to get the device into saturation.  For the NPN case, the base needs to be higher than the emitter.  For the PNP case, the base needs to be lower than the emitter.

The other relationship is that, at best, you can get VCE Sat down to 0.2V - that is, the voltage between the collector and emitter when the transistor is saturated will be about 0.2V.  You may not be able to get that far into saturation.  The 2N3904 datasheeet suggests it may be difficult to get below 1.0V.

I suppose we can add one more relationship:  The base current needs to be 1/10th of the collector current to get the transistor into saturation.  If you need 100 mA of collector current, you need to design in about 10 mA of base current.  This is just a 'rule of thumb' and varies considerably by device.  But it's a good place to start!

In your original circuit, the 4.3k resistor set the PNP base current.  LTSpice shows the output, given a 390 Ohm load as 11.8V at around 30 mA.  The PNP has only 0.2V between the collector and emitter which is deeply saturated.  That's a good thing.

Notice how the 390 Ohm load resistor and the 4.3k Ohm base resistor have a nearly 10:1 relationship.

So, you original circuit, with the real transistors simulates pretty well.  LTSpice .asc file attached


« Last Edit: May 19, 2017, 02:06:56 PM by rstofer »
 
The following users thanked this post: bitman

Online Hero999

  • Super Contributor
  • ***
  • Posts: 8593
  • Country: gb
Re: Understanding transistors
« Reply #29 on: May 19, 2017, 06:19:25 PM »
Using discrete components is a very good learning experience but if you just want to get this done, why not use a logic level shifting IC specifically designed for the purpose?

Check out the CD40109B and CD4504B. Links to data sheets below:
http://www.ti.com/lit/ds/symlink/cd40109b-q1.pdf
http://www.ti.com/lit/ds/symlink/cd4504b-ep.pdf
« Last Edit: May 19, 2017, 07:37:23 PM by Hero999 »
 

Offline NottheDan

  • Frequent Contributor
  • **
  • Posts: 256
  • Country: gb
Re: Understanding transistors
« Reply #30 on: May 19, 2017, 09:16:05 PM »
Am I missing something or do you have high chance of junking the data in your eeprom via software bug there? Should the software fail to turn off one pin before turning on another for any reason you'll possibly be overwriting your eeprom instead of reading.
 

Offline bitman

  • Regular Contributor
  • *
  • Posts: 107
  • Country: us
  • Open Source Guy jabbing with Electronics
Re: Understanding transistors
« Reply #31 on: May 19, 2017, 11:01:46 PM »
Using discrete components is a very good learning experience but if you just want to get this done, why not use a logic level shifting IC specifically designed for the purpose?

Check out the CD40109B and CD4504B. Links to data sheets below:
http://www.ti.com/lit/ds/symlink/cd40109b-q1.pdf
http://www.ti.com/lit/ds/symlink/cd4504b-ep.pdf

So I looked into 4504B and it only seems to support two voltages. I need at least 3 if not 4 of which one of them is ground. I couldn't see how that would work with that circuit. I didn't know about 40109B but reading it seems to have the same issue and the 4504, it's only two voltages. Since they all have to go to the same pin, it didn't look like it was providing me what I needed?

You're right though - the learning side of this is probably worth the experience by itself. But I did look into it. I even have a few 4504s lying around but couldn't find a way to use them in my example.
 

Offline bitman

  • Regular Contributor
  • *
  • Posts: 107
  • Country: us
  • Open Source Guy jabbing with Electronics
Re: Understanding transistors
« Reply #32 on: May 19, 2017, 11:03:30 PM »
Am I missing something or do you have high chance of junking the data in your eeprom via software bug there? Should the software fail to turn off one pin before turning on another for any reason you'll possibly be overwriting your eeprom instead of reading.

The way I have the 595 setup, it turns on all the bits at once on a clock pulse. I actually have 3 of them in series (the other two is the address). So while OE is always low (enabled) the new values do not leave the storage until the whole byte is ready. So that should not happen.
 

Online Hero999

  • Super Contributor
  • ***
  • Posts: 8593
  • Country: gb
Re: Understanding transistors
« Reply #33 on: May 20, 2017, 03:57:16 AM »
Using discrete components is a very good learning experience but if you just want to get this done, why not use a logic level shifting IC specifically designed for the purpose?

Check out the CD40109B and CD4504B. Links to data sheets below:
http://www.ti.com/lit/ds/symlink/cd40109b-q1.pdf
http://www.ti.com/lit/ds/symlink/cd4504b-ep.pdf

So I looked into 4504B and it only seems to support two voltages. I need at least 3 if not 4 of which one of them is ground. I couldn't see how that would work with that circuit. I didn't know about 40109B but reading it seems to have the same issue and the 4504, it's only two voltages. Since they all have to go to the same pin, it didn't look like it was providing me what I needed?

You're right though - the learning side of this is probably worth the experience by itself. But I did look into it. I even have a few 4504s lying around but couldn't find a way to use them in my example.
Looking at your schematic again. I can see what you're trying to do. The CD40109 and 4504 only shift from one voltage to another. There is a way to disable the output which , with the addition of a longic inverter, would allow you to set the output to 0V, or 12V but that's not what you want here.

You certainly do need two transistors. One will not do.

Use the circuit posted at the start of the thread, with the PNP transistors with the emitters connected to different voltages and the collectors connected together via Schottky diodes.

 

Offline bitman

  • Regular Contributor
  • *
  • Posts: 107
  • Country: us
  • Open Source Guy jabbing with Electronics
Re: Understanding transistors
« Reply #34 on: May 20, 2017, 04:50:50 AM »
Looking at your schematic again. I can see what you're trying to do. The CD40109 and 4504 only shift from one voltage to another. There is a way to disable the output which , with the addition of a longic inverter, would allow you to set the output to 0V, or 12V but that's not what you want here.
Hmmm - I do need to be able to set "ground". If that could be the default when there's no signal, it would probably be a better solution than having a signal come in (what if there's no signal etc).  When I read the specs of the CMOS and TTL chips it doesn't look like they can handle more than 5v, so I definitely don't think an inverter or similar would be the solution - unless I can isolate them from the higher voltages.

Quote
You certainly do need two transistors. One will not do.
So when I initially searched for solutions, I definitely saw a lot that used more than one transistor (and lots of discussions for/against and about details). My (most likely faulty) understanding of using two was because one alone couldn't handle the power (ie. isolating the current from the base). Anyway, as I wrote earlier I definitely need to work on my understanding here a bit better. I can see why they would work, but not WHY they're better than just one.

Quote
Use the circuit posted at the start of the thread, with the PNP transistors with the emitters connected to different voltages and the collectors connected together via Schottky diodes.
Thanks for the diagram! Very helpful indeed. Just in time for my weekend projects :) I just got a "bunch" of basic transistors including the 3904 (I just had 3906) so I don't think your timing could have been better. I'll grab a blank board and give this a try.  Also, based on other feedback it's clear I need to look at the voltage consumed by the diode and transistor so the end voltage will be what I need it to be.

One question - what does RL mean on the transistor before ground?  Ok, TWO questions - since 5v is connected directly, it means there's always going to be 5v? I'm not seeing how I can use this to switch the lead to "0v" or close to that.

Thanks again!
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 3129
  • Country: us
Re: Understanding transistors
« Reply #35 on: May 20, 2017, 06:21:25 AM »

Hmmm - I do need to be able to set "ground". If that could be the default when there's no signal, it would probably be a better solution than having a signal come in (what if there's no signal etc).  When I read the specs of the CMOS and TTL chips it doesn't look like they can handle more than 5v, so I definitely don't think an inverter or similar would be the solution - unless I can isolate them from the higher voltages.

The 7406 Hex Inverter is open collector and can handle up to 30V on the output.  It would have to sink whatever current you plan on having available at the output when it tries to hold the output at 0V.  Remember, the open collector is either 'open' or conducting to ground.  Input logic '0' and the output is whatever it is from the power supply and limiting resistor.  Input logic '1' and the output goes to zero with the gate sinking all the current from the power source through the limiting resistor.

http://www.ti.com/lit/ds/symlink/sn7416.pdf
 

Offline bitman

  • Regular Contributor
  • *
  • Posts: 107
  • Country: us
  • Open Source Guy jabbing with Electronics
Re: Understanding transistors
« Reply #36 on: May 20, 2017, 07:38:11 AM »
The 7406 Hex Inverter is open collector and can handle up to 30V on the output.  It would have to sink whatever current you plan on having available at the output when it tries to hold the output at 0V.  Remember, the open collector is either 'open' or conducting to ground.  Input logic '0' and the output is whatever it is from the power supply and limiting resistor.  Input logic '1' and the output goes to zero with the gate sinking all the current from the power source through the limiting resistor.

http://www.ti.com/lit/ds/symlink/sn7416.pdf
What's the difference between the 7405 and the 7406 ?  I have some 7405's around.  I've got no problems reversing the logic if that's what it takes.

Btw. I'm using a voltage divider to step from 14 to 12. Does that make a difference?
 

Online Howardlong

  • Super Contributor
  • ***
  • Posts: 3806
  • Country: gb
Re: Understanding transistors
« Reply #37 on: May 20, 2017, 08:00:22 AM »
The 7406 Hex Inverter is open collector and can handle up to 30V on the output.  It would have to sink whatever current you plan on having available at the output when it tries to hold the output at 0V.  Remember, the open collector is either 'open' or conducting to ground.  Input logic '0' and the output is whatever it is from the power supply and limiting resistor.  Input logic '1' and the output goes to zero with the gate sinking all the current from the power source through the limiting resistor.

http://www.ti.com/lit/ds/symlink/sn7416.pdf
What's the difference between the 7405 and the 7406 ?  I have some 7405's around.  I've got no problems reversing the logic if that's what it takes.

Btw. I'm using a voltage divider to step from 14 to 12. Does that make a difference?

You are stretching my memory a long way back but ISTR it's the max open collector voltage that makes the difference. All are still 5V logic, but on 5V buses back in the 70s it was still common to use OC with pullups rather than tristate as it was cheaper. Higher voltage OC, I bow to those in the know, but I assume it was to drive stuff that needed it like incandescant bulbs etc.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 3129
  • Country: us
Re: Understanding transistors
« Reply #38 on: May 20, 2017, 08:14:25 AM »

What's the difference between the 7405 and the 7406 ?  I have some 7405's around.  I've got no problems reversing the logic if that's what it takes.

Btw. I'm using a voltage divider to step from 14 to 12. Does that make a difference?

Check the datasheet...  The 7405 can't handle voltages higher than 5V

You need to think about the impedance of the voltage divider and how the voltage changes as a function of load.  I saw that resistor to get the 14V down to 12V and it may, or may not, work.  Voltage dividers composed of resistors are always load dependent.

You could try a zener diode to drop the voltage by 2 volts and probably get less sensitivity to varying loads.  Or, if the voltage isn't terribly sensitive, take 3 voltage drops from a string of diodes.  That would drop 14V to about 11.9V

 

Online Howardlong

  • Super Contributor
  • ***
  • Posts: 3806
  • Country: gb
Re: Understanding transistors
« Reply #39 on: May 20, 2017, 08:21:58 AM »
This thread needs a good, slow, video all by itself, it so takes me back to when I was learning this stuff 40 plus years ago. I empathise with the OP, it's deja vu.
 

Online Hero999

  • Super Contributor
  • ***
  • Posts: 8593
  • Country: gb
Re: Understanding transistors
« Reply #40 on: May 20, 2017, 08:27:14 AM »
Looking at your schematic again. I can see what you're trying to do. The CD40109 and 4504 only shift from one voltage to another. There is a way to disable the output which , with the addition of a longic inverter, would allow you to set the output to 0V, or 12V but that's not what you want here.
Hmmm - I do need to be able to set "ground". If that could be the default when there's no signal, it would probably be a better solution than having a signal come in (what if there's no signal etc).  When I read the specs of the CMOS and TTL chips it doesn't look like they can handle more than 5v, so I definitely don't think an inverter or similar would be the solution - unless I can isolate them from the higher voltages.

Quote
You certainly do need two transistors. One will not do.
So when I initially searched for solutions, I definitely saw a lot that used more than one transistor (and lots of discussions for/against and about details). My (most likely faulty) understanding of using two was because one alone couldn't handle the power (ie. isolating the current from the base). Anyway, as I wrote earlier I definitely need to work on my understanding here a bit better. I can see why they would work, but not WHY they're better than just one.

Quote
Use the circuit posted at the start of the thread, with the PNP transistors with the emitters connected to different voltages and the collectors connected together via Schottky diodes.
Thanks for the diagram! Very helpful indeed. Just in time for my weekend projects :) I just got a "bunch" of basic transistors including the 3904 (I just had 3906) so I don't think your timing could have been better. I'll grab a blank board and give this a try.  Also, based on other feedback it's clear I need to look at the voltage consumed by the diode and transistor so the end voltage will be what I need it to be.

One question - what does RL mean on the transistor before ground?  Ok, TWO questions - since 5v is connected directly, it means there's always going to be 5v? I'm not seeing how I can use this to switch the lead to "0v" or close to that.

Thanks again!
1) I had a quick flick through the data sheet for the EEPROM and I don't see any reason why you'd want to set it to 0V

2) It's pretty easy, just replace the permanent 5V with an MCU output pin and add a pull-down resistor (1k to 100k) to hold it at 0V.

Btw. I'm using a voltage divider to step from 14 to 12. Does that make a difference?
As mentioned above the output impedance of the voltage divider might cause a problem. The output impedance of a potential divider is equal to the value of both of the resistors in parallel. If you know how much current is drawn from the potential divider, then you can work out how much the voltage will drop, when the load is connected.

Where are you getting the 14V from?

Perhaps you could use your MCU to control a voltage regulator, rather than switching the supply rail to different voltages?
 

Offline bitman

  • Regular Contributor
  • *
  • Posts: 107
  • Country: us
  • Open Source Guy jabbing with Electronics
Re: Understanding transistors
« Reply #41 on: May 20, 2017, 08:31:52 AM »

What's the difference between the 7405 and the 7406 ?  I have some 7405's around.  I've got no problems reversing the logic if that's what it takes.

Btw. I'm using a voltage divider to step from 14 to 12. Does that make a difference?

Check the datasheet...  The 7405 can't handle voltages higher than 5V
I did - and did again, and sorry I read 20 in the same table I saw voltage, not realizing it specified mA for THAT value. Sorry, I should have read it more careful.

Quote
You need to think about the impedance of the voltage divider and how the voltage changes as a function of load.  I saw that resistor to get the 14V down to 12V and it may, or may not, work.  Voltage dividers composed of resistors are always load dependent.

You could try a zener diode to drop the voltage by 2 volts and probably get less sensitivity to varying loads.  Or, if the voltage isn't terribly sensitive, take 3 voltage drops from a string of diodes.  That would drop 14V to about 11.9V

It's not even close right now. I only see a few volts on the emitter when it's on (it works for the 14v). When there's no connection it goes to about 6v. If I remove the 10K resistor I see 12V through the 8K resistor. I understand that it will change once there's a load on.  I'll try to build a simulation to see what's going on.
Thanks!
 

Offline bitman

  • Regular Contributor
  • *
  • Posts: 107
  • Country: us
  • Open Source Guy jabbing with Electronics
 

Offline bitman

  • Regular Contributor
  • *
  • Posts: 107
  • Country: us
  • Open Source Guy jabbing with Electronics
Re: Understanding transistors
« Reply #43 on: May 20, 2017, 10:35:03 AM »
1) I had a quick flick through the data sheet for the EEPROM and I don't see any reason why you'd want to set it to 0V
Of course I could be reading this wrong. https://media.digikey.com/pdf/Data%20Sheets/Winbond%20PDFs/W27C512.pdf
The OE is inversed. Ie. you have to set it LOW to read (enable) it (page 7). On the waveform on page 13, OE goes low to enable the output.  Granted, "low" can be betwen -0.3 and 0.8 volts - I've seen that as 0v because my simple electronics mind works that way. Am I reading this wrong?

Quote
2) It's pretty easy, just replace the permanent 5V with an MCU output pin and add a pull-down resistor (1k to 100k) to hold it at 0V.

But that will draw the other lines to 0? I need all 4 signals (14, 12, 5 and 0 volts to go to the same pin. This is why I tried with the diodes, but they don't seem to help with the 0v/grounding issue?

Quote
Btw. I'm using a voltage divider to step from 14 to 12. Does that make a difference?
As mentioned above the output impedance of the voltage divider might cause a problem. The output impedance of a potential divider is equal to the value of both of the resistors in parallel. If you know how much current is drawn from the potential divider, then you can work out how much the voltage will drop, when the load is connected.
Ouch - I just posted a simulation that shows the issue I'm seeing. I'm still not sure why I'm seeing different voltages if the transistor is closed or not, when measuring the potential voltage (I presume that's what the simulator is showing). But I'll read it more careful and knowing there's a parallel circuit will definitely help. The way I was thinking was that since only one line was active at a time, I didn't have to be concerned about additional power/amps being drawn elsewhere. But of course I now have a load on - this "easy" thing is turning out a lot more complicated.

Quote
Where are you getting the 14V from?
Booster (step up converter). I'm trying to use the voltage I would be supplying otherwise. So I got a simple buck-boost converter that I connect the 5 to, and I adjusted the potentiometer so I got 14v out (now 15 since there's a small voltage drop).  Of course doing so has shown me, that the penalty is a constant amp waste even when I don't use the 14v. I thought it was an easy/cheap solution since I suck at creating step-up even when I have a inductor and zener in a basic circuit. Reading up on that made it clear I wasn't ready to make those myself yet, so I got a cheap chinese thing from ebay (I've used similar on my 3D printer).  I was going to look into lowering the amperage once I had things working.

Quote
Perhaps you could use your MCU to control a voltage regulator, rather than switching the supply rail to different voltages?
You mean from the analog output have some kind of variable resistor controlled? Not sure how to do that. I'm pretty sure PWM is out of the question here :)
« Last Edit: May 20, 2017, 10:38:12 AM by bitman »
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 5344
  • Country: au
Re: Understanding transistors
« Reply #44 on: May 20, 2017, 12:11:24 PM »

Quote
..... and add a pull-down resistor (1k to 100k) to hold it at 0V.

But that will draw the other lines to 0? I need all 4 signals (14, 12, 5 and 0 volts to go to the same pin. This is why I tried with the diodes, but they don't seem to help with the 0v/grounding issue?

When you mentioned wanting one of several voltages applied to the same point which included 0V, I, too, thought of using a pull-down resistor.  The mechanism works like this:

When all of your 14V, 12V, 5V, etc. sources are switched off, the target pin has, essentially, no voltage applied to it, so you connect a resistor between that pin and ground to "pull down" any stray voltage on that pin to ground potential - 0V.  The value of this pull down resistor needs to be low enough to ensure it does this effectively (Rule 1).

When you then activate one of the higher voltage supplies, the voltage is applied to that pin - and the resistor.  The pin gets its voltage - which is what you want - and the resistor gets real current passing through it - which you would want to be as little as possible.  For this to happen, value of this pull down resistor needs to be as high as possible (Rule 2).  You should consider the biggest voltage it will be subjected to when doing this.

Here is where you need to work out a value for this pull down resistor which satisfies Rule 1 and Rule 2.

It is quite common for the range of resistor values for an effective pull-down to be pretty broad.  A suggestion has been made for this to be somewhere between 1K and 100K, which sounds reasonable to me.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 2617
  • Country: us
Re: Understanding transistors
« Reply #45 on: May 20, 2017, 12:59:43 PM »
You mean from the analog output have some kind of variable resistor controlled? Not sure how to do that. I'm pretty sure PWM is out of the question here :)


That actually does work. A low pass filter will convert PWM into a steady DC voltage, you can have a crude form of DAC with only a resistor and capacitor.
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 5344
  • Country: au
Re: Understanding transistors
« Reply #46 on: May 20, 2017, 01:12:45 PM »
You mean from the analog output have some kind of variable resistor controlled? Not sure how to do that. I'm pretty sure PWM is out of the question here :)


That actually does work. A low pass filter will convert PWM into a steady DC voltage, you can have a crude form of DAC with only a resistor and capacitor.

It may work - but questions to ask are: how smooth does the voltage need to be and how quickly do the voltage levels need to change?

The answer to this will affect your PWM frequency of operation and RC time constant ... and whether it will perform properly.
 

Online Hero999

  • Super Contributor
  • ***
  • Posts: 8593
  • Country: gb
Re: Understanding transistors
« Reply #47 on: May 20, 2017, 11:43:55 PM »
1) I had a quick flick through the data sheet for the EEPROM and I don't see any reason why you'd want to set it to 0V
Of course I could be reading this wrong. https://media.digikey.com/pdf/Data%20Sheets/Winbond%20PDFs/W27C512.pdf
The OE is inversed. Ie. you have to set it LOW to read (enable) it (page 7). On the waveform on page 13, OE goes low to enable the output.  Granted, "low" can be betwen -0.3 and 0.8 volts - I've seen that as 0v because my simple electronics mind works that way. Am I reading this wrong?

Quote
2) It's pretty easy, just replace the permanent 5V with an MCU output pin and add a pull-down resistor (1k to 100k) to hold it at 0V.

But that will draw the other lines to 0? I need all 4 signals (14, 12, 5 and 0 volts to go to the same pin. This is why I tried with the diodes, but they don't seem to help with the 0v/grounding issue?
I didn't read the whole data sheet in great detail.

If you want all the voltage many pins, just connect the pins together.

If you need different voltages on different pins, then you'll need to build multiple copies of the circuit.

Quote
Quote
Perhaps you could use your MCU to control a voltage regulator, rather than switching the supply rail to different voltages?
You mean from the analog output have some kind of variable resistor controlled? Not sure how to do that. I'm pretty sure PWM is out of the question here :)
That's one possibility or you could replace the variable resistor with a potential divider, say for 12V, then use a transistor to connect another resistor in parallel with the lower resistor to bump the voltage up to 14V. Then you should be able to simplify things by using the CD40109 and CD4096.



Please post a schematic of the boost converter you're using.
 

Offline bitman

  • Regular Contributor
  • *
  • Posts: 107
  • Country: us
  • Open Source Guy jabbing with Electronics
Re: Understanding transistors
« Reply #48 on: May 21, 2017, 02:01:49 AM »
Please post a schematic of the boost converter you're using.
http://www.electroschematics.com/wp-content/uploads/2014/07/xl6009-module-circuit.png
It's a very typical, cheap and often used XL6009.
 

Offline bitman

  • Regular Contributor
  • *
  • Posts: 107
  • Country: us
  • Open Source Guy jabbing with Electronics
Re: Understanding transistors
« Reply #49 on: May 21, 2017, 02:07:53 AM »
That's one possibility or you could replace the variable resistor with a potential divider, say for 12V, then use a transistor to connect another resistor in parallel with the lower resistor to bump the voltage up to 14V. Then you should be able to simplify things by using the CD40109 and CD4096.



Ouch - this is quite a bit above my current capabilities to understand/use.  Btw. speaking of quickly skimming the data sheet, I just realized that deep in the datasheet of the AT28C64B there's a 12V requirement for erase ... *sigh*
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf