Thursday, April 19, 2007

ELECTRONICS

TRANSISTORS
A NPN Transistor has its emitter as Negative, Base Positive, and Emitter as Negative. The Base Emitter is forward biased whilst the Base Collector is reverse biased.
That means, the Emitter should have a POSITIVE charge connected to it and should be much larger than the Base Emitter source - this helps to "Push" the current through the NP junction.

Transistors are used with resistors for BIASING. BIASING means providing the correct parameters for the transistor to work, e.g .06v (at least) at the base for the transistor to function.

Two methods of BIASING are SELF BIAS, where the load resistor is connected between the Collector and Base of the transistor and Fixed Bias, where the resistor is connected between the source power on the collector lead and to the base lead of the transistor.

A BASE resistor and a LOAD resistor are NEEDED for a transistor to work - this is because a resistor creates current (or electron flow) to flow, given a voltage. The load resistor is usually at the collector (in a Common Emitter Setup)
Diagram of a transistor showing Load and Base resistor and the output signal

R(Load)
|
/_______________ Output
/
R(Base)----|======
\
\
|________________


Amplification

NPN transistor: In simple terms, increasing the forward-
bias voltage of a transistor reduces the emitter-base junction barrier. This action allows more carriers to reach the collector, causing an increase in current flow from the emitter to the collector and through the external circuit. Conversely, a decrease in the forward-bias voltage reduces collector current
source: http://www.tpub.com/content/neets/14179/css/14179_75.htm


Common Collector is also know as a Emitter Follower.  When there is no input or output connected to the Collector lead of a 
transistor, this is known as a Common Collector. You dont need a resistor at the base for this
type of transistor circuit - (check this)
The input impedance (internal resistance) of this amplifier is very high; it is equal to the product of hfe and the load resistance Rl (at the emitter). However, output impedance is very low. The circuit's overall voltage gain is near-unity, and its output voltage is about 600 millivolts less than the input voltage. As a result, this circuit is know as a DC-voltage follower or an emitter follower.
http://www.uoguelph.ca/~antoon/tutorial/xtor/xtor2/xtor2.html
http://www.uoguelph.ca/~antoon/tutorial/xtor/xtor2/2fig11.gif

Likewise, when there is no input signal or output signal connected to the emmiter, then it is known as a Common Emitter
http://www.uoguelph.ca/~antoon/tutorial/xtor/xtor2/2fig9.gif

  • MORE POINTS ON BIASING
  • There exists a DC current that flows continusouly within the ciruit.  This is know as the Q point. When there has not been an AC signal applied through the circuit.
  • BIASING is used for DC setting of the transistor such that they operate at the ideal point (Q Point) between saturation and cut off in an Audio circuit.  If a transistor is used in a switching circuit, then the only two conditions needed are CUTOFF and SATURATION
  • Input to the Transistor is in millivolts AC which is then amplified by the transistor.
  • A resistor between the collector and connected back to the base of the transistor provides negative feedback to enhance a signal







THE CIRCUIT
This circuit works on the basis of a high-gain amplifier being driven into saturation (fully turned-on), firstly by the very small amount of current delivered by a high-value resistor and then from energy stored in an electrolytic.
When the energy from the electrolytic has been fully delivered, it cannot keep the amplifier fully turned on and it turns off slightly. This action removes the "turn-on" effect from the electrolytic and the amplifier begins to turn off. This action continues until the amplifier is fully turned off and is kept in the off state while the electrolytic begins to charge. The off-state is very long and the on-state is very short. This is how the LED produces a brief flash.

Here is the technical description of the operation of the circuit:

When the supply is connected, both transistors are off and the electrolytic charges via the 330k resistor and 22R. When the voltage on the base of Q1 rises to about .6v, the transistor begins to turn on and the resistance between its collector-emitter terminals is reduced. This allows current to flow in the collector-emitter circuit and Q2 is turned on via the 1k resistor. The 10n reduces the effect (the resistance) of the 1k resistor. Q2 conducts and the LED is illuminated.

