INTRODUCTION THE ARDUINO PRESENT BY THINGERBIT ELECTRONICS WWW.THINGERBITS.COM
What is a Microcontroller? Computer on a single integrated chip ● Processor (CPU) ● Memory (RAM / ROM / Flash) ● I/O ports (USB, I2C, SPI, ADC) Used in: Common microcontroller families: ● Intel: 4004, 8008, etc. ● Atmel: AT and AVR ● Microchip: PIC ● ARM: (multiple manufacturers) ● Cellphones ● Toys ● Household appliances ● Cars ● Cameras
The ATmega328P Microcontroller AVR 8-bit RISC architecture Up to 20 MHz clock Available in DIP package 32kB flash memory 1 kB SRAM 23 programmable I/O channels Six 10-bit ADC inputs Three timers/counters Six PWM outputs
What is Arduino Not? ❏ It is not a chip (IC) ❏ It is not a board (PCB) ❏ It is not a company or a manufacturer ❏ It is not a programming language ❏ It is not a computer architecture (although it involves all of these things...)
So what is Arduino? Founded by Massimo Banzi and David Cuartielles in 2005 Open-source hardware platform Based on “Wiring Platform”, which dates to 2003 ● Easy-to learn language and libraries (based on Wiring language) ● Integrated development environment (based on Processing programming environment) ● Available for Windows / Mac / Linux It’s a movement, not a microcontroller: Open source development environment
The Many Flavors of Arduino ● Arduino Uno ● Arduino Leonardo ● Arduino LilyPad ● Arduino Mega ● Arduino Nano ● Arduino Mini ● Arduino Mini Pro ● Arduino BT
Arduino-like Systems ● BBC Micro:bit (ARM) ● NodeMCU (ARM) ● Teensy(ARM) ● BeagleBoard (Linux) ● STM32 Discovery ● magicblocks
Arduino Add-ons (Shields) TFT Touch Screen Motor/Servo shield Data logger Ethernet shield Audio wave shield WiFi shield Cellular/GSM shield Proto-shield many more…...
Where to Get an Arduino Board Purchase from online vendor (available Sri Lanka)
Getting to know the Arduino ◆ Digital I/O ports is used to connect to other components or modules, to receive an input signal, or to send a control signal. Usually, we name it by adding a "D" in front of the number, such as D13. ◆ USB interface is used to provide power, upload code or communicate with PC. ◆ LED L is connected to digital I/O port 13 (D13). ◆ LED TX, RX is used to indicate the state of the serial communication. ◆ DC interface is connected DC power to provide power for the board. ◆ Power ports can provide power for electronic components and modules. ◆ Analog I/O ports can be used to measure analog signals. ◆ LED ON is used to indicate the power state.
ARDUINO IDE ONLINE IDE OFFLINE IDE
Download and Install Download Arduino compiler and development environment from: http://arduino.cc/en/Main/Software Before running Arduino, plug in your board using USB cable (external power is not necessary) Current version: 1.6.8 ● Windows ● MacOX ● Linux Open source development environment
Select your Board You have to select the arduino board type in your IDE. I am using an Arduino Uno board. To choose the board, find Tools on menu bar. Choose the option “Board” – and select your correct arduino board
Select Serial Port The port number is assigned while installing the hardware driver of board. You may refer the tutorial on Installing Arduino on Windows to know how to find the port number of board. You can find the port number by accessing device manager on Windows. See the section Port (COM & LPT) and look for an open port named “Arduino Uno (COMxx)“. If you are using a different board, you will find a name accordingly. What matters is the xx in COMxx part. In my case, its COM5. So my port number is 5. To select the right port, go to Tools–> Serial Port and select the port number.
Elements of the Arduino IDE • Text editor – syntax and keyword coloring – automatic indentation – programming shortcuts • Compiler • Hardware Interface – Uploading programs – Communicating with Arduino via USB
Using the Arduino IDE 1. Verify: Compiles and approves your code. It will catch errors in syntax (like missing semicolons or parentheses). 2. Upload: Sends your code to the 101 board. 3. New: This buttons opens up a new code window tab. 4. Open: This button will let you open up an existing sketch. 5. Save: This saves the currently active sketch. 6. Serial Monitor: This will open a window that displays any serial information your 101 board is transmitting. It is very useful for debugging. 7. Sketch Name: This shows the name of the sketch you are currently working on. 8. Code Area: This is the area where you compose the code for your sketch. 9. Message Area: This is where the IDE tells you if there were any errors in your code. 10. Text Console: The text console shows complete error messages. When debugging, the text console is very useful. 11. Board and Serial Port: Shows you what board and the serial port selections.
Arduino Reference
Arduino Sketch Structure void setup() ● Will be executed repeatedly void loop() ● Will be executed only when the program begins (or reset button is pressed)
Activity 1: LED Blink Load the “Blink” example (File>Examples>Basics>Blink) Compile, then upload the program Congratulations! you are now blinkers!
Now connect your own LED Resistor is needed to limit current Pin 13 is special: has built-in resistor and LED Resistor and LED may be interchanged (but polarity of LED is important) Change program and upload
Experimenting Change the blink rate – how fast can the LED blink (before you can no longer perceive the blinking?) – (...without changing the resistor?) How would you make the LED dimmer?
Summary Introduction to Arduino ❖ About of Arduino ❖ History of Arduino ❖ Arduino Board ❖ Arduino Software ➢ How to Use Online Arduino IDE ➢ Install Arduino Offline IDE - Windows ➢ Download Arduino IDE ➢ Arduino Online IDE ❖ First Use ❖ Blink Program Code ❖ Pinout Diagram - Arduino Uno
What’s Next? Chapter 1 - LED Blink ● Project 1.1 - Control LED by Manual Button ● Circuit Knowledge 1. Power supply 2. Voltage 3. Current (I) 4. Resistor ● Component knowledge 1. Jumper 2. Breadboard 3. Push button 4. LED ● Circuit ● Project 1.2 Control LED by Arduino ● Circuit knowledge 1. Analog signal & Digital signal 2. Low level & high level ● Code knowledge 1. Comments 2. Data type 3. Constant 4. Variable 5. Function ● Circuit ● Sketch

