2 Pulse Width Modulation (PWM) PWM is a way of digitally encoding analog signal levels.Through the use of high-resolution counters, the duty cycle of a square wave is modulated to encode a specific analog signal level. The PWM signal is still digital because, at any given instant of time, the full DC supply is either fully on or fully off. The voltage or current source is supplied to the analog load by means of a repeating series of on and off pulses. The on-time is the time during which the DC supply is applied to the load, and the off-time is the period during which that supply is switched off. Given a sufficient bandwidth, any analog value can be encoded with PWM.
3 Pulse Width Modulation (PWM) Three different PWM signals. Figure 1a shows a PWM output at a 10% duty cycle.That is, the signal is on for 10% of the period and off the other 90%.Figures 1b and 1c show PWM outputs at 50% and 90% duty cycles, respectively.These three PWM outputs encode three different analog signal values,at 10%, 50%, and 90% of the full strength.If, for example, the supply is 9V and the duty cycle is 10%, a 0.9V analog signal results.
7 MOTORS servo Hobby Servo: Built in Encoder -- Built in Servo Controller+V, GND, SignalGive the signal line a PWM value. (like PWM)ATT: Pulse Width DEFINES POSITION, NOT SPEEDPulse Width Signal created by Built Servo Controller.[the above is true for hobby servos. It allows for cheapMotors. Industrial servos, use different controlTechniques….]
11 RELAYS solid state Solid State Relays (SSR) DC Solid State: opto-isolation, very fast (PWM), very low power, drive directly fromMicrocontroller.AC Solid State: same as above, may not be able to switch faster than the ACSignal frequency. (used in light dimmers)
12 RELAYS vs. Transistor Switch Mechanical Relay: cheap, makes little noise, visibleMechanical motion.Solid State Relay: opto-isolation, very fast (PWM),very low power, drive directly from microcontroller.Transistor Switch: very cheap, small, fast.
13 SENSORS RESISTIVE SENSORS: CAPACITIVE: PIEZO ELECTRIC PYRO ELECTRIC (change resistance)“Photocell”“Bend Sensors”“CO sensor”CAPACITIVE:(change capacitance)“Condenser microphones”“Touch Sensors”PIEZO ELECTRICPYRO ELECTRICSONARS
14 SENSORS PIEZO ELECTRIC: PYRO ELECTRIC Create voltage when bent / when voltage acrossthey bend… .some capacitive sensors havedigital-out built in.PYRO ELECTRICWarps when exposed to heat. => change capacitance(“Motion Infrared Sensors”)
15 SENSORS SONARS PHOTOTRANSISTOR Light controlled switches Emit sound and record time it takes for sound waves to return.(reflection, angle, complications…)PHOTOTRANSISTORLight controlled switches(base current created with photons)
16 SENSORS INFRARED REFLECTION SENSORS IR OPTICAL SWITCH Transmitter / Receiver in one package or two.(record reflection time, similar to sonars; can be used as collisiondetection sensors or data link.)IR OPTICAL SWITCHIR LED + PHOTOTRANSISTOR
19 H-Bridge and PowerC Motor Control with a TIP120 TransistorThis example assumes you're using a DC motor that runson low voltage DC, in the 5-15V range. Connect leads to Its terminals, and run if from a benchtop powersupply if you have one. Try changing the voltage on it, and seeing what effect it has. Don't go over themotor's rated voltage. Connect a switch in series with the motor and use it to turn on the motor.Connect the base of a TIP120 transistor to one pin of your microcontroller.Note the second power supply. Most motors take a great deal more current than a microprocessor, and need their own supply. The example below uses a 9V battery as a separate power source.Whatever motor you use, make sure the power source is compatible (i.e. don't use a 9V battery for a 3V motor!). Although the example shown is on a BX-24, you can use it with any microcontroller.Just connect the 1K resistor to the output pin of your microcontroller.
20 H-Bridge and PowerThis circuit drives small DC motors up to about 100 watts or5 amps or 40 volts, whichever comes first. Using bigger partscould make it more powerful. Using a real H-bridge IC makes sense for this size of motor, but hobbyists love to do it themselves, and I thought it was about time to show a testedH-bridge motor driver that didn't use exotic parts.
32 OUR ASSIGNMENTSLight to vary motor speed.Heat to set off siren.
33 Light to SpeedMapping data… AND redefine your baseline each time...
34 Heat to SoundDefine Threshold… AND redefine your baseline each time..
35 ANALOG VOLTAGES on ARDUINO analogRead: -- reads an analog voltage at any of the ADC pins (you have 6).analogWrite: -- writes a PWM pulse to the PWM enabled digital pins (you have 3).Sensor “Calibration”
36 READING/WRITING Global Issues, question 1&2. 2 pages max. Due: October 30th, beginning of Lecture.No lecture next week.