The current through the LED is limited by the 22R resistor and at this point in the cycle a voltage is developed across the 22R. The negative end of the electrolytic is `jacked up' by this voltage and the positive end pushes the charge on the electrolytic into the base of Q1 to turn it on even harder. In a very short time all the energy in the electrolytic has been delivered to Q1 and it cannot hold Q1 ON any longer. The transistor turns off slightly and this has the effect of turning off Q2 a small amount.

The LED begins to turn off and the voltage across the 22R reduces. The negative lead of the electro drops a small amount and so does the positive lead. This action continues around the circuit until Q1 is fully turned off. This turns off Q2 and the LED is extinguished. The cycle starts again by the 10u charging.

The charge-time is considerably longer than the discharge time and this gives the LED a very brief flash.
from
 http://www.talkingelectronics.com/Projects/FlasherCircuits/Page83FlasherCircuitsP1.html




Resistors: Used to protect other components on the circuit - such as transistors (usually max milliamps 100ma) and LEDs.

Transistors: Amply Current
Base;Collector;Emitter

The COLLECTOR is the OUTPUT or amplified current/signal whereas the
Emitter is the input current

Voltage to Current Convertor
First, you must convert the input voltage to a current by using a Voltage to Current Convertor--a resistor.

Current to Voltage Convertor
Next, you convert the output current into a voltage by using a Current to Voltage Convertor in the collector circuit--you guessed it--a resistor.


A base current (Ib) flows only when the voltage VBE across the base-emitter junction is 0.7V or more.

On a NPN transistor (and using electron flow protocol), the voltage must reach at least 0.7v through the Emitter-Base, for a LARGER (100Hfe) current to flow through the COLLECTOR.

For the npn transistor, there is a voltage drop from the base to the emitter of 0.6 V.  THIS MEANS THAT THIS TYPE OF TRANSISTOR USES 0.6 VOLTS for it to function. For a pnp transistor, there is also a 0.6 V rise from the base to the emitter. In terms of operation, this means that the base voltage Vb of an npn transistor must be at least 0.6 V greater that the emitter voltage Ve; otherwise, the transistor will not pass emitter-to-collector current.
For a pnp transistor, Vb (voltage at the base) must be at least 0.6 V less than Ve (Voltage at the emitter); otherwise, it will not pass collector-to-emitter current.

The base of the PNP transistor is only ever allowed to get to 0.7 volts below the + rail or below (not higher than 0.7 volts compared to the emitter/voltage source) - So if we have a 9v battery, for a PNP transistor to switch on, the base voltage must be 
less than 8.3v compared to the emitter (source)

Say we get 1 mA flowing through a base resistor R1, from our input signal. The transistor will amplify that current. For a 2N2222 the gain is usually about 60 (hFE = 50 min at 1ma Vce = 10V) so we will get 60 mA flowing through R2 which is a resistor on the collector side. If R1 and R2 are equal, then we will have amplified the voltage sixty (60) times!

VOLTAGE

Voltage is the Potential Difference between two points. It is what makes the atoms in a wire (which is stationary) to MOVE - by its FORCE.
A device, such as a LED, needs moving atoms, or current (which is the change of charge per second) to move pass it.
This state of change of charge moves from a lower level to a higher level (-ve to +ve)


CAPACITORS

Capacitors hold CHARGE - not VOLTAGE - charge stops running when the capacitors voltage is equal to the base voltage

****

Note - some schematics use CONVENTIONAL flow - others use ELECTRON flow to illustrate their schematics!! Must read it correctly! Take the resistor and LED schematics

http://www.technologystudent.com/elec1/transis1.htm

****

WHEN reading schematics, remember that the charge must make a complete circuit before turning on, that means all components will receive charge from the charge source, i.e battery

****

REMEMBER: Transistors are CURRENT ACTIVATED Devices NOT Voltage devices

FETs (Field Effect Transistors)
http://www.ibiblio.org/kuphaldt/electricCircuits/Semi/SEMI_5.html

* Are Voltage activated devices
* Are always on devices (meaning they always allow current to flow from the source to the drain)
* Are reverse-baised to control current - meaning that a negative lead must be applied to the Base leg and a positive lead to the Source Leg (in a PN FET)
* Transistors are usually linear for their input/output characteristics especially for amplication of waveforms so they need to be linear - FETs are NOT linear - input source is not proportional to their output source (FETs have an inverse relationship - increasing the gate voltage causes a decrease of current to flow between the source and drain.
* Applying a negative voltage to the Positive end of the FET, causes the substrate in the FET to repel, causing the gap in the channel to close up. This is normal behaviour for Reverse Bias devices.
* The term 'proportion' is synonymous with 'linear'

IMPEDANCE

All devices in electronics have an impedance or resistance. In DC Circuits, this impedence is usually the resistance of the component or circuit. In AC circuits, the impedance is the measure of the change in the resistance during the change in the frequency of the signal. Impedance includes reactance, resistance, frequency and inductance.

Devices have an input impedance and an output impedance.
Input impedance is what an external component would see when it connects to the component. For example, a MIC that has a FET transistor in this case is the component and has a very high input impedance. My voice (which is the source in this case providing the voltage (FET's are voltage driven devices compared to bi-polar transistors)) see's this MIC which has a very high input impedance.

High Input Impedance means that the device (e.g a MIC) is only capable of CONSUMING or PRODUCING low levels of power and produces LOW current. Usually we should look for HIGH INPUT IMPEDANCE as the input impedance does not affect the source voltage input.

Usually input impedances should be high, at least ten times the output impedance of the circuit (or component) supplying a signal to the input. This ensures that the input will not 'overload' the source of the signal and reduce the strength (voltage) of the signal by a substantial amount.
(http://www.kpsec.freeuk.com/imped.htm)

Usually output impedances should be low, less than a tenth of the load impedance connected to the output. If an output impedance is too high it will be unable to supply a sufficiently strong signal to the load because most of the signal's voltage will be 'lost' inside the circuit driving current through the output impedance ZOUT.

The common transistor is called a junction transistor, and it was the key device which led to the solid state electronics revolution. In application, the junction transistor has the disadvantage of a low input impedance because the base of the transistor is the signal input and the base-emitter diode is forward biased. Another device achieved transistor action with the input diode junction reversed biased, and this device is called a "field effect transistor" or a "junction field effect transistor", JFET. With the reverse biased input junction, it has a very high input impedance. Having a high input impedance minimizes the interference with or "loading" of the signal source when a measurement is made.
source: http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/fet.html

DIODES

There are two current flows in a semiconductor, Electron Flow and Hole Flow.
Electron Flow is when current moves from a negative source to the positive source.
Hole Flow occurs only within the semiconductor, and moves from positive to negative.


An N-TYPE SEMICONDUCTOR is one that is doped with an N-TYPE or donor impurity (an
impurity that easily loses its extra electron to the semiconductor causing it to have an excess number of free electrons). Since this type of semiconductor has a surplus of electrons, the electrons are considered
the majority current carriers, while the holes are the minority current carriers.

A P-TYPE SEMICONDUCTOR is one which is doped with a P-TYPE or acceptor impurity (an
impurity that reduces the number of free electrons causing more holes). The holes in this type
semiconductor are the majority current carriers since they are present in the greatest quantity while the
electrons are the minority current carriers

REACTANCE (X)
Is the measurement of the opposition of AC Current in a circuit. This phenonomen is found in Capacitors and Inductors in AC Circuits.

RESONANCE

Occurs when the Reactance of the Inductor and the Reactance of the Capacitor are the same. This is when the circuit is said to be "tuned"

If the circuit frequence is less than the resonant frequence, the Capacitave Reactance will be larger than Inductive Reactance (measured in Ohms). This is because the capactor is no "filling" completely.

Suppose an a.c. circuit contains an XL of 300 ohms and an XC of 250 ohms. The resultant reactance is:
X = XL -XC
300 - 250
X = 50 ohms (inductive reactance)
Hence frequencies below resonant frequency will cause greater impedance and hence less current flow. Likewise, frequencies above resonant frequency will cause greater impedance by the inductor and will cause less current flow.

For a given source voltage, the current oscillating between the reactive parts will be stronger at the resonant frequency of the circuit than at any other frequency. At frequencies below resonance, capacitive current will decrease (due to greater reactance (opposition of AC current flow) from the capacitor; above the resonant frequency, inductive current will decrease. Therefore, the oscillating current (or circulating current, as it is sometimes called), being the lesser of the two reactive currents, will be maximum at resonance.

In a Series Resonant Circuit, Impedance is low, current high and voltage high at or near the Resonant Frequency. This is due to

Xl - Xc = 0

Where Xl is the reactance (measured in Ohms) of the inductor and Xc is the reactance of the capacitor.

In a Parallel Series Resonant Circuit, Impedance is High, current low and voltage low at or near the Resonant Frequency. This is due to

Il - Ic = 0 (Current through the Inductor and current throught the capacitor cancel each other out since they are opposities, since voltage in a parallel circuit is equal in all components, which means current is equal in all components (Inductor and Capacitor)

A circuit that is completed and has a voltage applied, but has zero current, must have an INFINITE IMPEDANCE (very high)(apply Ohm's law — any voltage divided by zero yields infinity)

REACTANCE (resistance in AC circuits caused by capacitors and inductors)

The total opposition to the flow of a change to an AC current.
The difference between a capacitor's reactance and an inductor's reactance equals reactance.

When an AC current is placed across an inductor, this causes an EMF that opposes this current.  This is called Inductive reactance.

INDUCTIVE REACTANCE

When the current flowing through an inductor continuously reverses itself, as in the case of an ac source, the inertia effect of the cemf is greater than with dc. The greater the amount of inductance (L), the greater the opposition from this inertia effect. Also, the faster the reversal of current, the greater this inertial opposition. This opposing force which an inductor presents to the FLOW of alternating current cannot be called resistance, since it is not the result of friction within a conductor. The name given to it is INDUCTIVE REACTANCE because it is the "reaction" of the inductor to the changing value of alternating current. Inductive reactance is measured in ohms and its symbol is XL.


Capacitors themselves offer a very real opposition to current flow. This opposition arises from the fact that, at a given voltage and frequency, the number of electrons which go back and forth from plate to plate is limited by the storage ability-that is, the capacitance-of the capacitor. As the capacitance is increased, a greater number of electrons change plates every cycle, and (since current is a measure of the number of electrons passing a given point in a given time) the current is increased.  
As the frequency increases, the movement of these electrons increases, causing more current to pass and hence its reactance or resistance is reduced.

INDUCTANCE

The characteristics of a device or ciruit to oppose any start, stop or change of value in AC current.

Saturday, April 14, 2007

Using arecord

to list sound devices:

arecord -l

to record 20sec cd quality;

arecord -f cd -D hw:0,1 -d 20 test.wav

Executing a script when Konsole runs

in vi .bashrc (/home/shelton/.bashrc) (or for root /root/.bashrc)

export PS1="\[\033[44;1;31m\][\u@\h:\w (\$(chkMntCount))]\$"

The first [...] is for colour coding
The Second [...] is to display user and machine name
this is followed by the chkMntCount script which is located in /usr/bin

Contents of chkMntCount is:
tune2fs -l /dev/hda3 | grep "Mount count"
tune2fs -l /dev/hda3 | grep "Maximum mount count"

Friday, April 13, 2007

Using equery

To find dependencies of a package:

equery d -a softwareName

Thursday, April 12, 2007

Opening PPS files

java -jar tonicpoint.jar

Sunday, April 08, 2007

Mount MP3 Player

mount -t vfat /dev/sda1 /mnt/mp3