PC/CP320 Physical Computing: Digital Interaction with the Analog World

This page is being updated for Fall 2017.



Teaching Evaluation Results
Course: CP/PC320ATerranceSturtevantFall2016
4students participated in this survey.
14students were registered in the course.
meandeptall
1This course deepened my understanding of the subject matter. 6.35.65.8
2The content of this course was consistent with the course outline/syllabus. 6.86.06.3
3The course helped me to see how subject matter and/or skills could be applied in other areas. 6.35.55.8
4The course helped me to understand the methods of inquiry, problem solving, and/or creative activity in the area of study. 6.35.55.7
5The course helped me to learn how to analyze information. 6.05.45.7
6The course provided opportunities for me to improve my written, oral, or other communication skills. 5.04.75.5
7The course helped me understand that there is more to learn in this area of study. 6.35.96.1
8The instructor organized lectures in a logical manner. 6.56.56.0
9The instructor had reasonable learning expectations for students in the course. 6.06.05.9
10This course material inspired me to learn more about the subject matter. 6.35.65.5
11Course assignments or project descriptions, including information about requirements, were clear. 6.06.05.7
12The instructor moved through course concepts at a comfortable pace. 6.06.05.9
13The instructor expressed an interest in student understanding when explaining course concepts. 6.86.86.1
14Classroom discussions improved my understanding of the course material. 6.36.35.9
15Course projects and/or assignments provided opportunity for creativity and creative thinking. 6.56.56.1
16The course provided opportunity for me to enhance my problem solving skills. 6.86.85.7
17The instructor encouraged students to be actively aware of their learning throughout the course. 6.86.86.1
18The instructor provided opportunities for me to develop my interest in this subject area. 6.56.55.8
19The instructor provided helpful responses to students' questions and requests for guidance. 5.85.45.9
20The instructor provided opportunities for me to feel engaged in the learning process. 7.05.25.8
21The instructor gave clear explanations. 6.05.25.8
22The instructor displayed an interest in and concern for student learning in this course. 6.55.56.0
23The instructor maintained a respectful learning environment. 7.05.96.4
24The instructor provided feedback on my coursework that helped me improve my understanding. 6.05.05.6




This is the Physics/Computing 320 Lab page, prepared by Terry Sturtevant .
Page last updated Tuesday February 21, 2017
**Items marked this way are not final.**


Introduction

Useful links

Evaluation Methods

Course Material

Week of ... Lab / Lecture Reference Material
[white background indicates required reading;
gray background indicates optional reading]


Sept. 7
Lecture:
  1. Course Introduction: What's the purpose of PC/CP320? [PDF]   [ June 23, 2016 ]
  2. Active Learning Classroom Introduction
  3. Using lab notebooks
    New Information: Lab Notebook summaries   [ January 16, 2017 ]
    Summary checklist   [ January 18, 2017 ]

  4. Overview of Physical Computing   [ September 9, 2015 ]
  5. Block Diagrams [HTML]   [ May 31, 2016 ]


  6. Electrical terminology   [ September 8, 2016 ]
  7. Resistors and resistance   [ February 29, 2012 ]

    colour code humour

    colour code snake humour

  8. Identifying resistor nominal values (ALC exercise)
    doc version
    png version

  9. Resistive sensors   [ October 18, 2016 ]
    force-dependent resistor
    photoresistor
    thermistor
    strain gauge

  10. Digital multimeters   [ May 24, 2012 ]

  11. Review: Breadboards [PDF]   [ May 1, 2012 ]

  12. Online Quiz: Read over the learning objectives for this course.
    Do quiz on MyLearningSpace between 7 a.m. Friday and 11:30 p.m. Sunday evening.
 

Resistance
[© 1995-2003 M. W. Davidson, Florida State University]

Fixed Resistors   [ May 12, 2014 ]
Measuring Resistance   [ January 16, 2017 ]
Measuring Continuity   [ January 16, 2017 ]


Resistor colour coding chart
[PDF; NIC Components, May 2004]

Which Way Does Current Really Flow?

