L.O. (Learning Objectives) Week 9:¶ ¶ • Document while learning from interfacing an input device to microcontroller (ATtiny85 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 9 9.0. Notes during the class and workshops:FABLAB¶ Digital, Analog, Logic sensors • Digital: 0 or 1, true or false, left or right (gives us 0-1.5V back) • Analog: a range of values (gives us 0-5Volts back) • Logic sensor: (5V or 3.3V) o If the data sheet is longer than 5 pages, it is logic sensor. o Are logic sensors always 16 bits? Most of the time, but not always. o We need more bits to represent information in detail, which is meaningful information o Digital. (in the realm of digital) aka “fancy digital” • Q. Why bother using digital when we can measure anything with analog? Multisampling • Sampling multiple times • Should average the 100 values • Filters the background noise • Increase the accuracy • E.g. • void knob(){ • pot = digitalRead(A0) + pot; //0-1024 • x ++; // x = x +1 /// x =+ 1; • if(x > 100){ • pot = pot/100; • Serial.println(pot); • x = 0; • } • } Should be testing all the time • Multimeter – when using the sensor for the first time There are libraries that are specific to the sensor (super useful). • Arduino >> Include Library – very useful Other things highlighted during the class and workshops: • Debouncing • Internal pull ups • 12c SDA SCL • Resistor bridges – like a full bridge rect • 4x matched values into a differential • NTC tables • Photo transistors – uses pull up resistor to set again o Synchronous detection pulsing that output light Helpful website for sharing source code: • https://www.codepile.net/pile/KY7OM5Yp Small change in big signal • Safety thing • For 5V, we want to measure between 0 to 5V, not 48 to 50V. Long vs. Int • https://www.google.com/search?client=safari&rls=en&q=long+vs+int&ie=UTF-8&oe=UTF-8 Microbit • Similar to Scratch • https://microbit.org 9.1. Documentation while learning from interfacing an input device to microcontroller (ATtiny85 chosen) and how the physical property relates to the measured results:¶ The overall workflow of the week9: 1. 2. note: The sensor of my choice: • Heartbeat Sensor (or heartrate sensor) -- using infra-red light The sensor of my choice: • Heartbeat Sensor (or heartrate sensor) -- using infra-red light The IR brightness: • The heartbeat sensor that we have in our lab had a brightness dimmer (or worse) than the that of a basic remote control. • Craig helped me check this by using a phone that has a outdated(?) camera lens quality • Therefore, I have decided to make a new heartbeat sensor on my own, using the chips that exist in our lab. • We had everything I need to make this new one with better IR LED chip (emitting brighter light). Comparing two different models for the phototransistor pin (that reads the reflection of the IR light): • I had two options. • Datasheet was super useful! I compared the light wave frequency range graphs on each data sheet for each models :) (problems faced are discussed at the end of the documentation.) 9.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. Kicad design process: *********Important realization of the week 9: I NOW UNDERSTAND HOW KICAD WORKS AND THE STRUCTURE OF KICAD SOFTWARE. ********* 9.3. The programming process/es I used:¶ int ledPin = 2; int sensorPin = 0; double alpha = 0.75; int period = 80; double change = 0.0; void setup () { pinMode (ledPin, OUTPUT); Serial.begin (115200); digitalWrite(ledPin, HIGH); } void loop () { static double oldValue = 0; static double oldChange = 0; int rawValue = analogRead (sensorPin); double value = alpha * oldValue + (1 - alpha) * rawValue; Serial.print (rawValue); Serial.print (","); Serial.println (value); oldValue = value; delay (period); } 9.4. Creating and breaking problems ~~ and how I fixed them:¶ Problem 1 (adding/deleting libraries): • Kicad (design software for CNC machine 'Vantam') was not able to find the footprint libraries that I have already added on Kicad weeks ago. • The same thing happened with the symbols libraries on Kicad. (no screenshot for this) • The cause was that I moved the file location from 'Download' folder to 'Documents' folder, after I added the libraries for the first time weeks ago. Problem 1 -- Solution: 1. Deleted all the libraries on kicad (whose locations were still in Download foler, not Documents folder) -- both the libraries in global and project-specific. 2. Added them again -- but from Documents folder (the new file location on my laptop) this time. 3. Added them to the global library, not to the project-specific library. note: Project-specific libraries are for "project-specific" symbols/footprints, e.g., Infra-red emitter, which is not a basic component/chip on a circuit board. (basic and global goes together, to simply put.) Problem 2 (on the schemetic): • Not an error, but the schemetic had two warnings from the error check screen. • I did not fully understand what the warning message meant, therefore I searched on the internet. "not driven by any pin" Problem 2 -- Solution: • There were many people who have already asked the same/similar questions on the internet or the Kicad online forum. They mostly directed me to the same solution: • Then I added these: • As a result, the overall structure on the schemetic, white screen looks like this: note: the same warning signs remained even after "solving the problem". The only difference in the warning messages were the chip/pin number. After thoroughly checking with the hello board layout and how chips and pins are connected, and asking Craig about it, I concluded these could be ignored at the time. And I did not get any related errors afterwards. Problem 3 (footprint for Phototransistor not found): • When updated the netlist on the layout (black) screen, I got error messages (not simply warnings!). • It was weird to me at first because I carefully checked all the footprint-related information (as it was the part that I struggled the most last time in week 6 or 7.) • Overall, I had these two options for the photogransistor footprint (in global(basic) libraries), and apparently, none of them would work! note: not it was the time for me to add my very first "project-specific library" on Kicad. Problem 3 -- Solution: • The best solution for this is this: 1. Search the model number of the chip on the manufacturer's website (e.g., Kicad) 2. Go to the main page specifically curated for that particular chip 3. FIND "LIBRARY" or any file that ends with ".lib". ... note: Kicad did not have a specific library file for this particular chip. Craig's tip after discussing with me: replace the phototransistor chip symbol with any normal LED chip or any other chip whose size is 1206 (the same size as the initial phototransistor chip). Since the schemetic view is simply for seeing which pin connects to which pin, it does not matter if a chip symbol is replaced by another chip symbol that has the same physical properties, e.g. number of legs, size, etc. Problem 4 (accidentally broke an endmill 0.8 mm): • This happened because I confused the global 'Placement' toolbox on the Ventam software. • I thought (6, 9) = (x, y) was not the default value, and I changed it to (o, o) which I thought was the origin point. • Seokpa explained to me that we have to calculate the shape/size of the bed, and that's why we use (6, 9) as a default value when using Ventam in our lab. Problem 4 -- Solution: • Changed back to (6, 9) = (x, y). And not it works without breaking another endmill. 9.5. Source code:¶ int ledPin = 2; int sensorPin = 0; double alpha = 0.75; int period = 80; double change = 0.0; void setup () { pinMode (ledPin, OUTPUT); Serial.begin (115200); digitalWrite(ledPin, HIGH); } void loop () { static double oldValue = 0; static double oldChange = 0; int rawValue = analogRead (sensorPin); double value = alpha * oldValue + (1 - alpha) * rawValue; Serial.print (rawValue); Serial.print (","); Serial.println (value); oldValue = value; delay (period); } 9.6. The Fun Discoveries of The Week, && the Questions of the Week 9:¶ 1. Fun Discoveries that I encountered throughout the week 8 are: • You don’t need to connect the board/pin to VCC always. • VCC is only able to “turn on” the power • Whereas digital pwm ports/pins are able to do both “turning on” and “turning off” the power. • TX: sends signals from the computer to the chip • RX: receives signals from chip to the computer • Using TX and RX is not the most efficient, o But it’s the easiest • How to make “drawing process (before designing on the schemetic on Kicad)” useful? o Making a drawing note from datasheet – which pin connects to what and what. • Anything 1206 can be replaced by others that are 1206. • It is dangerous to say that someone knows everything or can fix every problem that they encounter – because no one can do it or be a machine! • It is helpful to ask “are you okay?” to that classmate(s) who has not said any word for 15 minutes. It is called ‘collective mental healthcare”. 2. the Questions of the Week 8, I think, are: (note: More interesting questions seem to come up after a hectic, somewhat-unorganized process of experiments. Therefore, I have not researched on these questions written below yet, but I will because they are super duper intriguing! :) ) Q. What is the history behind the evolution of circuit board ever since it was invented/made? Q. What is the difference between a pull-up resister and a resister? Why do we need both kinds of resisters? Q. What is the origin of Sensors in the fields of technology/related fields? Q. What is the exact definition(s) of the sensor? -- interesting how we can separte sensor(output) and input exactly in technology. I've always thought of these concepts as systemetic and interactive between the two. 9.7. Hi Neil -- I watched Neil's talks and interviews:¶ Video 1: Video 2: Video 3: