Getting Started with Arduino: Difference between revisions
Keyestudio (talk | contribs) |
Keyestudio (talk | contribs) |
||
Line 40: | Line 40: | ||
In those illustrations, you see the Arduino board. At first,all those connectors might be a little confusing. Here is an explanation of what every element of the board does: | In those illustrations, you see the Arduino board. At first,all those connectors might be a little confusing. Here is an explanation of what every element of the board does: | ||
Let's take a look at the details of this development board with the following chart: | |||
<br>[[Image:UNO.png|500px|frameless]]<br> | |||
{| width="80%" cellspacing="0" border="1" | |||
|- | |||
| align="center" | [[Image:KS0313 5.1-1.png|500px|frameless]] | |||
| align="light" | '''USB Connection''' | |||
Arduino board can be powered via USB connector. <br> | |||
All you needed to do is connecting the USB port to PC using a USB cable. | |||
|- | |||
| align="center" | [[Image:KS0313 5.1-2.png|500px|frameless]] | |||
| align="light" | '''DC Power Jack''' | |||
Arduino board can be supplied with power from the DC power jack | |||
|- | |||
| align="center" | [[Image:KS0313 5.1-3.png|500px|frameless]] | |||
| align="light" | '''Voltage Regulator''' | |||
To control the voltage provided to the Arduino board, as well as to stabilize the DC voltage used by the processor and other components. | |||
|- | |||
| align="center" | [[Image:KS0313 5.1-4.png|500px|frameless]] | |||
| align="light" | '''Crystal Oscillator''' | |||
Helping Arduino deal with time problems. How does Arduino calculate time? by using a crystal oscillator. | |||
The number printed on the top of the Arduino crystal is 16.000H9H. It tells us that the frequency is 16,000,000 Hertz or 16MHz. | |||
|- | |||
| align="center" | [[Image:KS0313 5.1-5.png|500px|frameless]] | |||
| align="light" | '''Arduino RESET''' | |||
You can reset your Arduino board, for example, start the program from the very beginning. Firstly, use the RESET button(17). Or you can connect an external reset button to Arduino pin 5 labeled RESET | |||
|- | |||
| align="center" | [[Image:KS0313 5.1-6.png|500px|frameless]] | |||
| align="light" | '''Pin Header(3.3V,5V,GND,Vin''' | |||
[[Image:KS0313 5.1-7.png|500px|frameless]]3.3V - provides 3.3V output voltage <br> | |||
[[Image:KS0313 5.1-8.png|500px|frameless]]5V - provides 5V output voltage<br> | |||
Using 3.3 volts and 5 volts, most components can normally operate with Arduino board together.<br> | |||
[[Image:KS0313 5.1-9.png|500px|frameless]]GND(Ground pins)- two GND headers on Arduino, each of which can be used for circuit ground.<br> | |||
[[Image:KS0313 5.1-10.png|500px|frameless]]Vin - You can supply an external power (like AC power supply) through this pin to Arduino board. | |||
|- | |||
| align="center" | [[Image:KS0313 5.1-11.png|500px|frameless]] | |||
| align="light" | '''Analog Pins''' | |||
Arduino UNO board has 6 analog inputs, labeled A0 through A5. These pins can read the signal from analog sensors (such as humidity sensor or temperature sensor), and convert it into the digital value that can read by microcontrollers) | |||
|- | |||
| align="center" | [[Image:KS0313 5.1-12.png|500px|frameless]] | |||
| align="light" | '''Microcontroller ''' | |||
Each Arduino board has its own microcontroller. You can regard it as the brain of your board.<br> | |||
The main IC (integrated circuit) on the Arduino is slightly different from the panel pair. Microcontrollers are usually from ATMEL. Before you load a new program from the Arduino IDE, you must know what IC is on your board. This information can be checked at the top of IC. | |||
|- | |||
| align="center" | [[Image:KS0313 5.1-13.png|500px|frameless]] | |||
| align="light" | '''ICSP (In-Circuit Serial Programming) Header''' | |||
In most case, ICSP is the AVR,an Arduino micro-header consisting of MOSI, MISO, SCK, RESET, VCC, and GND.It is often called the SPI (serial peripheral interface) and can be considered an "extension" of the output.In fact, put the output devices subordinateto the SPI bus host. | |||
|- | |||
| align="center" | [[Image:KS0313 5.1-14.png|500px|frameless]] | |||
| align="light" | '''Power LED Indicator''' | |||
Powering the Arduino, LED on means that your circuit board is correctly powered on. If LED is off, connection is wrong. | |||
|- | |||
| align="center" | [[Image:KS0313 5.1-15.png|500px|frameless]] | |||
| align="light" | '''TX and RX LED ''' | |||
Onboard you can find two labels: RX(receive ) and TX (transmit)<br> | |||
First appear on digital pin 0 and 1 for serial communication; <br> | |||
Besides, the RX LED on the board will flash in different speed when serial data is being transmitted. The flash speed depends on the baud rate set by board. And RX LED will also flash during the receiving process. | |||
|- | |||
| align="center" | [[Image:KS0313 5.1-16.png|500px|frameless]] | |||
| align="light" | '''Digital I/O''' | |||
Arduino UNO has 14 digital input/output pins (of which 6 can be used as PWM outputs). These pins can be configured as digital input pin to read the logic value (0 or 1). Or used as digital output pin to drive different modules like LED, relay, etc. The pin labeled “〜” can be used to generate PWM. | |||
|- | |||
| align="center" | [[Image:KS0313 5.1-17.png|500px|frameless]] | |||
| align="light" | '''AREF''' | |||
Reference voltage( 0-5V) for the analog inputs. Used with analogReference(). | |||
|- | |||
|} | |||
=====Installing Arduino IDE===== | |||
When you get theUNO development board, first you should install the software and driver of Arduino. Here you can browse the ARDUINO website at this link, https://www.arduino.cc, pop up the following interface. | |||
<br>[[Image:KS0313-1.png|600px|frameless]]<br> | |||
Then click the SOFTWARE on the browse bar, you will have two options ONLINE TOOLS and DOWNLOADS. | |||
<br>[[Image:KS0313-2.png|600px|frameless]]<br> | |||
Click DOWNLOADS, it will appear the latest software version of ARDUINO 1.8.5 shown as below. | |||
<br>[[Image:KS0313-3.png|600px|frameless]]<br> | |||
In this software page, on the right side you can see the version of development software for different operating systems. So ARDUINO has a rather powerful compatibility. You should download the software that is compatible with the operating system of your computer.<br> | |||
In our project, we will take WINDOWS system as an example here. There are also two options under Windows system, one is installed version, the other is non-installed version. | |||
For simple installed version, first click Windows Installer, you will get the following page.<br> | |||
<br>[[Image:KS0313-4.png|600px|frameless]]<br> | |||
<br>[[Image:KS0313-5.png|600px|frameless]]<br> | |||
This way you just need to click JUST DOWNLOAD, then click the downloaded file to install it. <br> | |||
For non-installed version, first click Windows ZIP file, you will also get the pop-up interface as the above figure.<br> | |||
Click JUST DOWNLOAD, and when the ZIP file is downloaded well to your computer, you can directly unzip the file and then click the icon of ARDUINO program to start it. <br> | |||
=====Installing Arduino (Windows)===== | |||
Install Arduino with the exe. Installation package | |||
<br>[[Image:713.png|600px|frameless]]<br> | |||
Click“I Agree”to see the following interface. | |||
<br>[[Image:714.png|600px|frameless]]<br> | |||
Click “Next”. Pop up the interface below. | |||
<br>[[Image:715.png|600px|frameless]]<br> | |||
You can press Browse… to choose an installation path or directly type in the directory you want.<br> | |||
Then click “Install” to initiate installation. | |||
Wait for the installing process, if appear the interface of Window Security, just continue to click Install to finish the installation. | |||
<br>[[Image:716.png|600px|frameless]]<br> | |||
All right, up to now, you have completed the Arduino setup! The following icon will appear on your PC desktop. | |||
<br>[[Image:Ks0313图片1.png|600px|frameless]]<br> | |||
Double-click the icon of Arduino to enter the desired development environment shown as below. | |||
<br>[[Image:717.png|600px|frameless]]<br> | |||
=====Installing Installing Driver===== | |||
Next, we will introduce the driver installation of UNO R3 development board. The driver installation may have slight differences in different computer systems. So in the following let’s move on to the driver installation in the WIN 7 system. <br> | |||
The Arduino folder contains both the Arduino program itself and the drivers thatallow the Arduino to be connected to your computer by a USB cable. Before we launch the Arduino software, you are going to install the USB drivers.<br> | |||
Plug one end of your USB cable into the Arduino and the other into a USB socket on your computer.<br> | |||
When you connect UNO board to your computer at the first time, right click the icon of your “Computer” —>for “Properties”—> click the “Device manager”, under “Other Devices”, you should see an icon for“Unknown device” with a little yellow warning triangle next to it. This is your Arduino.<br> | |||
<br>[[Image:Driver 1.png|600px|frameless]]<br> | |||
Then right-click on the device and select the top menu option (Update Driver Software...) shown as the figure below.. | |||
<br>[[Image:Driver 2.png|600px|frameless]]<br> | |||
It will then be prompted to either “Search Automatically for updated driversoftware” or “Browse my computer for driver software”. Shown as below. In this page, select “Browse my computer for driver software”. | |||
<br>[[Image:Driver 3.png|600px|frameless]]<br> | |||
After that, select the option to browseand navigate to the “drivers” folder of Arduino installation. | |||
<br>[[Image:Driver 4.png|600px|frameless]]<br> | |||
Click “Next” and you may get a security warning, if so, allow the software to be installed. Shown as below. | |||
<br>[[Image:Driver 5.png|600px|frameless]]<br> | |||
Once the software has been installed, you will get a confirmation message. Installation completed, click “Close”. | |||
<br>[[Image:Driver 6.png|600px|frameless]]<br> | |||
Up to now, the driver is installed well. Then you can right click “Computer” —>“Properties”—>“Device manager”, you should see the device as the figure shown below. | |||
<br>[[Image:Driver 7.png|600px|frameless]]<br> |
Revision as of 14:46, 23 July 2018
What is Arduino?
Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. You can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming language (based on Wiring), and the Arduino Software (IDE) , based on Processing.
Click the link below to get more info.
https://www.arduino.cc/en/Guide/Introduction
Getting Started with Arduino and Genuino products
The Arduino Platform
Arduino is composed of two major parts:
The Arduino board , which is the piece of hardware you work on when you build your objects. Arduino senses the environment by receiving inputs from many sensors, and affects its surroundings by controlling lights, motors, and other actuators.
The Arduino IDE , the piece of software you run on your computer. You use the IDE to create a sketch (a little computer program) that you upload to the Arduino board. The sketch tells the board what to do.
You can tell your Arduino what to do by writing code in the Arduino programming language and using the Arduino development environment .
Not too long ago, working on hardware meant building circuits from scratch, using hundreds of different components with strange names like resistor, capacitor,LED, transistor, and so on. Every circuit was "wired" to do one specific application, and making changes required you to cut wires, solder connections, and more.
With the appearance of digital technologies and microprocessors, these functions, which were once implemented with wires, were replaced by software
programs.
Software is easier to modify than hardware. With a few keypresses, you can radically change the logic of a device and try two or three versions in the same amount of time that it would take you to solder a couple of resistors.
Click here to get the Arduino Language Reference
The Arduino software icon is showed below.
Double-click the icon of Arduino to enter the desired development environment, you should see as below.
The Arduino Hardware
The Arduino board is a small microcontroller board,which is a small circuit (the board) that contains a whole computer on a small chip (the microcontroller). It is a lot cheaper and very useful to build interesting devices.
In those illustrations, you see the Arduino board. At first,all those connectors might be a little confusing. Here is an explanation of what every element of the board does:
Let's take a look at the details of this development board with the following chart:
Installing Arduino IDE
When you get theUNO development board, first you should install the software and driver of Arduino. Here you can browse the ARDUINO website at this link, https://www.arduino.cc, pop up the following interface.
Then click the SOFTWARE on the browse bar, you will have two options ONLINE TOOLS and DOWNLOADS.
Click DOWNLOADS, it will appear the latest software version of ARDUINO 1.8.5 shown as below.
In this software page, on the right side you can see the version of development software for different operating systems. So ARDUINO has a rather powerful compatibility. You should download the software that is compatible with the operating system of your computer.
In our project, we will take WINDOWS system as an example here. There are also two options under Windows system, one is installed version, the other is non-installed version.
For simple installed version, first click Windows Installer, you will get the following page.
This way you just need to click JUST DOWNLOAD, then click the downloaded file to install it.
For non-installed version, first click Windows ZIP file, you will also get the pop-up interface as the above figure.
Click JUST DOWNLOAD, and when the ZIP file is downloaded well to your computer, you can directly unzip the file and then click the icon of ARDUINO program to start it.
Installing Arduino (Windows)
Install Arduino with the exe. Installation package
Click“I Agree”to see the following interface.
Click “Next”. Pop up the interface below.
You can press Browse… to choose an installation path or directly type in the directory you want.
Then click “Install” to initiate installation.
Wait for the installing process, if appear the interface of Window Security, just continue to click Install to finish the installation.
All right, up to now, you have completed the Arduino setup! The following icon will appear on your PC desktop.
Double-click the icon of Arduino to enter the desired development environment shown as below.
Installing Installing Driver
Next, we will introduce the driver installation of UNO R3 development board. The driver installation may have slight differences in different computer systems. So in the following let’s move on to the driver installation in the WIN 7 system.
The Arduino folder contains both the Arduino program itself and the drivers thatallow the Arduino to be connected to your computer by a USB cable. Before we launch the Arduino software, you are going to install the USB drivers.
Plug one end of your USB cable into the Arduino and the other into a USB socket on your computer.
When you connect UNO board to your computer at the first time, right click the icon of your “Computer” —>for “Properties”—> click the “Device manager”, under “Other Devices”, you should see an icon for“Unknown device” with a little yellow warning triangle next to it. This is your Arduino.
Then right-click on the device and select the top menu option (Update Driver Software...) shown as the figure below..
It will then be prompted to either “Search Automatically for updated driversoftware” or “Browse my computer for driver software”. Shown as below. In this page, select “Browse my computer for driver software”.
After that, select the option to browseand navigate to the “drivers” folder of Arduino installation.
Click “Next” and you may get a security warning, if so, allow the software to be installed. Shown as below.
Once the software has been installed, you will get a confirmation message. Installation completed, click “Close”.
Up to now, the driver is installed well. Then you can right click “Computer” —>“Properties”—>“Device manager”, you should see the device as the figure shown below.