The following are questions you should be able to answer by the respective weeks in Introduction to Physical Computing. Try to answer all of the questions without resorting to copying external code or diagrams. If you don’t know where to start on a given question, first review the lab and material from the syllabus for the week in question, and then consult with your instructor in office hours. If you plan to discuss the questions with your instructor, fill in the answers in the text fields below and print this page out (or save as PDF) to review with your instructor. There is no submit button, the form fields are only for you to type into for convenience.
Microcontrollers read a variable input using an analog-to-digital circuit inside the controller. The Arduino Uno can read the input voltage with a resolution of 10 bits using the
analogRead() command. Give the numeric range (in base 10) for this resolution. How much memory does this take up?
Two resistors in series create a voltage divider. When one of the resistors is a variable resistor, they can be used to create an analog input to a microcontroller. Describe or draw the schematic for this circuit.
A potentiometer is a variable resistor in which a wiper moves across the surface of the resistor, creating a variable resistance. Describe or draw the schematic for connecting a potentiometer to a microcontroller’s analog input pin.
How can you test the output of an analog sensor before connecting an analog sensor to your microcontroller’s analog input?
Imagine you used
analogRead() to read an analog input. You got a reading of 10. Assume an analog input voltage range from 0 to 5 V. What is the voltage of your reading?
Under the same conditions as the last question, what’s the voltage difference when the reading difference is 1 point? For example, what’s the voltage difference between a reading of 10 and a reading of 11?
Assume the analog input voltage range is 0 to 3.3 volts instead of 5 volts. What are the answers for the previous two questions now?
Most microcontrollers cannot output a true analog voltage. Instead they create a pseudo-analog voltage by producing a series of pulses. What is this principle called? What property of the pulses is the microcontroller changing in order to produce this effect?
The principle described in the previous question is used by Arduino’s
analogWrite() command. What property of the pulses is controlled by the
What is the resolution of the output from Arduino’s
analogWrite() command? Give a decimal numeric range.
Write a program to read an analog input on an Arduino, map the result to the range you just cited, and fade an LED or play a tone on a speaker.