Resistor colour codes: 4- band, 5- band
[GIF; © 1996-2003 Electronix Express]
Resistor colour code: 4, 5, 6 band
[JPG; T. May, University of Colorado]
[PDF 50pp, © Wavetek Meterman, 2000]
Wavetek Meterman 33XR Operator's Manual
[PDF 17pp, © Amprobe,]

MAKE presents: The Resistor
the resistor

Resistors [from PC200]
Resistor colour code: 4, 5, 6 band
[JPG; T. May, University of Colorado]


Sept. 11
Lecture:

xkcd comic

  1. Kirchhoff's laws   [ May 16, 2011 ]
  2. Kirchhoff's laws example   [ March 14, 2012 ]
  3. Voltage dividers   [ October 1, 2012 ]
  4. Application of voltage dividers - internal resistance   [ June 13, 2014 ]
  5. Determining battery internal resistance (ALC exercise)
    doc version
    png version

  6. Single board computer platforms   [ November 23, 2016 ]

    Arduino, Pi model B+
    Arduino, Pi model B
    Pi model A, B, B+
    Pi 2, model B+
    Pi 3, Pi 2, model B+
    Arduino, Pi model B, BeagleBone


Lecture:
  1. Static discharge   [ February 18, 2010 ]

    ESD video (2/4)
    ESD video (2/4)
    ESD video (3/4)
    ESD video (4/4)
    ESD prevention measures
  2. Linux shell command summary
    Note: Linux is case-sensitive, and commands should be in lower case.
  3. Raspberry Pi GPIO pins
  4. Access GPIO from Linux user space

  5. Voltage, current and Ohm's law quiz

  6. Online Quiz: Review proper electrical terminology.
    Do quiz on MyLearningSpace between 7 a.m. Friday and 11:30 p.m. Sunday evening.
  7. Quiz during next week's lecture!

GREAT electricity animations! (includes examples) [Arizona State University 2002]
Electrical Circuits Review [pdf 18pp; B. M. Fleischer] - sections B.1 and B.2.1 

Operating point analysis in CircuitLab [video]
operating point analysis in CircuitLab


Internal resistance of a voltage source [screencast of PDF]
internal resistance of a voltage source
Voltage Divider [© 2000, C.R. Nave, Georgia State University]

Potentiometers [video]
potentiometers

Voltage dividers [video]
voltage dividers


From Electrostatics to ESD [Compliance Engineering, Sept 2000]
 

Measuring DC Voltage   [ January 16, 2017 ]
Measuring DC Current   [ January 16, 2017 ]

Lab bench setup in N2082 [video]
lab bench setup in N2082


Dual DC supplies [video]
dual DC supplies




Ohm's Law [java applet; © W. Fendt, 2003 ]
Voltage Circuit Simulator   [java applet; G. Bothune, UOregon]



MAKE presents: Ohm's Law
Ohm's law


Sept. 18
Lecture:
  1. Review of previous quiz
  2. Show good lab summary from first lab
  3. Function generators   [ October 11, 2012 ]
  4. Oscilloscopes   [ September 20, 2016 ]

    Triggering on an oscilloscope
    oscilloscope triggering
  5. Sketching AC signals   [ April 19, 2011 ]

  6. GPIO access in Python
    Official RPi.GPIO Wiki examples
  7. GPIO access in Python
    Basic python example
    Modified python example
    Broadcom numbering example
    Another Broadcom numbering example
    Another board numbering example
    Python GPIO BOARD and BCM Modes
    Converting BOARD to Broadcom numbering (ALC exercise)
  8. Good Coding Style   [ November 18, 2016 ]

    Programming tips
    documentation- Why magic numbers are evil
    Unnamed numerical constants

    code 
quality

    Coding without comments

  9. Simple DC circuits quiz

Lecture:
  1. Review of previous quiz
  2. Logic gate characteristics - voltage   [ November 16, 2016 ]
    Logic gate characteristics - measuring voltage limits   [ November 20, 2014 ]
  3. GPIO Electrical specifications
    Determining GPIO voltage limits (ALC exercise)

  4. Logic gate characteristics - current   [ September 4, 2013 ]
    Logic gate characteristics - measuring current limits   [ September 4, 2013 ]
    datasheets for SN7400, CD4011UB, 74HC00A

  5. Oscilloscope quiz

  6. Online Quiz: Review Kirchhoff's laws and their application.
    Do quiz on MyLearningSpace between 7 a.m. Friday and 11:30 p.m. Sunday evening.



Logic Gates
logic gates created from discrete components
Measuring Strain with Strain Gages  [© 2016 National Instruments Corporation]
Logic Family Selection Guide


 
Overtones, harmonics, and additive synthesis [video]
overtones, harmonics, and additive synthesis

DC and AC voltage measurements with an oscilloscope
DC and AC voltage measurements with an oscilloscope

Finding the origin on an oscilloscope in XY mode
finding the origin on an oscilloscope in XY mode

Use of a function generator - Part I
use of a function generator (1/2)

Use of a function generator - Part II
use of a function generator (2/2)


MAKE presents: The Oscilloscope
oscilloscopes



Close-up pictures of signal generators we have in the lab:
White case model (Instek GFG-8217A)
Black case model (Wavetek FG3C)
Grey case model (Wavetek FG3B)
Old model (Wavetek 182A)

XYZ's of Signal Sources [pdf 52pp; © 2005, Tektronix, Inc.]

Philips oscilloscope (PM3207)

XYZ's of Oscilloscopes [pdf 64pp; © 2001, Tektronix, Inc.] The Cathode Ray Oscilloscope [pdf 6pp, T. Sturtevant]
TDS1000 and TDS2000 Series Digital Storage Oscilloscopes [© Copyright Tektronix, Inc.]
TDS210 Series Digital Storage Oscilloscopes [© Copyright Tektronix, Inc.]

ABCs of Probes [pdf 48pp; © 2005, Tektronix, Inc.]
Oscilloscope animation (Flash)


Sept. 25
Lecture:
  1. Review of previous quiz
  2. Diodes [PDF]   [ September 9, 2015 ]
    Diode Measurement  [ May 1, 2014 ]

    diode operation humour

  3. Zener Diodes and Photodiodes [PDF]   [ November 10, 2016 ]
    Selecting Zener/photodiode resistors (ALC exercise)
    1N5913B Zener diode, ON Semiconductor; determine resistor for 12V supply
    SFH 229 Photodiode, Osram Semiconductors; determine resistor for 9V supply and 3.3V swing with light

  4. Optical Isolation [PDF]   [ November 10, 2016 ]
    Selecting LED/photodiode resistors for optoisolator(ALC exercise)
    4N26, Fairchild;
    determine resistors for 5v on input and output at least 3V with a 3.3V supply
    determine resistors for 3.3v on input and output at least 4V with a 5V supply
    4N26, Isocom
    4N26, Texas Instruments
  5. Optoisolator breadboard layout [PDF]   [ October 23, 2015 ]
  6. Lab notes (optoisolator)
    scope output
    circuit
    triangle wave output
    increased output resistor value

  7. Capacitors   [ October 9, 2015 ]
  8. Identifying Capacitor Polarity  [ February 4, 2013 ]

Lecture:
  1. Logic gate characteristics - propagation delay   [ November 16, 2016 ]

  2. Logic gate characteristics: Open collector and open drain outputs   [ November 16, 2016 ]
    datasheet for SN7401
  3. Logic gate characteristics: - Tri-state outputs   [ May 20, 2011 ]
    Processor internal architecture
    "Standard" Processor internal architecture
    Z80 system architecture (outside mpu)
    Hyperphysics microprocessor page

    GPIO Electrical Specifications
    Determining GPIO current limits (ALC exercise)
    Find all of the rules governing current limits.

  4. Diode and capacitor quiz

  5. Online Quiz: Review oscilloscope operation.
    Do quiz on MyLearningSpace between 7 a.m. Friday and 11:30 p.m. Sunday evening.


Diode Measurement [screencast of PDF]
diode measurement


MAKE presents: The Diode
the diode



Checking Diodes   [ January 16, 2017 ]
Physics of a Diode [©2003 Marvin Casanova ]

Measuring Capacitance   [ January 16, 2017 ]
How Capacitors Work [© 1998 - 2003 HowStuffWorks, Inc.]
Charging and Discharging A Capacitor [© 1995-2003 M. W. Davidson and The Florida State University]

