SlideShare une entreprise Scribd logo
1  sur  106
Introduction to
microcontrollers.
presented by
Michael Parks, PE

last revision: 24 April 2010
what is a
microcontroller?
A tiny computer that is programmable to run one
program, typically in a continuous manner.

Serves as a bridge between the physical world and
the computer world.

Interacts with the “real world” through transducers
such as sensors, actuators, motors, lights, etc.

4 Functions: Input, Process, Output, Communicate

Abbreviated MCU, uC, μC

                          2
what can it do?
   In a nutshell, anything you want it do.
   a. Two-way interaction with the real-world
   b. Hardware and software needed for your design
   Some examples I have done:
   a. RFID controlled lighting
   b. Motion controlled lighting
   c. Range detector
   d. Laser light game

   Input from                              Output to
                   Process data via     Real-World via
   Real-Word
                   software running      Transducers
via Transducers                           (Actuators,
                  on MCU hardware
    (Sensors)                             Indicators)

                          3
choosing the right
microcontroller.
 Development environment usability
 Analog input
 Number of digital I/O pins
 Speed of execution
 Price
 Amount of memory
 Power

 Complexity level based on knowledge and project goals
 a. High-Level: Teleo System, I-Cubed, Lego Mindstorms
 b. Medium-level: Parallax BASIC Stamp, Arduino
 c. Low-level: PIC chips, SX chips, Atmel (AVR) chips




                                     4
the Arduino.

 Open Source Hardware running the open source
 programming language Wiring.

 Can interact with a PC through many languages,
 most popular is Processing.




                       5
anatomy of a
microcontroller.
   UART            DIGITAL I/O

 INTERRUPT
                      CPU
CONTROLLER

 INTERNAL          PULSE WIDTH
  TIMERS           MODULATION

DATA MEMORY
                      A/D
 PROGRAM           CONVERTER
 MEMORY

              6
anatomy of a
microcontroller.
   UART            DIGITAL I/O

 INTERRUPT
                      CPU
CONTROLLER

 INTERNAL          PULSE WIDTH
  TIMERS           MODULATION

DATA MEMORY
                      A/D
 PROGRAM           CONVERTER
 MEMORY

              6
anatomy of a
microcontroller.
   UART            DIGITAL I/O

 INTERRUPT
                      CPU
CONTROLLER

 INTERNAL          PULSE WIDTH
  TIMERS           MODULATION

DATA MEMORY
                      A/D
 PROGRAM           CONVERTER
 MEMORY

              6
anatomy of a
microcontroller.
   UART            DIGITAL I/O

 INTERRUPT
                      CPU
CONTROLLER

 INTERNAL          PULSE WIDTH
  TIMERS           MODULATION

DATA MEMORY
                      A/D
 PROGRAM           CONVERTER
 MEMORY

              6
anatomy of a
microcontroller.
   UART            DIGITAL I/O

 INTERRUPT
                      CPU
CONTROLLER

 INTERNAL          PULSE WIDTH
  TIMERS           MODULATION

DATA MEMORY
                      A/D
 PROGRAM           CONVERTER
 MEMORY

              6
microcontroller guts.




              7
microcontroller guts.

                    Central Processing
                    Unit (CPU):
                    CPU does all the
                    arithmetic and logic
                    operations.

                    It controls the flow of
                    execution of
                    instructions.




              7
microcontroller guts.
                   RANDOM ACCESS
                   MEMORY (RAM):

                   RAM holds the set
                   of instructions
                   (program), i.e. being
                   executed by the
                   CPU.

                   It holds important
                   data required by the
                   program.

                   It holds some
                   important data
                   structures like
                   ʻstackʼ.

                   It is volatile.
              7
microcontroller guts.
                   FLASH MEMORY:
                   Flash memory is
                   basically EEPROM.

                   It holds the program
                   written by the user.

                   The program can be
                   erased or written
                   here many times.

                   WATCHDOG:
                   Circuitry to prevent
                   behaviors that would
                   have negative
                   impacts to
                   microcontroller.

              7
microcontroller guts.
                   I/O PORTS:
                   Each port is made
                   up of n-pins ( mostly
                   8 pins).

                   Each pin can be
                   configured as either
                   input pin or output.

                   If a pin is input pin, it
                   accepts data from
                   the device it is
                   connected to.

                   If a pin is output pin,
                   it sends the data to
                   the device it is
                   connected to.
              7
microcontroller guts.
                   ANALOG-TO-DIGITAL
                   CONVERTER (DAC):
                   Most of the real world
                   signals are analog in
                   nature.

                   But a microcontroller is
                   a digital device, thus it
                   cannot process analog
                   signals.

                   ADC digitizes an analog
                   signal and gives it to the
                   microcontroller for
                   further processing.


              7
microcontroller guts.
                   TIMERS:
                   In many
                   applications, time
                   keeping is a must.

                   Microcontrollers
                   have timers to
                   measure time.

                   SERIAL PORT:
                   Microcontrollers can
                   speak to computers
                   or other digital
                   equipment via a
                   serial port.


              7
Arduino “Duemilanove”
specs.
 Built around the ATmega168 microcontroller
 14 digital I/O pins (6 provide PWM output)
 6 analog inputs (ADC provides quantization)
 5 V DC, 40 mA per I/O pin
 16 KB of flash memory
 1 KB of SRAM
 512 bytes of EEPROM
 16 MHz clock speed
 2 interrupt pins
 Supports SPI, I2C, UART 5V TTL serial




                               8
A look at the software side.



              9
computer science 101.
  DATA TYPES
a. Variables (local and global)
    i. Numbers: integer, long, float , double
    ii. Digital: bit, byte, word
    iii. Logic: Boolean
    iv. Array
    v. Text: char, string
b. Signed versus unsigned
c. Static variables and Constants
d. Keywords or reserved words
e. Converting between data types
f. Structures (C user defined data type)

 CONTROL STRUCTURES
a. Operators: arithmetic, comparison, boolean, bitwise, compound
b. if...then...else (conditional statements)
c. Loops
    i. main or event loop (infinite loop)
    ii. while
    iii. do..while
    iv. for
  v. continue, break, return
d. Recursion
e. Switch case
f. Functions (math and trig) / procedures / subroutine / commands

                                                10
computer science 201.
  OTHER CONCEPTS
a. Comments
b. Libraries (#include)
c. Flags
d. Pointers
e. Interrupts
f. Random number generator

  PROGRAMMING PARADIGMS
a. Syntax (proper combination of words) versus semantics (meaning of those words)
b. Object-oriented programming versus sequential
       - class, objects, inheritance, polymorphism, virtual functions
c. Psuedocode before you code
d. Rapid Development and SCRUM
e. Types of Testing: Black Box, White Box, Unit, Integration, Regression, System,
Usability, Acceptance, Alpha, Beta, Security, Stress, Compatibility.

  MICROCONTROLLER SPECIFIC FUNCTIONS
a. Digital I/O
b. Analog I/O
c. Advanced I/O: tone, pulses
d. Time
e. Serial Communications
                                        11
debugging tips.
writing software is an iterative process.
a. code, verify, debug, compile, upload, reset, and run.
b. Results of a run used to inform next coding cycle.
c. 1/10th of time is coding, 9/10th of time is debugging

keep the program small.
a. add new functionality in small increments.
b. key functions first, nice-to-haves last

save different versions

know every line of code (LOC or SLOC)

look at all variables

use debug statements and a debugger tool
                              12
“Wiring” programming
overview.
 Arduino programs are known as “sketches”

 Every program has at least two routines
 a. setup( )
 b. loop( )

 digital and analog input / output

 serial communications


                         13
Arduino sketch.
// set pin numbers:
                                                                               Declare global
const int buttonPin = 2;
const int ledPin = 13;
                               // the number of the pushbutton pin
                               // the number of the LED pin
                                                                               variables and
int buttonState = 0;           // variable for reading the pushbutton status
                                                                                 constants
void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);
  // initialize the pushbutton pin as an input:

}
  pinMode(buttonPin, INPUT);
                                                                               Setup pins and
                                                                                 baud rate
void loop(){
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);


    // check if the pushbutton is pressed.
    // if it is, the buttonState is HIGH:
    if (buttonState == HIGH) {
      // turn LED on:
      digitalWrite(ledPin, HIGH);

                                                                                   Loop
    }
    else {

                                                                                continuously
      // turn LED off:
      digitalWrite(ledPin, LOW);
    }
}




                                                        14
Arduino sketch commands
pinMode( )
serial.Begin( )
serial.Read( )
digitalRead( )
digitalWrite( )
analogRead( )
analogWrite( )
delay( )
millis( )
randomSeed( )
random( )
pulseIn( )
ShiftOut( )

                  15
“Processing”
programming language.
 Combination of programming language and
 development environment that runs on personal
 computer (Windows, Linux, or Mac).

 Can listen for packets from MCU and process
 using the power of the PC.

 Can use more powerful software such as Flash,
 Visual Basic, C#, Java to manipulate/display/
 interact with the data from the MCU.

 Export to applets for the Web or desktop app.
                        16
more on “Processing”
 Every piece of software written in Processing has:
 a. setup( )
 b. draw( )

 Import libraries
 a. import processing.serial.*;
 b. Serial myPort;

 Draw and Redraw
 Easy to interface with graphics, video, sound, mouse,
 keyboard, web, text files


                            17
“Processing” sketch.
  void setup() {
    size(400, 400);                      Declare
    stroke(255);                      variables and
  }
                                          screen
  void draw() {                      characteristics
    background(192, 64, 0);
    line(150, 25, mouseX, mouseY);
  }


                                     draw is the main
                                      loop that runs
                                       continuously




                             18
understanding
data packets.
  Create packet of data, based on sensor inputs and
  computed values to be transmitted on a repetitive
  or as needed basis.
                                            System
Header     Sensor1             Sensor2      Status      Trailer
(8 bits)   (32 bits)           (32 bits)     Flags     (8 bits)
                                            (8 bits)

                       88 BIT DATA PACKET




                               19
understanding
data packets.
  Create packet of data, based on sensor inputs and
  computed values to be transmitted on a repetitive
  or as needed basis.
                                               System
Header     Sensor1             Sensor2         Status      Trailer
(8 bits)   (32 bits)           (32 bits)        Flags     (8 bits)
                                               (8 bits)

                       88 BIT DATA PACKET

 Alarm Status    Operating Mode             Comm Mode Failure
    (2 bits)         (3 bits)                 (2 bits) (1 bit)
                               19
understanding
data packets.
 Bitwise logic operations
 Bitmasking
 Checksum
 Parity Bits
 Start Bit / Stop Bit
 Binary Coded Decimal (BCD)
 ASCII versus Raw Byte (Raw limited 0 -> 255)
 Message Handling
 a. Punctuation using delimiting character
 b. Call and Response (Handshaking)
                        20
other software skills.
 Get to know Hypertext Markup Language (HTML),
 mySQL (Standard Query Language), and Hypertext
 Preprocessor (PHP). Will be useful for writing apps that
 interact over the Internet.

 Get some web space that supports PHP and mySQL.

 Use a good Serial Communication app such as PuTTY.
 Also try Gobetwtino (Windows only).

 Always check to see if someone has written a library
 before writing your own code. No need to reinvent the
 wheel. Give credit though!

                            21
A look at the hardware side.



             22
electrical engineering 101.
Voltage (volts): electrical potential
- 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital)
Current (amps): rate of electron flow
Resistance (ohms, Ω): opposition of flow of current
Ground: 0V potential, where current wants to flow to
Power (Watt): The rate at which energy is consumed
Capacitance (farads): Ability to store electrical charge.
Digital versus Analog: Discrete versus Continuous
Conventional current flows high potential to low potential. in reality,
electrons are repelled from negative and attracted to the positive.
Components: resistor, capacitor, 555 timer, op-amps, LED,
photocell, thermistor, inductor, diode, transistor, H-bridge, battery,
speaker, transformer, mic, piezo buzzer




                                    23
electrical engineering 101.
Voltage (volts): electrical potential
- 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital)   RESISTOR
Current (amps): rate of electron flow
Resistance (ohms, Ω): opposition of flow of current
Ground: 0V potential, where current wants to flow to
Power (Watt): The rate at which energy is consumed
Capacitance (farads): Ability to store electrical charge.
Digital versus Analog: Discrete versus Continuous
Conventional current flows high potential to low potential. in reality,
electrons are repelled from negative and attracted to the positive.
Components: resistor, capacitor, 555 timer, op-amps, LED,
photocell, thermistor, inductor, diode, transistor, H-bridge, battery,
speaker, transformer, mic, piezo buzzer




                                    23
electrical engineering 101.
Voltage (volts): electrical potential
- 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital)  CAPACITOR
Current (amps): rate of electron flow
Resistance (ohms, Ω): opposition of flow of current
Ground: 0V potential, where current wants to flow to
Power (Watt): The rate at which energy is consumed
Capacitance (farads): Ability to store electrical charge.
Digital versus Analog: Discrete versus Continuous
Conventional current flows high potential to low potential. in reality,
electrons are repelled from negative and attracted to the positive.
Components: resistor, capacitor, 555 timer, op-amps, LED,
photocell, thermistor, inductor, diode, transistor, H-bridge, battery,
speaker, transformer, mic, piezo buzzer




                                    23
electrical engineering 101.
Voltage (volts): electrical potential
- 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital)LIGHT EMITTING DIODE
Current (amps): rate of electron flow
Resistance (ohms, Ω): opposition of flow of current
Ground: 0V potential, where current wants to flow to
Power (Watt): The rate at which energy is consumed
Capacitance (farads): Ability to store electrical charge.
Digital versus Analog: Discrete versus Continuous
Conventional current flows high potential to low potential. in reality,
electrons are repelled from negative and attracted to the positive.
Components: resistor, capacitor, 555 timer, op-amps, LED,
photocell, thermistor, inductor, diode, transistor, H-bridge, battery,
speaker, transformer, mic, piezo buzzer




                                     23
electrical engineering 101.
Voltage (volts): electrical potential
- 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital)     DIODE
Current (amps): rate of electron flow
Resistance (ohms, Ω): opposition of flow of current
Ground: 0V potential, where current wants to flow to
Power (Watt): The rate at which energy is consumed
Capacitance (farads): Ability to store electrical charge.
Digital versus Analog: Discrete versus Continuous
Conventional current flows high potential to low potential. in reality,
electrons are repelled from negative and attracted to the positive.
Components: resistor, capacitor, 555 timer, op-amps, LED,
photocell, thermistor, inductor, diode, transistor, H-bridge, battery,
speaker, transformer, mic, piezo buzzer




                                    23
electrical engineering 101.
Voltage (volts): electrical potential
- 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital)  INDUCTOR
Current (amps): rate of electron flow
Resistance (ohms, Ω): opposition of flow of current
Ground: 0V potential, where current wants to flow to
Power (Watt): The rate at which energy is consumed
Capacitance (farads): Ability to store electrical charge.
Digital versus Analog: Discrete versus Continuous
Conventional current flows high potential to low potential. in reality,
electrons are repelled from negative and attracted to the positive.
Components: resistor, capacitor, 555 timer, op-amps, LED,
photocell, thermistor, inductor, diode, transistor, H-bridge, battery,
speaker, transformer, mic, piezo buzzer




                                    23
electrical engineering 101.
Voltage (volts): electrical potential
- 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital) INTEGRATED CIRCUIT
Current (amps): rate of electron flow
Resistance (ohms, Ω): opposition of flow of current
Ground: 0V potential, where current wants to flow to
Power (Watt): The rate at which energy is consumed
Capacitance (farads): Ability to store electrical charge.
Digital versus Analog: Discrete versus Continuous
Conventional current flows high potential to low potential. in reality,
electrons are repelled from negative and attracted to the positive.
Components: resistor, capacitor, 555 timer, op-amps, LED,
photocell, thermistor, inductor, diode, transistor, H-bridge, battery,
speaker, transformer, mic, piezo buzzer




                                     23
electrical engineering 101.
Voltage (volts): electrical potential
- 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital)  PHOTOCELL
Current (amps): rate of electron flow
Resistance (ohms, Ω): opposition of flow of current
Ground: 0V potential, where current wants to flow to
Power (Watt): The rate at which energy is consumed
Capacitance (farads): Ability to store electrical charge.
Digital versus Analog: Discrete versus Continuous
Conventional current flows high potential to low potential. in reality,
electrons are repelled from negative and attracted to the positive.
Components: resistor, capacitor, 555 timer, op-amps, LED,
photocell, thermistor, inductor, diode, transistor, H-bridge, battery,
speaker, transformer, mic, piezo buzzer




                                    23
electrical engineering 101.
Voltage (volts): electrical potential
- 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital) TRANSISTOR
Current (amps): rate of electron flow
Resistance (ohms, Ω): opposition of flow of current
Ground: 0V potential, where current wants to flow to
Power (Watt): The rate at which energy is consumed
Capacitance (farads): Ability to store electrical charge.
Digital versus Analog: Discrete versus Continuous
Conventional current flows high potential to low potential. in reality,
electrons are repelled from negative and attracted to the positive.
Components: resistor, capacitor, 555 timer, op-amps, LED,
photocell, thermistor, inductor, diode, transistor, H-bridge, battery,
speaker, transformer, mic, piezo buzzer




                                    23
electrical engineering 101.
Voltage (volts): electrical potential
- 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital)
Current (amps): rate of electron flow
Resistance (ohms, Ω): opposition of flow of current
Ground: 0V potential, where current wants to flow to
Power (Watt): The rate at which energy is consumed
Capacitance (farads): Ability to store electrical charge.
Digital versus Analog: Discrete versus Continuous
Conventional current flows high potential to low potential. in reality,
electrons are repelled from negative and attracted to the positive.
Components: resistor, capacitor, 555 timer, op-amps, LED,
photocell, thermistor, inductor, diode, transistor, H-bridge, battery,
speaker, transformer, mic, piezo buzzer




                                    23
nodes and loops.

 Circuit must be a
 continuous loop.
 Sum of all voltage
 drops and gains
 around a loop is 0V.
 Current into a node
 equals current out of a
 node.



                           24
limiting current.
Ohm’s Law: V=I*R

5V = 3V + (Imax * R)
5V = 3V + 7mA * R
0.007A * R = 2V
                                   Imax   3V
R = 286Ω
                           5V
P = I2R
P = (.007A)2 * 286Ω
P = 0.014W = 14mW

300Ω, 1/8W resistor will suffice.
To be safe, pick components that
have slightly larger values then
calculated requirements.
                           25
signals theory.
An electrical signal has 3 key
attributes that vary with time:
a. Frequency
b. Amplitude
c. Phase

Communications
Baud rate: bits per second, two
devices must “talk” at same
baud rate
Simplex, Half-Duplex, Full-
Duplex comm channels
Overall comms speed based on
Bandwidth (bits per second) and
Latency (milliseconds)
                                  26
digital logic gates.
  Floating gate: A digital
  device gets confused if it
  doesn’t see ground or 5V.
  Causes of confusion: RF
  noise, static electricity.
  Typically a problem with
  switches.
  Need a pull-up or pull-down
  resistor to eliminate high
  problems resulting from
  floating gates.
  Other issue: Switch
  bounce. “Debounce” can
  be done in hardware or
  software

                                27
digital logic gates.
  Floating gate: A digital
  device gets confused if it
  doesn’t see ground or 5V.
  Causes of confusion: RF
  noise, static electricity.
  Typically a problem with
  switches.
  Need a pull-up or pull-down
  resistor to eliminate high
  problems resulting from
  floating gates.
  Other issue: Switch
  bounce. “Debounce” can
  be done in hardware or
  software

                                27
digital logic gates.
  Floating gate: A digital
  device gets confused if it
  doesn’t see ground or 5V.
  Causes of confusion: RF
  noise, static electricity.
  Typically a problem with
  switches.
  Need a pull-up or pull-down
  resistor to eliminate high
  problems resulting from
  floating gates.
  Other issue: Switch
  bounce. “Debounce” can
  be done in hardware or
  software

                                27
digital logic gates.
  Floating gate: A digital
  device gets confused if it
  doesn’t see ground or 5V.
  Causes of confusion: RF
  noise, static electricity.
  Typically a problem with
  switches.
  Need a pull-up or pull-down
  resistor to eliminate high
  problems resulting from
  floating gates.
  Other issue: Switch
  bounce. “Debounce” can
  be done in hardware or
  software

                                27
feedback loops.
The output of the
system is fed back to
the system as an
additional input.

Adds complexity.

Timing becomes
crucial when multiple
objects are linked.


                        28
analog to digital.
 MCU can “deal” with analog
 only after analog-to-digital
 converter (ADC) digitizes or
 quantizes the analog signal.

 Resolution is based on
 number of bits and
 sensitivity of ADC.

 Example: ADC with 10V
 reference voltage and 12-bit
 resolution. 2^12 = 4096.
                                     Number of steps:
                                     2#bits - 1
 10V/4096 means MCU can
 read between at at 2.44 mV          Resolution:
 resolution.                         Voltage Range / 2#bits

                                29
voltage dividers.

Voltage Divider
   Used to drop voltage to
   required level.
   Input to microcontroller if you
   replace R1 with a sensor that is
   based on variable resistance.

   Vout = Vin * [R2 / (R1+R2) ]
   - R1 -> 0, then Vout = Vin
   - R1 -> Infininity, Vout = 0

   What happens if variable
   resistor is on bottom?




                                      30
transistors and gates.
 Sourcing versus Sinking
 a. Source current to device
 b. Sink current from device to ground.

 Common Anode / Common Cathode

 Gate Fan-In / Fan-Out

 Serial versus Parallel

 CMOS-TTL interfacing

 Bipolar Power Supply




                                   31
transistors and gates.
 Sourcing versus Sinking
 a. Source current to device
 b. Sink current from device to ground.

 Common Anode / Common Cathode

 Gate Fan-In / Fan-Out

 Serial versus Parallel

 CMOS-TTL interfacing

 Bipolar Power Supply




                                   31
transistors and gates.
 Sourcing versus Sinking
 a. Source current to device
 b. Sink current from device to ground.

 Common Anode / Common Cathode

 Gate Fan-In / Fan-Out

 Serial versus Parallel

 CMOS-TTL interfacing

 Bipolar Power Supply




                                   31
transistors and gates.
 Sourcing versus Sinking
 a. Source current to device
 b. Sink current from device to ground.

 Common Anode / Common Cathode

 Gate Fan-In / Fan-Out

 Serial versus Parallel

 CMOS-TTL interfacing

 Bipolar Power Supply




                                   31
transistors and gates.
 Sourcing versus Sinking
 a. Source current to device
 b. Sink current from device to ground.

 Common Anode / Common Cathode

 Gate Fan-In / Fan-Out

 Serial versus Parallel

 CMOS-TTL interfacing

 Bipolar Power Supply




                                   31
transistors and gates.
 Sourcing versus Sinking
 a. Source current to device
 b. Sink current from device to ground.

 Common Anode / Common Cathode

 Gate Fan-In / Fan-Out

 Serial versus Parallel

 CMOS-TTL interfacing

 Bipolar Power Supply




                                   31
transistors and gates.
 Sourcing versus Sinking
 a. Source current to device
 b. Sink current from device to ground.

 Common Anode / Common Cathode

 Gate Fan-In / Fan-Out

 Serial versus Parallel

 CMOS-TTL interfacing

 Bipolar Power Supply




                                   31
amplifiers and filters.
 Amplifier Circuits built using
 Operational Amplifiers (Op-Amps):
 a. Inverting (Av = -Rf / Rin)
 b. Non-Inverting (Av = 1+Rf/Rin)
 c. Differentiating
 d. Integrating
 e. Summing
 f. Subtractor

 Filters
 a. High-pass
 b. Low-pass
 c. Bandpass
 d. Bandstop (Notch)




                                    32
amplifiers and filters.
 Amplifier Circuits built using
 Operational Amplifiers (Op-Amps):
 a. Inverting (Av = -Rf / Rin)
 b. Non-Inverting (Av = 1+Rf/Rin)
 c. Differentiating
 d. Integrating
 e. Summing
 f. Subtractor

 Filters
 a. High-pass
 b. Low-pass
 c. Bandpass
 d. Bandstop (Notch)




                                    32
amplifiers and filters.
 Amplifier Circuits built using
 Operational Amplifiers (Op-Amps):
 a. Inverting (Av = -Rf / Rin)
 b. Non-Inverting (Av = 1+Rf/Rin)
 c. Differentiating
 d. Integrating
 e. Summing
 f. Subtractor

 Filters
 a. High-pass
 b. Low-pass
 c. Bandpass
 d. Bandstop (Notch)




                                    32
amplifiers and filters.
 Amplifier Circuits built using
 Operational Amplifiers (Op-Amps):
 a. Inverting (Av = -Rf / Rin)
 b. Non-Inverting (Av = 1+Rf/Rin)
 c. Differentiating
 d. Integrating
 e. Summing
 f. Subtractor

 Filters
 a. High-pass
 b. Low-pass
 c. Bandpass
 d. Bandstop (Notch)




                                    32
amplifiers and filters.
 Amplifier Circuits built using
 Operational Amplifiers (Op-Amps):
 a. Inverting (Av = -Rf / Rin)
 b. Non-Inverting (Av = 1+Rf/Rin)
 c. Differentiating
 d. Integrating
 e. Summing
 f. Subtractor

 Filters
 a. High-pass
 b. Low-pass
 c. Bandpass
 d. Bandstop (Notch)




                                    32
amplifiers and filters.
 Amplifier Circuits built using
 Operational Amplifiers (Op-Amps):
 a. Inverting (Av = -Rf / Rin)
 b. Non-Inverting (Av = 1+Rf/Rin)
 c. Differentiating
 d. Integrating
 e. Summing
 f. Subtractor

 Filters
 a. High-pass
 b. Low-pass
 c. Bandpass
 d. Bandstop (Notch)




                                    32
inductive loads and
decoupling capacitors.
  Inductive vs. Resistive Loads
  Blowback Voltage
  a. When transistor turns off,
  motion of magnets in motor
  decelerating will induce back
  voltage across coils.
  b. Flywheel or Snubber diode
  allows voltage to dissipate safely.
  Always put diode in parallel to
  inductive load.
  Can also be in parallel to Collector-
  Emitter of transistor.

  Need decoupling capacitors
  across Vdd and GND of all ICs and
  Voltage Regulators when you have
  inductive loads.


                                          33
inductive loads and
decoupling capacitors.
  Inductive vs. Resistive Loads
  Blowback Voltage
  a. When transistor turns off,
  motion of magnets in motor
  decelerating will induce back
  voltage across coils.
  b. Flywheel or Snubber diode
  allows voltage to dissipate safely.
  Always put diode in parallel to
  inductive load.
  Can also be in parallel to Collector-
  Emitter of transistor.

  Need decoupling capacitors
  across Vdd and GND of all ICs and
  Voltage Regulators when you have
  inductive loads.


                                          33
inductive loads and
decoupling capacitors.
  Inductive vs. Resistive Loads
  Blowback Voltage
  a. When transistor turns off,
  motion of magnets in motor
  decelerating will induce back
  voltage across coils.
  b. Flywheel or Snubber diode
  allows voltage to dissipate safely.
  Always put diode in parallel to
  inductive load.
  Can also be in parallel to Collector-
  Emitter of transistor.

  Need decoupling capacitors
  across Vdd and GND of all ICs and
  Voltage Regulators when you have
  inductive loads.


                                          33
pulse width modulation.
 Pulse Width Modulation,
 abbreviated PWM.

 “Faking” an analog output
 signal by adjusting the
 on / off cycle (aka duty
 cycle) of a digital signal.

 Equivalent power to
                                      20% YIELDS 2.4V
 continuous voltage.                   50% YIELDS 6V
                                      80% YIELDS 9.6V
 Vout = (Ton/Toff) * Vdigital   100% YIELDS 12V (ALWAYS ON)

                           34
hysteresis
 Systems where inputs fluctuate rapidly near a
 threshold value result in noisy output.
 Hysteresis can be used to filter signals so that the
 output reacts slowly by taking recent history into
 account.
 For example, a thermostat controlling a heater may
 turn the heater on when the temperature drops
 below A degrees, but not turn it off until the
 temperature rises above B degrees. This prevents
 rapid switching on and off as the temperature drifts
 around the set point. Resulting in less voltage
 spikes and wear-and-tear on equipment.
 A Schmitt trigger is a simple electronic circuit that
 also exhibits this property. Often, some amount of
 hysteresis is intentionally added to an electronic
 circuit (or digital algorithm) to prevent unwanted
 rapid switching. This and similar techniques are
 used to compensate for contact bounce in
 switches, or noise in an electrical signal.


                                           35
scaling functions.
         Sometimes the range of your inputs doesn’t match
         the values of your outputs.
         Need a scaling function to adjust for variances in
         the two.
    OUTPUT DEVICE          INPUT SENSOR

                  2000             500

                                                                         Output Pulsewidth =

                                                    (sensorValue - min. sensorValue) x Output pulseRange
                                                        _______________________________________________ + min. Output
                                                                         Input sensorRange               pulseWidth
                           sensor Value
           Pulsewidth




Output                                      Input
Range:                                     Range:
 1000                                        470




                    1000              30


                                                                36
other electrical concepts.
 Smoothing, Sampling, Averaging
   Sometimes noise is added by the environment, sensor imperfections, or supporting
   circuit.
   Need to reduce that noise for performance.
       a. Smoothing: If sensor output, at rests, continuously bounces by 3, then divide
            output by 3 before using in computations. Cost of smoothed sensor reading is
            loss of resolution. Useful if output has small, finite states.
       b. Averaging: Take mean of last X sensor readings. Or keep array and sort each
            new reading, then take median.
       c. Sampling: Read sensors at twice the highest frequency component of observed
            phenomenon to reduce ambiguity. See Nyquist Criterion.

 Threshold, Edge, Peak
 a. Threshold: Detect is signal goes above/drops below certain value. May need to build in
    hysteresis for signals the hover around the threshold to eliminate constant fluctuations.
 b. Edge Detection: Detect a rising or falling edge of a signal. Use hysteresis to detect when
    signal hits the 10% and 90% mark of the final value.
 c. Peak detection: Ensure signal is above/below threshold value. Constantly measure
    signal input and compare to previous value. When new reading is less than previous
    reading, then peak has been reached.
 d. Signal Skew: Output signal slow to respond to change in input signal. Measure at 50%.
 e. Signal Slew: Slow rise or fall time of signal. Measure between 10% and 90%.

                                             37
more about electronics.
 Tools you will need:
 a. Variable temperature soldering iron, solder (60/40 .32”), flux,
    solder braid, solder sucker
 b. Digital multimeter
 c. USB oscilloscope
 d. Wire strippers, needle nose pliers
 e. Magnifying class
 f. Anti-static pad and wrist strap
 g. Alligator clips
 h. Breadboards (various sizes)
 i. Long reach tweezers
 j. Precision screwdriver set
 k. IC chip extractor / inserter
 l. “Third hand” tool
 m.Calipers

                                38
types of sensors and actuators.
Sensors (input transducers, from the real-world to the computer)
Beware of sensor drift, use redundant and independent sensors.
a. infrared
b. pressure
c. temperature
d. magnetic
e. microphone
f. RFID reader
g. photodiode
h. strain gauge
i. accelerometers
Output transducers or indicators (from the computer to real-world)
a. radios / antenna
b. light bulb / LED
c. speaker / buzzer
d. screens / monitors
Actuators (creating motion)
a. dc motor
b. servo
c. piezoelectric motor
                                        39
using a multimeter.




Analog versus digital
Auto-ranging
Polarity check
Continuity check
Measure current, voltage, resistance, capacitance
Diode and transistor check
                          40
using an oscilloscope.
 Measure voltage over time.
 Watch electrical signal over time
 as waveform.
 Can be digital, analog, or PC-
 based (USB).
 Measure in both time and
 frequency domains (via a Fast
 Fourier Transform or FFT)

 Other useful equipment:
   Function generator
   DC power supply
   Logic analyzer


                               41
soldering techniques.
Use soldering iron with adjustable temperature, let soldering iron get hot.
Heat the joint, not the solder.
Clean component leads and PCB before.
Usually used .32” 60/40 solder.
Smaller joints are better joints.
Keep tip clean, tin your tip smoothly.
Side of tip gets hotter than the very tip of the soldering iron (larger surface area).
Keep moist sponge.
Use flux, desoldering vacuum, solder wick, helping hands tool, tweezers, heat
sinks.
Ensure room is well ventilated as solder contains lead.
Turn soldering iron off when done.




                                           42
other hardware skills.

 RF and IR wireless links.

 Want to do home automation? Try X10 hardware.
 There is an Wiring library to interface with X10.

 XBee radios do the “dirty” work of controlling RF
 communications between microcontrollers.




                         43
thermal management with heat sinks
High current and high frequency devices can generate a lot of
heat which can damage components, especially ICs.
Dissipate heat through the device (radiation), heat sinks
(conduction), and fans (convection).
Thermal Resistance (θja) is the measure of how efficiently heat
is transferred across the boundary between two different
mediums. Measured in °C/W
     θja: Overall thermal resistance
     θcs: Thermal resistance of thermal paste
     θjc: Thermal resistance of the package
     θsa: Thermal resistance of heat sink
     TJ: Temperature of device/package junction
     TA: Temperature of ambient air
     TS: Temperature of heat sink
     TC: Temperature of device case
     P:    Power (Watts, P = IV)
     θja (with heat sink)    = θcs + θjc + θsa = (TJ - TA) / P
     θja (without heat sink) = θjc + θca = (TJ - TA) / P
Lower thermal resistance means better heat sink. Heat sinks
with large surface area and good air circulation gives best heat
dissipation. Don’t forget the thermal paste!

                                          44
sizing the heat sink
Given:                                         Find heatsink with θsa <= 6.8°C/W
θja = 8°C/W θjc = 0.2°C/W
θcs = 0.5°C/W TJmax = 85°C                     Ex. Part# 240-12.7B has θsa = 6°C/W and
TAmax = 70°C Vmax = 3.3V Imax = .6A            meets dimensional requirements.

P = IV = .6A x 3.3V = 1.98W to dissipate       Verify it will work.


P <= (TJ - TA) / θja = (85°C - 70°C) / 8°C/W TJ = [ (θcs + θjc + θsa) x P ] + TA
                                             TJ = 78.7°C
P <= 1.85W

                                               TJmax = 85°C
1.98W is NOT less than 1.85W, therefore
                                               78.7°C < 85°C, therefore good to use.
heat sink is required. Use 10%-15%
safety factor in actual application.
                                               NOTE: If 15% safety margin was used...
θja = (TJ - TA) / P = (85°C - 70°C) / 1.98W
                                               78.7°C x 1.15 = 90.5°C
θja = 7.5°C/W                                  90.5°C is NOT less than 85°C, therefore
                                               heat sink 240-12.7B is not a good choice.
θja = θcs + θjc + θsa
7.5°C/W = 0.2°C/W + θsa + 0.5°C/W
θsa <= 6.8°C/W

                                              45
Putting hardware and
software together.
It is an irrelevant argument as to whether software or
hardware is “better”. Both are necessary, and you will be
the master when you know when to use each.




                             46
a complete design from
concept to product.
  Concept: A system that reads an RFID tag,
  validates identity, and adjust lights to user’s
  preferences.
  First outline and diagram what needs to be
  designed.
  Simulate hardware design.
  Write code, stub in hardware interaction

                     Validate user
Read RFID tag                               Control lights
                   Recall preferences



                           47
a complete design from
concept to product.
  Determine what components are required.
  a. Which microcontroller, sensor, actuator, etc?
  b.What will be done in hardware and what will be
     done in software?


                    Validate user
Read RFID tag                           Control lights
                  Recall preferences


 RFID             MICROCONTROLLER                 X10
  TAG                     48                    CONTROL
READER                                            UNIT
a complete design from
concept to product.
  Determine what components are required.
  a. Which microcontroller, sensor, actuator, etc?
  b.What will be done in hardware and what will be
     done in software?         FUNCTIONAL


                    Validate user
Read RFID tag                           Control lights
                  Recall preferences


 RFID             MICROCONTROLLER                 X10
  TAG                     48                    CONTROL
READER                                            UNIT
a complete design from
concept to product.
  Determine what components are required.
  a. Which microcontroller, sensor, actuator, etc?
  b.What will be done in hardware and what will be
     done in software?                     PHYSICAL


                    Validate user
Read RFID tag                            Control lights
                  Recall preferences


 RFID             MICROCONTROLLER                  X10
  TAG                     48                     CONTROL
READER                                             UNIT
when to use hardware
versus software.
 When to “do it” in hardware
   a. Speed is a concern.
   b. PCB real estate is not a concern.
   c. Recurring per unit costs.
   d. If it is easier to do in hardware than
      software, such as CRC circuit.
 When to “do it” in software
   a. Adaptable, quick/easy changes.
   b. Data that varies from user to user.
   c. Once implemented/tested, no more per
      unit costs.
   d. If there are fast, simple, powerful libraries
      available to perform certain functions.
 Both have advantages/disadvantages!
                                  49
when to use hardware
versus software.                                         ICs
                                                       IR LED
 When to “do it” in hardware                          Transistor
   a. Speed is a concern.                             Capacitor
   b. PCB real estate is not a concern.
   c. Recurring per unit costs.
   d. If it is easier to do in hardware than
      software, such as CRC circuit.
 When to “do it” in software
   a. Adaptable, quick/easy changes.
   b. Data that varies from user to user.
   c. Once implemented/tested, no more per
      unit costs.
   d. If there are fast, simple, powerful libraries
      available to perform certain functions.
 Both have advantages/disadvantages!
                                  49
when to use hardware
versus software.                                         ICs
                                                       IR LED
 When to “do it” in hardware                          Transistor
   a. Speed is a concern.                             Capacitor
   b. PCB real estate is not a concern.
   c. Recurring per unit costs.
   d. If it is easier to do in hardware than
      software, such as CRC circuit.
 When to “do it” in software
   a. Adaptable, quick/easy changes.
                                                        main( )
   b. Data that varies from user to user.
                                                      function1( )
   c. Once implemented/tested, no more per
                                                         int x
      unit costs.
                                                        float y
   d. If there are fast, simple, powerful libraries
      available to perform certain functions.
 Both have advantages/disadvantages!
                                  49
a complete design from
concept to product.
 Design architecture

 Identify what to do in HW and SW, define
 interfaces.

 Design and build HW and SW components, test
 and debug separately.

 Integrate hardware and software.

 Test, debug, test, debug, ...

 Document, document, document THROUGHOUT.
                          50
common mistakes.
Remember Occam’s Razor and be methodical in troubleshooting the following:
a. Not hooking up ground or power.
b. Reversing ground and power.
c. Connecting power/ground to wrong IC pin.
d. Connecting to different pin then what is written in the software.
e. Not supplying sufficient power.
f. No pull-up/pull down resistor on I/O pin.
g. “Dirty” power supply.
h. Switch bounce.
i. Wrong resolution.
j. Mixing up the TX and RX pins.
k. Wrong serial port.
l. Another application is controlling the serial port.
m. Incompatible baud rates.
n. Bad components (not the microcontroller or software’s fault)
o. Bent IC pin or chip in backwards.
p. ASCII versus raw byte.
q. Poor soldering job, shorted traces or pins.
r. Something was miscoded in software -- remember code, debug, code, ...

                                     51
hardware you’ll come to know.
 Switches                                   Battery (Cells)                             Antenna
        Normally Open vs. Normally Closed
        Momentary vs. Toggle                Motors
        Make-then-break, Break-then-make           DC                                   Analog-to-Digital Converter
        Poles and Throws (SPST, SPDT)              Stepper                                     RC Network and RCTime Function
        Foot                                       RC Servo                                    if ADC unavailable on uC
        Tape                                Silicon Controlled Rectifier (SCR)           Digital-to-Analog Converter
        Roller                              DIAC / TRIAC                                Operational Amplifier
        Whisker                             Transistors                                 Audio Amplifier
        Micro                                      BJT (Higher current capability)      Schmitt Trigger (Hysteresis)
        Tilt                                              NPN (N.O.)                    Liquid Crystal Display (LCD)
        Reed (magnetic)                                   PNP (N.C.)                    Piezoelectric Devices
 Wire (AWG number)                                        Darlington Pair               H-Bridge
        Solid                                      FET (Faster, low power)              Bridge Rectifier
        Braided                                           JFET                          Power Inverter
        Coaxial                                           MOSFET                        Opto-Isolator
        Twister Pair                                             Enhancement            Ground / Earth / Chassis
 Resistors                                                       Depletion              Digital and Analog (Linear) Integrated
                                                                                        Circuits (ICs
        Fixed vs. Variables                 Incandescent Bulbs                          555 timer
        Potentiometer (pot)                        Oscillator                           F/V and V/F converter
        Rheostat                                   Microphone                           Vibrating motor
        Thermistor                                 Speaker                              PTC fuse
        Photoresistor                              Voltage Regulator                    RFID reader
        Flex                                       Digital Logic Gates                  Rectifier
        Force Sensitive                                   AND                           Header, socket, jacks
 Capacitors                                               OR                            IR transmitter / receiver
        varactor                                          NAND                          Vibratab
        polarized                                         NOR                           PIR sensor
        non-polarized                                     XOR                           Ultrasonic ranging sensor
 Inductors                                                XNOR                          Line sensor
        chokes                                            NOT (Inverter)                Hall sensor
        transformers                                      Buffer (Tri-State Buffer)     RF transmitter/receiver pair
        solenoids (linear motion)                         Flip-Flop                     Accelerometer
        Mechanical relays                                 Latch                         Pressure sensor
 Solid State Relays                                       Shift Register                Temperature sensor
 Ferrite beads                                            Encoder / Decoder             GPS
 Boards                                                   Multiplexer / Demultiplexer   Bluetooth / WiFi / Ethernet module
        Breadboard                                        Transmission gate             Wheatstone bridge
        Perforated Board                           Diodes (anode + / cathode -)         Heat sinks
        Copper Etch                                       Zener
        Printed Circuit Board (PCB)                       Light-Emitting (LED)
 Varistors                                                7-Segment Display
 Varactor                                                 Schottky
 Sidactor                                                 Tunnel
 Fuses                                                    Photodiode

                                                               52
staying focused.
you can do it!
 Keep an engineering journal and track every idea.
 Stay high level.
 Don’t over plan, experiment a lot.
   a. However, don’t just start coding or hooking up
      components. Spend the time doing paper design,
      flowcharts, and prototype individual subsystems.
   b. Try some circuit simulators such as TINA and EDISON.
 Collaborate with others.
 Spend time learning mechanical motions and materials too.
   a. Levers, Gears, Pulleys, Ratchets, Cam, Joint, Pistons,
      Linkages. (Keep your LEGOs!)
   b. Metals, Plastics, Adhesives, Conductive cloth and
      thread. Conductor versus Insulators.
                             53
where to shop.
 www.adafruit.com
 www.sparkfun.com
 www.parallax.xom
 www.goldmine-elec.com
 www.digikey.com
 www.jameco.com
 www.makershed.com
 Also, many vendor will offer free samples. Fairchild, National
 Semiconductor, and Microchip for example. Check out www.ladyada.net

 Spec Sheets
   Important to learn how to read schematics and understand circuit
   symbols.
   www.symbols.net/electrical
   www.octopart.com



                                   54
where to find out more.
www.michaelbparks.com
   blog: Geek Cowboy (blog.geekcowboy.net)
   email: mike@michaelbparks.com
www.arduino.cc
www.processing.org
www.makezine.com
www.ladyada.net
Guide to Programmable Logic Controllers
PC / Arduino Proxy Interface
Igoe, Tom. Making Things Talk and Physical Computing
Platt, Charles. Make: Electronics
Banzi, Massimo. Getting Started with Arduino
Mims, Forrest. Engineering Notebooks.


                             55
Questions?
Backup Slides



           57
typical problems and
solutions.
 Problems
    a. Ground loops
    b. Cross talk
    c. Noise
    d. Jitter
    e. Skew
    f. EMI
    g. Ringing
    h. Spikes / Droop
 Solutions
    a. Bypass
    b. Decouple
    c. Shielding
    d. Layout
    e. Ground plane
    f. Hierarchy / abstraction in design
    g. Regularity
    h. Modularity
    i. Locality
                                       58
power.

Real Power: Watts. P = V*I*cos(phase angle)
- DC power, phase angle = 0, cos(0) = 1, therefore P=VI
Reactive Power: VARs. Q = V*I*sin(phase angle)
Complex or Apparent Power: Volt-Ampere, VAs. S = V*I
S = P + jQ, S2 = P2 + Q2

Power Factor = Real Power / Apparent Power.
- Ideal PF is 1.
Power is the rate at which energy is consumed,
measured in joules per second.
Energy is measured in joules or more common;y
Kilowatt-Hour (kWHr)
                          59
more power.
 Batteries: Rated in mA-Hr.
    A 1000 mA-Hr batter can source 1000 mA for 1 hour.

 Supply correct voltage, but can over supply current.
    A 12V, 3A source can power 3 12V, 1A devices.
 Increase voltage, can spin a wheel faster. Increase current, can spin a larger
 wheel.

 Power DC jacks.
 DC power jack: power center, ground shield or vice-versa.

 Audio Impedance Matching: Source resistance, Speaker resistance.
 Square root of source resistance over speaker resistance.
 Noise margins

 Transformer relations: Np/Ns = Vp/Vs = Is/Ip
 Root-Mean-Square (RMS) Voltage: DC equivalent of an AC voltage.
 High Impedance (Z)
 CIVIL, ELI the ICE man.

                                     60
decibels.
Ap (ratio) = Pout / Pin
Ap (bel) = log(Pout/Pin)
Ap (dB) = 10 log10(Pout/Pin)
Vp (dB) = 20 log10(Vout/Vin)
Unity Gain = 0 dB
Multiply ratios, Sum bels.
Gain is to increase, attenuate is to drop
1 bel = 50%
RF (dBm).
   1 mW of power transmitted.
   dBm = 10 log10 (power received)
  - 1mW received: 10 log10 (1 mW) = 0 dBm (ideal)
  - .5mW received: 10 log10 (.5 mW) = -3.01 dBm
Bode plot (phase margin)

                              61
flags.

Carry

Zero

Sign

Parity

Overflow



          62
other topics.
 Karnauph Maps
 Sequential versus Combinational logic.
 Mealy versus Moore machines.
 Direct versus Capacitive Coupling
 a. Direct: No frequency dependance, attenuates
 signal, high input impedance possible
 b. Capacitive: Less gain at low freq, less
 impedance at high freq, no attenuation, block
 unwanted DC components.
 Design Abstraction: Behavioral (RTL, VHDL);
 Structural (circuit, logic gate, ERC); Physical
 (layout, DRC)

                       63
IC package types.


Dual Inline Pins (DIP), socket mount

Small Outline IC (SOIC), surface mount

Plastic Lead Chip Carrier (PLCC)




                        64
constraints.

 Design always a competition between:
 a. Size
 b. Power
 c. Speed
 d. Cost




                       65
calibration graphs.
                 Components of the same type will have a wide range of outputs
                 given the exact same input.
                 This is why spec sheets tend to give ranges of values.
                 Seen in such components as ultrasonic range finders or
                 thermistors.
                 Need to put completed circuit through set of tests of varying
                 inputs and measure the outputs, then graph the results. Will help
                 later in reading sensor results and interpreting their meaning and/
                 or troubleshooting.
                    5
Output Voltage




                        5
                 3.75                 4.25

                  2.5                                            3

                 1.25
                                                                         1
                    0
                        1m            2m                         3m     4m
                                             Distance (meters)
                                                      66

Contenu connexe

Tendances

Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded SystemsSudhanshu Janwadkar
 
Digital multimeter
Digital multimeterDigital multimeter
Digital multimeterVivek Pathak
 
Microprocessor & Micro-controller
Microprocessor & Micro-controllerMicroprocessor & Micro-controller
Microprocessor & Micro-controllerOm Bheda
 
Microprocessor & microcontroller
Microprocessor & microcontroller Microprocessor & microcontroller
Microprocessor & microcontroller Nitesh Kumar
 
Introduction to Microcontroller
Introduction to MicrocontrollerIntroduction to Microcontroller
Introduction to MicrocontrollerNikhil Sharma
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded SystemsSandeep Reddy
 
Introduction to Avr Microcontrollers
Introduction to Avr MicrocontrollersIntroduction to Avr Microcontrollers
Introduction to Avr MicrocontrollersMohamed Tarek
 
Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor Mrunal Deshkar
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduinoyeokm1
 
Embedded systems and their applications in our daily routine
Embedded systems and their applications in our daily routineEmbedded systems and their applications in our daily routine
Embedded systems and their applications in our daily routineAsad Qayyum Babar
 
8051 MICROCONTROLLER ARCHITECTURE.pptx
 8051 MICROCONTROLLER ARCHITECTURE.pptx 8051 MICROCONTROLLER ARCHITECTURE.pptx
8051 MICROCONTROLLER ARCHITECTURE.pptxMemonaMemon1
 
Introduction to microprocessor
Introduction to microprocessorIntroduction to microprocessor
Introduction to microprocessorSudhir Reddy
 
Microprocessor and microcontrollers
Microprocessor and microcontrollersMicroprocessor and microcontrollers
Microprocessor and microcontrollersHiran Gabriel
 

Tendances (20)

Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded Systems
 
Digital multimeter
Digital multimeterDigital multimeter
Digital multimeter
 
Microprocessor & Micro-controller
Microprocessor & Micro-controllerMicroprocessor & Micro-controller
Microprocessor & Micro-controller
 
Microprocessor & microcontroller
Microprocessor & microcontroller Microprocessor & microcontroller
Microprocessor & microcontroller
 
Embedded c
Embedded cEmbedded c
Embedded c
 
Introduction to Microcontroller
Introduction to MicrocontrollerIntroduction to Microcontroller
Introduction to Microcontroller
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded Systems
 
I/O Ports
I/O Ports I/O Ports
I/O Ports
 
Introduction to Avr Microcontrollers
Introduction to Avr MicrocontrollersIntroduction to Avr Microcontrollers
Introduction to Avr Microcontrollers
 
Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor
 
CPLD xc9500
CPLD xc9500CPLD xc9500
CPLD xc9500
 
Introduction in microcontroller
Introduction in microcontrollerIntroduction in microcontroller
Introduction in microcontroller
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Embedded systems and their applications in our daily routine
Embedded systems and their applications in our daily routineEmbedded systems and their applications in our daily routine
Embedded systems and their applications in our daily routine
 
8051 MICROCONTROLLER ARCHITECTURE.pptx
 8051 MICROCONTROLLER ARCHITECTURE.pptx 8051 MICROCONTROLLER ARCHITECTURE.pptx
8051 MICROCONTROLLER ARCHITECTURE.pptx
 
SRAM
SRAMSRAM
SRAM
 
Introduction to microprocessor
Introduction to microprocessorIntroduction to microprocessor
Introduction to microprocessor
 
Evm electronic voting machine
Evm electronic voting machineEvm electronic voting machine
Evm electronic voting machine
 
Microprocessor and microcontrollers
Microprocessor and microcontrollersMicroprocessor and microcontrollers
Microprocessor and microcontrollers
 
Embedded system
Embedded systemEmbedded system
Embedded system
 

Similaire à Introduction to Microcontrollers

Developing an avr microcontroller system
Developing an avr microcontroller systemDeveloping an avr microcontroller system
Developing an avr microcontroller systemnugnugmacmac
 
Boimetric using 8051
Boimetric  using 8051 Boimetric  using 8051
Boimetric using 8051 Shilpa Nayak
 
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxINDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxMeghdeepSingh
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerRup Chowdhury
 
Msp 430 architecture module 1
Msp 430 architecture module 1Msp 430 architecture module 1
Msp 430 architecture module 1SARALA T
 
Lecture 5-Embedde.pdf
Lecture 5-Embedde.pdfLecture 5-Embedde.pdf
Lecture 5-Embedde.pdfBlackHunter13
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontrollersnehapvs
 
Introduction to embedded systems using the msp430 6. 1 Enumerate the.pdf
Introduction to embedded systems using the msp430 6. 1 Enumerate the.pdfIntroduction to embedded systems using the msp430 6. 1 Enumerate the.pdf
Introduction to embedded systems using the msp430 6. 1 Enumerate the.pdfaienterpresses
 
Introduction to embedded systems using the msp430 6.1 Enumerate the .pdf
Introduction to embedded systems using the msp430 6.1 Enumerate the .pdfIntroduction to embedded systems using the msp430 6.1 Enumerate the .pdf
Introduction to embedded systems using the msp430 6.1 Enumerate the .pdfaienterpresses
 
Microcontroller from basic_to_advanced
Microcontroller from basic_to_advancedMicrocontroller from basic_to_advanced
Microcontroller from basic_to_advancedImran Sheikh
 
Micro Controller 8051 of Speedo Meter using KEIL Code
Micro Controller 8051 of Speedo Meter using KEIL CodeMicro Controller 8051 of Speedo Meter using KEIL Code
Micro Controller 8051 of Speedo Meter using KEIL CodeSunil Kumar R
 
Introduction to EMBEDDED SYSTEM.pdf
Introduction to EMBEDDED SYSTEM.pdfIntroduction to EMBEDDED SYSTEM.pdf
Introduction to EMBEDDED SYSTEM.pdfAkashBhagat32
 
Introducttion to robotics and microcontrollers
Introducttion to robotics and microcontrollersIntroducttion to robotics and microcontrollers
Introducttion to robotics and microcontrollersSandeep Kamath
 

Similaire à Introduction to Microcontrollers (20)

Developing an avr microcontroller system
Developing an avr microcontroller systemDeveloping an avr microcontroller system
Developing an avr microcontroller system
 
Magnetic door lock
Magnetic door lockMagnetic door lock
Magnetic door lock
 
Iot Workshop NITT 2015
Iot Workshop NITT 2015Iot Workshop NITT 2015
Iot Workshop NITT 2015
 
Boimetric using 8051
Boimetric  using 8051 Boimetric  using 8051
Boimetric using 8051
 
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxINDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontroller
 
Msp 430 architecture module 1
Msp 430 architecture module 1Msp 430 architecture module 1
Msp 430 architecture module 1
 
Lecture 5-Embedde.pdf
Lecture 5-Embedde.pdfLecture 5-Embedde.pdf
Lecture 5-Embedde.pdf
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 
Introduction to embedded systems using the msp430 6. 1 Enumerate the.pdf
Introduction to embedded systems using the msp430 6. 1 Enumerate the.pdfIntroduction to embedded systems using the msp430 6. 1 Enumerate the.pdf
Introduction to embedded systems using the msp430 6. 1 Enumerate the.pdf
 
Introduction to embedded systems using the msp430 6.1 Enumerate the .pdf
Introduction to embedded systems using the msp430 6.1 Enumerate the .pdfIntroduction to embedded systems using the msp430 6.1 Enumerate the .pdf
Introduction to embedded systems using the msp430 6.1 Enumerate the .pdf
 
Assignment
AssignmentAssignment
Assignment
 
Microcontroller from basic_to_advanced
Microcontroller from basic_to_advancedMicrocontroller from basic_to_advanced
Microcontroller from basic_to_advanced
 
GOWTHAM REPORT
GOWTHAM REPORTGOWTHAM REPORT
GOWTHAM REPORT
 
Micro Controller 8051 of Speedo Meter using KEIL Code
Micro Controller 8051 of Speedo Meter using KEIL CodeMicro Controller 8051 of Speedo Meter using KEIL Code
Micro Controller 8051 of Speedo Meter using KEIL Code
 
EEE226a.ppt
EEE226a.pptEEE226a.ppt
EEE226a.ppt
 
Introduction to EMBEDDED SYSTEM.pdf
Introduction to EMBEDDED SYSTEM.pdfIntroduction to EMBEDDED SYSTEM.pdf
Introduction to EMBEDDED SYSTEM.pdf
 
LECT 2.pptx
LECT 2.pptxLECT 2.pptx
LECT 2.pptx
 
Embedded System Basics
Embedded System BasicsEmbedded System Basics
Embedded System Basics
 
Introducttion to robotics and microcontrollers
Introducttion to robotics and microcontrollersIntroducttion to robotics and microcontrollers
Introducttion to robotics and microcontrollers
 

Plus de mike parks

Desktop Manufacturing Tools
Desktop Manufacturing ToolsDesktop Manufacturing Tools
Desktop Manufacturing Toolsmike parks
 
IoT Cyber+Physical+Social Engineering Attack Security (v0.1.6 / sep2020)
IoT Cyber+Physical+Social Engineering Attack Security (v0.1.6 / sep2020)IoT Cyber+Physical+Social Engineering Attack Security (v0.1.6 / sep2020)
IoT Cyber+Physical+Social Engineering Attack Security (v0.1.6 / sep2020)mike parks
 
MIT App Inventor + Arduino + Bluetooth
MIT App Inventor + Arduino + BluetoothMIT App Inventor + Arduino + Bluetooth
MIT App Inventor + Arduino + Bluetoothmike parks
 
Introduction To Electrical Engineering
Introduction To Electrical EngineeringIntroduction To Electrical Engineering
Introduction To Electrical Engineeringmike parks
 
Radio merit badge
Radio merit badgeRadio merit badge
Radio merit badgemike parks
 

Plus de mike parks (6)

Desktop Manufacturing Tools
Desktop Manufacturing ToolsDesktop Manufacturing Tools
Desktop Manufacturing Tools
 
IoT Cyber+Physical+Social Engineering Attack Security (v0.1.6 / sep2020)
IoT Cyber+Physical+Social Engineering Attack Security (v0.1.6 / sep2020)IoT Cyber+Physical+Social Engineering Attack Security (v0.1.6 / sep2020)
IoT Cyber+Physical+Social Engineering Attack Security (v0.1.6 / sep2020)
 
Wearables 101
Wearables 101Wearables 101
Wearables 101
 
MIT App Inventor + Arduino + Bluetooth
MIT App Inventor + Arduino + BluetoothMIT App Inventor + Arduino + Bluetooth
MIT App Inventor + Arduino + Bluetooth
 
Introduction To Electrical Engineering
Introduction To Electrical EngineeringIntroduction To Electrical Engineering
Introduction To Electrical Engineering
 
Radio merit badge
Radio merit badgeRadio merit badge
Radio merit badge
 

Dernier

2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)Delhi Call girls
 
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
The Selfspace Journal Preview by Mindbrush
The Selfspace Journal Preview by MindbrushThe Selfspace Journal Preview by Mindbrush
The Selfspace Journal Preview by MindbrushShivain97
 
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,dollysharma2066
 
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)Delhi Call girls
 
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...PsychicRuben LoveSpells
 
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morcall Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morvikas rana
 
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girlsPooja Nehwal
 
WOMEN EMPOWERMENT women empowerment.pptx
WOMEN EMPOWERMENT women empowerment.pptxWOMEN EMPOWERMENT women empowerment.pptx
WOMEN EMPOWERMENT women empowerment.pptxpadhand000
 
LC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfLC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfpastor83
 
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)Delhi Call girls
 
Pokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy TheoryPokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy Theorydrae5
 
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)Delhi Call girls
 

Dernier (15)

2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
 
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
 
The Selfspace Journal Preview by Mindbrush
The Selfspace Journal Preview by MindbrushThe Selfspace Journal Preview by Mindbrush
The Selfspace Journal Preview by Mindbrush
 
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
 
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
 
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
 
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
 
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morcall Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
 
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
 
WOMEN EMPOWERMENT women empowerment.pptx
WOMEN EMPOWERMENT women empowerment.pptxWOMEN EMPOWERMENT women empowerment.pptx
WOMEN EMPOWERMENT women empowerment.pptx
 
LC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfLC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdf
 
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
 
Pokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy TheoryPokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy Theory
 
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
 

Introduction to Microcontrollers

  • 1. Introduction to microcontrollers. presented by Michael Parks, PE last revision: 24 April 2010
  • 2. what is a microcontroller? A tiny computer that is programmable to run one program, typically in a continuous manner. Serves as a bridge between the physical world and the computer world. Interacts with the “real world” through transducers such as sensors, actuators, motors, lights, etc. 4 Functions: Input, Process, Output, Communicate Abbreviated MCU, uC, μC 2
  • 3. what can it do? In a nutshell, anything you want it do. a. Two-way interaction with the real-world b. Hardware and software needed for your design Some examples I have done: a. RFID controlled lighting b. Motion controlled lighting c. Range detector d. Laser light game Input from Output to Process data via Real-World via Real-Word software running Transducers via Transducers (Actuators, on MCU hardware (Sensors) Indicators) 3
  • 4. choosing the right microcontroller. Development environment usability Analog input Number of digital I/O pins Speed of execution Price Amount of memory Power Complexity level based on knowledge and project goals a. High-Level: Teleo System, I-Cubed, Lego Mindstorms b. Medium-level: Parallax BASIC Stamp, Arduino c. Low-level: PIC chips, SX chips, Atmel (AVR) chips 4
  • 5. the Arduino. Open Source Hardware running the open source programming language Wiring. Can interact with a PC through many languages, most popular is Processing. 5
  • 6. anatomy of a microcontroller. UART DIGITAL I/O INTERRUPT CPU CONTROLLER INTERNAL PULSE WIDTH TIMERS MODULATION DATA MEMORY A/D PROGRAM CONVERTER MEMORY 6
  • 7. anatomy of a microcontroller. UART DIGITAL I/O INTERRUPT CPU CONTROLLER INTERNAL PULSE WIDTH TIMERS MODULATION DATA MEMORY A/D PROGRAM CONVERTER MEMORY 6
  • 8. anatomy of a microcontroller. UART DIGITAL I/O INTERRUPT CPU CONTROLLER INTERNAL PULSE WIDTH TIMERS MODULATION DATA MEMORY A/D PROGRAM CONVERTER MEMORY 6
  • 9. anatomy of a microcontroller. UART DIGITAL I/O INTERRUPT CPU CONTROLLER INTERNAL PULSE WIDTH TIMERS MODULATION DATA MEMORY A/D PROGRAM CONVERTER MEMORY 6
  • 10. anatomy of a microcontroller. UART DIGITAL I/O INTERRUPT CPU CONTROLLER INTERNAL PULSE WIDTH TIMERS MODULATION DATA MEMORY A/D PROGRAM CONVERTER MEMORY 6
  • 12. microcontroller guts. Central Processing Unit (CPU): CPU does all the arithmetic and logic operations. It controls the flow of execution of instructions. 7
  • 13. microcontroller guts. RANDOM ACCESS MEMORY (RAM): RAM holds the set of instructions (program), i.e. being executed by the CPU. It holds important data required by the program. It holds some important data structures like ʻstackʼ. It is volatile. 7
  • 14. microcontroller guts. FLASH MEMORY: Flash memory is basically EEPROM. It holds the program written by the user. The program can be erased or written here many times. WATCHDOG: Circuitry to prevent behaviors that would have negative impacts to microcontroller. 7
  • 15. microcontroller guts. I/O PORTS: Each port is made up of n-pins ( mostly 8 pins). Each pin can be configured as either input pin or output. If a pin is input pin, it accepts data from the device it is connected to. If a pin is output pin, it sends the data to the device it is connected to. 7
  • 16. microcontroller guts. ANALOG-TO-DIGITAL CONVERTER (DAC): Most of the real world signals are analog in nature. But a microcontroller is a digital device, thus it cannot process analog signals. ADC digitizes an analog signal and gives it to the microcontroller for further processing. 7
  • 17. microcontroller guts. TIMERS: In many applications, time keeping is a must. Microcontrollers have timers to measure time. SERIAL PORT: Microcontrollers can speak to computers or other digital equipment via a serial port. 7
  • 18. Arduino “Duemilanove” specs. Built around the ATmega168 microcontroller 14 digital I/O pins (6 provide PWM output) 6 analog inputs (ADC provides quantization) 5 V DC, 40 mA per I/O pin 16 KB of flash memory 1 KB of SRAM 512 bytes of EEPROM 16 MHz clock speed 2 interrupt pins Supports SPI, I2C, UART 5V TTL serial 8
  • 19. A look at the software side. 9
  • 20. computer science 101. DATA TYPES a. Variables (local and global) i. Numbers: integer, long, float , double ii. Digital: bit, byte, word iii. Logic: Boolean iv. Array v. Text: char, string b. Signed versus unsigned c. Static variables and Constants d. Keywords or reserved words e. Converting between data types f. Structures (C user defined data type) CONTROL STRUCTURES a. Operators: arithmetic, comparison, boolean, bitwise, compound b. if...then...else (conditional statements) c. Loops i. main or event loop (infinite loop) ii. while iii. do..while iv. for v. continue, break, return d. Recursion e. Switch case f. Functions (math and trig) / procedures / subroutine / commands 10
  • 21. computer science 201. OTHER CONCEPTS a. Comments b. Libraries (#include) c. Flags d. Pointers e. Interrupts f. Random number generator PROGRAMMING PARADIGMS a. Syntax (proper combination of words) versus semantics (meaning of those words) b. Object-oriented programming versus sequential - class, objects, inheritance, polymorphism, virtual functions c. Psuedocode before you code d. Rapid Development and SCRUM e. Types of Testing: Black Box, White Box, Unit, Integration, Regression, System, Usability, Acceptance, Alpha, Beta, Security, Stress, Compatibility. MICROCONTROLLER SPECIFIC FUNCTIONS a. Digital I/O b. Analog I/O c. Advanced I/O: tone, pulses d. Time e. Serial Communications 11
  • 22. debugging tips. writing software is an iterative process. a. code, verify, debug, compile, upload, reset, and run. b. Results of a run used to inform next coding cycle. c. 1/10th of time is coding, 9/10th of time is debugging keep the program small. a. add new functionality in small increments. b. key functions first, nice-to-haves last save different versions know every line of code (LOC or SLOC) look at all variables use debug statements and a debugger tool 12
  • 23. “Wiring” programming overview. Arduino programs are known as “sketches” Every program has at least two routines a. setup( ) b. loop( ) digital and analog input / output serial communications 13
  • 24. Arduino sketch. // set pin numbers: Declare global const int buttonPin = 2; const int ledPin = 13; // the number of the pushbutton pin // the number of the LED pin variables and int buttonState = 0; // variable for reading the pushbutton status constants void setup() { // initialize the LED pin as an output: pinMode(ledPin, OUTPUT); // initialize the pushbutton pin as an input: } pinMode(buttonPin, INPUT); Setup pins and baud rate void loop(){ // read the state of the pushbutton value: buttonState = digitalRead(buttonPin); // check if the pushbutton is pressed. // if it is, the buttonState is HIGH: if (buttonState == HIGH) { // turn LED on: digitalWrite(ledPin, HIGH); Loop } else { continuously // turn LED off: digitalWrite(ledPin, LOW); } } 14
  • 25. Arduino sketch commands pinMode( ) serial.Begin( ) serial.Read( ) digitalRead( ) digitalWrite( ) analogRead( ) analogWrite( ) delay( ) millis( ) randomSeed( ) random( ) pulseIn( ) ShiftOut( ) 15
  • 26. “Processing” programming language. Combination of programming language and development environment that runs on personal computer (Windows, Linux, or Mac). Can listen for packets from MCU and process using the power of the PC. Can use more powerful software such as Flash, Visual Basic, C#, Java to manipulate/display/ interact with the data from the MCU. Export to applets for the Web or desktop app. 16
  • 27. more on “Processing” Every piece of software written in Processing has: a. setup( ) b. draw( ) Import libraries a. import processing.serial.*; b. Serial myPort; Draw and Redraw Easy to interface with graphics, video, sound, mouse, keyboard, web, text files 17
  • 28. “Processing” sketch. void setup() { size(400, 400); Declare stroke(255); variables and } screen void draw() { characteristics background(192, 64, 0); line(150, 25, mouseX, mouseY); } draw is the main loop that runs continuously 18
  • 29. understanding data packets. Create packet of data, based on sensor inputs and computed values to be transmitted on a repetitive or as needed basis. System Header Sensor1 Sensor2 Status Trailer (8 bits) (32 bits) (32 bits) Flags (8 bits) (8 bits) 88 BIT DATA PACKET 19
  • 30. understanding data packets. Create packet of data, based on sensor inputs and computed values to be transmitted on a repetitive or as needed basis. System Header Sensor1 Sensor2 Status Trailer (8 bits) (32 bits) (32 bits) Flags (8 bits) (8 bits) 88 BIT DATA PACKET Alarm Status Operating Mode Comm Mode Failure (2 bits) (3 bits) (2 bits) (1 bit) 19
  • 31. understanding data packets. Bitwise logic operations Bitmasking Checksum Parity Bits Start Bit / Stop Bit Binary Coded Decimal (BCD) ASCII versus Raw Byte (Raw limited 0 -> 255) Message Handling a. Punctuation using delimiting character b. Call and Response (Handshaking) 20
  • 32. other software skills. Get to know Hypertext Markup Language (HTML), mySQL (Standard Query Language), and Hypertext Preprocessor (PHP). Will be useful for writing apps that interact over the Internet. Get some web space that supports PHP and mySQL. Use a good Serial Communication app such as PuTTY. Also try Gobetwtino (Windows only). Always check to see if someone has written a library before writing your own code. No need to reinvent the wheel. Give credit though! 21
  • 33. A look at the hardware side. 22
  • 34. electrical engineering 101. Voltage (volts): electrical potential - 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital) Current (amps): rate of electron flow Resistance (ohms, Ω): opposition of flow of current Ground: 0V potential, where current wants to flow to Power (Watt): The rate at which energy is consumed Capacitance (farads): Ability to store electrical charge. Digital versus Analog: Discrete versus Continuous Conventional current flows high potential to low potential. in reality, electrons are repelled from negative and attracted to the positive. Components: resistor, capacitor, 555 timer, op-amps, LED, photocell, thermistor, inductor, diode, transistor, H-bridge, battery, speaker, transformer, mic, piezo buzzer 23
  • 35. electrical engineering 101. Voltage (volts): electrical potential - 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital) RESISTOR Current (amps): rate of electron flow Resistance (ohms, Ω): opposition of flow of current Ground: 0V potential, where current wants to flow to Power (Watt): The rate at which energy is consumed Capacitance (farads): Ability to store electrical charge. Digital versus Analog: Discrete versus Continuous Conventional current flows high potential to low potential. in reality, electrons are repelled from negative and attracted to the positive. Components: resistor, capacitor, 555 timer, op-amps, LED, photocell, thermistor, inductor, diode, transistor, H-bridge, battery, speaker, transformer, mic, piezo buzzer 23
  • 36. electrical engineering 101. Voltage (volts): electrical potential - 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital) CAPACITOR Current (amps): rate of electron flow Resistance (ohms, Ω): opposition of flow of current Ground: 0V potential, where current wants to flow to Power (Watt): The rate at which energy is consumed Capacitance (farads): Ability to store electrical charge. Digital versus Analog: Discrete versus Continuous Conventional current flows high potential to low potential. in reality, electrons are repelled from negative and attracted to the positive. Components: resistor, capacitor, 555 timer, op-amps, LED, photocell, thermistor, inductor, diode, transistor, H-bridge, battery, speaker, transformer, mic, piezo buzzer 23
  • 37. electrical engineering 101. Voltage (volts): electrical potential - 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital)LIGHT EMITTING DIODE Current (amps): rate of electron flow Resistance (ohms, Ω): opposition of flow of current Ground: 0V potential, where current wants to flow to Power (Watt): The rate at which energy is consumed Capacitance (farads): Ability to store electrical charge. Digital versus Analog: Discrete versus Continuous Conventional current flows high potential to low potential. in reality, electrons are repelled from negative and attracted to the positive. Components: resistor, capacitor, 555 timer, op-amps, LED, photocell, thermistor, inductor, diode, transistor, H-bridge, battery, speaker, transformer, mic, piezo buzzer 23
  • 38. electrical engineering 101. Voltage (volts): electrical potential - 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital) DIODE Current (amps): rate of electron flow Resistance (ohms, Ω): opposition of flow of current Ground: 0V potential, where current wants to flow to Power (Watt): The rate at which energy is consumed Capacitance (farads): Ability to store electrical charge. Digital versus Analog: Discrete versus Continuous Conventional current flows high potential to low potential. in reality, electrons are repelled from negative and attracted to the positive. Components: resistor, capacitor, 555 timer, op-amps, LED, photocell, thermistor, inductor, diode, transistor, H-bridge, battery, speaker, transformer, mic, piezo buzzer 23
  • 39. electrical engineering 101. Voltage (volts): electrical potential - 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital) INDUCTOR Current (amps): rate of electron flow Resistance (ohms, Ω): opposition of flow of current Ground: 0V potential, where current wants to flow to Power (Watt): The rate at which energy is consumed Capacitance (farads): Ability to store electrical charge. Digital versus Analog: Discrete versus Continuous Conventional current flows high potential to low potential. in reality, electrons are repelled from negative and attracted to the positive. Components: resistor, capacitor, 555 timer, op-amps, LED, photocell, thermistor, inductor, diode, transistor, H-bridge, battery, speaker, transformer, mic, piezo buzzer 23
  • 40. electrical engineering 101. Voltage (volts): electrical potential - 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital) INTEGRATED CIRCUIT Current (amps): rate of electron flow Resistance (ohms, Ω): opposition of flow of current Ground: 0V potential, where current wants to flow to Power (Watt): The rate at which energy is consumed Capacitance (farads): Ability to store electrical charge. Digital versus Analog: Discrete versus Continuous Conventional current flows high potential to low potential. in reality, electrons are repelled from negative and attracted to the positive. Components: resistor, capacitor, 555 timer, op-amps, LED, photocell, thermistor, inductor, diode, transistor, H-bridge, battery, speaker, transformer, mic, piezo buzzer 23
  • 41. electrical engineering 101. Voltage (volts): electrical potential - 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital) PHOTOCELL Current (amps): rate of electron flow Resistance (ohms, Ω): opposition of flow of current Ground: 0V potential, where current wants to flow to Power (Watt): The rate at which energy is consumed Capacitance (farads): Ability to store electrical charge. Digital versus Analog: Discrete versus Continuous Conventional current flows high potential to low potential. in reality, electrons are repelled from negative and attracted to the positive. Components: resistor, capacitor, 555 timer, op-amps, LED, photocell, thermistor, inductor, diode, transistor, H-bridge, battery, speaker, transformer, mic, piezo buzzer 23
  • 42. electrical engineering 101. Voltage (volts): electrical potential - 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital) TRANSISTOR Current (amps): rate of electron flow Resistance (ohms, Ω): opposition of flow of current Ground: 0V potential, where current wants to flow to Power (Watt): The rate at which energy is consumed Capacitance (farads): Ability to store electrical charge. Digital versus Analog: Discrete versus Continuous Conventional current flows high potential to low potential. in reality, electrons are repelled from negative and attracted to the positive. Components: resistor, capacitor, 555 timer, op-amps, LED, photocell, thermistor, inductor, diode, transistor, H-bridge, battery, speaker, transformer, mic, piezo buzzer 23
  • 43. electrical engineering 101. Voltage (volts): electrical potential - 5V = ‘1’, true, on. 0V = ‘0’, false, off (Digital) Current (amps): rate of electron flow Resistance (ohms, Ω): opposition of flow of current Ground: 0V potential, where current wants to flow to Power (Watt): The rate at which energy is consumed Capacitance (farads): Ability to store electrical charge. Digital versus Analog: Discrete versus Continuous Conventional current flows high potential to low potential. in reality, electrons are repelled from negative and attracted to the positive. Components: resistor, capacitor, 555 timer, op-amps, LED, photocell, thermistor, inductor, diode, transistor, H-bridge, battery, speaker, transformer, mic, piezo buzzer 23
  • 44. nodes and loops. Circuit must be a continuous loop. Sum of all voltage drops and gains around a loop is 0V. Current into a node equals current out of a node. 24
  • 45. limiting current. Ohm’s Law: V=I*R 5V = 3V + (Imax * R) 5V = 3V + 7mA * R 0.007A * R = 2V Imax 3V R = 286Ω 5V P = I2R P = (.007A)2 * 286Ω P = 0.014W = 14mW 300Ω, 1/8W resistor will suffice. To be safe, pick components that have slightly larger values then calculated requirements. 25
  • 46. signals theory. An electrical signal has 3 key attributes that vary with time: a. Frequency b. Amplitude c. Phase Communications Baud rate: bits per second, two devices must “talk” at same baud rate Simplex, Half-Duplex, Full- Duplex comm channels Overall comms speed based on Bandwidth (bits per second) and Latency (milliseconds) 26
  • 47. digital logic gates. Floating gate: A digital device gets confused if it doesn’t see ground or 5V. Causes of confusion: RF noise, static electricity. Typically a problem with switches. Need a pull-up or pull-down resistor to eliminate high problems resulting from floating gates. Other issue: Switch bounce. “Debounce” can be done in hardware or software 27
  • 48. digital logic gates. Floating gate: A digital device gets confused if it doesn’t see ground or 5V. Causes of confusion: RF noise, static electricity. Typically a problem with switches. Need a pull-up or pull-down resistor to eliminate high problems resulting from floating gates. Other issue: Switch bounce. “Debounce” can be done in hardware or software 27
  • 49. digital logic gates. Floating gate: A digital device gets confused if it doesn’t see ground or 5V. Causes of confusion: RF noise, static electricity. Typically a problem with switches. Need a pull-up or pull-down resistor to eliminate high problems resulting from floating gates. Other issue: Switch bounce. “Debounce” can be done in hardware or software 27
  • 50. digital logic gates. Floating gate: A digital device gets confused if it doesn’t see ground or 5V. Causes of confusion: RF noise, static electricity. Typically a problem with switches. Need a pull-up or pull-down resistor to eliminate high problems resulting from floating gates. Other issue: Switch bounce. “Debounce” can be done in hardware or software 27
  • 51. feedback loops. The output of the system is fed back to the system as an additional input. Adds complexity. Timing becomes crucial when multiple objects are linked. 28
  • 52. analog to digital. MCU can “deal” with analog only after analog-to-digital converter (ADC) digitizes or quantizes the analog signal. Resolution is based on number of bits and sensitivity of ADC. Example: ADC with 10V reference voltage and 12-bit resolution. 2^12 = 4096. Number of steps: 2#bits - 1 10V/4096 means MCU can read between at at 2.44 mV Resolution: resolution. Voltage Range / 2#bits 29
  • 53. voltage dividers. Voltage Divider Used to drop voltage to required level. Input to microcontroller if you replace R1 with a sensor that is based on variable resistance. Vout = Vin * [R2 / (R1+R2) ] - R1 -> 0, then Vout = Vin - R1 -> Infininity, Vout = 0 What happens if variable resistor is on bottom? 30
  • 54. transistors and gates. Sourcing versus Sinking a. Source current to device b. Sink current from device to ground. Common Anode / Common Cathode Gate Fan-In / Fan-Out Serial versus Parallel CMOS-TTL interfacing Bipolar Power Supply 31
  • 55. transistors and gates. Sourcing versus Sinking a. Source current to device b. Sink current from device to ground. Common Anode / Common Cathode Gate Fan-In / Fan-Out Serial versus Parallel CMOS-TTL interfacing Bipolar Power Supply 31
  • 56. transistors and gates. Sourcing versus Sinking a. Source current to device b. Sink current from device to ground. Common Anode / Common Cathode Gate Fan-In / Fan-Out Serial versus Parallel CMOS-TTL interfacing Bipolar Power Supply 31
  • 57. transistors and gates. Sourcing versus Sinking a. Source current to device b. Sink current from device to ground. Common Anode / Common Cathode Gate Fan-In / Fan-Out Serial versus Parallel CMOS-TTL interfacing Bipolar Power Supply 31
  • 58. transistors and gates. Sourcing versus Sinking a. Source current to device b. Sink current from device to ground. Common Anode / Common Cathode Gate Fan-In / Fan-Out Serial versus Parallel CMOS-TTL interfacing Bipolar Power Supply 31
  • 59. transistors and gates. Sourcing versus Sinking a. Source current to device b. Sink current from device to ground. Common Anode / Common Cathode Gate Fan-In / Fan-Out Serial versus Parallel CMOS-TTL interfacing Bipolar Power Supply 31
  • 60. transistors and gates. Sourcing versus Sinking a. Source current to device b. Sink current from device to ground. Common Anode / Common Cathode Gate Fan-In / Fan-Out Serial versus Parallel CMOS-TTL interfacing Bipolar Power Supply 31
  • 61. amplifiers and filters. Amplifier Circuits built using Operational Amplifiers (Op-Amps): a. Inverting (Av = -Rf / Rin) b. Non-Inverting (Av = 1+Rf/Rin) c. Differentiating d. Integrating e. Summing f. Subtractor Filters a. High-pass b. Low-pass c. Bandpass d. Bandstop (Notch) 32
  • 62. amplifiers and filters. Amplifier Circuits built using Operational Amplifiers (Op-Amps): a. Inverting (Av = -Rf / Rin) b. Non-Inverting (Av = 1+Rf/Rin) c. Differentiating d. Integrating e. Summing f. Subtractor Filters a. High-pass b. Low-pass c. Bandpass d. Bandstop (Notch) 32
  • 63. amplifiers and filters. Amplifier Circuits built using Operational Amplifiers (Op-Amps): a. Inverting (Av = -Rf / Rin) b. Non-Inverting (Av = 1+Rf/Rin) c. Differentiating d. Integrating e. Summing f. Subtractor Filters a. High-pass b. Low-pass c. Bandpass d. Bandstop (Notch) 32
  • 64. amplifiers and filters. Amplifier Circuits built using Operational Amplifiers (Op-Amps): a. Inverting (Av = -Rf / Rin) b. Non-Inverting (Av = 1+Rf/Rin) c. Differentiating d. Integrating e. Summing f. Subtractor Filters a. High-pass b. Low-pass c. Bandpass d. Bandstop (Notch) 32
  • 65. amplifiers and filters. Amplifier Circuits built using Operational Amplifiers (Op-Amps): a. Inverting (Av = -Rf / Rin) b. Non-Inverting (Av = 1+Rf/Rin) c. Differentiating d. Integrating e. Summing f. Subtractor Filters a. High-pass b. Low-pass c. Bandpass d. Bandstop (Notch) 32
  • 66. amplifiers and filters. Amplifier Circuits built using Operational Amplifiers (Op-Amps): a. Inverting (Av = -Rf / Rin) b. Non-Inverting (Av = 1+Rf/Rin) c. Differentiating d. Integrating e. Summing f. Subtractor Filters a. High-pass b. Low-pass c. Bandpass d. Bandstop (Notch) 32
  • 67. inductive loads and decoupling capacitors. Inductive vs. Resistive Loads Blowback Voltage a. When transistor turns off, motion of magnets in motor decelerating will induce back voltage across coils. b. Flywheel or Snubber diode allows voltage to dissipate safely. Always put diode in parallel to inductive load. Can also be in parallel to Collector- Emitter of transistor. Need decoupling capacitors across Vdd and GND of all ICs and Voltage Regulators when you have inductive loads. 33
  • 68. inductive loads and decoupling capacitors. Inductive vs. Resistive Loads Blowback Voltage a. When transistor turns off, motion of magnets in motor decelerating will induce back voltage across coils. b. Flywheel or Snubber diode allows voltage to dissipate safely. Always put diode in parallel to inductive load. Can also be in parallel to Collector- Emitter of transistor. Need decoupling capacitors across Vdd and GND of all ICs and Voltage Regulators when you have inductive loads. 33
  • 69. inductive loads and decoupling capacitors. Inductive vs. Resistive Loads Blowback Voltage a. When transistor turns off, motion of magnets in motor decelerating will induce back voltage across coils. b. Flywheel or Snubber diode allows voltage to dissipate safely. Always put diode in parallel to inductive load. Can also be in parallel to Collector- Emitter of transistor. Need decoupling capacitors across Vdd and GND of all ICs and Voltage Regulators when you have inductive loads. 33
  • 70. pulse width modulation. Pulse Width Modulation, abbreviated PWM. “Faking” an analog output signal by adjusting the on / off cycle (aka duty cycle) of a digital signal. Equivalent power to 20% YIELDS 2.4V continuous voltage. 50% YIELDS 6V 80% YIELDS 9.6V Vout = (Ton/Toff) * Vdigital 100% YIELDS 12V (ALWAYS ON) 34
  • 71. hysteresis Systems where inputs fluctuate rapidly near a threshold value result in noisy output. Hysteresis can be used to filter signals so that the output reacts slowly by taking recent history into account. For example, a thermostat controlling a heater may turn the heater on when the temperature drops below A degrees, but not turn it off until the temperature rises above B degrees. This prevents rapid switching on and off as the temperature drifts around the set point. Resulting in less voltage spikes and wear-and-tear on equipment. A Schmitt trigger is a simple electronic circuit that also exhibits this property. Often, some amount of hysteresis is intentionally added to an electronic circuit (or digital algorithm) to prevent unwanted rapid switching. This and similar techniques are used to compensate for contact bounce in switches, or noise in an electrical signal. 35
  • 72. scaling functions. Sometimes the range of your inputs doesn’t match the values of your outputs. Need a scaling function to adjust for variances in the two. OUTPUT DEVICE INPUT SENSOR 2000 500 Output Pulsewidth = (sensorValue - min. sensorValue) x Output pulseRange _______________________________________________ + min. Output Input sensorRange pulseWidth sensor Value Pulsewidth Output Input Range: Range: 1000 470 1000 30 36
  • 73. other electrical concepts. Smoothing, Sampling, Averaging Sometimes noise is added by the environment, sensor imperfections, or supporting circuit. Need to reduce that noise for performance. a. Smoothing: If sensor output, at rests, continuously bounces by 3, then divide output by 3 before using in computations. Cost of smoothed sensor reading is loss of resolution. Useful if output has small, finite states. b. Averaging: Take mean of last X sensor readings. Or keep array and sort each new reading, then take median. c. Sampling: Read sensors at twice the highest frequency component of observed phenomenon to reduce ambiguity. See Nyquist Criterion. Threshold, Edge, Peak a. Threshold: Detect is signal goes above/drops below certain value. May need to build in hysteresis for signals the hover around the threshold to eliminate constant fluctuations. b. Edge Detection: Detect a rising or falling edge of a signal. Use hysteresis to detect when signal hits the 10% and 90% mark of the final value. c. Peak detection: Ensure signal is above/below threshold value. Constantly measure signal input and compare to previous value. When new reading is less than previous reading, then peak has been reached. d. Signal Skew: Output signal slow to respond to change in input signal. Measure at 50%. e. Signal Slew: Slow rise or fall time of signal. Measure between 10% and 90%. 37
  • 74. more about electronics. Tools you will need: a. Variable temperature soldering iron, solder (60/40 .32”), flux, solder braid, solder sucker b. Digital multimeter c. USB oscilloscope d. Wire strippers, needle nose pliers e. Magnifying class f. Anti-static pad and wrist strap g. Alligator clips h. Breadboards (various sizes) i. Long reach tweezers j. Precision screwdriver set k. IC chip extractor / inserter l. “Third hand” tool m.Calipers 38
  • 75. types of sensors and actuators. Sensors (input transducers, from the real-world to the computer) Beware of sensor drift, use redundant and independent sensors. a. infrared b. pressure c. temperature d. magnetic e. microphone f. RFID reader g. photodiode h. strain gauge i. accelerometers Output transducers or indicators (from the computer to real-world) a. radios / antenna b. light bulb / LED c. speaker / buzzer d. screens / monitors Actuators (creating motion) a. dc motor b. servo c. piezoelectric motor 39
  • 76. using a multimeter. Analog versus digital Auto-ranging Polarity check Continuity check Measure current, voltage, resistance, capacitance Diode and transistor check 40
  • 77. using an oscilloscope. Measure voltage over time. Watch electrical signal over time as waveform. Can be digital, analog, or PC- based (USB). Measure in both time and frequency domains (via a Fast Fourier Transform or FFT) Other useful equipment: Function generator DC power supply Logic analyzer 41
  • 78. soldering techniques. Use soldering iron with adjustable temperature, let soldering iron get hot. Heat the joint, not the solder. Clean component leads and PCB before. Usually used .32” 60/40 solder. Smaller joints are better joints. Keep tip clean, tin your tip smoothly. Side of tip gets hotter than the very tip of the soldering iron (larger surface area). Keep moist sponge. Use flux, desoldering vacuum, solder wick, helping hands tool, tweezers, heat sinks. Ensure room is well ventilated as solder contains lead. Turn soldering iron off when done. 42
  • 79. other hardware skills. RF and IR wireless links. Want to do home automation? Try X10 hardware. There is an Wiring library to interface with X10. XBee radios do the “dirty” work of controlling RF communications between microcontrollers. 43
  • 80. thermal management with heat sinks High current and high frequency devices can generate a lot of heat which can damage components, especially ICs. Dissipate heat through the device (radiation), heat sinks (conduction), and fans (convection). Thermal Resistance (θja) is the measure of how efficiently heat is transferred across the boundary between two different mediums. Measured in °C/W θja: Overall thermal resistance θcs: Thermal resistance of thermal paste θjc: Thermal resistance of the package θsa: Thermal resistance of heat sink TJ: Temperature of device/package junction TA: Temperature of ambient air TS: Temperature of heat sink TC: Temperature of device case P: Power (Watts, P = IV) θja (with heat sink) = θcs + θjc + θsa = (TJ - TA) / P θja (without heat sink) = θjc + θca = (TJ - TA) / P Lower thermal resistance means better heat sink. Heat sinks with large surface area and good air circulation gives best heat dissipation. Don’t forget the thermal paste! 44
  • 81. sizing the heat sink Given: Find heatsink with θsa <= 6.8°C/W θja = 8°C/W θjc = 0.2°C/W θcs = 0.5°C/W TJmax = 85°C Ex. Part# 240-12.7B has θsa = 6°C/W and TAmax = 70°C Vmax = 3.3V Imax = .6A meets dimensional requirements. P = IV = .6A x 3.3V = 1.98W to dissipate Verify it will work. P <= (TJ - TA) / θja = (85°C - 70°C) / 8°C/W TJ = [ (θcs + θjc + θsa) x P ] + TA TJ = 78.7°C P <= 1.85W TJmax = 85°C 1.98W is NOT less than 1.85W, therefore 78.7°C < 85°C, therefore good to use. heat sink is required. Use 10%-15% safety factor in actual application. NOTE: If 15% safety margin was used... θja = (TJ - TA) / P = (85°C - 70°C) / 1.98W 78.7°C x 1.15 = 90.5°C θja = 7.5°C/W 90.5°C is NOT less than 85°C, therefore heat sink 240-12.7B is not a good choice. θja = θcs + θjc + θsa 7.5°C/W = 0.2°C/W + θsa + 0.5°C/W θsa <= 6.8°C/W 45
  • 82. Putting hardware and software together. It is an irrelevant argument as to whether software or hardware is “better”. Both are necessary, and you will be the master when you know when to use each. 46
  • 83. a complete design from concept to product. Concept: A system that reads an RFID tag, validates identity, and adjust lights to user’s preferences. First outline and diagram what needs to be designed. Simulate hardware design. Write code, stub in hardware interaction Validate user Read RFID tag Control lights Recall preferences 47
  • 84. a complete design from concept to product. Determine what components are required. a. Which microcontroller, sensor, actuator, etc? b.What will be done in hardware and what will be done in software? Validate user Read RFID tag Control lights Recall preferences RFID MICROCONTROLLER X10 TAG 48 CONTROL READER UNIT
  • 85. a complete design from concept to product. Determine what components are required. a. Which microcontroller, sensor, actuator, etc? b.What will be done in hardware and what will be done in software? FUNCTIONAL Validate user Read RFID tag Control lights Recall preferences RFID MICROCONTROLLER X10 TAG 48 CONTROL READER UNIT
  • 86. a complete design from concept to product. Determine what components are required. a. Which microcontroller, sensor, actuator, etc? b.What will be done in hardware and what will be done in software? PHYSICAL Validate user Read RFID tag Control lights Recall preferences RFID MICROCONTROLLER X10 TAG 48 CONTROL READER UNIT
  • 87. when to use hardware versus software. When to “do it” in hardware a. Speed is a concern. b. PCB real estate is not a concern. c. Recurring per unit costs. d. If it is easier to do in hardware than software, such as CRC circuit. When to “do it” in software a. Adaptable, quick/easy changes. b. Data that varies from user to user. c. Once implemented/tested, no more per unit costs. d. If there are fast, simple, powerful libraries available to perform certain functions. Both have advantages/disadvantages! 49
  • 88. when to use hardware versus software. ICs IR LED When to “do it” in hardware Transistor a. Speed is a concern. Capacitor b. PCB real estate is not a concern. c. Recurring per unit costs. d. If it is easier to do in hardware than software, such as CRC circuit. When to “do it” in software a. Adaptable, quick/easy changes. b. Data that varies from user to user. c. Once implemented/tested, no more per unit costs. d. If there are fast, simple, powerful libraries available to perform certain functions. Both have advantages/disadvantages! 49
  • 89. when to use hardware versus software. ICs IR LED When to “do it” in hardware Transistor a. Speed is a concern. Capacitor b. PCB real estate is not a concern. c. Recurring per unit costs. d. If it is easier to do in hardware than software, such as CRC circuit. When to “do it” in software a. Adaptable, quick/easy changes. main( ) b. Data that varies from user to user. function1( ) c. Once implemented/tested, no more per int x unit costs. float y d. If there are fast, simple, powerful libraries available to perform certain functions. Both have advantages/disadvantages! 49
  • 90. a complete design from concept to product. Design architecture Identify what to do in HW and SW, define interfaces. Design and build HW and SW components, test and debug separately. Integrate hardware and software. Test, debug, test, debug, ... Document, document, document THROUGHOUT. 50
  • 91. common mistakes. Remember Occam’s Razor and be methodical in troubleshooting the following: a. Not hooking up ground or power. b. Reversing ground and power. c. Connecting power/ground to wrong IC pin. d. Connecting to different pin then what is written in the software. e. Not supplying sufficient power. f. No pull-up/pull down resistor on I/O pin. g. “Dirty” power supply. h. Switch bounce. i. Wrong resolution. j. Mixing up the TX and RX pins. k. Wrong serial port. l. Another application is controlling the serial port. m. Incompatible baud rates. n. Bad components (not the microcontroller or software’s fault) o. Bent IC pin or chip in backwards. p. ASCII versus raw byte. q. Poor soldering job, shorted traces or pins. r. Something was miscoded in software -- remember code, debug, code, ... 51
  • 92. hardware you’ll come to know. Switches Battery (Cells) Antenna Normally Open vs. Normally Closed Momentary vs. Toggle Motors Make-then-break, Break-then-make DC Analog-to-Digital Converter Poles and Throws (SPST, SPDT) Stepper RC Network and RCTime Function Foot RC Servo if ADC unavailable on uC Tape Silicon Controlled Rectifier (SCR) Digital-to-Analog Converter Roller DIAC / TRIAC Operational Amplifier Whisker Transistors Audio Amplifier Micro BJT (Higher current capability) Schmitt Trigger (Hysteresis) Tilt NPN (N.O.) Liquid Crystal Display (LCD) Reed (magnetic) PNP (N.C.) Piezoelectric Devices Wire (AWG number) Darlington Pair H-Bridge Solid FET (Faster, low power) Bridge Rectifier Braided JFET Power Inverter Coaxial MOSFET Opto-Isolator Twister Pair Enhancement Ground / Earth / Chassis Resistors Depletion Digital and Analog (Linear) Integrated Circuits (ICs Fixed vs. Variables Incandescent Bulbs 555 timer Potentiometer (pot) Oscillator F/V and V/F converter Rheostat Microphone Vibrating motor Thermistor Speaker PTC fuse Photoresistor Voltage Regulator RFID reader Flex Digital Logic Gates Rectifier Force Sensitive AND Header, socket, jacks Capacitors OR IR transmitter / receiver varactor NAND Vibratab polarized NOR PIR sensor non-polarized XOR Ultrasonic ranging sensor Inductors XNOR Line sensor chokes NOT (Inverter) Hall sensor transformers Buffer (Tri-State Buffer) RF transmitter/receiver pair solenoids (linear motion) Flip-Flop Accelerometer Mechanical relays Latch Pressure sensor Solid State Relays Shift Register Temperature sensor Ferrite beads Encoder / Decoder GPS Boards Multiplexer / Demultiplexer Bluetooth / WiFi / Ethernet module Breadboard Transmission gate Wheatstone bridge Perforated Board Diodes (anode + / cathode -) Heat sinks Copper Etch Zener Printed Circuit Board (PCB) Light-Emitting (LED) Varistors 7-Segment Display Varactor Schottky Sidactor Tunnel Fuses Photodiode 52
  • 93. staying focused. you can do it! Keep an engineering journal and track every idea. Stay high level. Don’t over plan, experiment a lot. a. However, don’t just start coding or hooking up components. Spend the time doing paper design, flowcharts, and prototype individual subsystems. b. Try some circuit simulators such as TINA and EDISON. Collaborate with others. Spend time learning mechanical motions and materials too. a. Levers, Gears, Pulleys, Ratchets, Cam, Joint, Pistons, Linkages. (Keep your LEGOs!) b. Metals, Plastics, Adhesives, Conductive cloth and thread. Conductor versus Insulators. 53
  • 94. where to shop. www.adafruit.com www.sparkfun.com www.parallax.xom www.goldmine-elec.com www.digikey.com www.jameco.com www.makershed.com Also, many vendor will offer free samples. Fairchild, National Semiconductor, and Microchip for example. Check out www.ladyada.net Spec Sheets Important to learn how to read schematics and understand circuit symbols. www.symbols.net/electrical www.octopart.com 54
  • 95. where to find out more. www.michaelbparks.com blog: Geek Cowboy (blog.geekcowboy.net) email: mike@michaelbparks.com www.arduino.cc www.processing.org www.makezine.com www.ladyada.net Guide to Programmable Logic Controllers PC / Arduino Proxy Interface Igoe, Tom. Making Things Talk and Physical Computing Platt, Charles. Make: Electronics Banzi, Massimo. Getting Started with Arduino Mims, Forrest. Engineering Notebooks. 55
  • 98. typical problems and solutions. Problems a. Ground loops b. Cross talk c. Noise d. Jitter e. Skew f. EMI g. Ringing h. Spikes / Droop Solutions a. Bypass b. Decouple c. Shielding d. Layout e. Ground plane f. Hierarchy / abstraction in design g. Regularity h. Modularity i. Locality 58
  • 99. power. Real Power: Watts. P = V*I*cos(phase angle) - DC power, phase angle = 0, cos(0) = 1, therefore P=VI Reactive Power: VARs. Q = V*I*sin(phase angle) Complex or Apparent Power: Volt-Ampere, VAs. S = V*I S = P + jQ, S2 = P2 + Q2 Power Factor = Real Power / Apparent Power. - Ideal PF is 1. Power is the rate at which energy is consumed, measured in joules per second. Energy is measured in joules or more common;y Kilowatt-Hour (kWHr) 59
  • 100. more power. Batteries: Rated in mA-Hr. A 1000 mA-Hr batter can source 1000 mA for 1 hour. Supply correct voltage, but can over supply current. A 12V, 3A source can power 3 12V, 1A devices. Increase voltage, can spin a wheel faster. Increase current, can spin a larger wheel. Power DC jacks. DC power jack: power center, ground shield or vice-versa. Audio Impedance Matching: Source resistance, Speaker resistance. Square root of source resistance over speaker resistance. Noise margins Transformer relations: Np/Ns = Vp/Vs = Is/Ip Root-Mean-Square (RMS) Voltage: DC equivalent of an AC voltage. High Impedance (Z) CIVIL, ELI the ICE man. 60
  • 101. decibels. Ap (ratio) = Pout / Pin Ap (bel) = log(Pout/Pin) Ap (dB) = 10 log10(Pout/Pin) Vp (dB) = 20 log10(Vout/Vin) Unity Gain = 0 dB Multiply ratios, Sum bels. Gain is to increase, attenuate is to drop 1 bel = 50% RF (dBm). 1 mW of power transmitted. dBm = 10 log10 (power received) - 1mW received: 10 log10 (1 mW) = 0 dBm (ideal) - .5mW received: 10 log10 (.5 mW) = -3.01 dBm Bode plot (phase margin) 61
  • 103. other topics. Karnauph Maps Sequential versus Combinational logic. Mealy versus Moore machines. Direct versus Capacitive Coupling a. Direct: No frequency dependance, attenuates signal, high input impedance possible b. Capacitive: Less gain at low freq, less impedance at high freq, no attenuation, block unwanted DC components. Design Abstraction: Behavioral (RTL, VHDL); Structural (circuit, logic gate, ERC); Physical (layout, DRC) 63
  • 104. IC package types. Dual Inline Pins (DIP), socket mount Small Outline IC (SOIC), surface mount Plastic Lead Chip Carrier (PLCC) 64
  • 105. constraints. Design always a competition between: a. Size b. Power c. Speed d. Cost 65
  • 106. calibration graphs. Components of the same type will have a wide range of outputs given the exact same input. This is why spec sheets tend to give ranges of values. Seen in such components as ultrasonic range finders or thermistors. Need to put completed circuit through set of tests of varying inputs and measure the outputs, then graph the results. Will help later in reading sensor results and interpreting their meaning and/ or troubleshooting. 5 Output Voltage 5 3.75 4.25 2.5 3 1.25 1 0 1m 2m 3m 4m Distance (meters) 66

Notes de l'éditeur

  1. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  2. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  3. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  4. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  5. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  6. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  7. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  8. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  9. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  10. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  11. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  12. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  13. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  14. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  15. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  16. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  17. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  18. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  19. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  20. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  21. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  22. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  23. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  24. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  25. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  26. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  27. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  28. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  29. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  30. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  31. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  32. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  33. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  34. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  35. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  36. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  37. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  38. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  39. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  40. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  41. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  42. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  43. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  44. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  45. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  46. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  47. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  48. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  49. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  50. Capacitor: DC block, consume reactive power, bring p.f. to unity, filter, spike remover, tank/spring/small battery. Inductor: Transformer, Spark coil/ignition, Solenoid, remove EMI from long wires, choke AC, flywheel Resistor: Dissipate energy as heat, limit current, drop voltage, bleeder resistor Reactance: X=XL-XC. XL = 2*pi*f*L, XC = 1 / (2*pi*f*C) Resonance: Xc = XL fo = 1 / (2*pi*sqrt(LC)) Wo = 2*pi*fo Q = XL/R, Xc/R Time Constant = RC = L/R, TimeFinal = 5*TimeConstant
  51. bipolar power supply: neg terminal sucks up current, pos terminal sources current
  52. bipolar power supply: neg terminal sucks up current, pos terminal sources current
  53. bipolar power supply: neg terminal sucks up current, pos terminal sources current
  54. bipolar power supply: neg terminal sucks up current, pos terminal sources current
  55. bipolar power supply: neg terminal sucks up current, pos terminal sources current
  56. bipolar power supply: neg terminal sucks up current, pos terminal sources current