SlideShare a Scribd company logo
Introduction to Arduino
SENSORS - SECTION1
What is Arduino?
• It is a series of open-source
microcontroller board based
on a diverse range of
microcontrollers (MCU)
• Importance: Widely used in
electronics, automation, and
IoT projects.
• Different Boards: Arduino
Uno, Mega, Nano.
INTRO. TO ARDUINO
• It’s a micro-computer/
microcontroller .
• As any computer it has internal
CPU, RAM, IOs interfaces.
• It’s used for control purposes.
• Arduino uno is reprogrammable,
codes can be ported into it for
specific application.
What is Arduino Uno?
• A microcontroller board based on ATmega328P
Key Components:
• Microcontroller unit
• Digital & Analog Pins
• Power Supply & Voltage Regulators
• USB Interface for programming
Arduino Uno
Board
Layout
Board Components
•Reset Button : This will restart any code that is loaded to the Arduino board
•Ground Pin : There are a few ground pins on the Arduino and they all work the same
•Analog Pins (A0 - A5): These pins read the signal from an analog sensor and convert it to digital
•Digital Input/Output : Pins 0-13 can be used for digital input or output
•PWM ((~3, ~5, ~6, ~9, ~10, ~11): The pins marked with the (~) symbol can simulate analog
output
•USB Connection : Used for powering up your Arduino and uploading sketches
Board Components
• TX/RX : Transmit and receive data indication LEDs
• ATmega Microcontroller : Popular microcontroller chip,
• Power LED Indicator : This LED lights up anytime the board is plugged
in a power source
• DC Power Barrel Jack : This is used for powering your Arduino with a
power supply
• 3.3V Pin : This pin supplies 3.3 volts of power
• 5V Pin : This pin supplies 5 volts of power
steps to write Arduino code
1.download and install the Arduino IDE
(integrated development environment).
2.Connect the Arduino to your computer's USB port
Arduino IDE
‫القوائم‬ ‫شريط‬
‫السريعة‬ ‫األوامر‬ ‫شريط‬
‫هنا‬ ‫الكود‬ ‫كتابة‬
‫والرسائل‬ ‫األخطاء‬ ‫عرض‬
3. Settings { choose Arduino board and port number }
steps to write Arduino code
Tools --> Boards Tools --> Serial port
Basic electronics
1- BREADBOARD
• It’s an important board in
electronics to do prototyping
Basic electronics
1- BREADBOARD …
Basic electronics
2- LED
• Light Emitting Diode.
Avo meter
It is a device used to measure voltage, current,
and resistance
Basic electronics
3- RESISTORS
• Resistors provide a specific
amount of resistance to a path
in a circuit or wire.
Basic electronics
3- BATTERY
• A battery is a source of electric
power.
• 9v , 12v,…
Basic electronics
6-BATTERY CLIPS
•
Basic electronics
3- JUMPER WIRES MALE
MALE
• To connect two points to each
other without soldering.
Basic electronics
6-REGULATOR
• takes an input voltage of up to
38 V and efficiently reduces it
to 5 V.
VHDL or Verilog: describe your adder and correction logic
VHDL or Verilog: describe your adder and correction logic
Basic electronics
CIRCUITS EXAMPLE
• To turn on a led
Basic electronics
CIRCUITS EXAMPLE
• To turn on a led
Code Structure
1.void setup( ){ } 2. void loop( ) { }
setting up your Arduino for the rest of
the program.
code here run once
the setup() function is called first. It’s
executed only once and must be used
to set pinModes, make settings for
hardware components.
contains the statements that
will run
The loop() function is next to
the setup() function and it is
iterated infinitely
useful functions
1.pinMode( pinNumber, direction ); set a pin as input/output
2.digitalWrite( pinNumber , state ); set a digital pin high/low
3. Delay( time ); wait an amount of time in milliseconds
Arduino C Syntax
comments
// This is a single-line comment
/* This
is
a
multi-line
comment */
variables
In Arduino C, identifiers should contain only alphanumeric
characters, dash (-), or underscore(_).
An identifier can only start from an underscore or a letter.
dataType variable_name ;
int x ;
or..
int x = 3;
Variables datatypes
Data type Size range
boolean (8 bit) true/false
byte (8 bit) 0-255
char (8 bit) (A-Z) or -128 to 127
word (16 bit) 0-65535
unsigned int (16 bit) 0-65535
int (16 bit) -32768 to 32767
unsigned long (32 bit) 0-4,294,967,295
long (32 bit) -2,147,483,648 to 2,147,483,647
float (32 bit) -3.4028235E38 to 3.4028235E38
Examples
Arithmetic operators
Comparison
Operators
Boolean Operators
Compound Operators
Operator name Operator simple Description Example
increment ++ Increment operator, increases integer value by one A++ will give 11
decrement -- Decrement operator, decreases integer value by one A-- will give 9
compound addition +=
Add AND assignment operator. It adds right operand to
the left operand and assign the result to left operand
B += A is equivalent to B = B+ A
compound subtraction -=
Subtract AND assignment operator. It subtracts right
operand from the left operand and assign the result to
left operand
B -= A is equivalent to B = B - A
compound
multiplication
*=
Multiply AND assignment operator. It multiplies right
operand with the left operand and assign the result to
left operand
B*= A is equivalent to B = B* A
compound division /=
Divide AND assignment operator. It divides left operand
with the right operand and assign the result to left
operand
B /= A is equivalent to B = B / A
compound modulo %=
Modulus AND assignment operator. It takes modulus
using two operands and assign the result to left operand
B %= A is equivalent to B = B % A
What is Variable Scope?
Variables
Scope
local variables
Declared inside
a function or a
block
Global
variables
Declared
outside of all
functions
Parameters
defined inside
function
parentheses
Constants
• Constants are fixed values that do not change during program
execution.
• Constants help improve code :
• readability
• maintainability
• prevent accidental changes.
Types of Constants in Arduino
1. #define Preprocessor Constant
2. const Keyword (Recommended)
3. Built-in Constants (HIGH, LOW, INPUT, OUTPUT, etc.)
Preprocessor Constant
• Uses #define to create a macro constant (no data type).
• replaces values before compilation.
• No memory usage (just replaces text).
• No type checking
const Keyword
• Uses const to create a typed constant variable.
• Uses memory (stored in RAM)
Built-in Constants
Constant Value Description
HIGH 1 Sets pin to HIGH (5V)
LOW 0 Sets pin to LOW (0V)
INPUT 0 Sets pin as input
OUTPUT 1 Sets pin as output
Arduino c Syntax
Control Structures
Arduino C supports these control structures:
•if
•if …else…
•for
•switch case
•while
•do… while…
Blinking led Example
Blinking led Example
Blinking led Example

More Related Content

PPTX
arduino and its introduction deep dive ppt.pptx
PPT
Arduino_CSE ece ppt for working and principal of arduino.ppt
PDF
introductiontoarduino-111120102058-phpapp02.pdf
PDF
Arduino: Arduino starter kit
PPTX
Introduction to Arduino Hardware and Programming
PPTX
Introduction to the Arduino
PDF
Arduino-workshop.computer engineering.pdf
KEY
Intro to Arduino
arduino and its introduction deep dive ppt.pptx
Arduino_CSE ece ppt for working and principal of arduino.ppt
introductiontoarduino-111120102058-phpapp02.pdf
Arduino: Arduino starter kit
Introduction to Arduino Hardware and Programming
Introduction to the Arduino
Arduino-workshop.computer engineering.pdf
Intro to Arduino

Similar to VHDL or Verilog: describe your adder and correction logic (20)

PDF
Starting with Arduino
PDF
introductiontoarduino-130219180141-phpapp01.pdf
PPTX
Introduction To Arduino-converted for s.pptx
PDF
Arduino microcontroller ins and outs with pin diagram
PDF
arduino
PDF
Intro to Arduino Revision #2
PPTX
Introduction to arduino
PPTX
Arduino course
PPTX
PDF
arduinocourse-180308074529 (1).pdf
PPTX
Basics of mechatronics - Arduino tutorial
PDF
Ardx experimenters-guide-web
PDF
02 Sensors and Actuators Understand .pdf
PPTX
arduino
PPTX
introductiontoarduino-130219180141-phpapp01.pptx
PDF
Arduino experimenters guide ARDX
PPTX
Audible Objects
PPTX
teststststststLecture_3_2022_Arduino.pptx
PDF
Arduino experimenters guide hq
Starting with Arduino
introductiontoarduino-130219180141-phpapp01.pdf
Introduction To Arduino-converted for s.pptx
Arduino microcontroller ins and outs with pin diagram
arduino
Intro to Arduino Revision #2
Introduction to arduino
Arduino course
arduinocourse-180308074529 (1).pdf
Basics of mechatronics - Arduino tutorial
Ardx experimenters-guide-web
02 Sensors and Actuators Understand .pdf
arduino
introductiontoarduino-130219180141-phpapp01.pptx
Arduino experimenters guide ARDX
Audible Objects
teststststststLecture_3_2022_Arduino.pptx
Arduino experimenters guide hq
Ad

Recently uploaded (20)

PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
Safety Seminar civil to be ensured for safe working.
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
web development for engineering and engineering
PPTX
Construction Project Organization Group 2.pptx
PPTX
OOP with Java - Java Introduction (Basics)
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Geodesy 1.pptx...............................................
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Artificial Intelligence
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Safety Seminar civil to be ensured for safe working.
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Model Code of Practice - Construction Work - 21102022 .pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
web development for engineering and engineering
Construction Project Organization Group 2.pptx
OOP with Java - Java Introduction (Basics)
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Geodesy 1.pptx...............................................
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Artificial Intelligence
UNIT-1 - COAL BASED THERMAL POWER PLANTS
bas. eng. economics group 4 presentation 1.pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Ad

VHDL or Verilog: describe your adder and correction logic

  • 2. What is Arduino? • It is a series of open-source microcontroller board based on a diverse range of microcontrollers (MCU) • Importance: Widely used in electronics, automation, and IoT projects. • Different Boards: Arduino Uno, Mega, Nano.
  • 3. INTRO. TO ARDUINO • It’s a micro-computer/ microcontroller . • As any computer it has internal CPU, RAM, IOs interfaces. • It’s used for control purposes. • Arduino uno is reprogrammable, codes can be ported into it for specific application.
  • 4. What is Arduino Uno? • A microcontroller board based on ATmega328P Key Components: • Microcontroller unit • Digital & Analog Pins • Power Supply & Voltage Regulators • USB Interface for programming
  • 6. Board Components •Reset Button : This will restart any code that is loaded to the Arduino board •Ground Pin : There are a few ground pins on the Arduino and they all work the same •Analog Pins (A0 - A5): These pins read the signal from an analog sensor and convert it to digital •Digital Input/Output : Pins 0-13 can be used for digital input or output •PWM ((~3, ~5, ~6, ~9, ~10, ~11): The pins marked with the (~) symbol can simulate analog output •USB Connection : Used for powering up your Arduino and uploading sketches
  • 7. Board Components • TX/RX : Transmit and receive data indication LEDs • ATmega Microcontroller : Popular microcontroller chip, • Power LED Indicator : This LED lights up anytime the board is plugged in a power source • DC Power Barrel Jack : This is used for powering your Arduino with a power supply • 3.3V Pin : This pin supplies 3.3 volts of power • 5V Pin : This pin supplies 5 volts of power
  • 8. steps to write Arduino code 1.download and install the Arduino IDE (integrated development environment). 2.Connect the Arduino to your computer's USB port
  • 9. Arduino IDE ‫القوائم‬ ‫شريط‬ ‫السريعة‬ ‫األوامر‬ ‫شريط‬ ‫هنا‬ ‫الكود‬ ‫كتابة‬ ‫والرسائل‬ ‫األخطاء‬ ‫عرض‬
  • 10. 3. Settings { choose Arduino board and port number } steps to write Arduino code Tools --> Boards Tools --> Serial port
  • 11. Basic electronics 1- BREADBOARD • It’s an important board in electronics to do prototyping
  • 13. Basic electronics 2- LED • Light Emitting Diode.
  • 14. Avo meter It is a device used to measure voltage, current, and resistance
  • 15. Basic electronics 3- RESISTORS • Resistors provide a specific amount of resistance to a path in a circuit or wire.
  • 16. Basic electronics 3- BATTERY • A battery is a source of electric power. • 9v , 12v,…
  • 18. Basic electronics 3- JUMPER WIRES MALE MALE • To connect two points to each other without soldering.
  • 19. Basic electronics 6-REGULATOR • takes an input voltage of up to 38 V and efficiently reduces it to 5 V.
  • 24. Code Structure 1.void setup( ){ } 2. void loop( ) { } setting up your Arduino for the rest of the program. code here run once the setup() function is called first. It’s executed only once and must be used to set pinModes, make settings for hardware components. contains the statements that will run The loop() function is next to the setup() function and it is iterated infinitely
  • 25. useful functions 1.pinMode( pinNumber, direction ); set a pin as input/output 2.digitalWrite( pinNumber , state ); set a digital pin high/low 3. Delay( time ); wait an amount of time in milliseconds
  • 27. comments // This is a single-line comment /* This is a multi-line comment */
  • 28. variables In Arduino C, identifiers should contain only alphanumeric characters, dash (-), or underscore(_). An identifier can only start from an underscore or a letter. dataType variable_name ; int x ; or.. int x = 3;
  • 29. Variables datatypes Data type Size range boolean (8 bit) true/false byte (8 bit) 0-255 char (8 bit) (A-Z) or -128 to 127 word (16 bit) 0-65535 unsigned int (16 bit) 0-65535 int (16 bit) -32768 to 32767 unsigned long (32 bit) 0-4,294,967,295 long (32 bit) -2,147,483,648 to 2,147,483,647 float (32 bit) -3.4028235E38 to 3.4028235E38
  • 34. Compound Operators Operator name Operator simple Description Example increment ++ Increment operator, increases integer value by one A++ will give 11 decrement -- Decrement operator, decreases integer value by one A-- will give 9 compound addition += Add AND assignment operator. It adds right operand to the left operand and assign the result to left operand B += A is equivalent to B = B+ A compound subtraction -= Subtract AND assignment operator. It subtracts right operand from the left operand and assign the result to left operand B -= A is equivalent to B = B - A compound multiplication *= Multiply AND assignment operator. It multiplies right operand with the left operand and assign the result to left operand B*= A is equivalent to B = B* A compound division /= Divide AND assignment operator. It divides left operand with the right operand and assign the result to left operand B /= A is equivalent to B = B / A compound modulo %= Modulus AND assignment operator. It takes modulus using two operands and assign the result to left operand B %= A is equivalent to B = B % A
  • 35. What is Variable Scope? Variables Scope local variables Declared inside a function or a block Global variables Declared outside of all functions Parameters defined inside function parentheses
  • 36. Constants • Constants are fixed values that do not change during program execution. • Constants help improve code : • readability • maintainability • prevent accidental changes.
  • 37. Types of Constants in Arduino 1. #define Preprocessor Constant 2. const Keyword (Recommended) 3. Built-in Constants (HIGH, LOW, INPUT, OUTPUT, etc.)
  • 38. Preprocessor Constant • Uses #define to create a macro constant (no data type). • replaces values before compilation. • No memory usage (just replaces text). • No type checking
  • 39. const Keyword • Uses const to create a typed constant variable. • Uses memory (stored in RAM)
  • 40. Built-in Constants Constant Value Description HIGH 1 Sets pin to HIGH (5V) LOW 0 Sets pin to LOW (0V) INPUT 0 Sets pin as input OUTPUT 1 Sets pin as output
  • 41. Arduino c Syntax Control Structures Arduino C supports these control structures: •if •if …else… •for •switch case •while •do… while…