Abstract Teaching laboratory electronics in a general physics laboratory classroom requires hauling hundreds of pounds of apparatus from stockroom to lab bench and back each day. Some students see the equipment as "magical mystery boxes" that must be connected in just the right way to func?on properly. Such abstrac?on can be an impediment to learning electronic principles. CSUCI is exploring an alterna?ve, where the students design and build a very compact and simple "open" electronics workbench with adjustable DC power supplies, a versa?le func?on generator, an audio amplifier, and a solderless breadboard. They construct all of this on a small perforated circuit board for ~$25. Along with a digital mul?meter (~ $10), they are able to build, troubleshoot, and study a wide variety of circuits without an oscilloscope or other apparatus. Dr. Rasnow will present the results and lessons learned from this experimental curriculum. 0 Do‐it‐Yourself Electronics Laboratory Brian Rasnow Dept. of Physics California State University Channel Islands 1 C.S.U. Channel Islands New Course * Spring 2009 Phys 310 Electronics A new class in new major in a new (small) school required recrui?ng students from other science majors Do you wonder how gadgets work? How to fix broken stereos, Ipods, computers? How to design sensors, actuators, control systems, or computers? This new course explores electronics • from simple devices to complex instruments • from wavefunctions to software • mixing theory with practical methods We will • build amplifiers, transducers, rail guns, microcontrollers • measure the speed of light • fix broken Ipods, computers, stereos 4 Units, M 10-11:50 am & W 9 – 11:50 am Prerequisites Phys 101 or 201. All majors welcome. For further information: http://phys106fall08.wetpaint.com/page/Basic+Electronics Prof. Brian Rasnow brian.rasnow@csuci.edu 2 Class philosophy • Electronics is hard to learn – No innate sense of weak electricity • Rely on machines to detect it – Abstract and unintui?ve • Different physics than our innate senses – Daun?ng complexity • Technology provides us with a smorgasbord of devices with various behaviors • But learning how to learn about electronics will help you learn about other complex, unintui?ve systems in life 3 Our Approach • Emphasize lab ac?vi?es – Build prac?cal understanding – Build hands‐on skills • Key to understanding advanced electronics topics are – Understand basic concepts – Learn the art of measurement • Using a voltmeter & oscilloscope • What to do when things don’t work – – – – Iden?fy simple circuits and learn to parse schema?cs Familiarity with simple components Art of building, tes?ng, designing Keeping it simple with hierarchical abstrac/on 4 First ac?vity: Baberies & bulbs • What general rules predict circuit behavior? • How do voltage and current help predict circuit behavior? – How can we frame general rules in terms of these abstract concepts? – What evidence do we have that electrons exist? • What excep?ons to these rules are there? – Where do the rules break down? E.g., Jacob’s ladder 5 Mystery Boxes • Can you figure out what’s inside each of these boxes? • Draw the schema?cs for the simplest circuit within each and explain how you concluded that. A ? = • To solve this, we built crude voltmeters and ohmmeters with light bulbs and baberies. • Abstrac?on is obvious. 6 Mul?meters • Explore a mul?meter – Human interface and electric interface to measure … • How can you damage one? • How can one damage you? 7 Variable DC power supply • Explore a variable DC power supply – Human interface and electric interface • How can you damage one? • How can one damage you? 8 Func?on Generator • Explore a func?on generator – Human interface and electric interface • How can you damage one? • How can one damage you? Oscilloscope • Explore a scope – Human interface and electric interface – Both are quite complex • How can you damage one? • How can one damage you? 9 Circuits labs • We used these apparatus to explore Ohm’s law, voltage dividers, and simple resistor, capacitor, inductor, diode, transistor, and FET circuits 10 Component transfer func?ons • A major goal of the labs is to explore/discover the characteris?cs of components & their innumerable combina?ons in circuits … 11 Logis?cs & Abstrac?on • Moving >100 pounds of mul?meters, power supplies, func?on generators, and oscilloscopes back and forth from cabinets to classroom and lab bench was becoming a burden – Doing the simplest experiment was onerous • Some students perceived the labs as exercises in how to connect these magical boxes together to achieve a desired state – Their understanding of what their apparatus did was lacking – The apparatus was obviously complex and expensive, and in?mida?ng 12 Matlab Simula?on • Simula?on solves the logis?cs problem, but its abstract Produces: >> |Vr| = 3.0V, phase = 82.8deg at 1kHz >> |Vr| = 18.8V, phase = 38.5deg at 10kHz 13 Bode Plot • Approximately piecewise linear behavior on loglog amplitude and log‐linear phase plots allows for graphical es/mates of complex circuits “corner frequency” 14 Time domain • Simula?ng waveforms that match oscilloscope data makes the simula?ons more credible • This Matlab func?on f2t() converts from frequency domain to ?me domain, with the inverse Fourier transform (ifft) 15 Simulated waveforms • Sine waves are eigenfunc?ons of linear circuits • But we want to get more hands‐on 16 Individual / class project • Objec?ve: We will each build our own mul?‐output DC power supply, func?on generator, and audio amplifier, as a convenient, compact, affordable test bed for exploring simple electronic circuits. We will learn many prac?cal lessons in the process of design, prototyping, construc?on, and debugging, and ul?mately using the system for future labs. • Design Specifica?ons: – size <6"x8"x3”; weight <2lbs; cost of materials <$30 – DC power supplies: • + &– 12VDC constant voltage at 0‐100mA, <10mV ripple and noise • +&‐ 1.2‐15VDC variable at 0‐100mA – Func?on generator: 10‐100kHz; 0‐10V amplitude; sine, triangle, square wave – Audio amplifier: protected input; 0.05‐50,000 gain; 50Hz ‐ 15kHz bandwidth 17 Methods • Designs modified from datasheets found online – – – – – 3 pin voltage regulators: 7812, 7912, LM317, LM337 Transformer specs and RMS Exar XR2206 func?on generator LM386 audio amplifier Prototyped designs on solderless breadboard • Learned where to acquire parts: – Ebay, www.allelectronics.com, www.futureelectronics.com, etc. – Recycled from consumer electronics – We needed to be extremely frugal to meet budget constraints • Construc?on: – perforated circuit breadboard – Posi?ve photoresist single sided PCB – Small solderless breadboard • “Bootstrapped” approach 18 Interfaces • Inputs – Power plug – Audio input – Solderless breadboard • Outputs – – – – – – +/‐12V, +/‐1.2‐15V Fgen out Sync out Speaker LED indicator Solderless breadboard • Controls – – – – – +/‐ V = 5k pots Frequency = 500k pot Amplitude = 50k pot DC offset = 50k pot Volume 50k pot 19 Power supply schema?c Note polarity of caps. The pinouts of each voltage regulator is different! Why are there two 1k resistors in series with the LED? Why is it on the nega?ve supply? 20 Layout • Power supply occupies ~1/4 of the circuit board • It is powering prototyped func?on generator on a small solderless breadboard 21 Construc?on +12 ‐12 gnd gnd ‐V +V Power LED 22 Power supply solder side • Note: By careful layout, only two traces cross others • One trace is more common than others, hence it’s called “common” or “ground”. 23 Power supply solder side • Note: By careful layout, only two traces cross others • One trace is more common than others, hence it’s called “common” or “ground”. • If this were a printed circuit, this conductor could cover much of the board. 24 X‐ray view 25 Func?on generator schema?c • First prototype is the simplest circuit from Figs. 2 & 11 of the data sheet. • f = 1/RC 200 fmin = 100Hz fmax = 100kHz w/.01uf • Sine output is offset by Vcc/2 • Square output is open‐ collector 3 26 Func?on Generator prototype sqr out • Verify sine and square wave outputs on a scope, & both pots work as expected (volume and frequency increase clockwise). • What changes or features should we consider? • How will we lay this circuit out to solder (with minimal crossing of wires)? amplitude Sine out +12 Gnd freq 27 Final design Freq • This circuit produces ~100Hz‐100kHz sine, triangle, and square waves with adjustable frequency, amplitude, and DC offset. • Breadboard the upper le{ part first, then we’ll build it on a printed circuit board 10k 28 PCB design • Printed circuit board, designed in Adobe Illustrator, implements all interconnec?ons but 2 (blue) on one side of a 2”x2” copper clad circuit board. • Component side view with copper pabern grayed. Grid is 100 mil (.1”). • Note that traces generally run ver?cally and “vias” (blue) are horizontal. Geometry does maber in this physical abstrac?on of the circuit. 29 Design ques?ons • Do you understand … – – – – – – – – What is the theore?cal maximum and minimum frequency? Why R1 + R2 (i.e., isn’t R2 << R1, so why is it there?) Why R3 || R4 (vs. one resistor?) What’s the role of R5 and the Zener? Why isn’t R5 10k or 1k? Hint: you’ll need to understand the “open collector” configura?on inside pin 11. Why is R6 fixed instead of variable as in most circuits in the datasheet? What is the role of C4? What constrains the values of C4 and R9? What is the op amp gain? Phase? Vs. frequency? Might there be a problem with the polarity of C4? 30 PCB layout • 6 func?on generators fit on a 4”x6” circuit board. – Large ground plane (and V+) minimizes etching – Etched component holes are drill guides • To make a printed circuit board: 1. Print this pabern on transparency film 2. Place film on photoresist 3. Expose to sunlight (exposure determined empirically, ~1 min) 4. Develop to remove exposed photoresist 5. Examine, touch up errors (with Sharpie) Write your ini?als or name with Sharpie 6. Etch unprotected copper 7. Drill 8. Scrape or dissolve photoresist (acetone) 9. Place components and solder 10. Clean and test 31 PCB construc?on 1. Developed photoresist 2. Etched bare copper 3. Drilled 4. Removed photoresist 5. Soldered components 6. Component side 32 Func?on generator pcb 33 Mounted on motherboard Wires holding it down 34 Some lessons learned • Hands‐on experiences and building useful things was rewarding and engaging – This was the first ?me most students used a soldering iron & drill press – Conver?ng recycled AC or DC adapters into LED night lights was “cool” – Building from scratch and owning sophis?cated test equipment was cool • The art of compromise in engineering was repeatedly experienced – Cost, simplicity, robustness, user‐friendliness, capabili?es are traded off • Building power supplies demys?fied what a power supply does – Undersizing filter capacitors let the students see poor regula?on – The adjustable supplies were not necessary • Building the func?on generator and audio amp let students explore many devices and circuits without using any school equipment – This appeared to empower and mo?vate some to explore more 35 More lessons • Soldering is a skill picked up by some students faster than others, and it takes ?me – Soldering the PCB was much quicker and easier than the perf board • Layout is also a slowly learned skill – visualizing top and bobom simultaneously – Could it help to build the PCB before the PS? • A walk‐in, open lab bench, equipped with soldering sta?on, oscilloscope, voltmeter, tools and parts, helped students complete their projects outside of class • Tried to engage the class in debugging individual boards 36 Other topics explored • Transistors & FETs in satura?on and op‐amp comparators segued to the digital abstrac?on – Explored the Arduino microcontroller • Appreciate the computa?onal power of feedback – Read Braitenberg’s “Vehicles” • Time domain reflectometry (without a TDR) – Measued speed of light & length of a wire – Related to SWR and radio • Transducers: sensors and actuators 37 Final comments • Low enrollment and haven’t collected final lab reports to more formally assess student outcomes • Didn’t get any ipods or home electronics to explore • Can beber CAD tools be incorporated in the class? • Building the PS/func?on generator circuits was the high point of the class • Some students bought used oscilloscopes for <$100 • Hopefully they’ll con?nue exploring electronics! 38 References & Acknowledgements • • • • • • • • Horowitz & Hill, “The Art of Electronics” A. Agarwal, MIT Open Courseware, 6.002 Circuits and Electronics R. Middlebrook, Design‐oriented Analysis Paradigm V. Braitenberg “Vehicles: Experiments in Synthe?c Psychology” Circuit cellar magazine & website The Arduino online community CSUCI Physics Dept. Students of Phys 310 Thank you! Ques?ons? 39