Stores data for a calculated value in your program.The value it holds may vary or change depending on the conditions or instructions specified in the program.
MICROCONTROLLER (1)■An integratedcircuit (IC) that can already beconsidered as a single-chip computer becauseinside it can be found all the necessary componentsof a computer system, including the centralprocessing unit (CPU) that serves as the brain of thecomputing device, timer/counter, clock, read-onlymemory (ROM), random-access memory (RAM), andprogrammable input/output peripherals.
3.
MICROCONTROLLER (2)■Having allthese essential components ina single chip makes it possible to performvarious dedicated tasks without the needfor other external circuits. As such, amicrocontroller is generally used as anembedded system, as an integral part ofmachineries such as appliances andautomobiles.
4.
EMBEDDED SYSTEM■A systemwith a set of instructions referred toas a program. It is embedded into devices toperform a specific function that can becontrolled, monitored, or performed withminimal or sometimes even without a userinterface. Some examples of commonlyknown microcontrollers are 8051, PIC seriesof microcontrollers.
5.
WHY USE ARDUINO?■There are numerous families of microcontroller platforms thatare available in the market, which offer the same features andfunctionalities, but using Arduino is advantageous to students,teachers, and others who are interested in developingmicrocontroller-based applications.■ Arduino is considered as one of the most successful tools forScience, Technology, Engineering, and Math (STEM)education. It is also an effective electronics prototyping toolused today, allowing the developers to create their ownprototype of an application.
6.
PROTOTYPE■ Refers tothe initial design or model of an application ordevice to demonstrate its requirements and functions.It will undergo fine tuning before it is eventuallytranslated into the final working model.
7.
1. Affordability.■ Learningmicrocontroller programming and robotics isnow affordable. It is less expensive compared to otherboards. A basic Arduino kit can be bought as a pre–assembled package of for manual assembly.
8.
2. Simplicity■ WithArduino’s simplicity, users can build differentprojects from the most basic for beginners to the moreadvanced applications for expert users. ArduinoSoftware (IDE) simplifies all complicated details ofmicrocontroller programming with its user – friendlyfeatures. You can easily build your own project bysimply following the step-by-step instructions providedin the user manual.
9.
3. Cross –Platform Compatibility■ The Arduino software (IDE) runs on different operatingsystems. It runs on Macintosh, Windows, and Linuxunlike other microcontroller platforms that usually runon only one system.
10.
4. Open Source■Arduino is designed as an open-source hardware andsoftware tool, allowing both experienced programmersand beginners to contribute to its modification,extension, and improvement.
11.
5. Arduino Community■Arduino has thousands of users around the world thatcan interact with each other, exchange ideas,knowledge, and experiences, and provide access todocumentation and tutorials on the Internet. This helpsothers Arduino users and enthusiasts to easily learnmicrocontroller programming even without abackground in programming, electronics, and robotics.
12.
Arduino Uno Microcontroller■Arduino Uno is an open-sourcemicrocontroller board based onthe ATmega328P microcontrollerthat was developed by Arduino.Atmega is a powerful chip at avery affordable price that isgenerally found in a smallmachine and appliances as wellas remote control toy cars androbots.Figure 1. Atmega 328 Microcontroller
13.
Arduino Uno Microcontroller■Arduino Uno is the first in a series of USB-basedboards. It is highly recommended for beginnersbecause it is the most documented in the Arduinofamily and provides an easy-to-use interface.
14.
Arduino Uno Microcontroller■IoT (Internet of Things) is a system that allowspeople around the world to exchange data and toconnect almost “all things” like electronic andcomputing devices, appliances, machines, andother applications with embedded systems overthe Internet. It is now one of the latest trends inthe development of microcontroller projects.
15.
Parts of theArduino Uno Microcontroller Unit11. Microcontroller – acts asthe brain of the entiresystem. This is where theinstructions on what themicrocontroller will do issent and processed
16.
Parts of theArduino Uno Microcontroller Unit2. USB Port – this is used tosupply power to the systemand to transmit and uploaddata from the computer.2
17.
Parts of theArduino Uno Microcontroller Unit2. USB Port – this is used tosupply power to the systemand to transmit and uploaddata from the computer.2
18.
Parts of theArduino Uno Microcontroller Unit3. Barrel Jack – it is acircular port with a 2.1mmdiameter. It is another wayto supply power to the boardusing an AC – DC adapterthat gas 6 – 20 volts output.2
19.
Parts of theArduino Uno Microcontroller Unit4. Reset Button – this isused to restart the system.4
20.
Parts of theArduino Uno Microcontroller Unit5. Power Header – this isused to supply enoughpower to the externalcomponents of an Arduinoproject.5
21.
Parts of theArduino Uno Microcontroller Unit6. Digital Input / Output PinsThese pins are used to connectexternal devices to your board. DigitalPins are used to read or write digitaldata, which are either HIGH or LOW.Digital input pins read digital inputs,whereas digital output pins writedigital output.- Digital Pin I/O 0 to Digital Pin I/O 13- Pin A0 to A5 (Digital I/O Pin 14 toDigital I/O Pin 19)6
22.
Parts of theArduino Uno Microcontroller Unit7. Analog Input Pins –compared with digital data,which are either HIGH or LOW,analog data covers all values ina specific range. Analog pinsread digital input, write digitaloutput but not analog output.- Analog Input Pins A0 to A57
23.
Parts of theArduino Uno Microcontroller Unit8. Analog Output Pins / PWM(Pulse – Width Modulated) Pins– Analog Output Pins ~3, ~5,~6, ~9. ~10, ~117
Integrated Development Environment(IDE)Is a software application that provides the developer orprogrammer a development tool with a graphic userinterface (GUI) to write and test the code =. It makes iteasier to write Arduino code, conduct testing, and uploaddata to the microcontroller. It was designed using theJava Programming Language and was based onProcessing Language together with other open-sourcesoftware.
26.
Getting Started withArduino (IDE)You have two (2) options in running an Arduino IDE – itcan be run either online or offline.Online IDE – if you have a stable/reliable internetconnectivity, you can use the Arduino Web Editor, whichcan be accessed through https://create.Arduino.cc/Here you can always access the latest version of the IDEwithout the need to install the software and subsequentupdates. It also allows you to create and save yoursketches over the internet
27.
Getting Started withArduino (IDE)Desktop IDE – If you opt to work offline, you need todownload and install the latest version of the desktopArduino IDE.Downloading Arduino Software IDEhttps://www.Arduino.cc/en/Main/SoftwareOpening Arduino Software IDETo open and launch Arduino IDE just click the shortcut orthe folder where the file was saved.
28.
Installing Arduino IDEAfterthe Arduino IDE software has been downloaded,simply double-click the file that was saved.Follow the on-screen instructions and finish theinstallation.
30.
Title Bar■ Thisshows the filename of the sketch. Filename refersto the name you use to identify your program.■ The title bar also contains the minimize, maximize, andclose buttons of the application.
31.
Menu bar■ Thisallows access to all the different functions andcommands of the Arduino IDE.
32.
Toolbar■ Verify button– this is used to check the code for anysyntax error before the program is uploaded to yourmicrocontroller. A syntax error refers to an error in thesource code that causes failure in executing theprogram. Once an error occurs, the programmer mustdebug the program. Debugging means finding andfixing or resolving any errors in your program.
33.
Upload Button■ Thisis used to transfer the program from yourcomputer into the microcontroller after successfullyverifying that the source code is free from errors
34.
New File Button■This allows you to create a new file or new Arduinowindow.Open button■ This is used to retrieve previous sketch/sketches.Save button■ This allows you to save the current sketch to yourcomputer.
35.
Serial Monitor■ Thisconnects the computer and the Arduino and isused to send and receive serial data. It is also usefulfor debugging purposes and can be used to control theArduino using the keyboard.Status Bar■ This provides feedback after the verification andcompiling of the program.
Hardware■ The physicalpart or component of a machine.■ These are tangible components that you can touch, see, and feel.■ Users cannot duplicate the hardware unless it is constructed ormanufactured using physical materials and or components.■ It can be replaced with a new one if damaged.■ It is not affected by computer viruses.■ It cannot be electronically transferred through a computernetwork.
38.
Software■ Contains theset of instructions that is used to control and operatethe machine.■ These are intangible components that cannot be seen or touched.■ Users can duplicate and have many copies of a software.■ Are developed by writing instructions using a specificprogramming language.■ Are used to control the functions of a computer or robot.■ A backup copy can be reinstalled if it is damaged or corrupted.■ Can be affected by computer viruses.■ Can be transferred electronically through a computer network.
39.
Program and ProgrammingLanguage■ A software program is a set of instructions that is used to tella machine what to do. There are various ways to write thesecommands using different types of programming languages. Aprogramming language is used by programmers anddevelopers to write code that contain commands that will beexecuted by a computer device. The Arduino microcontrollercan be developed using different programming languages likethe MATLAB, Industrial Robot Languages, C/C++, C#/.Net,Java, Python, and more.
1. Analysis■ Thisphase defines and analyzes the problem.The success of a computer program may dependon the proper analysis of what you want aprogram to do. This is made possible byidentifying the purpose of the program, theproblems to be solved, the requirements, andthe possible solutions.
42.
2. Design■ Inthis phase, the programmer designs analgorithm of the solutions to the problem beforewriting the actual program. An algorithm is asequence of instructions needed to solve theproblem. The programmer may also use a visualrepresentation of the solution to the problemusing a flowchart.
43.
3. Coding andDebugging■ This phase refers to the process of writing codeor instructions using a specific programminglanguage. After writing the code, theprogrammer must detect, locate, and correct anysyntax errors. This process is known asdebugging. Syntax refers to the grammaticalrules of a specific programming language.
44.
4. Testing■ Oncethe program is free from any errors orbugs, the programmer needs to check theprogram’s efficiency to ensure that there are nological errors. This means it works as it isexpected and meets the requirements based onthe specifications that were analyzed.
45.
5. Implementation andMaintenance■ Implementation means the program is ready foruse after it has passed all the previous phasesand met the specified requirements. Duringimplementation, the program may requireupgrading and maintenance to adapt to minorchanges in the requirements.
46.
Algorithms, Pseudocode, andFlowcharts■ Algorithms, pseudocode, and flowcharts are commontools used in designing the solution to a problem. Theseare helpful in developing a program especially forbeginners. Since they are independent of a specificprogramming language, they make it easier tounderstand the problem and its requirements, and tostudy possible alternative solutions before writing theactual program.
47.
Advantages■ They areprogram – independent. This means that they can belearned without a formal background in any programminglanguage.■ They offer substitutes to the usual lengthy narrativedescription of program.■ They are easier to understand than a program written in aspecific programming language.■ They allow the users the chance to focus on other importantmatters.■ They allow easy analysis in each part of the process in theprogram.
48.
Limitations■ Since itis program independent, it does not representany programming language. This means that it isunderstandable by person-to-person rather that person-to-computer.■ They do not represent a natural means ofcommunication.■ They only show the step-by-step process in the program,but do not explain why a particular set of operation ismade.
49.
Algorithm■ Depicts thenarrative description of the procedure for thesolutions to the problem in a computer program.Example:Problem – Display value of a number from 1 to 10AlgorithmStep1: Initialize the value of number to 0Step2: Increment value of number by 1Step3: Display value of numberStep4: If value of number is less than 5 then go back step 2,otherwise end the process.
50.
Number Display Isnumber < 10(STEP 1) 0(STEP 2) 0 + 1 = 1 (STEP 3) 1 (STEP 4) 1 < 5 = TRUE(since TRUE, go back to STEP 2)(STEP 2) 1 + 1 = 2 (STEP 3) 2 (STEP 4) 2 < 5 = TRUE(since TRUE, go back to STEP 2)(STEP 2) 2 + 1 = 3 (STEP 3) 3 (STEP 4) 3 < 5 = TRUE(since TRUE, go back to STEP 2)(STEP 2) 3 + 1 = 4 (STEP 3) 4 (STEP 4) 4 < 5 = TRUE(since TRUE, go back to STEP 2)(STEP 2) 4 + 1 = 5 (STEP 3) 5 (STEP 4) 5 < 5 = FALSE(since FALSE, the process will STOP)SIMULATION
51.
Flowchart■ Used asa graphical representation of the algorithm. Ituses different symbols to demonstrate each process inthe program. Each symbol represents a specificfunction. With a flowchart, you can easily visualize andanalyze the process in the algorithm, and identify therelationships between the steps in the processLimitations■ User needs to be familiar with the symbols and their functions.■ It can sometimes become lengthy if there are interconnectedsymbols that can otherwise be explained in just a few narrativelines.
52.
Name Symbol FunctionTerminalSymbol To start and stop a procedure or a program.Initialization To prepare initial data or values for a variable.Input/Output Box To store and read input data and display theoutput.Processing Box To denote processing in a program.Decision Box To signify that a condition must be evaluated,and a selection must be made of whether todetermine the next procedure.Flow Direction Indicator→ ←↑↓ To signify the order and direction of the flow ofoperation.On-page Connector To connect a symbol to other parts of theflowchart symbol within the same page to avoid along queue of flow lines.Off-page Connector To connect the next process of the flowchart thatis located on the next page.
53.
Flowcharting Technique■ SequentialStructure – this is used when the procedurein the program is to be executed in sequence or oneafter the other.
54.
Problem – Askan input of twonumber, compute, and display itssum.Algorithm:1. Initialize variable num1,num2, sum2. Input value for num1 andnum23. Compute for the sum twooutput numbers4. Formula sum = num1 +num25. Display value of sumSTARTnum 1, num 2, sum = 0Input num 1, num 2sum = num 1 + num 2display sumEND
55.
Flowcharting Technique■ SelectionStructure – this is used when a program statement requires tobe tested as whether it is TRUE or FALSE, and the corresponding logicalpath will be taken, both logical paths must eventually end with theterminal symbol (STOP) to exit the flow structure.
56.
Problem – Inputtwo numbers,compare them, and display whichvalue is larger.Algorithm:1. Initialize variable num1,num2 to zero2. Input num1, num23. Is num1 > num2?‘If TRUE, do step 4, else do step 54. Display the value of num 15. Display the value of num2If TRUE, do step 4, else do step 5STARTNum2 = 0Input num 1, num 2STOPis num1 > num2?Display num1 Display num2TRUE FALSE
57.
Flowcharting Technique■ IterationStructure – used when the program structure requires repetitionor iteration. It also uses the decision symbol to test when the loopingstructure will repeatedly perform the process while the condition is TRUEand when it will exit once the condition becomes FALSE.TF
58.
Problem – Displayvalue of anumber from 1 to 5.Algorithm:1. Initialize value ofnumber to 02. Increment value ofnumber by 13. Display value of number4. If value of number is lessthan 5 then go back tostep 2, otherwise endthe process.STARTNumber = 0Number = number + 1STOPIs number < 5 ?Display numberFALSE11TRUE
59.
Problem – Displayvalue of anumber from 1 to 5.Algorithm:1. Initialize value ofnumber to 12. Display value of number3. If value of number is lessthan or equal 54. Increment value ofnumber by 15. If value of number is lessthan 5 then go back tostep 2, otherwise endthe process.STOPSTARTNumber = 1Is number ≤ 5 ?Display numberFALSE11TRUENumber = number + 1
Pseudocode■ An algorithmthat uses English structured phrases torepresent the process to be processed in a program. Itsdifference with the usual algorithm is that it resembles thestatement in a particular programming language.■ It is used during the design phase to give more attention tothe logic of the algorithm without being distracted by theprogramming syntax.■ With this, it will be easier for the programmer to translatethe pseudocode into a source code, a line of code written ina specific programming language that is executable andunderstandable by a computer.
62.
Problem: Display thevalueof a number from 1 to 5.Algorithm:1. Initialize value ofnumber as 0,2. Increment value ofnumber by 1,3. Display value of number,4. If value of number is lessthan 5 then go back tostep 2, otherwise endthe process.