Circuit & Component Check

Danny T wrote:
Robert Monsen wrote:

I just removed the 4.7K resistor on my breadboard, and it still works
the same. I'll ignore this in future :)


I just looked at the datasheet for the 16F676, and it specifies a
resistor of at least 1k, along with an optional cap of 0.1uF to
ground. This is on pg 58 of the 16F630/16F676 datasheet.


I'm currently using 16F627 and 12F629. What section of the datasheet was
it under, so I can check what these say?
It's under 'special features of the CPU', where it talks about MCLR

4. RA2 has a jumped, and gets tied to +5V or ground, via a 1k
resistor. I've been using 10k - how important is this value?


The value is not critical; 100 ohms or 100k would also work.


Actually, many microchip parts have internal "weak pullup resistors",
which can be turned on and of individually for port pins. They are
10k. Look at the datasheet for your part.


I noticed these, but didn't full understand them. If these are turned
on, is it safe to remove the resistors and connect directly to 5V/Ground?
I don't think so. Connecting it to 5V would just bypass the resistor.
Connecting it to ground would just waste 0.5mA to no purpose.

The pullups work just like an external 10k resistance to Vdd. The point
is that you can set ports up as inputs without worrying about the CMOS
'floating input' problem, which causes a big current drain when a CMOS
input sits 1/2 way between ground and Vdd.

As far as your circuit goes, if you use these pullups, you don't have to
connect the port to anything, it will automatically read as high when
you look at it, and won't consume inordinate amounts of power.

You can also use this to your advantage with pushbuttons, for example.
Use a normally open pushbutton, set the port to use the internal weak
pullups, and connect the other side to ground. Then, if you push the
button, the port will read 0, otherwise, it'll read high.

If you aren't using the port, however, you can just set it to be an
output using the TRIS register, and then safely leave it unconnected.

--
Regards,
Robert Monsen

"Your Highness, I have no need of this hypothesis."
- Pierre Laplace (1749-1827), to Napoleon,
on why his works on celestial mechanics make no mention of God.
 
Dominic-Luc Webb wrote:
Actually, maybe you can explain the way that NPN 2N3904 transistor
is connected? It looks odd to me that the emitter is not tied to
ground, but the collector is. I am not sure I see what it is
supposed to do in this circuit.
Yes, the emitter and collector are the wrong way round: the collector should
go to the piezo, and the emitter should go to ground - as you said.

Also, the base resistor (R5) is unnecessarily small. If we take an
excessively high estimate of 200mA for piezo current, divide by a low
estimate of 50 for gain (beta), we still need only 4ma of base current to
saturate the transistor. The base resistor should be (5-0.7)/4 = 1k.
 
On Mon, 3 Jan 2005, Andrew Holme wrote:

Dominic-Luc Webb wrote:
Actually, maybe you can explain the way that NPN 2N3904 transistor
is connected? It looks odd to me that the emitter is not tied to
ground, but the collector is. I am not sure I see what it is
supposed to do in this circuit.

Yes, the emitter and collector are the wrong way round: the collector should
go to the piezo, and the emitter should go to ground - as you said.

Also, the base resistor (R5) is unnecessarily small. If we take an
excessively high estimate of 200mA for piezo current, divide by a low
estimate of 50 for gain (beta), we still need only 4ma of base current to
saturate the transistor. The base resistor should be (5-0.7)/4 = 1k.

Andrew and others....

I am thrilled over here... finally getting to the point where I can
question someone else's circuit. I too was suspicous of the base
resistance, having checked the spec sheet for that transistor, very
common small signal type.

A pattern is emerging.... it seems like maybe some of the resistances in
this circuit are off by very close to one order of magnitude while the
collector and emitter are backwards. Dyslexia?

Dominic
 
Robert Monsen wrote:
I'm currently using 16F627 and 12F629. What section of the datasheet
was it under, so I can check what these say?

It's under 'special features of the CPU', where it talks about MCLR
For the PIC16F627, it reads

The on-chip POR circuit holds the chip in reset until
VDD has reached a high enough level for proper operation.
To take advantage of the POR, just tie the MCLR
pin through a resistor to VDD. This will eliminate external
RC components usually needed to create Power-on
Reset. A maximum rise time for VDD is required. See
Electrical Specifications for details.
The only references in electrical specs I can see are:

Voltage on MCLR and RA4 with respect to VSS -0.3 to +14V
and

Voltage spikes below VSS at the MCLR pin, inducing currents greater than 80 mA, may cause latch-up.
Thus, a series resistor of 50-100W should be used when applying a "low" level to the MCLR pin rather
than pulling this pin directly to VSS.
But I'm pulling MCLR *up*, to stop it resetting, aren't I?! :-\


As far as your circuit goes, if you use these pullups, you don't have to
connect the port to anything, it will automatically read as high when
you look at it, and won't consume inordinate amounts of power.

You can also use this to your advantage with pushbuttons, for example.
Use a normally open pushbutton, set the port to use the internal weak
pullups, and connect the other side to ground. Then, if you push the
button, the port will read 0, otherwise, it'll read high.

If you aren't using the port, however, you can just set it to be an
output using the TRIS register, and then safely leave it unconnected.
Cool, that'll save me a few components then!
So if it's configured as an input, and pull-ups are enabled, I don't
need any resistors, but just leave it unconnected, or connected directly
to ground for a high/low respectively?

--
Danny
 
Andrew Holme wrote:

Actually, maybe you can explain the way that NPN 2N3904 transistor
is connected? It looks odd to me that the emitter is not tied to
ground, but the collector is. I am not sure I see what it is
supposed to do in this circuit.

Yes, the emitter and collector are the wrong way round: the collector should
go to the piezo, and the emitter should go to ground - as you said.

Also, the base resistor (R5) is unnecessarily small. If we take an
excessively high estimate of 200mA for piezo current, divide by a low
estimate of 50 for gain (beta), we still need only 4ma of base current to
saturate the transistor. The base resistor should be (5-0.7)/4 = 1k.
LOL!
And they published this guys book! ;)

Maybe you can clear up a few terms I keep hearing, but keep ignoring cos
I don't full understand!

Base / Collector / Emitter - I don't completely understand.. Is the
collector always +ve and the emitter grounded/-ve?

Sink / Drain - These seem to be used in describing which way things are
connected... Used in the datasheets quite a bit too, such as "input/open
drain output"

--
Danny
 
Dominic-Luc Webb wrote:
2. RB1 and RB2 have a 1K resistor, then what looks like two diodes. If
these are unused, are the diodes needed? If they're supposed to be LEDs,
1K seems high - I calculated my two sets of LEDs as needing 120Ohms
and 160Ohms?

Maybe you mean RB0 and RB1.... if the supply is 5 volts and these
are typical 5 mm 2.0 volt and 0.03 amp LEDs, then a typo would
make more sense. This would work out to exactly 100 Ohm, just
obeying Ohm's law.
I did mean RB0 & RB1, correct.

100 Ohm sounds more like it, I've got a few different LEDs here, and the
resistors have worked out as 120 and 160. *However*, I did connect a 1K
today, since it's the lowest I have till my stuff arrives, and the LED
is more than bright enough. Maybe he can get 1K resistors cheaper than
100 Ohms ;-)


I'll wait and see if anyone suggests an explanation for that
transistor. It would more more sense to me if the collector
and emitter were in reverse order.
LOL! I can't believe so many of you noticed that so quickly! Guess I'll
double check before copying any examples from that book ;o)
 
Danny T wrote:
Andrew Holme wrote:

Actually, maybe you can explain the way that NPN 2N3904 transistor
is connected? It looks odd to me that the emitter is not tied to
ground, but the collector is. I am not sure I see what it is
supposed to do in this circuit.

Yes, the emitter and collector are the wrong way round: the
collector should go to the piezo, and the emitter should go to
ground - as you said.

Also, the base resistor (R5) is unnecessarily small. If we take an
excessively high estimate of 200mA for piezo current, divide by a low
estimate of 50 for gain (beta), we still need only 4ma of base
current to saturate the transistor. The base resistor should be
(5-0.7)/4 = 1k.

