Fundamentals of Arduino- is a 05 days consecutive program and training session and this slide is for the 1st day of those 05 days. The session took place on 28th December 2020. This is very much designed for school and college-going students-who are interested in Arduino, Robotics, and other 4th Industrial Revolution-peripherals.
In this session, Basic of Electronics, Basic of Arduino, Technical Spec, Basic Coding, and IDE were discussed.
The event was organized by EMK Center and the trainer was Mr. Redwan Ferdous.
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Fundamentals of Arduino: Day-01
1. Fundamentals of Arduino
Day 01 of 05
Redwan Ferdous
Electrical Engineer| Tech Enthusiast| Robotics | Automobile| Data Science |
Tech-Entrepreneur & Investor |
redwan.contact@gmail.com | ferdousr@emk.com.bd
https://sites.google.com/view/redwanferdous
2. Disclaimer
• You need not to invent wheel all the time, rather its better to create
application using that wheel !!
• Most of the contents of my slides are collected from internet. Credit
mentioned with due respect at the last slide.
• My job is to facilitate the way of learning. Your job is to explore
according to that.
• If you assure me of ‘Practice’, I can assure you of ‘Success’.
28-Dec-20 2
Most of the information collected from Internet |
redwan.contact@gmail.com
3. Course Summary
• This course is stated as “Arduino Simulation: An elementary
approach”- Organized by EMK Center, Dhaka, Bangladesh
• Course Duration: 05 Days. Each Day 2.00 hours.(including FAQ)
• The schedule is subject to be changed based on unavoidable
circumstances (if appears any).
Date Stating Time End Time
Monday, December 28, 2020 5.30 pm 07.00 pm
Tuesday, December 29, 2020 5.30 pm 07.30 pm
Wednesday, December 30, 2020 5.30 pm 07.30 pm
Thursday, December 31, 2020 5.30 pm 07.30 pm
Saturday, January 02, 2020 5.30 pm 07.30 pm
28-Dec-20 3
Most of the information collected from Internet |
redwan.contact@gmail.com
4. Course Summary (cont.-2)
• Each day’s lecture slide can be found on Slideshare at instructors
profile- after the end of the scheduled lecture.
Link: https://www.slideshare.net/RedwanFerdous/
• The instructor personally do believe the following quote:
“ Keep it Simple
Keep it Short
Keep it Real”
- It will be reflected throughout the course contents and
methodology of sharing the knowledge as well as interaction.
28-Dec-20 4
Most of the information collected from Internet |
redwan.contact@gmail.com
5. Course Outline
• This is a “Elementary” or “Introductory” course on Arduino through
practical and simulation avoiding commercial development of industrial
solution example.
• Course Outline:
Submission of final project by the participants and send the evaluation result
virtually by EMK/instructor.
28-Dec-20 5
Day-01 Day-02 Day-03 Day-04 Day-05
- Basic of
Arduino
- IDE
- Basic
Electronics
- Introduction to
coding at Arduino
- Intro to
Simulation
- 02 x Projects
- Basic Sensors
- Basic Shields
- 03x Projects
-Introduction to
Tinkercad
- 03x Projects
- 03x Projects
- Assignment
- Competitions
- Open
Discussions
Most of the information collected from Internet |
redwan.contact@gmail.com
6. Decorum for Attendee
• This 05 days session will be a semi-formal session. The instructor is
very much fun loving, believe me!
• You can ask question either in the end of the session or during the
demonstration.
• Whenever you are not talking, please MUTE your microphone. You
can switch your video off during observing live demonstration for
better experience.
28-Dec-20 6
Most of the information collected from Internet |
redwan.contact@gmail.com
7. Decorum for Attendee (cont.)
• All the attendee will practice live with the instructor – that is showed
on shared screen on the platform.
• During the live demonstration there might be technical error like
internet disconnection or hanging of host platform- please have
patience on that situation. Everything will be All Right !
• This is a two-way communicating session. Both Instructor and
attendee will learn from each other. Medium –English/Bengali.
• We will learn a lot more than Arduino and Simulation,I believe !
28-Dec-20 7
Most of the information collected from Internet |
redwan.contact@gmail.com
8. And, I’m Considering…
• You have knowledge of the followings:
• Basic Electronics (Resistance, Capacitance, Inductance, Transistor, FET, Diode,
AC-DC, Op-Amp, Opto-couplers)
• Basic Analog and Digital circuitry
• Basic Components (LED, LDR, POT, LCD, Motor)
• Basic Example coding experience in Arduino IDE
28-Dec-20 8
Most of the information collected from Internet |
redwan.contact@gmail.com
9. Fundamentals of Arduino
Day -01
28-Dec-20 9
Most of the information collected from Internet |
redwan.contact@gmail.com
10. What is an Arduino?
• This is an Arduino!
28-Dec-20 10
Most of the information collected from Internet |
redwan.contact@gmail.com
11. Basic Electronics
• Electronics is the science of how to control electric energy,
energy which the electrons have a fundamental role.
• Its also deals with electrical circuits that involve active electrical
components such as vacuum tubes, transistors, diodes and integrated
circuits, and associated passive electrical components and interconnection
technologies.
• You will work with a number of basic electronic components when building
electronic circuits, including resistors, capacitors, diodes, transistors, and
integrated circuits.
Here is a brief overview of the functions of each of these basic electronic
components.
28-Dec-20 11
Most of the information collected from Internet |
redwan.contact@gmail.com
12. Current
–Current moves through a
circuit element “through
variable.”
–Current is rate of flow of
negatively-charged particles,
called electrons, through a
predetermined cross-sectional
area in a conductor.
–Like water flow.
– Essentially, flow of electrons in an
electric circuit leads to the
establishment of current.
I(t) =
o q : relatively charged electrons
(C)
o Amp = C/sec
o Often measured in milliamps,
mA
dq
dt
•Symbol: I
•Unit: Ampere
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
12
14. Voltage
– Potential difference across
two terminals in a circuit
“across variable.”
– In order to move charge from
point A to point B, work
needs to be done.
– Like potential energy at a
water fall.
– Let A be the lower potential/voltage
terminal
– Let B be the higher potential/voltage
terminal
o Then, voltage across A and B is the
cost in energy required to move a unit
positive charge from A to B.
•Symbol: V
•Unit: Volt
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
14
19. Resistor Labels
• Wire-wound resistors have a label indicating resistance and power ratings.
• A majority of resistors have color bars to indicate their resistance magnitude.
• There are usually 4 to 6 bands of color on a resistor. As shown in the figure
below, the right most color bar indicates the resistor reliability, however, some
resistor use this bar to indicate the tolerance. The color bar immediately left to
the tolerance bar (C), indicates the multipliers (in tens). To the left of the
multiplier bar are the digits, starting from the last digit to the first digit.
Resistor value = )%(10 tolAB C
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
19
20. Resistors
Resistor is passive
electrical component that
implements electrical
resistance as a circuit
element. Resistors act to
reduce current flow, and,
at the same time, act
lower voltage levels within
circuits.
If you put resistors next to
a penny, you get an idea
of how small they are.
28-Dec-20 20
21. Example
• The first band is yellow, so the first digit is 4
• The second band is violet, so the second digit is 7
• The third band is red, so the multiplier is
• Resistor value is )%(51047 2
2
10
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
21
22. Metric Units and Conversions
Abbreviation Means Multiply unit by Or
p pico .000000000001 10 -12
n nano .000000001 10 -9
µ micro .000001 10 -6
m milli .001 10 -3
. Unit 1 10 0
k kilo 1,000 10 3
M mega 1,000,000 10 6
G giga 1,000,000,000 10 9
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
22
23.
24. Variable Resistor Concept
•In electrical circuit, a switch is used
to turn the electricity on and off just
like a valve is used to turn the water
on and off.
•There are times when you want
some water but don’t need all the
water that the pipe can deliver, so
you control water flow by adjusting
the faucet.
•Notice, however, that you can
control the water flow by forcing the
water through an adjustable length
of rocks, as shown to the right.
Water
in
Movable arm
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
24
25. Variable Resistor Construction
• To vary the resistance in an electrical circuit, we use a variable resistor.
•This is a normal resistor with an additional arm contact that can move along
the resistive material and tap off the desired resistance.
Terminal B Wiper Terminal A Terminal B Wiper Terminal A
Stationary contact
Wiper contact
Resistive material
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
25
26. Variable Resistor: Rotary Potentiometers
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
26
27. Capacitor
Capacitor is a passive two-terminal electrical component
used to store electrical energy temporarily in an electric
field.
Capacitors come in several different varieties, the two most
common being ceramic disk and electrolytic. The amount of
capacitance of a given capacitor is usually measured in
microfarads, abbreviated μF.
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
27
28. Inductor
•Antenna coil
–contains an iron core
that magnifies magnetic
field effects
–used to tune in ultra-
high-frequency signals, i.e.
RF signals
•Tuning coil
–screw-like “magnetic field
blocker” that can be adjusted to
select the desired inductance
value
–used in radio receivers to select a
desired frequency.
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
28
29. Basic topics under Electronics
• Transformer
• Integrated Circuits (IC)
• Multimeter/ Ohmmeter
• Capacitor
• Resistor
• Diode
• Light-Emitting Diodes (LED)
• Transistors
28-Dec-20 29
Most of the information collected from Internet |
redwan.contact@gmail.com
30. Transformer
A transformer is an electrical device that transfers electrical
energy two or more circuits through electromagnetic
induction.
Commonly, transformers are used to increased or decrease the
voltages of alternating current in electric power.
Transformers can thus be designed to efficiently change AC
voltage from one voltage level to another within power
networks. Transformers also can be used in television,
computer, and electric station.
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
30
31. Integrated Circuits
Integrated circuit, another name for a chip, is a small electronic
device made out of semiconductor material.
The first IC was developed in the 1950s by Jack of Texas
Instruments and Robert Noyce of Fairchild Semiconductor.
ICs are used for a variety of devices, including
microprocessors, audio and video equipment,
automobiles, and other home appliances.
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
31
32. Multimeter/Ohmmeter
A multimeter, also known as a Volt-Ohm meter, is an
electronic measuring instrument that combines several
measurement functions in one unit.
33. Ammeter Connection
• Break the circuit so that the ammeter can be connected in series
• All the current flowing in the circuit must pass through the ammeter
• An ammeter must have a very LOW input impedance
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
33
34. Voltmeter Connection
• The voltmeter is connected in parallel between two
points of circuit
• A voltmeter should have a very HIGH input impedance
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
34
35. Diode
Diode is a two-terminal electronic component with asymmetric
conductance; it has low resistance to current in one
direction, and high resistance in the other.
The most common function of a diode is to allow an electric
current to past in one direction, while blocking current in the
opposite direction.
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
35
37. Transistor
Transistor is a semiconductor device used to amplify and
switch electronic signals and electrical power. It is composed of
semiconductor material with at least three terminals for
connection to an external circuit.
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
37
38. Arduino??
• A microcontroller board, contains
on-board power supply, USB port to
communicate with PC, and
an Atmel microcontroller chip.
• It simplify the process of creating any
control system by providing the standard
board that can be programmed and
connected to the system without the need
to any sophisticated PCB design
and implementation.
• It is an open source hardware, any one can
get the details of its design and modify
it or make his own one himself
28-Dec-20 38
Most of the information collected from Internet |
redwan.contact@gmail.com
41. Tech Spec: Arduino
• Microcontroller: Microchip
ATmega328P
• Operating Voltage: 5 Volts
• Input Voltage: 7 to 20 Volts
• Digital I/O Pins: 14 (of which 6 can
provide PWM output)
• UART: 1
• I2C: 1
• SPPI: 1
• Analog Input Pins: 6
• DC Current per I/O Pin: 20 mA
• DC Current for 3.3V Pin: 50 mA
• Flash Memory: 32 KB of which 0.5
KB used by bootloader
• SRAM: 2 KB
• EEPROM: 1 KB
• Clock Speed: 16 MHz
• Length: 68.6 mm
• Width: 53.4 mm
• Weight: 25 g
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
41
42. Advantage of Using Arduino
• The advantage of using Arduino are
• Inexpensive
• Cross-platform
• Open-source
• Extensible software and hardware.
• Awesome community for Arduino.
The tutorials provided by the community and the various projects and blog
posts make the ride of learning arduino easy and so it has become an useful
utility for beginners.
28-Dec-20 42
Most of the information collected from Internet |
redwan.contact@gmail.com
43. Arduino IDE
• The open-source Arduino Software (IDE) makes it easy to write code
and upload it to the board. This software can be used with any
Arduino board.
• The current version of the Arduino IDE is 1.8.13 and is compatible
with Windows, Linux and Mac OS. The Arduino IDE can be easily
installed from the website of Arduino.
• URL: https://www.arduino.cc/en/software
28-Dec-20 43
Most of the information collected from Internet |
redwan.contact@gmail.com
45. Let’s Explore
• Let’s explore Arduino site and find different options with Arduino:
https://www.arduino.cc/
28-Dec-20 45
Most of the information collected from Internet |
redwan.contact@gmail.com
46. Getting started with Programming
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
46
47. void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Bare minimum code
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
47
48. • setup : It is called only when the Arduino is powered on or reset. It is
used to initialize variables and pin modes
• loop : The loop functions runs continuously till the device is powered
off. The main logic of the code goes here. Similar to while (1) for
micro-controller programming.
Bare minimum code
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
48
49. • A pin on arduino can be set as input or output by using pinMode
function.
• pinMode(13, OUTPUT); // sets pin 13 as output pin
• pinMode(13, INPUT); // sets pin 13 as input pin
PinMode
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
49
50. • digitalWrite(13, LOW); // Makes the output voltage on pin 13 , 0V
• digitalWrite(13, HIGH); // Makes the output voltage on pin 13 , 5V
• int buttonState = digitalRead(2); // reads the value of pin 2 in
buttonState
Reading/writing digital values
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
50
51. • What is analog ?
• It is continuous range of voltage values (not just 0 or 5V)
• Why convert to digital ?
• Because our microcontroller only understands digital.
Analog to Digital Coversion
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
51
52. ADC in Arduino Uno
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
52
53. Converting Analog Value to Digital
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
53
55. • The Arduino Uno board contains 6 pins for ADC
• 10-bit analog to digital converter
• This means that it will map input voltages between 0 and 5 volts into
integer values between 0 and 1023
ADC in Arduino
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
55
56. • analogRead(A0); // used to read the analog value from the pin A0
• analogWrite(2,128);
Reading/Writing Analog Values
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
56
57. • // These constants won't change. They're used to
give names to the pins used:
const int analogInPin = A0; // Analog input pin that
the potentiometer is attached to
const int analogOutPin = 9; // Analog output pin
that the LED is attached to
int sensorValue = 0; // value read from the pot
int outputValue = 0; // value output to the PWM
(analog out)
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop() {
• // read the analog in value:
sensorValue = analogRead(analogInPin);
// map it to the range of the analog out:
outputValue = map(sensorValue, 0, 1023, 0, 255);
// change the analog out value:
analogWrite(analogOutPin, outputValue);
// print the results to the serial monitor:
Serial.print("sensor = " );
Serial.print(sensorValue);
Serial.print("t output = ");
Serial.println(outputValue);
// wait 2 milliseconds before the next loop
// for the analog-to-digital converter to settle
// after the last reading:
delay(2);
}
ADC Example
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
57
58. Example: Blinking LED
• There are many example codes in the arduino IDE itself. The following
is for blinking an LED which is analogous to the regular “hello world”
program.
• In the arduino UNO board there is an led at pin 13 which will be used
here. These pins varies for different arduino boards.
28-Dec-20 58
Most of the information collected from Internet |
redwan.contact@gmail.com
59. Example: Blinking LED
Sketch:
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
}
28-Dec-20 59
Most of the information collected from Internet |
redwan.contact@gmail.com
60. Anything you want me to tell?
Thank You
28-Dec-20
Most of the information collected from Internet |
redwan.contact@gmail.com
60
61. Reference
• Arduino : Introduction & Programming-Anurag Dwivedi & Rudra Pratap Suman
• https://specnith.com/post1.html
• https://science.pppst.com/electronics.html.
28-Dec-20 61
Most of the information collected from Internet |
redwan.contact@gmail.com