Identifying Capacitor Polarity [screencast of PDF]
capacitor polarity


MAKE presents: The Capacitor
the capacitor


What is a Tri-state buffer? [© 2003 by Charles C. Lin]

Tristate Buffers
tri-state buffers



Introduction to Wired-OR Outputs and Open-Collector Circuits   [© 2003 National Instruments Corporation]
7401 datasheet   [© 1995 National Semiconductor]

Design Fundamentals for Phototransistor Circuits   [ April 30, 2015 ] [© 2002 Fairchild Semiconductor]
 
  • Lab A: Zener Diodes and Photodiodes  [ November 1, 2016 ]
  • Lab B: Optical Isolators  [ September 22, 2016 ]
    PS2501 datasheet
    Note: Don't take this circuit apart after the lab; you'll be using it later.
  • Postlab Requirements: Show your calculations for the required resistors for the Zener diode and for each optoisolator.



Oct. 2
Lecture:
  1. Review of previous quiz
  2. Introduction to Analog to Digital and Digital to Analog Conversion [PDF]   [ June 24, 2015 ]
  3. Analog to Digital and Digital to Analog Conversion [PDF]   [ June 24, 2015 ]

    A/D converter demonstration [video]
    A/D converter demonstration

  4. Analog and Digital Grounds and Decoupling Capacitors [PDF]   [ October 25, 2011 ]
  5. Identify decoupling capacitors in circuits
    circuit1
    circuit2
    circuit3

  6. Serial Communication-SPI [PDF]   [ November 16, 2016 ]
  7. Determining MAX522 command words (ALC exercise)
    MAX522 SPI digital-to-analog converter
    What needs to be sent (in Hex) to:
    • Shutdown DAC A
    • Shutdown DAC B
    • Load DAC A with a value of 2 (decimal)
    • Load both DACs with a value of 32 (decimal)
    • Shutdown both DACs
  8. Programming tips

  9. Determining MCP3008 command words and data format (ALC exercise)
    MCP3008 SPI analog-to-digital converter
    What change do you need to make to ADC code to have both DAC and ADC connected at the same time?

Lecture:
  1. Inductive Output Transducers [PDF]   [ October 18, 2016 ]
  2. Controlling Output Transducers [PDF]   [ November 10, 2016 ]

  3. Wheatstone bridge circuits   [ October 18, 2016 ]

  4. Wheatstone bridge animation

    electricity humour

  5. Zener diode quiz

  6. Online Quiz: Review op amp introduction
    Do quiz on MyLearningSpace between 7 a.m. Friday and 11:30 p.m. Sunday evening.




Stepper, servo, DC motor control [video]
stepper, servo, DC motor control

Induced EMF demo from MIT [video]
induced EMF demo from MIT

Induced EMF in a motor [video]
induced EMF in a motor

What is a solenoid valve? [video]
solenoid valve


How do servos work? [video]
how servos work


MOSFET tutorial [video]
MOSFET tutorial

Transistor as a switch [video]
transistor as a switch

SSRs Technical Information [PDF 8pp; © Copyright Matsushita Electric Works, Ltd.]
Solid State Relays [PDF 5pp; Vishay, 2001]


Wheatstone Bridges: Introduction [©2003 eFunda; Engineering Fundamentals]
Wheatstone Bridge Animation [screencast of animation]
Wheatstone bridge

Measuring Strain with Strain Gauges [©2005 National Instruments Corporation]

 
 

Optoisolator simulation [video]
optoisolator simulation


Analog Optical Isolators VACTROLS® [©1998-2004. PerkinElmer, Inc.] Sensors and Signal Conditioning Overview  [ December 19, 2011 ]
Solenoid Catalog [ © 1999, 2000 Magnetic Sensor Systems ]


Animations:

READING WEEK

Oct. 9 READING WEEK - No lecture or labs


