960 likes | 1.06k Views
Welcome to Workshop 88’s. Arduino 301: Control the World!. Please have your Arduino, IDE, and breadboard fired up and ready to go. ver 1.0 2/2/14. What we’re going to cover. Arduino pins: What you can connect directly For more muscle: Relays, Transistors
E N D
Welcome to Workshop 88’s Arduino 301:Control the World! Please have your Arduino, IDE,and breadboard fired up and ready to go. ver 1.0 2/2/14
What we’re going to cover • Arduino pins: What you can connect directly • For more muscle: Relays, Transistors • Solid state relays and 120VAC control • Movers: Servos, DC motors, Solenoids, Steppers • Bonus demo: BLDC motor intro Some of this is Arduino, some basic electronics.
Please Introduce Yourself! • Name, job, school etc • Why you’re here • Programming in general, and with Arduino in particular • Electronics experience: Digital? Analog? AC house wiring? • Hobby stuff: Robots? RC vehicles?
What we’re going to cover • Arduino pins: What you can connect directly • For more muscle: Relays, Transistors • Solid state relays and 120VAC control • Movers: Servos, DC motors, Solenoids, Steppers Some of this is Arduino, some basic electronics.
Direct connect • Arduino I/O pin hardware capabilities
Direct connect • Arduino I/O pin hardware capabilities Atmel AVR processor
Direct connect • Arduino I/O pin hardware capabilities • 4 states • Output: HIGH: ~5V, source ~20 mA • Output: LOW: ~0V, sink ~20 mA • Input: Hi-Z, no pullup • Input: 38KΩpullup to Vcc (5V often) • Absolute Max V: Vcc + 0.5V Atmel AVR processor
How do you know the details? Look at the datasheet!
Direct connect (Output!) • LED (with resistor!) • Some input expecting a “logic level” • Opto isolator (looks just like an LED!)
Direct connect: PWM Digital output are either ON or OFF but a computer can turn them ON and OFF really fast. If fast enough you get an effect in between ON and OFF. Works great for LED brightness control.
Direct connect: PWM • The usual approach is calledPulse Width Modulation • AVR chips support PWM only on certain pins. • Arduino does PWM by analogWrite(pin,value). • Must do pinMode(pin, OUTPUT); • analogWrite() accepts 8-bit values (0-255).
Direct connect: PWM (demo with scope)
Direct connect: PWM LED lab Run up 2 LEDs, fading up/down, 180° out of phase.
Direct connect: PWM and LEDs PWM is especially good for dimming LEDs since brightness is directly related to current. Varying voltage to an LED+resistor doesn’t work well at low levels.
Direct connect: PWM and LEDs (demo LED with PWM v varied voltage using scope meters)
Direct connect: logic level input • “TTL” standard • Servos (we’ll cover those later) • Serial communication • Any device with I2C or SPI interface
What we’re going to cover • Arduino pins: What you can connect directly • For more muscle: Relays, Transistors • Solid state relays and 120VAC control • Movers: Servos, DC motors, Solenoids, Steppers • Bonus demo: BLDC motor intro This is all basic electronics.
More muscle: Relays & Transistors • Let us control higher CURRENT • Let us control higher VOLTAGE • Sometimes provide ISOLATION
More muscle: Relays Classic open-frame relay
More muscle : Relays What you’re likely to use: a reed relay
More muscle : Relays Inside a reed relay
Relays: Snubber! • Snubber, clamp, flyback, suppressor, free-wheeling, catch diode • Do some kind of demo
More muscle : Transistors We can use transistors as electronically controlled switches. (Sort of like a relay, but often better.)
More muscle : Transistors • Lots of kinds of transistors • We’ll use two: • Common bipolar • Metal Oxide Field Effect (MOSFET)
More muscle : Transistors: Bipolar This is the most common type of bipolar transistor, and is the one we’ll use here.
More muscle : Transistors: Bipolar In general, transistors can be considered amplifiers, but Think of it as this:
More muscle : Transistors: Bipolar Point iNPlace
More muscle : Transistors Switching terms: “HIGHSIDE” “LOWSIDE”
More muscle : Transistors: Bipolar Inject small currentinto BASEto EMITTER to turntransistor ON Maincurrentflow
More muscle : Transistors: Bipolar What part numbers? • NPN: 2N2222(A), 2N3904 • PNP: 2N2907, 2N3906 What’s important? • Max collector voltage • Max collector current
More muscle : Transistors: MOSFET These are great! • Voltage controlled • VERY low ONresistance Insulated Gate!
More muscle : Transistors: MOSFET Think of it as this: