L.O. (Learning Objectives) Week 11:¶ ¶ • Document while learning from interfacing an input device to microcontroller (ATtiny412 chosen) and how the physical property relates to the measured results. • Design and fabricate through the process • Upload the program to get the circuit board working • Create and break problems ~~ and how I fixed them • Journal the Fun Discoveries of The Week, && the Questions of the Week 11 11.0. Notes during the class and workshops:FABLAB¶ • Parallel structure for LEDs on the circuit board Is it useful in the same sense that the parallel structure for lighting that we learn in physics? Or different usage for the circuit board one? o “Charly Plex” = the name of this parallel structure (or, “multi plexing”, or “LED plexing”) • Impedance is highly, highly related to resistance, but they are not the same things. • MOSFET (transistor) o Source and the drain o RDS = resistance between the source and the drain o //drain, source, gate – three pins in a MOSFET chip o MOSFET = used when you control things that need more power, because it can switch between high and low (in power, not as in voltage). • DAC = digital to analog converter • PWM (pulse width modulation) – the graph has its I (current) in the y axis o Q. PWM – the differences between its function in input and in output? • Two more capacitors – small capacitors filter noise and the big capacitors filter other things? • Types of motors: o DC motors – twerk and efficiency o Servo Motors You wanna use servo motors when you want to control the angle of it o BLDCs are better in every way – quitter, faster, etc. Wired in three coils e.g. diagonals-in-a-triangle way Caution: Much more expensive than DC motors, and harder to control we need to understand “motor coils” to understand why’s behind the three-way structure inside the BLDC motors. o Stepper motor Connecting in an alternative loop Need feedback around them(stepper??) ? o //RPM = revolutions per minute o //Motors have coils and magnets o //KV – rpm for servo motors? o //“holding torque” – torque wrench o // Motor control It has three wires Crucial to Switch the hot side o //Change in PWM to change the position/degree of turn (e.g. 30 degree to the clockwise turn) o //How do you choose which motor you need to use for your purpose/project/object? • ESC – electronic speed controller o Same PWM used for the servo motors o Trickier in a way – varying the PWM? • Cupper tape / cupper coil o Can be cut out on the vinyl cutter • PNM? • “Shape memory” o http://fab.cba.mit.edu/classes/863.10/people/jie.qi/jieweek10.html o Fascinating • Displays o TFT o LCD o OLED • http://nueval.fabacademy.org • Week 11 Workflow: 1. Choose a device 2. Read datasheet 3. Choose supporting parts 4. Tutorial/example 5. Draw SCH a. Check rules 6. Design layout a. Design Rule Check 7. Test 8. Mill 9. Solder 10. Test 11. Code 11.1. Documentation while learning from interfacing an input device to microcontroller (ATtiny412 chosen) and how the physical property relates to the measured results:¶ The overall workflow of the week11: 1. Choose a device 2. Read datasheet 3. Choose supporting parts 4. Tutorial/example 5. Draw SCH a. Check rules 6. Design layout a. Design Rule Check 7. Test 8. Mill 9. Solder 10. Test 11. Code The output device of my choice: • Speaker -- giving out analog signals (which means I need digital-to-analog converter) Comparing two different models for the phototransistor pin (that reads the reflection of the IR light): • I had two options. • The bigger, circular one did not have datasheet, and the one with the square shape had one on the internet. • I was able to find a model number by using a trick of finding and referring to a spreadsheet of ingredients of the fab academy recipe. (I forgot the magic word! I'll ask Craig again.) • Although the model number did not get me to its data sheet (simply because the manufacturer did not make it in the first place), I was able to find a webpage that shows properties and some numbers related to the component. • This is info that I found on the webpage: (problems faced are discussed at the end of the documentation.) 11.2. Design and fabrication process:¶ Checking each component before starting on Kicad: • I made a detailed notes on necessary information -- which is especially helpful when assigning footprints. by reading info on this photo (ATTINY412 pinout diagram TMI: the one on the data sheet was not useful ((whisper: at all))) Kicad design process: 11.3. The programming process/es I used:¶ int yunjo = 369; 11.4. Creating and breaking problems ~~ and how I fixed them:¶ Problem 1 (I did not understand the layout around MOSFET (transistor that works liks a switch)): a. MOSFET and/or OPAMP i. What is MOSFET? ii. https://www.youtube.com/watch?v=GrvvkYTW_0k iii. MOSFET has two types of modes called depletion and enhancement. iv. //Drain VCC, Source GND (N-CH only), //need two resistors for a transistor (which includes MOSFET); one small R at the Gate, and the other one resistor at the source v. Compared to BJT which works by current, MOSFET works by voltage. vi. A really cool thing about MOSFETs: 1. They are variable resistors controlled by voltage, which means depending on the voltage applied between the gate and source, the resistance between the drain and source will vary. 2. With a low voltage at the gate, the resistance from the drain to source is very high. It’s kind of like an open switch. 3. As we increase voltage at the gate, we pass a threshold voltage, and then the resistance from the drain to the source drops, and it drops very quickly. 4. The key difference between MOSFETs and BJTs: the output current isn’t a multiplier of the input, because MOSFETs are all about VOLTAGE. 5. vii. RDS-on = Resistance between the Drain and Source 1. Always found in the MOSFET’s datasheet. viii. Not all MOSFETs are logic level compatible, so it is very important to check to see what the VGS threshold is before using it in your circuit. ix. Important to check how hot it is going to get. x. How we calculate if we need a heat sink or not: 1. The formula to determine how much power the MOSFET dissipates: 2. P = R * I^2 3. = Rds * I^2 xi. Workflow to understand and use MOSFET: xii. xiii. Reference: xiv. xv. N-Channel vs. P-Channel MOSFET: 1. N-channel MOSFETs: a. easier to work with, & the most commonly used type. b. TTL compatible c. Has several advantages over the P-channel MOSFET. d. E.g., the N-channel majority carriers (electrons) have a higher mobility than the P-channel majority carriers (holes). i. Because of this, the N-channel transistor has lower RDS(on and gate capacitance for the same die area (integrated circuit area). 2. In a P-channel: a. The source is connected to a positive voltage, b. And the FET will turn on when the voltage on the gate is below the source voltage by a certain amount. (Vgs < 0) c. Vgs = Voltage from Gate to Source 3. Choosing between these two affects the layout of the circuit board. xvi. UPDI = Unified Program and Debug Interface 1. is needed because I’m using ATTINY412, not ATTINY44 or 45 (which uses ISP chip instead(?)) 2. A proprietary interface for: a. external programming and on-chip debugging on a device 3. A successor to the PDI 2-wire physical interface a. (which is found on all AVR XMEGA devices.) Problem 1 -- Solution: Drain VCC, Source GND (N-CH only), //need two resistors for a transistor (which includes MOSFET); one small R at the Gate, and the other one resistor at the source Problem 2 (on the schemetic): When I opened the layout view on Kicad, the speaker footprint did not have any connections to other components. To solve this, I changed the component symbol for speaker from the one that has - and + signs to the one that has and 1, 2 numbers instead of the -/+ symbols. Through the process of solving this problem, I have learned that it is important to check the symbols/numbers on the footprint match with the ones on the symbol. Problem 3: On Sunday, thanks to Craig who came in to the lab on a holiday, I was able to questions that helped me move forward. The main question was about where I should put resistors on the board. In addition to the layout that I used for this week (i needed to put 2 resistors around MOSFET(transistor)), I also learned other two basic layouts that are often used for adding resistors on the board. Questions solved; issues resolved; speed increased. Problem 4: I kind of struggled to get the right values for the capacitor as well as two resistors that I'm using. Because even when I used the formula V=IR, I was not entirely sure if the values I got would be practically used for my board at all. As always, I read through information on the data sheet of the MOSFET (N-CH) that I'm using. But even then I was not sure, so I referred to the hello echo board example image for the capacitor value. This image shows a calculation that I've done, using the values e.g., Gate Threshold Voltage and Current. Problem 5: "Reflow Method" to help me (whose skin has alergetic reaction when soldering) with electronics! 11.5. Source code:¶ int Pin = 2; 11.6. The Fun Discoveries of The Week, && the Questions of the Week 11:¶ 1. Fun Discoveries that I encountered throughout the week 11 are: • Is it meaningless, useless to add Resistor to the GND line, not VCC line? o Because the electrical current exits to, through the GND line anyway? (when they come in from/through the VCC) o Not used commonly • It is useful to write down (with the textbox in Kicad) what each component/part does on the SCK(schematic view). o Mainly for understanding o But also for the future use E.g. the layout of chips/pins is the same always for MOSFET, regulator, etc. You can just copy and paste the whole layout later on when you need. • Sometimes when a component is popular (as in popularly used), multiple manufacturers make it. But the specifications and numbers on the data sheet should be the same. o You can see either data sheet when it has the same model number. (but there could be exceptions where you have to check manually with both/all data sheets). • To calculate the resistor value: o See: Gate-to-Source Voltage Gate Threshold Voltage Current E.g. Gate Threshold Voltage MAX = 2V; Current = 250uA CRUCIAL: you need voltage more than 2V, and current more than 250uA. And your resistor should match with these two factors – making them ‘more than the values written on the data sheet’ Because if you choose a resistor that meets the exact same values of 2V and 250uA, the transistor (in my case this component, but other component(s) in other cases) will continue to switch between on and off, which will cause the whole board to get heated up and burn stuff sooner or later. • To see the capacitor value(storage size?), you do NOT need to calculate. o You rather need to read the recommended value for the component in the data sheet. • Different kinds of resistors: o Pull-up resistor: connects to VCC o Pull-down resistor: connects to GND • CAD • Tube material for the wall – portable – part • Q. PWM – the differences between its function in input and in output? 11.7. Hi Neil -- I watched Neil's talks and interviews:¶ Video 1: Video 2: Video 3: