A diode is a semiconductor *PN junction that only allows current to flow through it in one direction. Depending upon what generation a person learned electronics that current flow’s direction might be based upon the movement of negative electrons or positive ‘holes’. Since the common practice today is to think in terms of a positive source and ground as a negative return; we are following hole flow (the void left by an exiting electron). *(Positive-doped, Negative-doped substrate).
The schematic symbol for a diode has an arrow showing hole flow from the anode to the cathode (k) and a line on the cathode blocking current entering from that side. The line corresponds to the marking on the device.
A common use for diodes is rectifying AC voltage. The positive half of the AC input goes through D1 and D2 while the negative half through D3 and D4. It is still pulsating at this point. The diamond-shaped arrangement of diodes on the right is referred to as a ‘full-wave bridge rectifier’.
Adding a filter capacitor in the microfarad range will smooth out the pulses and approximate DC. Add a voltage regulator and you end up with a decent DC power supply.
Crystal Radio Receiver
Another way diodes are used is to rectify and demodulate radio signals. If you did not wind a coil around a Quaker Oats box and pull in AM radio stations as a kid, your childhood was incomplete! Note that illustration (b) shows an AM ‘envelope’of a modulated signal in the neighborhood of 535 to 1605KHz. The diode strips off the negative half of this signal so the peaks and crests of the waves do not cancel each other out. the remaining positive envelope is a representation of the original modulating (audio) signal. C2 filters out the higher radio frequencies. You do need high impedance earphones (crystal ear buds). This runs entirely off of the air; no power required!
Zener Diode Voltage Reference
Usually when you break something in electronics, it becomes ‘toast’; however, the Zener Diode is designed to break down under reverse bias at a specific voltage. This feature is handy for a voltage reference that will remain consistent even though the power supply (like a draining battery) drifts in voltage, especially under different load conditions.
Common Zener Voltages
Reverse Polarity Protection
This circuit is the power input to the Arduino Uno board. D1 protects the whole board from burning up if someone tries to plug in a miswired power source. The correct power source should be 7-12VDC with a center positive pin. What this sacrifices is a 0.5V drop due to the diode’s barrier voltage (0.5 for a Schottky diode, 0.7 for silicon, 0.3V for much rarer germanium).
Any electromagnet, relay, or motor winding needs a protection diode to route the inductive kickback that is generated in a coil when the electric field collapses. Remember, this spike is opposite of the original applied polarity; thus the diode is reverse-biased to the source.
Light-Emitting Diodes (LED)
Engineers found out quite by accident that any forward-biased PN junction generates a little light (usually outside our visible spectrum). LEDs are designed to increase the surface area of that emission in either visible or invisible wavelengths. Ultraviolet is above the visible spectrum (the light that gives us a sun burn) and infrared (IR) is below; the light used by TV remote controls and thermal cameras.
A LED almost always has to have a series current-limiting resistor so it does not over heat and explode. One of my nephews once put one across a 9V battery and the LED’s top blew off like a 22 caliber bullet. Please respect the warnings! 330 ohm is a good choice.
Just as every forward-biased PN junction generates a little light; every reverse-biased PN junction is somewhat light sensitive. Generally, light causes the diode to leak a small current. Since this leakage is in uA (microamps or nanoamps) the signal must be amplified to be useful. This light sensitivity is why most diode and transistor packages are opaque. The photodiode pictured above is dark due to an IR filter so that it only responds to an IR signal, like that of a TV remote control.
Your cellphone camera can capture near infrared; so you can use it to check if your TV remote control is working.
Connect the voltmeter probe to the bottom of the green LED. Remove the green LED and reverse it so that the cathode faces the 330 ohm resistor to +5V (i.e. reverse biased.) Shine a flashlight on the LED; you should see a leakage voltage of about 10-13 mV.
Transistors come in a variety of packages; the larger ones are designed to handle more current and to dissipate more heat.
Now modify the wiring and include the transistor as shown above. This time when a flashlight shines on the LED the photodiode effect should be much more pronounced (on the order of several volts; though in the opposite direction or inverted). When you are through return the green LED to its original position.
A transistor is like a diode except it contains 2 PN junctions that may be arranged as NPN or PNP. As a result of having an extra pole relative to the base this kind of transistor is known as a ‘bipolar’ transistor. The center PN junction is called the base; and it controls the flow of current between the Collector and Emitter of the transistor. A very small current on the base effects a much larger current change between the collector and emitter; so this kind of transistor would be classified as a current-controlled device. From the hands-on experiment above, it is obvious that a transistor can amplify a signal; though the output is inverted. Depending upon the external biasing a transistor may function as an amplifier or as a switch; the switch reflecting the contrast of an off-state to an on/saturated state.
Operational Amplifiers and Integrated Circuits
A single transistor does not make a very good amplifier. The gain is hard to control; it amplifies the noise to the same degree as the desired signal. It always inverts the phase of its input. The Operational Amplifier (OpAmp) is a vast improvement and was a very influential early integrated circuit. The most common model, the 741 contained 17 transistors on a 2mm square of silicon substrate. It provided differential inputs that reject common-mode noise (it only amplifies the difference between the inputs, and the noise being on both cancel out). The DC offset voltage of its output could be adjusted easily. Most importantly, the gain could be precisely controlled using 2 or 3 feedback resistors.
An OpAmp without feedback resistors runs open-loop and operates as a comparator. A comparator’s output will switch between its high rail or its low rail (in our case, +5V and ground) depending upon which of its 2 inputs are higher.
If R1 and R2 are equal; and the V+ is 5V and V- ground; then for the non-inverting comparator the output would go high for an input above 2.5V and low for an input below that. For the inverting comparator the output would be have just the opposite. This kind of circuit is useful for level control, automatic lighting and for monitoring battery status.
LM35 Precision Centigrade Temperature Sensor IC
It may look like a transistor; but this 3-legged device contains 2 OpAmps and other components to provide simple and accurate temperature measurements. Spec sheet. The reading is easy to interpret as its output is 10mV/degree C.
Add the blue wires as indicated. Note the reading on the panel voltmeter. Pinch the LM35 between your fingers and note the rise in temperature. Our MakerSpace has some freeze spray; give it a short burst and see the meter go to zero degrees C.
The OpAmp in our kit is an improvement over the 741 because it is contains 2 amplifiers and it is designed for a single rather than a double polarity power supply (+12V, ground, -12V, etc.)
Connect the blue wires as indicated. Adjust the potentiometer until the green LED just illuminates and the red one goes out. Now pinch the LM35; if you set it right (and you are warm-blooded), the LEDs should switch from green to red.
Field-Effect Transistors (FET)
Whereas Bipolar Transistors are current-controlled devices FETS are voltage-controlled. Due to their low noise they are used in microphone preamplifiers, radio amplifiers and in active antennas. To make an N-channel FET conduct (drain to source) apply a positive voltage to its gate. For a P-channel, apply 0V or ground.
Metal Oxide Semiconductor Field-Effect Transistor (MOSFET)
MOSFETs also come in N and P-channel like JFETs; but MOSFETs are high power devices capable of switching heavy loads. Our kit contains an IRF9540N, P_channel MOSFET that can deal with 100V and 23A. This is ideal for running motors, relays and solenoids.
Note the ‘flywheel’ diode to protect against inductive kick: MOSFETs are static-sensitive devices.
MOSFET Load Control
R1 is optional (I used a 1K-ohm; could have skipped it). R2 keeps the motor off during the moment while the Arduino is booting up (called “non-destructive turn on”). Though the illustration above shows a motor; the load could be any high-current device such as a fan, a relay coil, etc. We are limited in this lab by the current capacity we can draw from the USB through the Arduino; if another source was available it could be connected to the MOSFET’s drain, up to 100V and 23A.
For code, we are simply using the Arduino Blink sketch again; though we could have modified our temperature sensor sketch to turn on the fan when the sensor detected above a given temperature. The main idea here is that heavy current loads can safely be controlled by a logic level by using a MOSFET switch.
This circuit is called a multivibrator. with the values shown it should oscillate in the kilohertz range.
These values will alternately blink the LEDs every second or so.