Oct. 16
Lecture:
  1. Review of previous quiz
  2. Operational Amplifier Basics [PDF]   [ October 4, 2016 ]

    Rails of an operational amplifier [video]
    op amp rails
  3. Reading data sheets   [ October 5, 2015 ]
  4. Reading data sheets   [ October 7, 2013 ]
    sample datasheet (Fairchild)
    sample datasheet (National Semiconductor)
    sample datasheet (International Rectifier)
    sample datasheet (Photonic Detectors)
  5. Noting variation in naming conventions (ALC exercise)
    sample 1
    sample 2
    sample 3
  6. Operational Amplifier Circuits [PDF]   [ September 4, 2014 ]
  7. Sketching amplifier output [PDF]   [ September 7, 2013 ]
  8. Practice op amp quiz
Lecture:
  1. Operational Amplifier Dynamic Response [PDF]   [ October 9, 2015 ]
  2. Negative Feedback in Operational Amplifiers [PDF]   [ July 29, 2013 ]
  3. Neat animations of op amp circuits

  4. Sketching op amp circuit output (ALC exercise)
    circuit 1

  5. Signal Conditioning [PDF]   [ October 9, 2012 ]

  6. Operational Amplifier Circuit quiz

  7. Online Quiz: Review optoisolator operation.
    Do quiz on MyLearningSpace between 7 a.m. Friday and 11:30 p.m. Sunday evening.





Analog computers [video]
analog computers


Op amp tutorial [video]
op amp tutorial

Low pass filter operation [video]
low pass filter operation


 

Four bus breadboards [video]
four bus breadboards




Op amps compared (including open collector) [video]
op amps compared (including open collector)


