Download Detailed Course Lectures (PowerPoint file)

Document related concepts

Islanding wikipedia , lookup

Immunity-aware programming wikipedia , lookup

Stray voltage wikipedia , lookup

Control theory wikipedia , lookup

Brushed DC electric motor wikipedia , lookup

Current source wikipedia , lookup

Alternating current wikipedia , lookup

Rectifier wikipedia , lookup

Ohm's law wikipedia , lookup

Mains electricity wikipedia , lookup

Voltage optimisation wikipedia , lookup

Stepper motor wikipedia , lookup

Two-port network wikipedia , lookup

Integrating ADC wikipedia , lookup

Voltage regulator wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

Oscilloscope history wikipedia , lookup

Power electronics wikipedia , lookup

Control system wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Variable-frequency drive wikipedia , lookup

Buck converter wikipedia , lookup

Schmitt trigger wikipedia , lookup

Pulse-width modulation wikipedia , lookup

Analog-to-digital converter wikipedia , lookup

Opto-isolator wikipedia , lookup

Transcript
Scientific and Industrial Instrumentation
Spring 2017
WELCOME!
Instructor: Dan Wolf
[email protected]
[email protected]
http://web.acd.ccac.edu/~dwolf/
Revised: 4/18/2017
1
Week #1 - Introduction
Agenda :
1. Introductions
2. Course Formalities
Lab Assignment:
MIT240_Unit1 - Oscilloscopes-Meters-Strain Gages
2
Course Introduction
Decision and
Control
OUTPUT
INPUT
This course presents techniques of measuring physical quantities
through electronic transducers. Electronic circuits used to convert
these signals to appropriate voltages are presented. Techniques for
electronic signals to control physical systems through both analog
and digital computers are also covered.
Considerable focus will be on the student’s ability to interface and
use instruments and sensors with less focus on designing circuits.
3
Today’s Instrumentation
Technology and Applications
The Silicon Labs Thunderboard
Sense is billed as a "feature
packed development platform for
battery operated IoT applications.
The mobile app enables a quick
proof of concept of cloud
connected sensors. The multiprotocol radio combined with a
broad selection of on-board
sensors, make the Thunderboard
Sense an excellent platform to
develop and prototype a wide
range of battery powered IoT
applications.“ $36
4
Attribution and Credit
This class will not require the purchase or use of a traditional text book. I will instead
provide internet links to both required and optional reading material. It is the
student’s responsibility to keep up with the reading material. I will not be printing this
material nor will I be providing downloadable copies.
In particular, the following websites contain material which has been significantly
referenced in the labs and lectures of this class. They are great sources of
information!
www.AllAboutCircuits (You can download the textbook from the Education section)
www.Sparkfun.com
www.AdaFruit.com
General Electronic Tutorials:
http://www.learningaboutelectronics.com/
http://www.explainthatstuff.com/
www.electronics-tutorials.ws
5
Basic Information Reference Sites
These are good introductory reference sites to learn about various topics. You can
also just do a “Google Search” and are likely to find many others.
Many electronic tutorials: www.electronics-tutorials.ws
Downloadable Electronic Text Book: www.AllAboutCircuits
Circuit Tutorials: https://learn.sparkfun.com/
Circuit Tutorials: https://learn.adafruit.com/
Learning about Electronics: http://www.learningaboutelectronics.com/
Explain That Stuff: http://www.explainthatstuff.com/
“If you can’t find what you want on the internet then you didn’t look hard enough!”
6
But beware of: “It must be true, I read it on the internet.”
“Text-Book” Reading Material
Required:
Industrial Instrumentation and Control: An Introduction to the Basic
Principles:
a) http://www.allaboutcircuits.com/technical-articles/instrumentation-andcontrol-an-introduction-to-the-basic-principles/
b) https://learn.sparkfun.com/tutorials/voltage-current-resistance-and-ohmslaw
c) https://learn.sparkfun.com/tutorials/how-to-use-a-multimeter
Optional:
7
Prior-Experience Evaluation
This is a very quick NON-CREDIT pre-test to allow me to
understand your current knowledge and capabilities.
Using the three electronic components, draw a schematic that will
allow the switch to energize the +5volt coil of the relay so that it
turns on the +24volt lamp.
+5V
COMMON
24V Lamp
Coil
NC
NO
8
Student Information
1. Name
2. Student ID Number
3. Phone Number
4. Alternate Phone Number
5. Do you have any hardware or electronics experience?
What areas?
6. What is your major? Is your major a 2 or 4 year program?
7. What do you already know? Word, Excel, PP, Mathcad, HTML
8.c. What is your expected graduation date?
9. Your EMAIL address
9
Introductions
1. Introduction to the Instructor
2. Student Introductions
a) Name
b) Where do you work or what is your degree?
c) Why are you taking this class?
10
Administrative Information
1. Grading
2. Syllabus
3. Questions?
11
Unit / Lab Assignments
Lab #1 Oscilloscopes, Meters, & Strain Gages
2) Lab #2 Load Cells
3) Lab #3 Relays and Motor Control
4) Lab #4 Timers and PWM
5) Lab #5 Optocouplers
6) Lab #6 Sensors
7) Lab #7 Analog to Digital
8) Lab #8 Op-Amps
9) Lab #9 Thermocouples
10) Lab 10 Open/Closed Loop Control (TBD, may be canceled)
11) Lab 11 Pneumatic Control (TBD, may be canceled)
1)
12
Mini-Assignment
Register for one or more of these newsletters and turn in a
copy of an email newsletter with your name on it.:

www.allaboutcircuits.com
(select “Join” in the upper-left corner)

www.controldesign.com/
(select “Register” in the upper-left corner)

http://www.ganssle.com/tem-subunsub.html
13
Maximize Your Time
Do not get behind !
You will need the entire scheduled class time each week
14
Mini-Assignment #1 – due next week
Questions to ask of two other students:
1) Name
2) Degree
3) Name of Pet, hobby, or interest.
4) Employment
5) What do you want to learn from this class?
15
Lab Guidelines
1. Lab work should be in teams of two whenever
possible.
2. Each student should alternate as the “lead” for the
hardware and “lead” for the software.
• If you allow your partner to do most of the
software or hardware, you will be cheating
yourself out of the learning experience.
3. You will work on Lab#1 tonight.
16
Neatness counts
Make sure your connections, wire routing, and equipment
placement is neat and organized!
Bad
Good
17
Lab #1 Hardware Interface Document
1. Lab #1 – Figure #4, Strain Gage
2. Lab #3 – Figure #3, Motor Control
3. Lab #4 – Figure #2, Astable 555
Figure #3, Monostable 555
4. Lab #5 – Figure #4a, Motor Drive Optocoupler
Figure #4b, Optocoupled Level-Shifter
Experiment #3 Schematic, Switch controlled Scorbot input
5. Lab #6 – Experiment #1, Figure #1 with Proximity Sensor
Experiment #1, Figure #1 with Photo-Electric Sensor
6. Lab #8 – Figure #1, 741 Inverting Amplifier
Figure #2, 741 Non-Inverting Amplifier
7. Lab #9 – tbd
8. Lab #10 - tbd
18
Motivational Comment
Equipment problems and uncertainties are undesired
but normal in industry. Engineers and technicians are
paid to “out-think” the problems and then provide
solutions while staying focused and (realistically)
optimistic.
You will experience problems and unknowns during
the lab experiments.
Don’t give up and ask for help!
19
Two methods of interfacing to a digital input
5uA Current flow
What size resister is required?
Input impedance is 1M ohm so when the switch is open, the input will
source up to 5uA thru the resister (5V/1M = 5uA).
5uA * 1K = 5mV which is well below the input threshold of 0.5 Volt for a
logic low.
20
Digital Input may or may not include internal
pull-up resisters
+5V
THIS WILL NOT WORK
BECAUSE THE BS DOES
NOT HAVE INTERNAL
PULL-UP/DOWN
RESISTERS!
THIS WILL WORK IF THE INPUTS
HAVE INTERNAL PULL-UP
RESISTERS.
+5V
Basic Stamp
Input
Device which
includes internal
pull-up resisters
P8 Input
Gnd
21
Digital Output Driving an LED
Part 1
Vdd, NOT Vin.
Connected on P8
Low

In this configuration a LOW, or 0V, at P8 will allow current to flow from
Vdd (+5V) through the LED and then to ground (thru P8). When P8 is
HIGH (+5V), no current will flow and the LED will not light. The LED is
Active Low.
22
Digital Output Driving an LED
Part 2

High
Another configuration that could be used is to have the LED
Active-High. In this configuration the LED will light when the
output is HIGH, or +5V. Current flows from the 5V output on P8
to ground or Vss (0V).
The 220 resistor will limit current flow to
approximately 20mA . The output current
from a BS2 pin should be limited to 20mA
maximum. The maximum current for an
LED is generally 30mA.
23
Digital Input Connected to an
Active-Low Switch