LOL!
And they published this guys book! ;)

Maybe you can clear up a few terms I keep hearing, but keep ignoring
cos I don't full understand!

Base / Collector / Emitter - I don't completely understand.. Is the
collector always +ve and the emitter grounded/-ve?
The base, collector and emitter (B, C, E) are the three terminals of a
bipolar transistor. The base and collector are positive with respect to the
emitter of an NPN transistor. The reverse is true of a PNP transistor.

The emitter of an NPN transistor is not always connected to ground.

Sink / Drain - These seem to be used in describing which way things
are connected... Used in the datasheets quite a bit too, such as
"input/open drain output"
Gate, drain and source are the terminals of a field effect transistor. They
are in, a limited sense, equivalent to base, collector and emitter.

A "current sink" is something into which current flows; a "current source"
is something out of which current flows. An output "sinks" current when it
pulls low; and "sources" current when it pulls high.

An "open drain" output can only pull low. The pull-up transistor is
disabled in this mode. It goes tri-state (i.e. floating, high-Z, open
circuit) for logic 1. The external circuitry determines the pin's
potential: it must not be allowed to float.

The bipolar equivalent of "open drain" is an "open collector" output.

Well, I've answered your specific questions. I could go on, but this is a
MASSIVE subject. I recommend the book "The Art of Electronics" by Horowitz
and Hill if you fancy some good arm chair / bed time reading on the subject.
It's informal, readable and not at all stuffy or dry.
 
I did mean RB0 & RB1, correct.

100 Ohm sounds more like it, I've got a few different LEDs here, and the
resistors have worked out as 120 and 160.

In this case, they are both 100 Ohm. There is fundamentally no difference
between the two LEDs that would justify two different resistor values
unless you want different brightnesses.


I'll wait and see if anyone suggests an explanation for that
transistor. It would more more sense to me if the collector
and emitter were in reverse order.

LOL! I can't believe so many of you noticed that so quickly! Guess I'll
double check before copying any examples from that book ;o)

I actually thought it was excellent that you showed this. I started in
electronics from a design in a book that did not work all that well,
although, the components were probably about the right values and the
transistor orienation was correct. This helps a lot because mainly
people assume that if you are not familiar with electronics and you
are following a schematic from a book, then if it fails, it must be
your fault. You now learned what I have: Examine every component. Ask
what it is doing there and why the values for each component are what
they are. I am more and more finding published schematics that I could
make improvements on.

Dominic
 
Dominic-Luc Webb wrote:
The base, collector and emitter (B, C, E) are the three terminals of
a bipolar transistor. The base and collector are positive with
respect to the emitter of an NPN transistor. The reverse is true of
a PNP transistor.

The emitter of an NPN transistor is not always connected to ground.


Is the emitter ever connected and actually running at a voltage that
is higher than the collector? Is this described in the Horowitz book?

Dominic
No, not the emitter of an NPN transistor: the minimum collector-emitter
voltage is about 0.2V when the transistor is saturated.

The H+H book covers this in detail.
 
Danny T wrote:
Andrew Holme wrote:

Well, I've answered your specific questions. I could go on, but this
is a
MASSIVE subject. I recommend the book "The Art of Electronics" by
Horowitz
and Hill if you fancy some good arm chair / bed time reading on the
subject.
It's informal, readable and not at all stuffy or dry.


At Ł50, I think I'll see if the Library have it first ;-)

Ta!
Try bookpool. They had it for $50 US. Who knows now, though, with the
dollar having 'issues'?

--
Regards,
Robert Monsen

"Your Highness, I have no need of this hypothesis."
- Pierre Laplace (1749-1827), to Napoleon,
on why his works on celestial mechanics make no mention of God.
 
Dominic-Luc Webb wrote:
Danny,

I just bought this book at Ebay for 27 brittish pounds with shipping
within USA... There were a number of copies of this book being sold
there. Be cautioned there is another, related book, maybe a lab manual,
etc, that sells for about half the price. If you go the auction route,
pay close attention to what people are wanting for shipping and handling,
and stick with people with a good record from previous deals.
Yep, the Student Manual - I noticed that right away :)


Here is the one I got: Ebay #4515997432

There is another auction right now, even lower price. Just type in
the name of the book and you should find several examples, such
as: Item 4516689114
I'll take a look, though I don't usually buy things more than about Ł20
from ebay - there are too many scammers (ebay don't make a big enough
deal of feedback - some people with hundreds of "good feedback"s are
from small Ł1 auctions with their mates) and ebay seem to be useless at
sorting out mishaps! :-(
 
Dominic-Luc Webb wrote:

I tried yesterday with some odd components lying around, but only had an
NPN transistor, no MOSFET, which resulted in my motor going fast and
slow, instead of fast and off!!

Danny, it will be great to see how this progresses. I am interested in
the reason why the effect on speed is occurring. It sounds like a
problem I am encountering with the 2N3055 NPN power transistor. I do
not find conditions under which it actually shuts off and I do not
understand why.
I still don't fully understand the differences between all these
different types of transistors/FETs... Since all works fine with the
MOSFET (ZVN4206A), I assumed the transistor was just "amplifying" or
something. A low from my chip seems to vary between 0V and -0.04 or so,
so maybe this is by design - dunno! The resistor I was using was an BC108A.

--
Danny
 
Dominic-Luc Webb wrote:

I tried yesterday with some odd components lying around, but only had an
NPN transistor, no MOSFET, which resulted in my motor going fast and
slow, instead of fast and off!!

Danny, it will be great to see how this progresses. I am interested in
the reason why the effect on speed is occurring. It sounds like a
problem I am encountering with the 2N3055 NPN power transistor. I do
not find conditions under which it actually shuts off and I do not
understand why.
I still don't fully understand the differences between all these
different types of transistors/FETs... Since all works fine with the
MOSFET (ZVN4206A), I assumed the transistor was just "amplifying" or
something. A low from my chip seems to vary between 0V and -0.04 or so,
so maybe this is by design - dunno! The resistor I was using was an BC108A.

--
Danny
 
Danny T wrote:
Dominic-Luc Webb wrote:

I tried yesterday with some odd components lying around, but only had an
NPN transistor, no MOSFET, which resulted in my motor going fast and
slow, instead of fast and off!!

Danny, it will be great to see how this progresses. I am interested in
the reason why the effect on speed is occurring. It sounds like a
problem I am encountering with the 2N3055 NPN power transistor. I do
not find conditions under which it actually shuts off and I do not
understand why.

I still don't fully understand the differences between all these
different types of transistors/FETs... Since all works fine with the
MOSFET (ZVN4206A), I assumed the transistor was just "amplifying" or
something. A low from my chip seems to vary between 0V and -0.04 or so,
so maybe this is by design - dunno! The resistor I was using was an BC108A.
Study the data sheets and come back with anything you see that doesn't
make sense to you.

--
John Popelish
 
On Sat, 8 Jan 2005, John Popelish wrote:

Dominic-Luc Webb wrote:

It is also frustrating that the specifications often do not tell what
kind of NPN transistor. I have seen the 2N3055 called a Darlington,
and I have seen internal schematics that clearly show that it is not.

It is always a good idea to review the data sheet if you can find one:
http://www.onsemi.com/pub/Collateral/2N3055-D.PDF

--
John Popelish
I have several. I do not necessarily trust these. Note that some of them
currently available on the Net (I just found one) specified Vce in units
of amperes, for instance. In some cases, the units are mixed up. Thanks
for the link, John. I do not have this particular one, and scanning
through it, I do not see this error. Indeed, there appear to be some
numbers I have not seen. On the other hand, note that it is not clearly
stated that it is even an NPN at all. This appears further down, in the
sheet, but it is almost inadvertant. Further, this spec sheet does not
show any internal archecture and does not seem to state whether or not
this is a single NPN or Darlington config. In the case of the 2N3055,
there are so many newby's, this little bit of extra blurb would be
useful to quite a few customers.

So what do you make of the problem of getting the 2N3055 to shut off?
Could it be damaged?

Dominic
 
Dominic-Luc Webb wrote:

I tried yesterday with some odd components lying around, but only had an
NPN transistor, no MOSFET, which resulted in my motor going fast and
slow, instead of fast and off!!

Danny, it will be great to see how this progresses. I am interested in
the reason why the effect on speed is occurring. It sounds like a
problem I am encountering with the 2N3055 NPN power transistor. I do
not find conditions under which it actually shuts off and I do not
understand why.

I still don't fully understand the differences between all these
different types of transistors/FETs... Since all works fine with the
MOSFET (ZVN4206A), I assumed the transistor was just "amplifying" or
something. A low from my chip seems to vary between 0V and -0.04 or so,
so maybe this is by design - dunno! The resistor I was using was an BC108A.

Study the data sheets and come back with anything you see that doesn't
make sense to you.

--
John Popelish

One thing that does not make sense is that Danny gets a varying low. I
would think low should be right at ground potential for this circuit.

I think BC108 is not a resistor, but a small signal NPN, about 0.1 Ic
and 300 Mhz with a large Hfe.

Dominic
 
So what do you make of the problem of getting the 2N3055 to shut off?
Could it be damaged?

That is always a possibility ot be checked out. But I don't have
enough details on the application to say. Care to tell me the
details, again, of the circuit that gave you trouble?

--
John Popelish

John (and others),

The circuit is 555 in classic astable mode. In one example circuit:

Timing cap, Ra and Rb give 1 kHz 7 volt square wave with about 65% duty
cycle at pin 3. This is confirmed by oscillscope. Supply is 7 volts
(Vcc1).

Pin 3 goes (series) to 100 Ohm resistor followed by 20 kOhm pot followed
by NPN transistor base. The load is an 8 Ohm 0.25 Watt speaker in
series with a 500 Ohm resistor and receives power from supply that is 20
volts (Vcc2) relative the 555
ground:

Pin3 ----> 100 Ohm ----> 20k pot ----> NPN base

Vcc2 ----> 500 Ohm ----> speaker ----> NPN collector

Emitter goes to ground


BF658 as transistor (small signal type) can give loud sound by tuning the
pot. Oscilloscope shows current going on and off.

2N3055 as transistor shows continuous 16 volt plateau and barely 0.2 volt
superimposed square wave, or greatly increased frequency. No tuning
of the pot gives loud sound from speaker.


BF658 does this:


16.2 V ___ ___ ___
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
Gnd --- ---- ---- ---

Swing is from Gnd to 16.2 V.



2N3055 does this:

16.2 ___ ___ ___
| | | | | |
16V --- ---- ---- ---

Never drops to ground potential. It can in some cases go to roughly
12 times high frequency, as well.


Dominic
 
Dominic-Luc Webb wrote:
So what do you make of the problem of getting the 2N3055 to shut off?
Could it be damaged?

That is always a possibility ot be checked out. But I don't have
enough details on the application to say. Care to tell me the
details, again, of the circuit that gave you trouble?

--
John Popelish

John (and others),

The circuit is 555 in classic astable mode. In one example circuit:

Timing cap, Ra and Rb give 1 kHz 7 volt square wave with about 65% duty
cycle at pin 3. This is confirmed by oscillscope. Supply is 7 volts
(Vcc1).

Pin 3 goes (series) to 100 Ohm resistor followed by 20 kOhm pot followed
by NPN transistor base. The load is an 8 Ohm 0.25 Watt speaker in
series with a 500 Ohm resistor and receives power from supply that is 20
volts (Vcc2) relative the 555
ground:

Pin3 ----> 100 Ohm ----> 20k pot ----> NPN base

Vcc2 ----> 500 Ohm ----> speaker ----> NPN collector

Emitter goes to ground

BF658 as transistor (small signal type) can give loud sound by tuning the
pot. Oscilloscope shows current going on and off.

2N3055 as transistor shows continuous 16 volt plateau and barely 0.2 volt
superimposed square wave, or greatly increased frequency. No tuning
of the pot gives loud sound from speaker.

BF658 does this:

16.2 V ___ ___ ___
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
Gnd --- ---- ---- ---

Swing is from Gnd to 16.2 V.

2N3055 does this:

16.2 ___ ___ ___
| | | | | |
16V --- ---- ---- ---

Never drops to ground potential. It can in some cases go to roughly
12 times high frequency, as well.

Dominic
I can't think that your 2N3055 is good, unless you have reversed the
base and emitter pins or something similar. It has a lot more charge
storage than the smaller transistor, so it is harder to turn it on and
off quickly, but at this frequency, that should behave very similarly,
except for leakage and rise and fall time. What you describe is not
explained by the difference in the two types.

--
John Popelish
 
If I understand
these transistor specs and math correctly, I believe this also means that if
I have a varying load, as would be the case with a photomultiplier tube
pulling current from a transformer driven via this transistor, then a much
larger beta could be desirable (i.e., more dynamic range).

Higher beta implies that you need less drive current into the base to
produce a given collector current. But you can usually provide excess
base current to handle the high current case, without messing the low
current case up, too much. The usual 'cost' is longer turn off time.
Driving any switching transistor with a large voltage and large series
resistor approximates a current source, which aggravates the turn on
and turn off time problems. Slightly more complicated drive schemes
(adding a base to emitter resistor to drain the stored charge out
faster at turn off and paralleling the series resistor with a small
capacitor to drive the transitions harder) can result in significant
efficiency improvements.
OK. As you can already guess, I have a couple of batteries in series
that yield 20 volts and I now have a voltage divider. My 555 now gets, and
outputs about 5 volts, and the speaker, drawing from the top of the
divider through collector gets consirably more. Even the 5 volt output
exceeds the requirements for any of the transistors being considered here.


Dominic
 
Dominic-Luc Webb wrote:
If I understand
these transistor specs and math correctly, I believe this also means that if
I have a varying load, as would be the case with a photomultiplier tube
pulling current from a transformer driven via this transistor, then a much
larger beta could be desirable (i.e., more dynamic range).

Higher beta implies that you need less drive current into the base to
produce a given collector current. But you can usually provide excess
base current to handle the high current case, without messing the low
current case up, too much. The usual 'cost' is longer turn off time.
Driving any switching transistor with a large voltage and large series
resistor approximates a current source, which aggravates the turn on
and turn off time problems. Slightly more complicated drive schemes
(adding a base to emitter resistor to drain the stored charge out
faster at turn off and paralleling the series resistor with a small
capacitor to drive the transitions harder) can result in significant
efficiency improvements.

OK. As you can already guess, I have a couple of batteries in series
that yield 20 volts and I now have a voltage divider. My 555 now gets, and
outputs about 5 volts, and the speaker, drawing from the top of the
divider through collector gets consirably more. Even the 5 volt output
exceeds the requirements for any of the transistors being considered here.

Dominic
If you run the 555 from a divider, it will have a hard time providing
any significant base drive current without collapsing its supply. I
would replace the divider with a 5 volt regulator.

That said, if you have a 100 ohm resister between a 5 volt powered 555
and the base of a grounded emitter NPN transistor, that leaves you
with 5 volts minus pull up saturation drop of the 555 minus the base
emitter drop of the transistor, across the 100 ohm resistor. Lets say
that the pull up saturation voltage is about (based on the middle left
graph on page 5 of http://cache.national.com/ds/LM/LM555.pdf )
1.5 volts and the base to emitter voltage of about .8 (saturated
switches have more base to emitter drop than ones operating in the
linear mode), so that leaves you with about 5 - 1.5 - 0.8= 2.7 volts
across the 100 ohm base resistor for a base current of about 27
milliamps.

If the transistor has a saturated gain (remember, you get a lot less
gain when the collector voltage gets near or below the base voltage)
of something like 20 to 50 that allows a collector current of
somewhere between .54 and 1.35 amperes. But the 555 supply has to be
able to deliver the 555 consumption and the 27 milliamperes of output
current while holding the supply steady at 5 volts.

Is all this making sense?

--
John Popelish
 

Welcome to EDABoard.com

Sponsor

Back
Top