Indroduction the arduino

  • 1.
    INTRODUCTION THE ARDUINO PRESENT BYTHINGERBIT ELECTRONICS WWW.THINGERBITS.COM
  • 2.
    What is a Microcontroller? Computeron a single integrated chip ● Processor (CPU) ● Memory (RAM / ROM / Flash) ● I/O ports (USB, I2C, SPI, ADC) Used in: Common microcontroller families: ● Intel: 4004, 8008, etc. ● Atmel: AT and AVR ● Microchip: PIC ● ARM: (multiple manufacturers) ● Cellphones ● Toys ● Household appliances ● Cars ● Cameras
  • 3.
    The ATmega328P Microcontroller AVR 8-bitRISC architecture Up to 20 MHz clock Available in DIP package 32kB flash memory 1 kB SRAM 23 programmable I/O channels Six 10-bit ADC inputs Three timers/counters Six PWM outputs
  • 4.
    What is ArduinoNot? ❏ It is not a chip (IC) ❏ It is not a board (PCB) ❏ It is not a company or a manufacturer ❏ It is not a programming language ❏ It is not a computer architecture (although it involves all of these things...)
  • 5.
    So what isArduino? Founded by Massimo Banzi and David Cuartielles in 2005 Open-source hardware platform Based on “Wiring Platform”, which dates to 2003 ● Easy-to learn language and libraries (based on Wiring language) ● Integrated development environment (based on Processing programming environment) ● Available for Windows / Mac / Linux It’s a movement, not a microcontroller: Open source development environment
  • 6.
    The Many Flavors ofArduino ● Arduino Uno ● Arduino Leonardo ● Arduino LilyPad ● Arduino Mega ● Arduino Nano ● Arduino Mini ● Arduino Mini Pro ● Arduino BT
  • 7.
    Arduino-like Systems ● BBC Micro:bit(ARM) ● NodeMCU (ARM) ● Teensy(ARM) ● BeagleBoard (Linux) ● STM32 Discovery ● magicblocks
  • 8.
    Arduino Add-ons (Shields) TFTTouch Screen Motor/Servo shield Data logger Ethernet shield Audio wave shield WiFi shield Cellular/GSM shield Proto-shield many more…...
  • 9.
    Where to Getan Arduino Board Purchase from online vendor (available Sri Lanka)
  • 10.
    Getting to knowthe Arduino ◆ Digital I/O ports is used to connect to other components or modules, to receive an input signal, or to send a control signal. Usually, we name it by adding a "D" in front of the number, such as D13. ◆ USB interface is used to provide power, upload code or communicate with PC. ◆ LED L is connected to digital I/O port 13 (D13). ◆ LED TX, RX is used to indicate the state of the serial communication. ◆ DC interface is connected DC power to provide power for the board. ◆ Power ports can provide power for electronic components and modules. ◆ Analog I/O ports can be used to measure analog signals. ◆ LED ON is used to indicate the power state.
  • 11.
  • 12.
    Download and Install DownloadArduino compiler and development environment from: http://arduino.cc/en/Main/Software Before running Arduino, plug in your board using USB cable (external power is not necessary) Current version: 1.6.8 ● Windows ● MacOX ● Linux Open source development environment
  • 13.
    Select your Board Youhave to select the arduino board type in your IDE. I am using an Arduino Uno board. To choose the board, find Tools on menu bar. Choose the option “Board” – and select your correct arduino board
  • 14.
    Select Serial Port Theport number is assigned while installing the hardware driver of board. You may refer the tutorial on Installing Arduino on Windows to know how to find the port number of board. You can find the port number by accessing device manager on Windows. See the section Port (COM & LPT) and look for an open port named “Arduino Uno (COMxx)“. If you are using a different board, you will find a name accordingly. What matters is the xx in COMxx part. In my case, its COM5. So my port number is 5. To select the right port, go to Tools–> Serial Port and select the port number.
  • 15.
    Elements of theArduino IDE • Text editor – syntax and keyword coloring – automatic indentation – programming shortcuts • Compiler • Hardware Interface – Uploading programs – Communicating with Arduino via USB
  • 16.
    Using the ArduinoIDE 1. Verify: Compiles and approves your code. It will catch errors in syntax (like missing semicolons or parentheses). 2. Upload: Sends your code to the 101 board. 3. New: This buttons opens up a new code window tab. 4. Open: This button will let you open up an existing sketch. 5. Save: This saves the currently active sketch. 6. Serial Monitor: This will open a window that displays any serial information your 101 board is transmitting. It is very useful for debugging. 7. Sketch Name: This shows the name of the sketch you are currently working on. 8. Code Area: This is the area where you compose the code for your sketch. 9. Message Area: This is where the IDE tells you if there were any errors in your code. 10. Text Console: The text console shows complete error messages. When debugging, the text console is very useful. 11. Board and Serial Port: Shows you what board and the serial port selections.
  • 17.
  • 18.
    Arduino Sketch Structure voidsetup() ● Will be executed repeatedly void loop() ● Will be executed only when the program begins (or reset button is pressed)
  • 19.
    Activity 1: LEDBlink Load the “Blink” example (File>Examples>Basics>Blink) Compile, then upload the program Congratulations! you are now blinkers!
  • 20.
    Now connect yourown LED Resistor is needed to limit current Pin 13 is special: has built-in resistor and LED Resistor and LED may be interchanged (but polarity of LED is important) Change program and upload
  • 21.
    Experimenting Change the blinkrate – how fast can the LED blink (before you can no longer perceive the blinking?) – (...without changing the resistor?) How would you make the LED dimmer?
  • 22.
    Summary Introduction to Arduino ❖About of Arduino ❖ History of Arduino ❖ Arduino Board ❖ Arduino Software ➢ How to Use Online Arduino IDE ➢ Install Arduino Offline IDE - Windows ➢ Download Arduino IDE ➢ Arduino Online IDE ❖ First Use ❖ Blink Program Code ❖ Pinout Diagram - Arduino Uno
  • 23.
    What’s Next? Chapter 1- LED Blink ● Project 1.1 - Control LED by Manual Button ● Circuit Knowledge 1. Power supply 2. Voltage 3. Current (I) 4. Resistor ● Component knowledge 1. Jumper 2. Breadboard 3. Push button 4. LED ● Circuit ● Project 1.2 Control LED by Arduino ● Circuit knowledge 1. Analog signal & Digital signal 2. Low level & high level ● Code knowledge 1. Comments 2. Data type 3. Constant 4. Variable 5. Function ● Circuit ● Sketch