Arduino Unit 0: Introduction Circuits OHM’s Law Serial/Parallel Circuits The Arduino Platform Intro to Circuit - EE 101 SIMPLE CIRCUIT SWITCH Voltage Source Ground + - L O A D What is a Circuit? Circuit - same root word as circle - loop An electrical circuit is an uninterrupted path of electricity between the positive voltage pole and the ground or negative pole. Electrical Properties Voltage V Current I ● Defined as the amount of potential electrical energy in a circuit ● The rate of charge flow in a circuit. ● Units: Volts (V) ● ● Units: Amperes (A) “Intensity” of current. Resistance R ● Opposition to charge flow ● Units: Ohms (Ω) Ohm’s Law Ohm’s Law describes the relationship between the Voltage (V), Current (I), and Resistance (R) of a circuit. The three different forms of Ohm’s Law are sometimes written as: Voltage → Potential Energy Like height of water tower Water Tower Water Tower V V More Energy == Higher Voltage Less Energy == Lower Voltage V=IR V=IR Physics Lesson: Potential Energy If you hold two bouncy balls, one in each hand - one hand above your head and one by your hip, which one will bounce higher? Of course, the one dropped from a greater height bounces higher By being held higher, it has greater potential energy Energy takes many forms Chemical energy Chemical energy is energy stored in the bonds of chemical compounds (atoms and molecules).Chemical energy is released in a chemical reaction, often in the form of heat. For example, we use the chemical energy in fuels like wood, coal by burning them. Mechanical Energy Mechanical energy is the energy a substance or system has because of its motion. For example machines use mechanical energy to do work. Electrical Energy Electrical energy is the energy carried by moving electrons in an electric conductor. It is one of the most common and useful forms of energy. Example – Lightening. Other forms of energy are also converted to electrical energy. For example, power plants convert chemical energy stored in fuels like coal into electricity through various changes in its form. Thermal energy Thermal energy is the energy a substance or system has related to its temperature, i.e., the energy of moving or vibrating molecules. For example, we use the solar radiation to cook food. Voltage Definition: Electrical Potential Energy Water / Current Flow Analogy Resistance → Size of pipe (same height) Water Tower Big Pipe == Lower Resistance V=I R Water Tower Small Pipe == Higher Resistance V=IR Remember -- a Circuit is a “circle” (+) Circuit → Circle Series Circuits - in-line (and pictured with a separate “ground” though it’s the same as the negative pole) One path for electricity Resistors in series - Resistance ADDs Rtotal=R1+R2+...+Rn Parallel Circuits Circuit Splits and creates two or more paths. Resistors in parallel (more in next unit) 1 Rtotal= 1 1 + R1 1 +…+ R2 Rn The Replica Platform & Arduino RedBoard - Arduino-compatible Arduino: Arduino is an open source computer hardware and software company, project, and user community that designs and manufactures single-board microcontrollers and microcontroller kits for building digital devices and interactive objects that can sense and control objects in the physical and digital world. (Wikipedia) About the board ● ● ● ● ● ● ● ATmega328 Processor 14 digital input/output pins (six PWM pins) 6 analog input 16MHz crystal oscillator USB connection Power jack Reset button Assemble the breadboard and Arduino Uno Replica to the project baseplate Arduino Uno Anatomy Redboard Anatomy A. B. C. D. E. F. G. H. I. J. K. L. Power In “Barrel Jack” Power In USB Port LED- RX: Receiving LED- TX: Transmitting Pin 13 Onboard LED Digital I/O Pins Power LED Reset Button ISP (In-System Programming) Header Power Bus and Analog Inputs RFU (Reserved for Future Use) SparkFun Qwiic port A B H C E K D F J I L G The Arduino IDE Setup instructions on page 6 Instructions vary on each platform (Windows, Mac, Linux) IDE - Integrated Development Environment ● ● ● ● ● Text Editor (for code) Configuration Syntax Highlighting Verify Code Upload code to board The Arduino IDE Anatomy Verify and Upload Save Serial Monitor Source Code (Syntax Highlighting) Status Error Messages (COM) Port General Workflow 1. 2. 3. 4. 5. Construct circuit on board Select the right port (Tools->Port) Edit your code Upload to board Test the project Lather, rinse, repeat Parts and Components Redboard, Breadboard, and Wires LED’s and Resistors Inputs-Potentiometer, Switch, Buttons Output Devices: LCD Screen, Piezo Buzzer Special Sensors: Photoresistor, Temperature, Ultrasonic Distance Sensor Motors: Gearmotor, Servomotor