Connect a push-button switch to P10 on the Basic Stamp
 The push-button is a momentary normallyopen (N.O.) switch. When the button IS NOT
pressed (open), P10 will sense Vdd (5V,
HIGH, 1) because it is pulled-up to Vdd.
 When PB1 IS pressed (closed), P10 will sense
Vss (0V, LOW, 0) making it Active-Low.
24
Digital Input Connected to an
Active-High Switch

Another configuration that could have been used is shown here.
Notice that the position of the switch and resistor have been reversed.
– When the button IS NOT pressed (open), P10 will sense Vss (0V, LOW,
0) because it is pulled-down to Vss.
– When PB1 IS pressed (closed), P10 will sense Vdd
(5V, HIGH, 1) making it Active-High.
The BASIC Stamp has uncommitted inputs. That is,
when an I/O pin is not connected and acting as an
input, it cannot be assured to be either HIGH or LOW.
Pull-up and pull-down resistors are needed to commit
the input to the non-active (open) state for switches.
The 1K resistor is used to prevent a short-circuit
between Vdd and Vss when the switch is closed.
25
Free Schematic and Flowchart Tools
1.
www.digikey.com/designtools
a) Scheme-iT – Schematic and Flowchart tool
b) PartSim – Circuit Simulation
c) PCBWeb – CAD application for designing & manufacturing
electronics hardware
d) Quadcept – PCB layout
2.
AutoDesk (AutoCAD) – Free as a CCAC Student
26
The End
27
Week #2 – Load Cells
Agenda :
a) Questions from last week?
b) Strain Gauges
c) Load Cells
DID YOU READ LAST WEEKS ASSIGNMENTS?
Lab Assignment:
MIT240_Unit2 - Load Cells
28
Unit #1 Practice Problems
Questions?
Review?
29
Load Cell Industry Example
http://www.futek.com/application
/load-cell/Automation-ContainerFilling
30
“Text-Book” Reading Material
On-Line Reading Material:
Required:
http://www.sensorland.com/HowPage002.html
Optional:
http://www.electronics-tutorials.ws/blog/wheatstone-bridge.html
http://www.allaboutcircuits.com/textbook/direct-current/chpt-9/strain-gauges/
31
Strain Gage Visualization
Strain Gauge demonstration:
http://www.rdpe.com/ex/hiw-sglc.htm
32
Strain Gauge Fundamentals
Decrease
33
Strain Gauge Fundamentals
 Accuracy will typically be 0.1% to 1.0%
 Sensitivity will typically be 2mV/Vex (so 10Vex will yield a
maximum of 20mV output. i.e. the slope of the data curve
 Offset Error: Voltage measured when the measurement is
zero.
 Full-scale (Gain) Error: difference between the ideal
voltage and the actual voltage when the measurement is at
maximum.
 Drift: change of the output as the temperature varies.
34
 Non-linearity: A deviation of the output curve from a straight
line.
Measurement Errors
Gain
Error
NonLinear
Ideal
Offset
Error
35
Accuracy versus Precision
36
Resolution Versus Sensitivity
Resolution is the smallest unit of measurement that can be
indicated by an instrument.
Sensitivity is the smallest amount of difference in quantity
that will change an instrument's reading.
A measuring tape for example will have a resolution, but
not sensitivity.
37
Quarter Bridge Strain Gauge Circuit
The output voltage is:
𝑅𝑥
𝑅𝑏
𝑉𝑜 =
−
∗ 𝑉𝑖𝑛
𝑅𝑐 + 𝑅𝑥 𝑅𝑎 + 𝑅𝑏
38
Quarter-Bridge Strain Gauge Circuit
The output voltage is:
𝑅𝑥
𝑅𝑏
𝑉𝑜 =
−
∗ 𝑉𝑖𝑛
𝑅𝑐 + 𝑅𝑥 𝑅𝑎 + 𝑅𝑏
39
Half-Bridge Strain Gauge Circuit
The output voltage is:
𝑋
𝑉𝑜 = 𝑉𝑒𝑥 ∗
2
Where:
Vo = bridge output voltage
Vex = excitation voltage applied to the bridge
CRx
X = relative change in resistance,
R1
If the 2nd Strain Gauge is not
loaded then it compensates for
temperature effects.
If it is loaded then it also doubles
the sensitivity.
40
Load Cells (Strain Gauge Applications)
41
Practice:
Quarter-Bridge Strain Gauge Circuit
Given the quarter-bridge circuit shown, assume Vin =
12V, Ra=Rb=Rc equal 350Ω and the strain gauge, Rx,
has a value of 350.8Ω. What is the value of Vo?
42
Practice:
Half-Bridge Strain Gauge Circuit
The output voltage is:
𝑋
𝑉𝑜 = 𝑉𝑒𝑥 ∗
2
Where:
Vo = bridge output voltage
Vex = excitation voltage applied to the bridge
CRx
X = relative change in resistance,
R1
Given the half-bridge circuit shown, assume Vin = 11V, R1=R3 equal
350Ω and the strain gauge, Rx, has a value of 350.1Ω (the second strain
gauge will have a value of 349.9 since it is mounted on the opposing side
of the beam). What is the value of Vo?
43
Lab Reports - An Overview
The title page should include your name, chapter# and lab title.
Software printouts and schematics may be referenced in the
text.
Discuss as many of the new lab concepts as possible.
Optional work is highly encouraged and required for grades
above 89%.
One of the worst things to do is get behind on the labs.
Additional grading details are explained in the syllabus.44
Lab Report Format
INTRODUCTION:
Provide an overview of the topics that are involved in the lab.
BODY:
List and discuss each experiment.
Include data and explain/discuss your calculations.
Optionals should be identified.
CONCLUSION:
Summarize each new instruction or concept.
PRINTOUTS:
Include software, hardware and layout diagrams.
45
Lab Report Schedule and Grading
• Lab reports are due two weeks after the last
work night for that lab.
• I require a majority of the labs before I will
grade them.
• I will return the graded labs to you the week
after I grade them.
• You must inform me in advance if your lab
report will be late.
46
Spell & Grammar Check Reminder
Are you using MS-Word for your labs?
Are you using the Spell Checker and Grammar
Checker?
To Configure:
Tools | Options | Spelling and Grammer
To run:
F7
47
The End
Please read Chapter 2 prior to the class next week.
48
Week #3 – Relays and Motor Control
Agenda :
1.
2.
3.
Lab Assignments are due
Relay Interfacing
Motor Control
On/Off Control
Forward/Reverse Control
Electrical Isolation
Lab Assignment:
MIT240_Unit3 - Relays and Motor Control
49
Unit #2 Arduino Calculations - Graph#1
Y = mX + b
so Weight = m*(RawA-D) + b
Slope = 𝒎 =
10−0
654−341
=
10
313
= 𝟎. 𝟎𝟑𝟏𝟗𝟓
10 = 0.03195*(654) + b so b = -10.895
Weight = 0.03195 * (RawA-D Value) - 10.895
Actual Lbs
RAW A-D Value
Voltage
4.88mV * Raw A-D
Measured Lbs
0
341
1664.08
0.016
2.2
410
2000.8
2.52
10
654
3191.52
10.42
50
Unit #2 Arduino Calculations - Graph#2
Y = mX + b
so Voltage = m*(RawA-D) + b
Slope = 𝒎 =
3191.08−1664.08
654−341
=
1527.44
313
= 𝟒. 𝟖𝟖
3191.52 = 4.88*(654) + b so b = 0
Voltage = 4.88 * (RawA-D Value) + 0
Actual Lbs
RAW A-D Value
Voltage
4.88mV * Raw A-D
Measured Lbs
0
341
1664.08
0.016
2.2
410
2000.8
2.52
10
654
3191.52
10.42
51
Lab Unit #2 Cost Evaluation
Discrete components versus Arduino: which is more cost
effective?
Arduino: $24.95
Load Shield: $19.95
Load Cell: $7.00
Strain Gauge: $1.08 each (Qty=2)
Resisters: $0.40 each (Qty=2)
Power supply & wire
52
Unit #2 Practice Problems
Most instrumentation efforts involve both software and
hardware so understanding both will significantly increase
(double) your value to the organization.
Questions?
Review?
53
System Diagram for Industrial
Automation Motor Control and Drives
Power Management
AC/DC
DC/DC
EiceDRIVER TM
Gate Driver
Inverter
Indicati o n
Maintenanc e
Interface &
Indus tri al
Autom ati o n
Netwo rk
M
3-Phase
Status
USB,
SDMMC,
Serial COM,
CAN &
Ethernet
XMC
Micro c ontroll er
Current Sensing
(Isolated and non-i sol ated with ADC and DSD)
Current Sensing
(Isolated and non-i sol ated with ADC and DSD)
Encoder and Resol v er Interfac e
Resolver Carrier Pattern Generation Interface
Legend
Pow er
Sensor
Microcontroller
Peripherals
Security
Other Product s
54
http://www.infineon.com/
“Text-Book” Reading Material
On-Line Reading Material:
Required:
http://www.allaboutcircuits.com/textbook/digital/chpt-5/relay-construction/
http://www.electronics-tutorials.ws/io/output-interfacing-circuits.html
https://learn.sparkfun.com/tutorials/transistors (repeat from previous week)
Optional:
Motor Control Video Lessons (15 minutes):
http://www.infineon.com/cms/media/Applications/motorcontrol/motorcontrol/index.htm
http://www.allaboutcircuits.com/textbook/digital/chpt-5/time-delay-relays/
http://www.allaboutcircuits.com/textbook/digital/chpt-5/protective-relays/
http://www.allaboutcircuits.com/textbook/digital/chpt-5/solid-state-relays/
https://www.allaboutcircuits.com/technical-articles/fet-vs-bjt-vs-igbt-whats-the-right55
choice-for-your-power-stage-design/
Transistor Theory (refresh)
Assume:
Base-Emitter Voltage = VBE = 0.6V
Collector-Emitter Voltage = VCE = 300mV
2N2222 Gain = hFE = 50
Ibase = (5V - VBE) / 330 ohm = 13mA
Icollector_maximum = Ibase * hFE = 13mA * 50 = 650mA (max)
IR2 = (12V - VCE) / R2 = (12 – 0.3) / 50 ohm = 234mA
+12 V
R2 = 50 ohm
R1 = 330 ohm
+5 V
2N2222
56
Relay Construction
57
BTA1-2C 12V Relay
DPDT – Double Pole, Double Throw
N.O. – Normally Open Contacts
N.C. – Normally Closed Contacts
Contacts are rated for 10A at 120VAC
+12V Coil
The datasheet for this is located on the class website.
58
Relay Types
 “Typical” Relays
a) SPST – Single Pole, Single Throw
b) SPDT – Single Pole, Double Throw
c) DPDT – Double Pole, Double Throw
 Time-Delay Relays – May delay on energization, de-energization, or both.
 Protective Relays – Monitors a value and acts as a Circuit Breaker
 Solid State Relays – No moving parts to wear out
Note: These are the
contact diagrams. The
relay diagram must
include both the coil
and contact diagrams.
59
Back-EMF Diodes (Fly-Back diode)
“Normal” On Operation. Assume the
resister is really a transistor driver.
The Diode shunts the
current and voltage
overload, thus
preventing damage to
the resister (transistor).
The field collapsing will induce an
increased current/voltage across the
resister that is greater than the power
supply.
60
Manual Switch Controlled Motor
+V
+V
BTA1-2C 12V coil
relay 12A @ 120VAC
8
1
120Vac
Supply
2
+
Motor
-
7
4
6
5
Motor
3
Use Pin 4 , N.C. to turn the Motor OFF
when the switch is closed.
Use Pin 3, N.O. to turn the motor ON
when the switch is closed.
61
Low Voltage Motor On/Off Control
+12V
Red
M
1N4001
Controlling
Instrument
Orange
Digital Output
0V = Off
+5V = On
2K ohm
Green
2N2222
Black
Ground
Power
Supply
Ground
62
Transistor – Relay Driver Circuit
Low voltage digital output is driving a high voltage motor.
The relay provides electrical isolation between the two circuits.
The Diode across the relay coil protects the output transistor from “back
EMF” that occurs when the relay coil is de-energized.
BTA1-2C 12V coil
relay 12A @ 120VAC
+12V
4
120Vac
Supply
5
2
Motor
1
2N2222
Hfe = 50
Digital
Output
0V = Off
+5V = On
8
7
3
6
2K ohm
63
Motor Forward/Reverse Circuit
Motor Forward/
Reverse Logic
M
BTA1-2C 12V coil relay
12A @ 120VAC
1
2
7
3
8
4
6
5
+12V
Gnd
64
Combined Motor Control Circuit
Forward/Reverse Motor Control
0V = Forward
+5V = Reverse
On/Off Motor Control
0V = Off
+5V = On
M
1
8
Motor
2N2222
Hfe = 50
Direction
1
+12V
2
Conveyor Belt
+12V
Red
2
+12V
Red
8
7
3
4
6
Orange
Green
2K ohm
2N2222
Hfe = 50
7
3
4
6
5
Black
Orange
Green
2K ohm
Black
65
5
The End
66
Week #4 – 555 Timers and PMW
Agenda :
1.
2.
3.
4.
555 Timers
Bistable
Monostable
Pulse Width Modulation (PWM)
Lab Assignment:
MIT240_Unit4 - Timers and PWM
The reading material listed in Lab Unit#4 is incorrect.
67
“Text-Book” Reading Material
On-Line Reading Material:
Required:
http://www.sentex.ca/~mec1995/gadgets/555/555.html
http://www.engin.swarthmore.edu/~ejaoudi1/datasheets/555
http://www.ocfreaks.com/pulse-width-modulation-pwm-tutorial/
Optional:
How to Build a 555 Timer Monostable Circuit:
http://www.learningaboutelectronics.com/Articles/555-timer-monostablecircuit.php
How to Build a 555 Timer Bistable Circuit:
http://www.learningaboutelectronics.com/Articles/555-timer-bistablecircuit.php
68
Oscilloscope Lab Review
1. Set up the voltage and time scales so that you use most of the display this will allow for a better measurement.
2. Assuming a 10Volts P-P sine wave:
The oscilloscope will show the Vp (5Volt) and Vp-p (10Volt)
The multimeter will show the Vrms value (0.707 * Vp = 3.5Volt)
3. Assuming a 0 to 10Volts square wave AND assuming a zero volt offset
AND assuming Thigh = Tlow:
The oscilloscope will show the 0 to 10Volt signal
The multimeter will show the Vrms value (0.5 * Vp = 0.5 * 10Volt = 5Volt)
4. Assuming a -5V to +5Volts square wave (10 Vp-p ) AND assuming a -5 Volt
offset AND assuming Thigh = Tlow:
The oscilloscope will show the -5V to +5Volt signal
The multimeter will show the Vrms value (0.5 * Vp-p = 0Volt)
69
Oscilloscope Lab Review
 Scope Probe Calibration
 10:1 Scope Probes
 Keep your scope leads SHORT and secure/tight.
 Pay attention to where you ground the scope (especially for
small signals).
 If the signal is not stable (varying) then adjusting the trigger
level may help.
 The next time you use the scope, ask me to explain/assist.
70
The 555 Timer
The IC 555 has three operating modes:
1. Astable (free-running) mode
2. Monostable mode (one pulse per trigger)
3. Bistable mode (Schmitt trigger / flip-flop)
It is typically an 8-pin IC or a 14-pin dual timer IC
71
555 Astable (Free-running) Timer
Where:
R1 and R2 > 1K
R1 + R2 <= 10M
100pF < C < 1000uF
R1 and R2 are in ohms
C is in farads.
72
555 Monostable Timer
Where:
1K < R <= 10M
100pF < C < 1000uF
R1 is in ohms
C is in farads.
73
What is Pulse Width Modulation
(PWM) ?
Pulse-width modulation (PWM) uses the duty cycle of digital pulses to
generate an analog voltage, typically to control motor speed. The average
value of voltage and current supplied to the load is determined by the duty
cycle.
74
555 Timer PWM LED Brightness
+V
M
This method is not efficient.
Although we could slow down a motor by wiring it in series to a variable
resister using a constant power supply, this approach wastes the power
being dropped across the resister. PWM has the advantage in that no
power is being wasted across such a resister.
75
Arduino PWM Motor Control
Considering the state of modern technology, you are more likely to implement PWM
with an “over-the-counter” solution rather than implementing it via a custom built
circuit card. This shifts much of the development work away from hardware design
and more towards software development.
M1
Adafruit Motor Shield v2.3
M
M1
Computer
USB
Arduino Uno
External
Power Supply
Connect a DC motor to motor port 1 - it does not matter which wire goes
into which terminal block as motors are bi-directional. Connect to the top two
terminal ports, do not connect to the middle pin (GND) See the next photo for
the red and blue wire example.
76
Arduino Motor Shield Connections
The Arduino motor controller can get quite hot and will be damaged if the motor
pulls more than 1.2A.
Even small “hobby” motors can pull more than this, especially at stall conditions.
Motor
Controller
shield
M1 Motor
wires
Arduino
Monitor here for
excessive heat.
77
Industry Example:
Intersil PWM Controller
Intersil: Complete controller
and smart power stage
solution delivers up to 450A
load to any processor, ASIC
or FPGA, making IoT and
cloud infrastructure greener.
http://www.intersil.com
78
Unit #4 Lab Preview Comments
 We only have two Arduino motor shields so you will have to
share.
 Figure #4 has not been tested and might have miss-labeled
pins.
 Figure #6 includes a motor direction relay!
 Ask me to explain/assist with the oscilloscope
79
The End
80
Week #5 – Optocouplers for Motor
Control
Agenda :
a)
b)
c)
d)
Opto-Isolator
Opto-Coupler
Open-Collector outputs
Digital “short-to-ground” inputs
Lab Assignment:
MIT240_Unit5 - Optocouplers
81
Lab #1 Hardware Interface Document
Reminder:
1. Lab #1 – Figure #4, Strain Gage
2. Lab #3 – Figure #3, Motor Control
3. Lab #4 – Figure #2, Astable 555
Figure #3, Monostable 555
4. Lab #5 – Figure #4a, Motor Drive Optocoupler
Figure #4b, Optocoupled Level-Shifter
Experiment #3 Schematic, Switch controlled Scorbot input
5. Lab #6 – Experiment #1, Figure #1 with Proximity Sensor
Experiment #1, Figure #1 with Photo-Electric Sensor
6. Lab #8 – Figure #1, 741 Inverting Amplifier
Figure #2, 741 Non-Inverting Amplifier
82
Grading Changes
The following grading changes will be in effect:
o Lab Units #1 to #3 will be 100% if received, 0% if not received. I will
also mark these as a percent so you can anticipate/preview the
grading described for Lab Units #4 to #11.
o Lab Units #4 to #11 will be graded from 0 to 100% based on
completeness, neatness, quality, extra efforts, completeness of the
optional questions, and my observations of your efforts/contributions
during the lab period.
o Depending on class progress and timing, a formal lab report will likely
be requested in the last half of the class.
Reminder: Re-draw my schematics for the Interface Document.
83
“Text-Book” Reading Material
On-Line Reading Material:
Required:
http://www.learningaboutelectronics.com/Articles/Optocouplercircuit.php
Optional:
84
Opto-Coupler Circuit
Typical IC Pinout:
Example Usage:
There are no electrical
connections between the
switch circuit and the LED
circuit (assuming the
grounds and power supplies
are not connected together.
85
Optocoupler / Optoisolator
• An optocoupler or optoisolator provides electrical isolation between the
input of the circuit and the output of the circuit.
• Electrical isolation is achieved through an IR LED and a phototransistor
so there is no direct conductive path from the input to the output of the
circuit.
• If there is a destructive surge in power on the input or output, it will not be
transferred to the other side.
86
Opto-coupler Types
The photo-transistor and photo-darlington devices are mainly
for use in DC circuits while the photo-SCR and photo-triac
allow AC powered circuits to be controlled.
87
Optocoupler Circuit Examples
Higher current drive capacity
+5V
Input
Ground
Low current drive capacity
The 270K resister allows you
tune the output sensitivity.
88
Scorbot Input Circuit Analysis
(Input is Open / Not Connected)
1. If the input is disconnected then:
a) The input is internally pulled to a high state (+5V) by R2.
b) Current flows from +5 V thru R2 and the Zener. The zener maintains
+5 V so the input voltage is +5 Volt.
c) The zener diode protects the input from an overvoltage by limiting the
voltage to +5 Volt.
Not connected  input is high
Shorted  input is low
89
ScorBot Input Circuit Analysis
(Input is Shorted)
1. The zener diode protects the input from an overvoltage by limiting the
voltage to +5 Volt.
2. If you short the input to ground then:
Current flows from +5 V thru R2 and R1 to ground so:
5𝑉𝑜𝑙𝑡
5𝑉𝑜𝑙𝑡
𝐼=
=
= 49𝑢𝐴
𝑅2 + 𝑅1 102𝐾
+5 V
𝑉𝑅1 = 𝐼 ∗ 𝑅1 = 49𝑢𝐴 ∗ 2000 = 0.098 𝑉𝑜𝑙𝑡
R2=100k
R1=2k
0.098V is less than 1.5V so the input will be
Low.
5.1 V
Input shorted
to ground
90
ScorBot Inputs driven different ways
(see Appendix C in the SCORBASE User Manual)
1. Figure 1 – Output is an open-collector, NPN , with a grounded emitter.
2. Figure 2 – Output is an open-collector, PNP, with emitter connected to
+V.
3. Figure 3 – Relay or switch contacts
4. Do NOT connect a voltage to the controller inputs.
Figure 1
Figure 2
Figure 3
Scorbot
Relay
Contacts
91
ScorBot Controller Outputs
(see Appendix C in the SCORBASE User Manual)
Outputs 1 to 4 have Relay Outputs with N.O.
and N.C. contacts:
Outputs 5 to 8 have Open Collector Outputs:
92
Industry Trends:
Opto-Coupler versus Digital Isolator
 CMOS has much bigger industry base than GaAs (LEDs)
 Reliability and service life: LEDs will lose brightness over time
 Performance: Digital Isolators are more efficient (power
consumption)
 Less external support components required.
93
Opto-Coupler Application for RPM
94
Opto-Coupler RPM Circuit
+5 V
+5 V
R2 = 330 ohm
Red
R2 = 10K ohm
White
Output
OPTEK Technology
Slotted Optical Switch
OPB816Z
Black
Green
95
Opto-Coupler Disk Calculations
Detector
If the motor is spinning at 10,000
RPM, will the opto-coupler
response time be fast enough to
measure the RPM?
MOTOR
0.3125"
Circumference = 2 * Pi * Radius
Diameter = 2 * Radius
IR LED
1.0"
96
Opto-Coupler Disk Calculations
Detector
1) What is the time for one revolution at the maximum RPM?
2) What is the circumference at the location of the LED beam?
3) What percent is the width of the slot divided by the
circumference?
4) How much time will the slot expose the light beam?
5) How does the “slot time” compare to the response time of the
optical coupler?
MOTOR
0.3125"
Circumference = 2 * Pi * Radius
Diameter = 2 * Radius
IR LED
1.0"
97
The End
Thank You !
98
Week #6 – Sensors and Encoders
Agenda:
1. Exam Next Week!
2. Sensors:
Photo Sensors
Proximity Sensors
3. Encoders
Lab Assignment:
MIT240_Unit6 - Sensors
99
Opto-Coupler Disk Calculations
1. The OPTEK OPB816Z datasheet does not specify the maximum
on/off frequency.
2. The OPTEK OPB816Z datasheet refers you the OP552
Optotransistor datasheet which also does not specify the maximum
on/off frequency.
3. As an alternative, look at the OPB615 datasheet which specifies:
Typical Low-High propagation delay = 0.6uS
Typical High-Low propagation delay = 0.3uS
0.6uS + 0.3uS = 0.9uS delay  1.1MHz (typical)
1. As an alternative example, look at the 2n2222 datasheet
100
which specifies a transition frequency of 250MHz.
“Text-Book” Reading Material
Required:
a) https://www.electrical4u.com/characteristics-of-sensors/
b) http://www.electronics-tutorials.ws/io/io_1.html
c) http://www.electronics-tutorials.ws/io/io_2.html
d) http://www.controldesign.com/articles/2016/encoders-andresolvers-a-sense-of-where-things-are/
Optional:
a) http://www.electronics-tutorials.ws/electromagnetism/halleffect.html
b) http://www.electronics-tutorials.ws/io/thermistors.html
c) http://www.electronics-tutorials.ws/io/io_4.html
d) http://www.motioncontrolonline.org/content-detail.cfm/MotionControl-News/Understanding-Optical-Encoders-Part-I-ofII/content_id/311
101
Exam Review
1. Open book exam; part take-home (tonight) and part in-class next
week.
2. Make sure you bring all of your course notes, labs, & powerpoints.
3. All exam questions can be answered with the help of the class
material.
4. All material up to and including tonight (Week#6) is included.
5. Varied types of questions.
6. One hour objective however I will try to reasonably extend the
time if one hour does not seem to be enough.
7. Look over your class material and be prepared to locate the
answers within your class material.
8. During the in-class part of the exam, I will ask each one of you to
demonstrate how to read a sine wave with the oscilloscope. You
102
may want practice or refresh your skills prior to class.
Lab #1 Hardware Interface Document
Reminder:
1. Lab #1 – Figure #4, Strain Gage
2. Lab #3 – Figure #3, Motor Control
3. Lab #4 – Figure #2, Astable 555
Figure #3, Monostable 555
4. Lab #5 – Figure #4a, Motor Drive Optocoupler
Figure #4b, Optocoupled Level-Shifter
Experiment #3 Schematic, Switch controlled Scorbot input
5. Lab #6 – Experiment #1, Figure #1 with Proximity Sensor
Experiment #1, Figure #1 with Photo-Electric Sensor
6. Lab #8 – Figure #1, 741 Inverting Amplifier
Figure #2, 741 Non-Inverting Amplifier
7. Lab #9 – tbd
8. Lab #10 - tbd
103
“Neural Dust” Sensors Could Lead to
Implantable Wearables
Article written on August 25, 2016 by Kate Smith
http://www.allaboutcircuits.com/news
/neural-dust-sensors-could-opendoor-to-implantable-wearables/
The neural dust prototype attached to a nerve
fiber in a rat. Image courtesy of UC Berkeley.
104
Sensor Types
1. Discrete – Have a single on/off trigger point
a) Limit Switches
b) SPDT
c) DPDT
2. Analog Sensors - measure a range of input conditions such as temperature,
RPM, or pressure which are converted to signals such as 0-5 volts, 0-10
volts or 4-20mA.
3. Non-contact Sensors
a) Proximity
b) Photo-electric
c) Light, temperature, force/pressure, position, speed, sound
4. Smart Sensors
A smart transducer is an analog or
digital transducer or actuator combined with a processing unit and a
communication interface.
105
Thermistor Temperature Sensors (NTC)



Thermistors - are a type of resistor whose resistance is dependent
on temperature. They can have either a negative or positive
temperature coefficient. Thermistors typically achieve a greater
precision within a limited 0°C to 300°C range
Typically they can range within −90°C to 300°C.
Accuracy of ±0.1°C or ±0.2°C
C𝑅 = 𝑘C𝑇
Where: CR
= change in resistance
CT = change in temperature
k = temperature coefficient of resistance
106
RTD Temperature Sensors (PTC)






An RTD is a Resistance Temperature Detector which measures temperature using
the principle that the resistance of a metal changes with temperature.
The most common RTD specification is 100 Ω, which means that at 0° C the RTD
element should demonstrate 100 Ω of resistance.
RTDs have a slower response time than thermocouples.
RTDs have a larger temperature range (−200 and 500 °C or −328.0 and 932.0 °F)
than thermistors but less than thermocouples.
RTDs may be either 2, 3, or 4 wire where more wires mean greater accuracy (3
and 4 wire RTDs normally use a Wheatstone bridge).
Platinum RTDs have α = 0.003925 Ω/(Ω·°C) in the 0 to 100 °C range.
107
Comparison of Temperature Sensors
Thermocouples will
be covered later in
the course.
108
RTD and Thermistor Circuit Examples
109
Smart Sensor Examples
Omega carries many different sensors:
http://www.omega.com/subsection/limit-switches.html
Non-Contact Level Controller for Small Tank
Applications
The LVCN414 Series is a non-contact, ultrasonic level
controller and transmitter that delivers reliable, costeffective, high-performance, small-tank fluid handling
control solutions. The LVCN414 targets process,
control and chemical feed applications in small tanks
mounted on skids, tools or machines. It is easily
configured through a USB connection and Windows
compatible software. The LVCN414 allows for realtime/ anytime measurement, lowering operational costs
and increasing productivity. The LVCN414 is a total
small tank level control and measurement solution.
A-33 RTD
Transmitter
110
Sensors & Relays we will be using
Detects the presence
of an object.
1.BRN
Detects the absence of
an infrared light source.
.
DPDT Relay, +12V
coil
+V
2.WHI
4.BLK
3.BLU
Gnd
CA18CLN12PA
Proximity Sensor
The datasheets for these are located on the class website.
111
Proximity Sensor
Detects the presence of an object.
1.BRN
+V
Detects the presence of an object
using capacitance as the sensing
mechanism.
It will detect an object that gets
very close to it (3-12mm).
2.WHI
4.BLK
3.BLU
Gnd
CA18CLN12PA
Proximity Sensor
The datasheet for this is located on the class website.
112
Photoelectric Sensor
Detects the absence/presence of
an infrared light source (within 2 m).
Object will break the
infrared light beam
E3F2-R2C4
Infrared
Photoelectric
Sensor
The datasheet for this is located on the class website.
Reflector
113
Banner SM312D – Diffuse Mode Sensor
 Range to 380 mm (15")
 Highly repeatable 1 millisecond response
 Both sourcing and sinking outputs (150 mA max. each) at
10-30V dc.
bn
+
10-30V dc
–
bu
wh
bk
Load
Load
114
Bottle Sensors
http://www.balluff.com/balluff/MUS/en/products.jsp
115
Incremental Encoder Example
•
•
•
•
Does not provide positional information
Non-contact thus reduced wear
Greater resolution and accuracy
Larger size than potentiometers
116
Absolute Encoder Example
• Also provides rotational position information.
• The higher the resolution, the higher the cost.
117
Resolution Explanation
(both methods are used)
Resolution - The resolution of a measurement system is the smallest
yet to distinguish difference in values.
For incremental encoders, resolution is defined as counts per turn.
For absolute single-turn encoders, it is positions per turn, expressed
as a multi-bit word. i.e. 720 / 360 = 2 pulses per degree
Encoders usually have from 100 to 6,000 segments per revolution.
This means that these encoders can provide 3.6 deg of resolution for
the encoder with 100 segments and 0.06 deg of resolution for the
encoder with 6,000 segments.
118
Resolution = Total Pulses / 360 degrees
Industry News – Encoder Technology
The DS-25 is a member of the DS series of Electric Encoders, based
on Netzer Precision proprietary technology.
17 bit resolution means:
360°
217
= 0.0027°
< 0.025° accuracy
Analog Sin/Cos, Digital SSi, BiSS-C output options
Lightweight miniature absolute rotary encoder
No bearing or other contact
119
E3F2-R2C4 Photoelectric Sensor
The datasheet for this is located on the class website.
+12V
1.BRN
BTA1-2C 12V coil relay
12A @ 120VAC
4
Object will break the
infrared light beam
5
Main
Circuit
2.PINK
E3F2-R2C4
Infrared
Photoelectric
Sensor
2
Reflector
4.BLK
1
3.BLU
E3F2-R2C4
Photoelectric Sensor
10-30 V, 100mA Max
8
7
3
6
120
CA18CLN12PA Proximity Sensor
The datasheet for this is located on the class website.
+12V
1.BRN
BTA1-2C 12V coil relay
12A @ 120VAC
4
5
2
2.WHI
4.BLK
3.BLU
CA18CLN12PA
Proximity Sensor
1
8
7
3
6
121
Automatic Conveyor Start/Stop
+12V
1.BRN
BTA1-2C 12V coil
relay 12A @ 120VAC
8
1
2
2.WHI
4.BLK
3.BLU
CA18CLN12PA
Proximity Sensor
7
6
5
3
1
9
DB-9M
Connector
4
When the proximity sensor
detects an object, it will energize
the relay which will turn off the
conveyor belt. Changing the
relay contacts from NC (pin 5) to
NO (pin6) will turn on the
conveyor (instead of off).
The second set of relay contacts
may be used as a status signal or
light.
DB-9F
Connector
9
1
- Motor +
Conveyor Belt
or Turntable
122
Class Assignment - Sensor Response Time
The Omron-E3F2-R2C4 sensor will be used to count the cans of beer
being filled at a high speed canning plant. Refer to the response time
listed in the datasheet. What is the maximum number of cans that can be
counted on the assembly line in an hour?
123
The End
Thank You !
124
Week #7 – Analog to Digital
Agenda :
1. Exam #1
2. Student Survey
3. Analog to Digital Convertors
Lab Assignment:
MIT240_Unit7 - Analog_to_Digital
125
Assignments Due
Student Information Sheet
Industry Magazine
Due
Due
Lab #1 – Oscilloscope
Lab #2 – Load Cell
Lab #3 – Relay/Motor
Lab #4 – Timers/PWM
Lab #5 – Optoisolators
Lab #6 – Sensors
Lab #7 – Analog to Digital
Lab #8 – Op-Amps
Lab #9 – tbd
Lab #10 – tbd
Due
Due
Due
Due
Due tbd
Due tbd
Due tbd
Due tbd
126
“Text-Book” Reading Material
Required:
a) http://www.eetimes.com/document.asp?doc_id=1276974
b) Explanation for three types of ADC:
http://hyperphysics.phy-astr.gsu.edu/hbase/Electronic/adc.html#c1
Optional:
a) Everything you wanted to know about A-D Convertors:
http://www.delftek.com/wpcontent/uploads/2012/04/National_ABCs_of_ADCs.pdf
b) https://learn.sparkfun.com/tutorials/analog-to-digital-conversion
c) http://www.allaboutcircuits.com/textbook/digital/chpt-13/practical-considerationsadc-circuits/
127
Accuracy versus Precision
128
Analog Definition
Digital - Only two states: 0 volts and +5V
1 = On = Set = +5Volts = High
0 = Off = Clear = 0Volts = Low
Analog - Unlimited number of states between a lower and
an upper value.
0V, 0.02V, 0.04V, 1.44V, 3.60V, 5.00V
An Analog-to-Digital-Converter (ADC) converts
129
an analog voltage into a digital value.
Connection Diagram for an ADC
130
Connection Diagram for an ADC
131
Selection Criteria for an ADC
• Analog Signal Range : 0-5V, 0-10V, -5V to +5V
• Cost
• Signal-Conditioning Requirements
• Conversion Speed : 10Ksps to 200+Msps
• Analog Resolution : 8 to 17+ bits
• Accuracy is affected by:
a.
b.
c.
d.
Offset
Gain
Nonlinearity
The stability of the reference voltage
132
ADC Resolution
ADC Resolution is the smallest change in voltage that the
ADC can measure.
An eight-bit converter has a resolution of:
1/(28) = 1/256 = 0.0039 times the full scale input voltage
I.e. it can measure a signal of 0.0039 * 5V = 0.01953 Volt (~20mV)
Volts / Bits = 5-0 / 256 = 0.019531 Volts per bit
= 19.5mV per bit (~20mV)
133
ADC 1-bit Example
ADC
1-bit Example
Vin > 2.5V: Signal is 1’
1’
Vin <= 2.5V: Signal is 0’
0’
2.5V
0V
1-bit  21 = 2 levels  2 increments
5V / 2 levels = 2.5V per increment
A/D Converter
Binary Output
5V
134
ADC 2-bit Example
ADC
2-bit Example
3.75 V < Vin <= 5.00V: Signal is 11’
11’
2.50 V < Vin <= 3.75V: Signal is 10’
10’
1.25 V < Vin <= 2.50V: Signal is 01’
01’
3.75V
2.50V
A/D Converter
Binary Output
5.00V
1.25V
0.00 V < Vin <= 1.25V: Signal is 00’
00’
0.00V
2-bits  22 = 4 levels  4 increments
5V / 4 levels = 1.25V per increment
135
ADC 3-bit Example
5.000V
4.375V
3.750V
3.125V
4.375 V < Vin <= 5.000V: Signal is 111’
111’
3.750 V < Vin <= 4.375V: Signal is 110’
110’
3.125 V < Vin <= 3.750V: Signal is 101’
101’
2.500 V < Vin <= 3.125V: Signal is 100’
100’
1.875 V < Vin <= 2.500V: Signal is 011’
011’
1.250 V < Vin <= 1.875V: Signal is 010’
010’
0.625 V < Vin <= 1.250V: Signal is 001’
001’
0.000 V < Vin <= 6.25V: Signal is 000’
000’
2.500V
1.875V
1.250V
0.625V
A/D Converter
Binary Output
ADC
3-bit Example
0.000V
3-bits  23 = 8 levels  8 increments
5V / 8 levels = 0.625V per increment
136
Analog Input Scaling
ANALOG VOLTAGE
INPUT
0V
0.02V
0.04V
1.0V
2.0V
4.0V
5.1V
DIGITAL INPUT
(RAW A-D)
0000 0000
0000 0001
0000 0010
0011 0010
0110 0100
1100 1000
1111 1111
SCREEN
Y-AXIS
0
0
0
4
8
16
21
TEMPERATURE
0
2
4
100
200
400
510
Assuming:
• The analog input is from 0 to +5 volts
• The digital port is an 8-bit port (0 to 255)
• The screen position ranges from 0 to 21 (22 positions)
• The temperature represented by the input voltage can
range from zero to 510 degrees
137
Nyquist Criterion
Why is this Sample Frequency Important?
If you are measuring a fast moving waveform then
the A-D converter must sample the waveform often
enough to accurately capture it over time.
The Nyquist criterion states that, in order to prevent
undesired aliasing, one must sample a signal at a
rate equal to at least twice its bandwidth.
Sample frequency > 2 * Signal bandwidth
138
Quantization Error
Assume that we have a 3-bit A-D converter so the resolution is 2n
=8
So, for an 8 Volt reference voltage, a 3-bit converter resolves the input into
VREF/8 = 8V/8 = 1 Volt steps. Quantization error is a round off error.
139
Offset and Gain Errors
Offset Error is when the measured output of the A-D converter
is higher or lower than the expected (ideal) output.
Gain error is when the slope of the output function is not the
same as that of the actual (ideal) signal.
140
Lab Temperature Sensor
The lab temperature sensor has the following parameters:
 Temperature range from 0 to 200 F
 Outputs .01 volts (+10mV) per F
 Maximum output is: 200F * .01V = 2Volts
But since the A-D has a resolution of 19.531mV, it will be able to
"see" changes of only 2 degrees. Thus:
One LSB = 2F
Extrapolating further, the maximum raw A-D count when using this
temperature sensor as the input is:
200F maximum / 2F = max A-D count
200
/2
= 100
141
Scaling to Engineering Units
When the sensing device has zero as the first output:
Engineering units = (full scale value/resolution) * measure input value
= (1,000 psi/4,096 resolution) * measured input value
When the sensing device has a non-zero value as the first output:
Engineering units: = (((max–min) / resolution) * measured input value) + min
= (((100–40) / 4,096) * measured input value) + 40 mm
142
Group Assignment - Analog
Assume that you have a 11-bit Analog to Digital chip with a range of 0-5V. Also
assume that it is connected to a pressure transducer that has a range of 0 - 300 PSI
and outputs a 0-5v signal.
What is the smallest increment of pressure that can be measured?
What is the smallest increment of voltage that can be measured?
What voltage is measured at a pressure of 105 PSI?
What digital value indicates a pressure of 105 PSI?
143
The End
Thank You !
144
Week #8 – Op-Amps and Exam
Agenda :
1.
2.
3.
Exam Review
Op Amps
Thermocouples
Lab Assignment:
Catch-up Lab
145
“Text-Book” Reading Material
Required:
http://www.technologystudent.com/elec1/opamp2.htm
http://www.androiderode.com/voltage-comparator-circuit/
http://www.androiderode.com/op-amp-adder-and-subtractor-circuits/
http://www.circuitstoday.com/inverting-amplifier-using-opamp
Optional:
http://www.electronics-tutorials.ws/opamp/opamp_1.html
http://www.learningaboutelectronics.com/Articles/Non-inverting-op-amp-circuit.php
http://www.learningaboutelectronics.com/Articles/Inverting-op-amp-circuit.php
http://www.learningaboutelectronics.com/Articles/Summing-amplifier-circuit.php
146
741 Op-Amp Package
147
Op-Amp Introduction
An Op-Amp is a Voltage Amplifier’ which can be
used in multiple ways:
• Inverting Amplifier
• Non-Inverting Amplifier
• Comparator Circuit (compares two voltages so essentially
it is an A-D)
• Adder
• Subtractor or Differential Amplifier
148
Op-Amp Characteristics
• Open Loop Gain (Avo) is the gain of the op-amp without positive or
negative feedback, typically it is about 20,000 to 200,000.
• Input Impedance (Zin) is the ratio of input voltage to input current,
assumed to be infinite but input leakage ranges from pico-amps to milliamps.
• Output Impedance (Zout) is assumed to be zero so that no internal
resistance is in series with the load, typically it is 100-200 ohms.
• Bandwidth (BW) – ideally it will amplify a signal from DC to very high
AC.
• Offset Voltage (Vio) – the output voltage when both inputs are
grounded, ideally = 0.
149
Inverting Op-Amp Amplifier
Gain (AV) =
−𝑅𝑓
𝑅1
Vout = Vin * AV
R2 adjusts the offset
https://www.allaboutcircuits.com/tools/op-amp-voltage-and-gain-calculator/
150
Non-Inverting Op-Amp Amplifier
𝑉𝑜𝑢𝑡
𝑉𝑖𝑛
Gain (AV) =
or
𝑅𝑓
Gain (AV) = 1+
𝑅𝑖
Vout = Vin * AV
https://www.allaboutcircuits.com/tools/op-amp-voltage-and-gain-calculator/
151
Adder and Subtractor Op Amp Circuits
ADDER
Vo = – (V1 + V2)
SUBTRACTOR / DIFFERENCE
Vo = V2 – V1
http://www.androiderode.com/op-amp-adder-and-subtractor-circuits/
152
741 Non-Inverting Comparator
Compares two voltages
so it is essentially an A-D.
When Vin rises above or
falls below Vref the output
changes polarity.
Vref
Vref = 12V *
𝑅2
𝑅1+𝑅2
http://www.androiderode.com/volta
ge-comparator-circuit/
153
The End
Thank You !
154
Week #9 – Thermocouples
Agenda :
1. Thermocouples
Lab Assignment:
MIT240_Unit8 - Op-Amps
155
Agenda Overview / Status
Week#
9
10
11
12
13
14
Date
3/29/17
4/5/17
4/19
4/26
5/3/17
5/10/17
Lab
Lecture Material
Op-Amps
Thermocouples
Thermocouples Closed/Open Loop Control
Project
Arduino Overview
Project
Grounding, Shielding, Noise
Project
Final Review
Final Exam
156
Assignments Due
Student Information Sheet
Industry Magazine
Due
Due
Lab #1 – Oscilloscope
Lab #2 – Load Cell
Lab #3 – Relay/Motor
Lab #4 – Timers/PWM
Lab #5 – Opto-isolators
Lab #6 – Sensors
Lab #7 – Analog to Digital
Lab #8 – Op-Amps
Lab #9 – Thermocouples
Lab #10 – tbd
Due
Due
Due
Due
Due
Due 3/29/2017
Due tbd
Due tbd
Due tbd
157
“Text-Book” Reading Material
Required:
http://www.analog.com/en/analog-dialogue/articles/measuring-temp-usingthermocouples.html
http://www.electronics-tutorials.ws/io/io_3.html
http://www.allaboutcircuits.com/textbook/direct-current/chpt-9/thermocouples/
http://www.eurotherm.net.au/control/product/appl/tc_colour_ha027723_1.pdf
Optional:
http://www.thermocoupleinfo.com/
Thermocouple Tables:
https://srdata.nist.gov/its90/menu/menu.html
http://www.allaboutcircuits.com/textbook/direct-current/chpt-9/thermocouples/
Thermistors and RTDs:
https://www.allaboutcircuits.com/projects/measuring-temperature-with-anntc-thermistor/
https://www.digikey.com/en/articles/techzone/2012/mar/selecting-a158
thermistor-or-rtd
The Seebeck Effect
When two different metallic materials are in contact, a voltage will be
generated that depends on the temperature difference between the junction
and the rest of the conductors. Typically, induced voltages will be between
1 and 70 µV/°C for standard metal combinations. This effect is known as
the Seebeck effect in honor of the Estonian physicist, Thomas Seebeck.
TC Type
Seebeck
uV/degC @ 25degC
E
61uV
J
52uV
K
41uV
N
27uV
R
9uV
S
6uV
T
41uV
159
Thermocouple Theory
A thermocouple consists of two wires of dissimilar metals joined together at
one end, called the measurement ("hot") junction. The other end, where the
wires are not joined, is connected to the signal conditioning circuitry traces,
typically made of copper. This junction between the thermocouple metals
and the copper traces is called the reference ("cold") junction. Note that the
reference junction temperature must be known to get an accurate absolute
temperature reading (reference junction compensation).
160
Thermocouple Pros and Cons
Advantages:
Good Temperature Range from -200degC to +2500degC
Very Rugged
Rapid Response
No self heating
Disadvantages:
Small Signal Levels (41 uV/degC for Type K)
Requires signal conditioning to eliminate noise and offset
errors
Accuracy (1-2degC)
Corrosion (two dissimilar metals)
Susceptibility to Noise (microvolt signal changes)
161
Thermocouple Types
162
Type K Thermocouple Table
DegC
0
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
0
0
0.397
0.798
1.203
1.612
2.023
2.436
2.851
3.267
3.682
4.096
4.509
4.92
5.328
5.735
6.138
1
0.039
0.437
0.838
1.244
1.653
2.064
2.478
2.893
3.308
3.723
4.138
4.55
4.961
5.369
5.775
6.179
Type K Thermocouple - Thermoelectric Voltage in mV
2
3
4
5
6
7
0.079
0.119 0.158 0.198 0.238 0.277
0.477
0.517 0.557 0.597 0.637 0.677
0.879
0.919
0.96
1
1.041 1.081
1.285
1.326 1.366 1.407 1.448 1.489
1.694
1.735 1.776 1.817 1.858 1.899
2.106
2.147 2.188
2.23
2.271 2.312
2.519
2.561 2.602 2.644 2.685 2.727
2.934
2.976 3.017 3.059
3.1
3.142
3.35
3.391 3.433 3.474 3.516 3.557
3.765
3.806 3.848 3.889 3.931 3.972
4.179
4.22
4.262 4.303 4.344 4.385
4.591
4.633 4.674 4.715 4.756 4.797
5.002
5.043 5.084 5.124 5.165 5.206
5.41
5.45
5.491 5.532 5.572 5.613
5.815
5.856 5.896 5.937 5.977 6.017
6.219
6.259 6.299 6.339
6.38
6.42
8
0.317
0.718
1.122
1.53
1.941
2.354
2.768
3.184
3.599
4.013
4.427
4.838
5.247
5.653
6.058
6.46
9
0.357
0.758
1.163
1.571
1.982
2.395
2.81
3.225
3.64
4.055
4.468
4.879
5.288
5.694
6.098
6.5
10
0.397
0.798
1.203
1.612
2.023
2.436
2.851
3.267
3.682
4.096
4.509
4.92
5.328
5.735
6.138
6.54
163
Lab Explanation & Software Review
Arduino Software Review: Arduino_Thermocouple.ino
a) AdaFruit AD8495 shield via the Arduino Analog 0 input
b) Accurate to about 1degC or about 2degF
Setup() – Executes once at startup to initialize for the loop() task
Loop() – This executes repeatedly and contains the main logic:
1) Collect 10 samples, discard the 2 upper and lower values, average the rest.
2) Convert the Raw ADC value to voltage: Vout = raw * (5.0 / 1023.0)
3) Convert: fTemperature_degC = (Vout - 1.25) / 0.00488
164
4) Convert the Raw ADC value to degF and degC then display on the monitor
5) 1 Raw ADC value = 1degC
The End
165
Week #10 – Closed/Open Loop Control
Agenda:
1.
2.
3.
4.
5.
Open-Loop Control
Closed-Loop Control
Communication Protocols
Fall 2017 registration starts this week!
No Class Next Week!
Lab Assignment:
MIT240_Unit9 - Thermocouples
166
“Text-Book” Reading Material
Required:
1. https://www.dataforth.com/4-20mA-transmitter.aspx
2. https://www.predig.com/indicatorpage/back-basics-fundamentals-420-ma-current-loops
3. https://www.omega.com/techref/das/rs-232-422-485.html
Optional:
1. http://www.murata-ps.com/data/meters/dms-an20.pdf
167
Agenda Overview / Status
Week#
Date
9
10
11
12
3/29/17
4/5/17
4/19
4/26
13
14
5/3/17
5/10/17
Lab
Lecture Material
Op-Amps
Thermocouples
Thermocouples Closed/Open Loop Control
Project
Arduino Overview
Project
Grounding, Shielding, Noise
Project
Final Exam
Final Review
The Final Project will require a formal lab report that
will be due 5/10/17.
You may choose your own project.
168
Control Systems
• May use auxiliary computers or embedded
microprocessors.
• Common control methods:
 Open Loop Control
 Closed Loop Control
 Bang-Bang Control
 PID Control (Proportional Integral Derivative)
• The control systems have not been standardized
by the industry and are manufacturer specific.
169
Closed Loop Controller


“Two-way” (feedback)
The input is adjusted to drive the output to the intended
value
170
Open Loop Controller



“One-way” signal to the output device
Feedback is not provided to ensure the output matches the
intended
The amount of force that is applied is constant so it’s
affect may be slower or faster than desired (or may vary
depending on the current state of the output environment)
171
Communication/Signal Protocols
•
RS-232C – one receiver / transmitter pair
•
RS-422 – twisted pair / voltage difference, 10 receivers
•
RS-485 – 32 transmitters and 32 receivers
•
Voltage: 0 to 5Volts, 1-5V, -10V to +10V (simpler)
•
Current: 0-20mA or 4-20mA (resistant to stray noise)
• Type 2 –Transmitter floats, Receiver has Pwr/Gnd
• Type 3 – Transmitter has Pwr/Gnd, Receiver does not float
• Type 4 - Transmitter has Pwr/Gnd, Receiver floats
•
•
Li-Fi
Ethernet Network
172
RS232 / RS422 / RS485 Summary
Cabling
Number of Devices
Communication
Mode
Max Distance
Max. Data Rate
Signaling
Mark (data 1)
Space (data 0)
Input Level Min.
RS232
single ended
1 transmit
1 receive
RS422
single ended multi-drop
1 transmitters
10 receivers
full duplex
full duplex, half duplex
50 feet at 19.2
4000 feet at 100 Kbps
Kbps
1Mpbs for 50 feet
10 Mpbs for 50 feet
unbalanced
balanced
-5 V min. -15 V 2 V min. (B>A) 6 V max.
max.
(B>A)
5 V min. 15 V
2 V min. (A>B) 6 V max.
max.
(A>B)
+/- 3 V
0.2V difference
RS485
multi-drop
32 transmitters
32 receivers
full duplex, half
duplex
4000 feet at 100
Kbps
10 Mpbs for 50 feet
balanced
5 V max. (B>A)
5 V max. (A>B)
0.2V difference
173
RS232 / RS422 / RS485 Connections
174
Current Loop Summary
Uses a current level (4-20mA or 0-20mA) to indicate
the process value
Good for long distances (~two miles)
Simple wiring
Less sensitive to background noise
VERY common for process control in industry
Sensors can be powered by the loop itself
175
4-20mA Transmitter Types
Transmitter “floats”
Transmitter and Receiver
share a common ground
Receiver “floats”
176
Industry Example – Thermocouple probe with 4-20mA
transmitter
Thermocouple Probe with
Industrial Protection Head
$52
ProSense temperature
transmitter, Type K
thermocouple input, 0 to 500
deg F fixed, 4-20 mA output,
8 to 35 VDC operating
voltage, DIN Form B
connection head mount,
screw terminals.
$60-$200 and up
177
Li-Fi - Light-Based Communication
178
Li-Fi - Light-Based Communication
179
The End
Thank You !
180
Week #11 – Pneumatic Control
Agenda :
1. Arduino/Microcontroller Overview
2. Pressure Switches
3. Pressure Transducers
Lab Assignment:
tbd
181
Agenda Overview / Status
Week#
9
Date
3/29/17
Lab
Op-Amps
Lecture Material
Thermocouples
10
11
12
4/5/17
4/19
4/26
Thermocouples
Project
Project
13
14
5/3/17
5/10/17
Project
Final Exam
Closed/Open Loop Control
Arduino Overview
Grounding, Shielding, Noise
Op-Amp and
Thermocouple labs are Due
Final Review
The Final Project will require a formal lab report that
will be due 5/10/17.
You may choose your own project.
182
Lab #1 Hardware Interface Document
Reminder: This is due May 3, 2017
1. Lab #1 – Figure #4, Strain Gage
2. Lab #3 – Figure #3, Motor Control
3. Lab #4 – Figure #2, Astable 555
Figure #3, Monostable 555
4. Lab #5 – Figure #4a, Motor Drive Optocoupler
Figure #4b, Optocoupled Level-Shifter
Experiment #3 Schematic, Switch controlled Scorbot input
5. Lab #6 – Experiment #1, Figure #1 with Proximity Sensor
Experiment #1, Figure #1 with Photo-Electric Sensor
6. Lab #8 – Figure #1, 741 Inverting Amplifier
Figure #2, 741 Non-Inverting Amplifier
183
Microcontrollers vs Microprocessor
A microprocessor is simply the
“brain” and requires additional
components to function.
A microcontroller will almost
always include timers, RAM and
I/O ports (digital and/or analog).
184
Industrial Microcontrollers
A microcontroller is a microprocessor-based chip or
product that is optimized for analog and/or digital I/O.
Examples:
a) 8051 8-bit Intel Microcontroller with four 8-bit I/O
ports
b) Peripheral Interface Controller (PIC) by Micro Chip
Technology, 8-bit
c) AVR Microcontroller – 8-bit Advanced Virtual RISC
d) ARM Microcontroller: 32-bit RISC processor
RISC = Reduced Instruction Set CPU
185
Personal Microcontrollers
Raspberry PI – Fully functional computer (~$35-$40)
Linux OS and Ethernet Capable
17 Digital I/O Pins but lacks analog I/O (must be an add-on)
Programmed via Python, C, C++, Java, Scratch, and Ruby
Arduino Uno – Microcontroller (~$10-$29)
14 Digital I/O Pins (6 can be used as PWM outputs)
6 Analog Inputs
Programmed via C
SPI (Serial Peripheral Interface) for clocked synchronous data
Optimized to interface with sensors and devices
Parallax BasicStamp 2 ($49 plus a carrier board)
Programmed via PBasic
16 Digital I/O Pins (plus 2 serial pins)
186
CCAC Classes (microcontroller related)
MIT-103 : Fundamentals of Embedded Microprocessors
Uses the PMD-1208 I/O module attached to a PC or laptop
Software (visual Basic) orientated class teaching generic
hardware concepts
Offered in the Fall 2017 semester
MIT-104 : Microcontrollers
Uses the Arduino and Basic Stamp microcontrollers
Software (Arduino C) and Hardware orientated (hardware
labs)
187
The End
Thank You !
188
Week #12 – Grounding, Shielding & Noise
Agenda :
1. Grounding, Shielding, and Noise
2. Safety
Lab Assignment:
Tbd
189
“Text-Book” Reading Material
Required:
a)
b)
c)
http://www.allaboutcircuits.com/video-lectures/ground-reference-points/
https://www.controldesign.com/articles/2017/basic-automation-safety-requiresnot-so-basicsafety?utm_source=hs_email&utm_medium=email&utm_content=42458203&_
hsenc=p2ANqtz-94FxI1NeS7bptQT_KzCYUh2EIv09AqF6eR9T5LHyM4jzV5U4Fn_tThKI3qK7P8yQFUJPHQGyx6YB6Qke4xT0x0F7vA&_hsmi=42458203
http://www.controldesign.com/articles/2008/087/?show=all
Optional:
a)
Earth versus Ground: http://www.davidbridgen.com/earth.htm
b)
Common, Ground, and Negative:
http://www.davidbridgen.com/common.htm
http://www.allaboutcircuits.com/projects/how-to-eliminate-ground-loops-withsignal-isolation/
190
http://www.allaboutcircuits.com/technical-articles/transformer-isolation/
c)
d)
Electrical Isolation
Electrical isolation is necessary to protect circuits, equipment, and people from
shocks and short circuits as well as to make accurate measurements.
Isolation, also referred to as galvanic isolation, means no direct conduction path
exists for the current to flow; no physical connection exists.
Isolation can be accomplished using electromagnetic, capacitive, or optical
devices.
While physically and electrically isolating the circuitry from unwanted currents,
required signals and power need to be transferred across the separated circuits.
191
Manual Conveyor Stop
(possible ground loop problems)
192
Automatic Conveyor Stop
(possible ground loop problems)
193
Grounding Problems
Explain how to avoid current loops.
Explain ground isolation.
194
Grounding Problems
195
Improved Grounding
196
Opto-Isolator
Uses an LED and a
photo-transistor to
achieve high electrical
isolation between the
input and output
circuits.
Assuming the input and output use two different
grounds, the power surges on the output motor will not
affect the input.
197
Improved Electrical Isolation
198
How much is your time worth?
11 participants in the
workplace can cost the
company $14.67 per
minute.
199
Week #13 – Course Review
Agenda :
1.
2.
3.
Course Review
Take-Home Final Exam
DID YOU TURN EVRYTHING IN?
Lab Assignment:
Catch-up and Finish
200
Prior-Experience Evaluation
This is a very quick NON-CREDIT pre-test to allow me to
understand your current knowledge and capabilities.
Using the three electronic components, draw a schematic that will
allow the switch to energize the +5volt coil of the relay so that it
turns on the +24volt lamp.
+5V
COMMON
24V Lamp
Coil
NC
NO
201
Course Improvement: Items to consider
 Lab time versus Theory/Lecture time?
 Hardware versus Software focus?
 Not enough material or too much material?
 Text Book?
 Lab handouts?
 Course was too fast or too slow?
 Equipment suitability?
 Classroom environment?
 Were the Powerpoint Lecture Notes useful?
202
Course Improvement Workshop
What should we change to improve this course?
Brain Storm Session (10 minutes):
Document all ideas – all ideas are valid.
Prioritizing (10 minutes):
Everyone gets 20 points. Assign your points to the ideas that you feel
will be most beneficial.
I will use the results to guide future improvements.
203
Review and Questions
The exam will be both open (part 1) and closed book (part 2).
Bring all of your course notes, lab reports, exams, ect. You will
need whatever you do not bring.
Bring a calculator and pencil. No loaners will be available.
Questions?
204
The End
Thank You!
205
Week #16 - Final Exam
Exam Time: 6:15pm
All outstanding work is due.
206
Thank – You!
It has been fun and exciting this past semester!
Thank-You for taking the class!
Feel free to call me in the future if you think I can help
you in any way.
Did you register for
Fall Semester
classes yet?
207