Introduction to Arduino: Microcontroller and IDE Basics PDF

Summary

This lesson delves into the world of Arduino microcontrollers, covering the Arduino Uno board, its components, and the development environment (IDE). It explores why Arduino is a valuable tool for STEM education, highlighting its affordability and simplicity. Topics include microcontroller basics, Arduino programming, setting up the IDE, and connecting to a computer.

Full Transcript

Lesson 2 : Arduino Microcontrolle Topics Topic one : Basic Parts of a Simple Robot Microcontroller : The Brain of the Robot Topic two : Arduino Microcontroller Unit Topic three : Different Parts of the Arduino Microcontroller Unit Topic four : Arduino Integrate...

Lesson 2 : Arduino Microcontrolle Topics Topic one : Basic Parts of a Simple Robot Microcontroller : The Brain of the Robot Topic two : Arduino Microcontroller Unit Topic three : Different Parts of the Arduino Microcontroller Unit Topic four : Arduino Integrated Development Tuesday, February 28, 2023 2 At the end of the lesson students will be able to do the following : Identify the basic parts of a simple robot Understand the importance of a controller as the “brain of the robot”. Discuss what Arduino is. List the advantages of using an Arduino microcontroller unit in prototyping Identify the parts of the Arduino Uno microcontroller. Identify the Arduino Uno IDE List the most commonly used functions in Arduino 3 A microcontroller is one of the vital components of modern Introductio electronics. It serves as the heart and brain of electronic devices. Its capabilities are innumerable depending on what is instructed to do through the n program. 4 A microcontroller is an integrated circuit (IC) that can already be Introductio considered a single-chip computer because inside, it can be found all the necessary components of a computer system, including the central processing unit (CPU) that’s serves as the brain of the computing n device, timer/counter, clock, ROM, RAM and programmable input/output 5 Having all these essential components in a single chip makes it Introductio possible to perform various dedicated tasks without the need for other external circuits. Microcontroller is generally used as an embedded system, as an integral part of machineries such as n appliances and automobiles. 6 Why use Arduino? 7 Arduino is considered as one of the most successful tools used for Science, Technology, Engineering and Math (STEM) education. It is also an effective electronics prototyping tool used today, allowing the developers to create their own prototype of an application. A prototype refers to the initial design or model of an application or device to demonstrate its requirements and functions. It will undergo fine tuning before 8 Here are some of the reasons why Arduino’s popularity is surging : 1. Affordability. Thanks to Arduino, learning microcontroller programming and robotics is now affordable. A basic Arduino kit can be bought as a pre-assembled package or for manual assembly 2. Simplicity. With Arduino’s simplicity, users are able to build different projects from the most basic for beginners to the more advanced application for expert users. Arduino software (IDE) simplifies all complicated details of microcontroller programming with its user-friendly features. You can easily build your own project by simple 9 3. Cross-Platform Compatibility. The Arduino software (IDE) runs on different operating system. It runs on Macintosh, Windows, and Linux, unlike other microcontroller platforms that usually run only to 4 Open one system. Source. Arduino is designed as an open source hardware and software tool, allowing both experienced programmers and beginners to contribute to its modification, extension and improvement. 5 Arduino Community. Arduino has thousands of users around the world that can interact with each other, exchange ideas, knowledge and experiences, and provide access to documentation and tutorials in the Internet. 10 Arduino Uno Microcontroller 2 8 r 3 a ro ll e eg t m co n T A cro M i 11 Parts of the Arduino Uno Microcontroller Unit Analog Output Pins / PWM (Pulse-width- Modulated) Pins Digital Input/Output Pins USB Port Reset Button Microcontroller (ATmega328P) Barrel Jack / Power Analog Input port Pins Power Header Parts of the Arduino Uno Microcontroller Unit 1. Microcontroller (ATmega328P) - major parts of Arduino board, acts as a brain of the entire system 2. USB Port - used both to supply power to the system and to transmit and upload data from the computer 3. Barrel Jack - It is a circular port with a 2.1 mm diameter. It is another way to supply power to the board using AC-DC adapter that has 6- 20 volts output. 4. Reset Button - used to restart the system 5. Power Header - used to supply power to the external components of an Arduino project 6. Digital Input / Output Pins - used to connect external devices to your board. Digital pins are used to read or write digital data, which is either HIGH or LOW Digital input pins read digital input ; Digital output pins write 13 Arduino Integrated Development Environment (IDE) Integrated Development Environment (IDE) is a software application that provides the developer or programmer a development tool with a graphic user interface (GUI) to write and test the code. It makes it easier to write Arduino code, conduct testing and 14 Getting Started with Arduino (IDE) 15 2 options in running an Arduino IDE ONLINE – if you have fast and reliable internet connection, you can use the Arduino Web Editor which can be accessed through https://create.arduino.cc OFFLINE – access thru desktop IDE. Opt to work offline, just download and install the latest version of the desktop Arduino IDE for free at https://www.Arduino.cc/en/Main/Software 16 Opening Arduino IDE* To open and launch Arduino IDE just click the shortcut or the folder where the file was saved. 17 1. Title Bar - shows the filename of the sketch. Filename refers to the name you used to 1 identify your program. 2. Menu bar – this allows access to all the different 2 functions and commands of the Arduino 3 4 IDE. 3. Toolbar - * Verify button – used to check the code for any syntax error before the program is uploaded to microcontroller * Upload button - used to transfer the program from your computer into the microcontroller after successfully 5 verifying that the source code is free from any errors. * New file button - this allows you to create a new file or new Arduino window * Open button - used to retrieve a previous sketch * Save button - allows you to save the current sketch to your computer 18 4. Serial Monitor - connects the computer and the Connecting the microcontrolle r to a computer 19 Setting up the Arduino IDE for Arduino Uno * Selecting the Microcontroller Tools > Board > Arduino/Genuino Uno 20 * Selecting the Port Tools > Port /COM5(Arduino Uno) Note : the Port number may vary depending on the available port provided by your computer) 21 Arduino IDE Basic Functions * Saving an Arduino Sketch 1. Click File > Save 2. Ctrl + S 3. Click the Save button in the toolbar * Creating a New Arduino Sketch 1. Click File > New 2. Ctrl + N 22 * Opening an Arduino 1. Click File > Open Sketch 2. Ctrl + O 3. Click the Open button in the toolbar * To check for syntax error 1. Sketch > verify/compile 2. Control + R 3. Click the verify button in the toolbar 23 * Uploading the in the Sketch in the Microcontroller unit 1. Click Sketch > Upload 2. Ctrl + U 3. Click the Open button in the toolbar Note : you will be able to upload your sketch successfully if there is no error : the Status bar should read Upload Done 24

Use Quizgecko on...
Browser
Browser