0% found this document useful (0 votes)
43 views

Intro 2 Arduino

This is introduction of Arduino for lecture in IT engineering fifth year . Assistance for Embedded Lab .

Uploaded by

La Win
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

Intro 2 Arduino

This is introduction of Arduino for lecture in IT engineering fifth year . Assistance for Embedded Lab .

Uploaded by

La Win
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Introduction to

Arduino
Arduino Hardware
❖ Arduino has over the years released over 100 hardware products: boards, shields, carriers, kits
and other accessories.
❖ An overview of all active Arduino hardware includes
✓ Nano families,
✓ MKR families and
✓ Classic families.

Arduino Nano 33 IoT Arduino Nano ESP32

Arduino MKR Zero Arduino MKR WiFi 1010 Arduino MKR GSM 1400

https://www.arduino.cc/en/hardware 2
Classic families (Boards)

Arduino UNO R4 Minima Arduino UNO R4 WiFi

3
Arduino UNO R3
Classic families (Boards)

ZERO
LEONARDO UNO WIFI Rev2
Classic families (Shields)

4
Arduino Motor Shield Rev3 Arduino Ethernet Shield Rev2 Arduino 4 Relay Shield
Mega families (Boards)

Arduino Due Arduino Mega 2560 Rev3

Arduino GIGA R1 WiFi


5
Arduino UNO

6
AVR Architecture (ATmega328 Microcontroller)

7
Memory (ATmega328 Microcontroller)

8
ARDUINO UNO R3

9
ARDUINO UNO R3

10
ARDUINO UNO R3

11
Basics of Arduino PWM (Pulse Width Modulation)
➢ Pulse Width Modulation or PWM, is a technique to generate an analog like signal
within a digital pin.
➢ Arduino digital pins generally use a square wave to control things. So it has
only two states, high (5 V on Uno, 3.3 V on an MKR board) and low (0 volts).
➢ analogWrite() works on a scale of 0 – 255.
➢ That means we can have 256 different voltages
from 0v to 5v.
➢ The difference between each step would be 5v/255
= 0.0196v.
➢ So we can have voltages like 0v, 0.0196v,
0.0392v, ….,5v.

✓ analogWrite(0) gives a signal of 0% duty cycle i.e


0v output.
✓ analogWrite(50) gives a signal of ~20% duty cycle
i.e 1v output.
✓ analogWrite(63) gives a signal of 25% duty cycle
i.e 1.25v output.
✓ analogWrite(127) gives a signal of 50% duty cycle
i.e 2.5v output.
12
Arduino PWM – LED Brightness Control
const int ledPin = 6;
void setup() {
// initialize ledPin (pin 6) as an output.
pinMode(ledPin, OUTPUT);
}

// the loop function runs over and over again forever


void loop() {
for (int brightness = 0; brightness < 255; brightness++)
{
analogWrite(ledPin, brightness);
delay(2);
}
for (int brightness = 255; brightness >= 0; brightness--)
{
analogWrite(ledPin, brightness);
delay(2);
}
}

13
Arduino Software Installation

https://www.arduino.cc/en/software 14
Arduino Language
Structure
void setup() {
// put your setup code here, to run once:
}

void loop() {
// put your main code here, to run repeatedly:
}

/* Blink.ino */
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
15
Arduino Lab for MicroPython

16
MicroPython
THANK YOU

You might also like