Last Time P and N type semiconductors Diode internals Transistors NPN PNP
Device of the Day...
Piezo microphone Device of the Day...
Transistor Recap Transistors operate as current amplifiers With the right configuration of resistors, we can use them as voltage amplifiers We can also use them as switches But: accurate amplification can be hard: different transistors (even of the same type) can have different gain properties
Continuing Today Operational Amplifiers Digital to Analog Conversion Analog to Digital Conversion
Operational Amplifiers These devices are composed of multiple transistors and other components Performs voltage amplification Uses external feedback to control its functions
Operational Amplifiers Differential amplification Voltage at output is proportional to difference between voltage at inputs Very high gain: A 100,000
Operational Amplifiers Under what conditions would we want to amplify the difference between two signals? Transmitting an analog signal over a large distance as a differential pair is less susceptible to noise. Any E/M interference will affect the two lines in the same way. So: the difference in voltage will not change
Ideal Op Amp Infinite input impedance Zero output impedance (open loop) Infinite open loop voltage gain V out = 0 when both inputs are at same voltage Output can change instantaneously (infinite bandwidth)
Feedback V out equals V in What happened to Gain?
Operational Amplifiers Positive valued feedback If we want gain, we fool the negative input into thinking the output is smaller than it actually is Voltage divider Vin = Vout * R1/(R1 + R2) Gain = (R1 + R2)/R1
Operational Amplifiers Negative valued feedback Same current flows across both resistors V R2 is three times V R1 Gain = (R2/R1) Can connect (sum) multiple inputs
Operational Amplifiers VU meter http://www.zen22142.zen.co.uk/circuits/audio/vumeter.htm Piezo microphone http://www.maxim ic.com/appnotes.cfm/appnote_number/1127
Things to Think About Supply voltages typically +15V and 15V Basic cautions Inputs to an op amp must stay within a certain voltage range (typically less than fully supply range) Difference between voltages at input also have a limited range (sometimes as little at 5V) Feedback must be negative (don't mix up the inverting and non inverting inputs)
Digital to Analog Conversion with PWM Encode some digital value in terms of a voltage Drive a line with a PWM signal and filter with an R C circuit Output voltage proportional to average input frequency What are the difficulties with this implementation?
Digital to Analog Conversion with PWM We designed our R C circuit assuming that there was an insignificant amount of current being drawn by the output side This means that the filtering properties will change as a function of current draw How do we fix this?
Digital to Analog Conversion with PWM Design the circuit such that only a small amount of current will flow Use an OP Amp to amplify this signal: What are the drawbacks to this approach?
Digital to Analog Conversion with PWM Drawbacks: The analog signal that we produce might not be smooth enough The R C filtering effectively imposes a delay on the input signal (on the order of the time constant)
Digital to Analog Conversion: with Resistor Networks Use data pins to scale voltage divider R = 10k
Digital to Analog Conversion: with Resistor Networks Drawbacks: Requires N I/O ports Only have N bits of resolution
Analog to Digital Conversion (ADC) The process of extracting a digital representation of an input voltage Many different techniques Commercial ADC modules available Following explanations serve as a guideline when choosing type of module for individual applications
ADC Implementation Successive approximation ADC Try various output codes and feed them into a DAC Compare the result with the analog input as a binary search Relatively accurate and fast
ADC Implementation Integrating ADC Use a capacitor to keep track of the ratio of an input signal level to a reference The input signal is integrated (averaged) A counter stops when the the integrated signal matches the reference (comparator) The count is proportional to the input level After the cycle the counter is reset and the capacitor is discharged Are much slower than Successive Approximation
ADC Implementation Flash ADC Also known as parallel encoding Encoder generates an output corresponding to highest comparator activated by the input voltage Fastest method of A/D
ADC With the PICs The 687s and the 819s include an ADC module with multiplexed inputs Code example Main(){ int value0; setup_port_a(all_analog); setup_adc(adc_clock_internal); } set_adc_channel(0); value0 = Read_ADC(); printf( %u \r\n, value0);
Next Time Lecture Thursday: Sensor Networks Additional Reading from the Wiki: Querying the Physical World Bonnet, P., Gehrke, J., and Seshadri, P., (2000) IEEE Personal Communications, Vol. 7, No. 5, October, pages 10 15. Special Issue on Smart Spaces and Environments Wearable Computers as Packet Transport Mechanisms in Highly Partitioned Ad Hoc Networks, J. Davis, A. Fagg, and B. Levine (2001), Proceedings of the Fifth International Symposium on Wearable Computers (ISWC'01) Milestone 5 due Monday