Oct. 23
Lecture:
  1. Review of previous quiz
  2. Serial communication (UART)
    Serial Communication-UART [PDF]   [ November 16, 2016 ]

    If using serial (i.e. UART) sensors, you need to turn off the serial console and feed both signals through the appropriate optoisolatrs (to and from the Pi). To turn off the serial console:
    sudo rpi-serial-console disable
    To turn on the serial console:
    sudo rpi-serial-console enable


  3. I2C interface
    Serial Communication-I2C [PDF]   [ November 16, 2016 ]
    Devices come with a default address programmed in, but it can usually be changed.

  4. Response-time sensors; shaft encoders and ultrasonic sensors
    Pulse Width Modulation Communication [PDF]   [ July 28, 2016 ]

    Note: On the Raspberry Pi 2, there are 4 possible PWM pins:
    • GPIO 18 (using PWM0, so same as GPIO 12)
    • GPIO 12 (using PWM0, so same as GPIO 18)

    • GPIO 13 (using PWM1, so same as GPIO 19)
    • GPIO 19 (using PWM1, so same as GPIO 13, and also is MISO, so won't be available if SPI1 in use)

    Project components - SR04 Ultrasonic range finders

    SR04 ultrasonic distance sensor signals


    Project components - DUR5200 Ultrasonic range finders

    DUR5200 ultrasonic distance sensor signals



  5. Sensor and actuator inventory   [ November 8, 2016 ]

  6. Block Diagrams [HTML]   [ May 31, 2016 ]


  7. Project components - voltage regulators

    voltage regulators


  8. Output transducer quiz

Lecture:
  1. Review of previous quiz
  2. Code Style Checklist [PDF]   [ January 18, 2017 ]

  3. Row-Column Devices [PDF]   [ November 23, 2015 ]
    Wiki sections on "more than one channel" and "several channels"

  4. Single Wire Communication
    Single Wire Interfaces [PDF]   [ July 25, 2016 ]


  5. Integration Project checklist [PDF]   [ October 28, 2016 ]


  6. Other Analog Sensors [PDF]   [ October 13, 2016 ]
  7. Sensor and actuator inventory   [ November 8, 2016 ]
    If using serial (i.e. UART) sensors, you need to turn off the serial console and feed both signals through the appropriate optoisolatrs (to and from the Pi). To turn off the serial console:
    sudo rpi-serial-console disable
    To turn on the serial console:
    sudo rpi-serial-console enable
  8. Design as a process
    Practical design example [PDF]   [ June 23, 2016 ]


  9. Online Quiz: Review op amp circuits.
    Do quiz on MyLearningSpace between 7 a.m. Friday and 11:30 p.m. Sunday evening.


ADC and DAC Glossary [HTML; PDF] [Dallas Semiconductor, 2000]

A/D converter simulation [video]
A/D converter simulation




Normal servo operation - effect of pulse width [video]
servo motor control


Continuous rotation servo - effect of pulse width [video]
servo motor control (continuous rotation)

Servo Operation and Calibration LM7805 Voltage regulator
LM7805 Voltage regulator datasheet (includes TAB package)
Basic Circuits - Bypass Capacitors [K. Ross, Seattle Robotics Society, 1997]
Circuit Integrity - Bypassing [© 2002 Williamson Labs]
Circuit Integrity - Decoupling [© 2001 Williamson Labs]

How a smartphone knows up from down
How a smartphone knows up from down


 



Oct. 30
Lecture:
  1. Bit banging [PDF]   [ October 31, 2016 ]
    Bit banging on Wikipedia
    latency problem
  2. Interrupts and threading [PDF]   [ November 1, 2016 ]
    Interrupts on Wikipedia
    Threading on Wikipedia
    Interrupts on the Raspberry Pi with Python
  3. Pigpio libraries
    These use a daemon process running in a separate thread to bit-bang more ports.

  4. Java on Raspberry Pi
    Pi4J Project GPIO access in Java for the Raspberry Pi

  5. Bluetooth
  6. Near Field Communication (NFC) and RFID
    PN532 module

  7. Arduino and the Wiring language
    Arduberry Arduino-compatible Raspberry Pi interface board
  8. Firmata protocol
    Firmata on Raspberry Pi

  9. Fritzing design software

  10. Exploration Project checklist

Lecture:
  1. Internet of Things [PDF]   [ October 20, 2015 ]
    "Hackers used 'internet of things' devices to cause Friday's massive DDoS cyberattack" - AP, Oct 22, 2016

  2. Integration project preparation
  3. Exploration project preparation

  4. Online Quiz: Review analog output transducers and controlling power.
    Do quiz on MyLearningSpace between 7 a.m. Friday and 11:30 p.m. Sunday evening.




 



Nov. 6
Lecture:
  1. Drones
No Thursday lecture; work on project
  No lectures; work on project
  • Integration project work
    All digital inputs and outputs must go through optoisolators!

Component Inventory


Nov. 13
No lectures; work on project
Deliverable (Thursday): Choice of Exploration project topic

Exploration project (proof-of-concept) list
 
  • project work


Nov. 20
No lectures; work on project
Deliverable (Thursday): Integration Project demonstration and report
Integration Project checklist [PDF]   [ October 28, 2016 ]


 
  • Try out unfamiliar sensor, actuator, or interface
    All digital inputs and outputs must go through optoisolators!
    Unfamiliar interfaces:
    • I2C (with sensors)
    • Graphics and mouse (with user)
    • Audio (with user)

    Unfamiliar sensors or actuators: Any you haven't used in the lab
    If using serial (i.e. UART) sensors, you need to turn off the serial console and feed both signals through the appropriate optoisolatrs (to and from the Pi). To turn off the serial console:
    sudo rpi-serial-console disable
    To turn on the serial console:
    sudo rpi-serial-console enable


  • project work


Nov. 27
No lectures; work on project
On-line Course Evaluation November 29

 
On-line Course Evaluation November 29
  • project work
 



Dec. 4
 
  Preliminary Exploration project video or screencast in lecture
Exploration project demonstration in lab -- Dec. 6
Deliverable: Demonstrate Exploration project prototype

Documentation and final video due Dec. 8
Exploration Project checklist [PDF]   [ October 28, 2016 ]
 

Resources

To view pdf documents, you can download Adobe Acrobat Reader .
get Acrobat Reader
If you need to update a browser, you might try Firefox which is Get Firefox!
Since this page uses cascading style sheets for its layout, it will look best with a browser which supports the specifications as fully as possible.

If you are looking for an office package, with a word processor, spreadsheet, etc., you might try LibreOffice which is Get LibreOffice!

Go to the main page for the Department of Physics and Computer Science.

Valid XHTML 1.1

Valid CSS!

WCAG
2.0
(Level AA)

Wilfrid Laurier University