@glenzac
GETTING STARTED WITH
ARDUINO
THE BASICS:
ELECTRONICS
2
THE BASICS
3
1. Voltage
2. Current
3. Resistance
4. Analog signal
5. Digital Signal
6. Power
7. Diode
8. Crystal
@glenzac
MICROCONTROLLERS
THE
SHORT
ANSWER
PROCESSOR PERIPHERALSMICROCONTROLLERS
5
@glenzac
THE ARDUINO
WORLD
Basic boards
7
IoT boards
8
▸ Easy to use
▸ Cross platform
▸ Inexpensive
▸ Open source
▸ Flexible use of language - C/C++
WHY ARDUINO ?
9
Q: ARDUINO as a product?
PARTS: ARDUINO UNO
10
What’s in the kit?
▸ Arduino Board + Breadboard + Button
▸ USB cable
▸ Male-Male jumpers x5
▸ Male-Female Jumpers x3
▸ LED
▸ LDR
▸ LM35 TEMP SENSOR
▸ 10k + 300E Resistor
11
@glenzac
CODING THE
ARDUINO
THE ARDUINO IDE
13
THE
PROCESS
CODE
COMPILE
FLASH
14
Blink - on-board LED
15
Blink - External LED
▸ LED
▸ Resistor
▸ Digital Pin
16
Serial
17
Digital Read
18
IR
19
LDR - AnalogRead
20
Temperature Sensor - LM35
21
Exercise : Convert to fahrenheit
Equation:
T(°F) = T(°C) × 9/5 + 32
22
PWM - Pulse width modulation
23
PWM example - fade
24
Using non-blocking delay
25
Using libraries : Servo Library
26
Extras to try:
▸ Ultrasonic Sensor
▸ Relay
▸ Motor driver
27
@glenzac
ARDUINO
Workarounds
and Tricks
● When running short of Digital pins
Use analog pins as digital pins by referring
them with special pin numbers
● To speed up execution / save memory
Use bit manipulation
29
digitalWrite(4,HIGH)
PORTD |=(1<<4)
digitalWrite(4,LOW)
PORTD &= ~(1<<4)
30
Taking it further:
● Use attached Learning and
Reference docs
● No hardware? - Use simulation
www.tinkercad.com/circuits
31
32
33
✋ Questions?
34
THANKS!
You can reach me at glenzac@gmail.com
35

Getting started with arduino

Editor's Notes

  • #16 Changing time,PIN no.,
  • #17 Find R,flash SOS
  • #18 Fix errors
  • #19 Floating Pull up
  • #21 Non standard code Threshold turn on led
  • #22 10mV/c => 20 degree = 200mV ADC : 0-5 / 0-1023 5000mV/1024 = 4.88mV 4.88mV * ADC value = current mV Current mV/10 = degree C Place finger and test
  • #24 True analog vs PWM DAC - GR sakura
  • #25 External LED Fade slow ...fade fast ..using LDR/IR
  • #26 Timers
  • #27 No manual tweaking Download library Install in docs
  • #28 No manual tweaking Download library Install in docs
  • #30 Try 14