ECE 102 Engineering Computation Chapter 11 LabJack Photo Resistor & Mechanical Switch Interface Dr. Herbert G. Mayer, PSU Status 9/2/2015 For use at CCUT Fall 2015
Syllabus LabJack HW Overview LabJack Features LabJack HW Control Input & Output Channels Digital Input Output\Analog Input Analog Output Summary
2 Photoresistor A photoresistor, or photocell, is a semiconductor device whose resistance depends (inversely) on the incident light intensity. Symbol: illumination increases resistance decreases
3 Connect photoresistor to analog FIO channel LabJack AIN Sense VS RpRp V in You need to add the external resistor R. R Read AIN: LabJack AIN Sense VS RpRp V in R ← OR → Read AIN: Issues: AIN range is 0 to V Sensitivity of response depends on R
4 Mechanical Switch A switch is a component that can interrupt or divert electric current in a circuit. Symbol: Mechanical switches have “contact bounce”. Courtesy of Wikimedia Commons SPST SPDT Pushbutton
5 In the lab exercises and project, a mini push button switch (SPST, momentary ON) is used. Switch Input → Left two pins are internally connected together (same node) Switch Output → Right two pins are internally connected together (same node ) Schematic view 1
6 Connect switch to digital FIO channel: SW pushed → V in = 0 V Digital value read is 0. SW released → V in = +3.3 V Digital value read is V Sense 100K Ω LabJack FIO Internal circuit – You do not need to build this. SW Assume switch is normally open. V in Read FIO: If 0 → SW pushed (ON) If 1 → SW released (OFF)
7 Connect switch to analog FIO channel (AIN): SW pushed → V in = 0 V SW released → V in = VS Threshold value = VS / 2 LabJack AIN SW Assume switch is normally open. Sense VS 1K Ω V in You need to add the external pull-up resistor. Read AIN: If V in < VS / 2 → SW pushed (ON) If V in ≥ VS / 2 → SW released (OFF)
8 What if there are not enough FIOs available to support multiple switches? Example: Connect three switches to a single FIO channel on the LabJack. → Configure the FIO for analog input (AIN) and connect the switches to a voltage divider network. AIN LabJack VS R up R1R1 R2R2 SW 0 SW 1 SW 2 V AIN