Microcontroller s and Arduino Platform
Microcontroller s and Arduino Platform
GROUP 2
Presented By:
MOUENDI SONE
MICROCONTROLLER ARCHITECTURE (MICROPROCESSOR, MEMORY, I/O PORTS)
• Microcontrollers are built around two primary architectural models, which define how the CPU access
memory:
• Von Newmann Architecture: In this model, a single address and data bus is shared for both program
instructions and dataThis means the CPU fetches instructions and read /writes data over the same pathways.
The entire memory space is unified which can simplify the design but may create a bottleneck (the “Von
Newmann bottleneck”) as instructions and data cannot be fetched simultaneously. A classic example is the
Motorola 68HC11
HARVARD ARCHITECTURE
• Harvard Architecture: This architecture uses physically separate memory and buses for program instructions
and data. This allows the CPU to fetch the next instruction while simultaneously accessing data,
significantly improving throughput and speed. Most modern microcontrollers, including the AVR family
(used in many Arduino boards) and PICs, are based on the Harvard architecture
DIFFERENCES BETWEEN MICROCONTROLLER & MICROPROCESSOR
Definition A self-contained computer on a single chip, The central processing unit (CPU) of a
integrating a CPU, memory, and I/O peripherals computer, built on a single chip. It requires
external components to function
Power Consumption Low power consumption, often with High power consumption, , require more
various power-saving modes. Ideal for complex power management
battery-powered devices
Cost Low overall system cost cost as many High system cost due due to the need for
components are integrated external memory, I/O controllers, and
other
Architecture Typically uses Harvard architecture (separate Typically uses Von Newmann architecture
programs and data memory) (unified program and data memory)
INTRODUCTION TO ARDUINO
• Arduino is an open-source electronics platform based on easy-to-use hardware and software. It was created in 2005 in Ivrea,
Italy, with the goal of providing a low-cost and simple way for students, artists, and hobbyists to create interactive electronic
projects.
• Hardware:: A programmable circuit board (the "Arduino board") featuring a microcontroller, power regulation, USB
connectivity, and accessible I/O pins
• Software:The Arduino Integrated Development Environment (IDE), a simplified programming environment based on C/C++
that allows you to write code ("sketches") and upload them to the board
TYPES OF ARDUINO BOARDS
•The Arduino ecosystem offers a variety of boards tailored to different project needs.
[Link] Uno
•The Arduino Uno is the most popular and widely used board, making it the standard entry point for beginners
FEATURES
. Microcontroller: ATmega328P (8-bit AVR):It's a small computer chip that reads instructions from your code and makes things happen like telling an LED to
blink or reading a temperature sensor. It's not powerful enough to run a game or browse the internet, but it's perfect for controlling lights, motors, and buttons
. Operating Voltage (5V):This is the energy level the Arduino uses to think and talk. Just like some toys need two AA batteries (3 volts) and others need a bigger
pack, this board needs 5 volts to run properly. If you plug a sensor that can only handle 3 volts directly into the Arduino, you might fry it like putting too much air
in a balloon.
• Digital I/O Pins: 14 (6 with PWM) These are the on/off switches on the board. A digital pin can either be fully ON (5V) or fully OFF (0V) like a light switch
that has no dimmer. There are 14 of these switches. However, 6 of them are special: they can blink super fast to fake a dimmer effect. This trick is called PWM
• Analog Input Pins ( 6):These are the "measuring" pins. Unlike the digital pins that only know "yes" or "no," these pins can read a range—like a volume knob.
If you connect a knob (potentiometer) and turn it from left to right, the Arduino reads a number from 0 (off) to 1023 (full blast).
• Flash Memory (32 KB):This is the Arduino's long-term memory drawer. When you unplug the board from your computer, it still remembers the program you
uploaded. This is where your sketch lives.
• Use Case: Ideal for learning the basics of electronics and programming, and for prototyping simple to mid-level projects
[Link] MEGA 2560
• The Arduino Mega 2560 is designed for more complex projects that require a large number of I/O pins and more memory
FEATURES
• Microcontroller: The ATmega2560 microcontroller is the one mounted on this board, it includes 256KB Flash memory, 8KB SRAM, and
4KB EEPROM. This increased storage helps to save several variables and a bigger program.
• Clock Speed: The Mega 2560 operates at a clock frequency of 16 MHz. This is a suitable operation speed since it will be able to cater to a
variety of fast processing applications.
• Input Voltage: It is recommended that the input voltage should be 7-12V with an operational range falling between 6-20V. The Powerboard
can work on a USB connection or an external power source.
• External Power Supply: The Arduino Mega 2560 can also be powered wirelessly using an external power supply of no more than 12V. This
is very practical for applications where a computer has to be deactivated.
• Communication Protocols:
• o UART: Four serial ports for communication with other devices like sensors, modules, or other microcontrollers
• o SPI and I2C: Utilized for high-speed interconnection between devices and devices
• USB Connection: The Connection of a USB cable to this board makes it possible to upload sketches to the board and also causes the board
to communicate using the PC’s serial port.
• Operating Voltage: The board operates on a voltage level of 5V and provides 5V and 3.3V for powering the external device interconnects.
• Use Case: Suited for projects like 3D printers, robotics, complex automation systems, and any application requiring many sensors and
[Link] LILYPAD
Arduino Lilypad Features:
The Arduino LilyPad is a unique and versatile platform specifically designed for wearable electronics and e-textile projects.
Here’s a detailed overview of its key features:
• [Link] and Sewable Design:
• Flat and Circular Shape: The LilyPad boards are round and flat, with large sewable connection points (pads) along the
perimeter. These pads are designed to be easily connected to conductive thread, allowing for integration into textiles and
clothing.
• Flexible PCB: The board is made from a thin, flexible PCB, making it more comfortable to wear r0tttttttttr
• 0t0t ttttwer consumption. This is critical for wearables that need to run for long periods on small batteries.
• Sleep Modes: The microcontroller (ATmega32U4 or ATmega328) includes multiple low-power sleep modes that further
reduce energy use when the device is inactive.
• [Link] Options:
• LilyPad Arduino USB (ATmega32U4):
• 32 KB Flash Memory (with 4 KB used by the bootloader).
• 2.5 KB SRAM and 1 KB EEPROM.
• Integrated USB for programming and communication.
• LilyPad Arduino Main Board or Simple Board (ATmega328P):
• 32 KB Flash Memory (with 2 KB used by the bootloader).
• Requires an external FTDI programmer for uploading sketches.
• [Link]/ Output Pins:
• Digital I/O Pins:
• The board has 9 digital I/O pins (LilyPad USB version), allowing for the connection of components like buttons, sensors, and LEDs.
• Up to 4 of these pins can be configured for PWM output, useful for controlling LED brightness or motor speed.
• Analog Input Pins:
• It has 4 analog input pins (A0-A3), which can be used to read sensors that output analog signals (e.g., light sensors, temperature
sensors).
• These pins can also be used as additional digital pins.
• Built-In USB Programming:
• USB Connectivity (LilyPad Arduino USB): The LilyPad Arduino USB version has an onboard micro-USB port, allowing it to be
programmed directly through a USB cable without needing an external programmer.
• External Programming (LilyPad Simple/Original): Older versions, like the LilyPad Main Board or Simple Board, require an FTDI
cable or USB-to-serial adapter to upload code.
• [Link] Communication Protocols:
• Serial Communication:Allows communication with external devices using UART (TX/RX).
• I2C (Inter-Integrated Circuit):Supports I2C communication, which allows multiple devices like sensors and displays to be connected
to the same data and clock lines.
• SPI (Serial Peripheral Interface):This protocol allows high-speed communication with peripherals like SD cards or displays.
Use Case: Perfect for integrating electronics into clothing, accessories, and other fabric-based projects.
ARDUINO PIN MAPS AND INTERFACING
Understanding the pinout of an Arduino board is crucial for connecting external components like sensors, LEDs, and motors.
1 Arduino Uno Pinout
The Arduino Uno's pin layout is organized for easy access and has become a standard for many shields (add-on boards). Here is a
detailed
Pin breakdown of its pin functions
Category Pin Labels Description/Key Functions
Power Pins Vin,5V/3.3V, GND, RESET, AREF Vin: Input voltage to the board (7-12V
recommended). 5V/3.3V: Regulated voltage outputs
to power external circuits. GND: Ground
connection. AREF: Analog Reference for setting a
custom ADC range
Digital Pins D0-D13 General-purpose I/O pins operating at 5V. They can be
configured as INPUT or OUTPUT using pinMode().
Maximum current per pin is 40 mA
External Interrupts 2,3 These pins can be configured to trigger an interrupt when a
specific change in voltage occurs, useful for detecting events
like button presses without constantly checking the pin's state
[Link] MEGA 2560 PINOUT
The Mega 2560 expands on the Uno's pinout, offering significantly more connectivity. It features 54 digital I/O pins, 16 analog inputs, and 4 hardware UARTs (serial
Number of pins Interpretation Detail
0 Digital I/O pin (RX) Serial data received through UART or USB
2-13 Digital I/O pins with PWM pins Used for PWM output or as digital pins.
15 Digital I/O pin (RX3) Used for receiving the data on the serial 3
16 Digital I/O pin (TX2) Used for transmitting the data on the serial 2
17 Digital I/O pin (RX2) Used for receiving the data on the serial 2
18 Used for transmitting the data on the serial 1
Digital I/O pin (TX1)
19 Digital I/O pin (RX1) Used for receiving the data on the serial 1
52 SCK or communication SPI For synchronization, it used the SPI clock signal.
• 1. Digital Pins (Pins 0–53)
• Arduino Mega 2560 has a total of 54 digital I/O pins from D2-D53 except for the power and ground pins.
• ● I/O Functionality: Each virtual pin can be set to either receive an input signal or offer an output signal, relying on the necessities of
your project. These pins are useful for studying sensor facts, controlling LEDs, or dealing with switches and relays.
• ● Voltage Levels: Digital pins operate at 5V, and may either be set to a HIGH (5V) or LOW (0V) state. Care should be taken to make
sure that outside additives connected to those pins can deal with those voltage levels.
• 2. Analog Pins (Pins A0–A15)
• The Mega 2560 features sixteen analog enter pins, classified A0 to A15. These pins are designed for analyzing analog voltages
between 0V and 5V and converting them to digital values using the onboard 10-bit Analog-to-Digital Converter (ADC).
• ● Analog to Digital Conversion: The 10-bit ADC offers 1024 discrete levels of resolution (values starting from 0 to 1023). This is
particularly useful for studying statistics from sensors that output a variable voltage, together with temperature, mild, or stress
sensors.
• ● Voltage Reference: By default, the reference voltage for analog readings is 5V. However, this will be changed using the
analogReference() characteristic, taking into account greater particular measurements with lower voltage ranges.
• 3. Power Pins
• The Arduino Mega 2560 presents plenty of power pins that can deliver regulated voltage to external components.
• ● 3.3V and 5V Pins: The 3.3V pin supplies 3.3 volts, whilst the 5V pin supplies 5 volts to any connected external additives. These
pins may be used to power sensors, actuators, and modules that require low working voltage. The 5V pin is regulated, so it may offer
a strong electricity delivery.
• ● Ground (GND) Pins: Multiple GND pins are supplied to establish a common ground within the circuit. These are critical for
• VIN Pin: The VIN pin allows you to energy the Arduino board with the use of an external strength source. When powering the
board in this manner, the enter voltage must range between 7V and 12V. The onboard voltage regulator will step down the voltage
to 5V to be used by way of the board.
• 4. UART (Serial Communication)
• Two strong points of the Mega 2560 are its multiple UART ports, which provide serial communication resources. In addition to the
Serial0 port available on most Arduino boards, the Mega 2560 has three additional UARTs.
• Serial0 (pins 0 and 1): This port is linked to the USB connection for communication with a PC. Pin 0 is the RX (receive) pin and
pin 1 is the TX (transmit) pin.
• Serial1 (pins 18 and 19), Serial2 (pins 16 and 17), Serial3 (pins 14 and 15): It is viable to join a range of serial devices, such as GPS
modules, Bluetooth, Blue adapters, and different microcontrollers. These greater hardware serial ports for problematic initiatives
require various serial conversation channels except interfering with the main USB connection this serial is helpful.
• 5. SPI (Serial Peripheral Interface)
• The Arduino Mega 2560 supports SPI communication, a high-speed protocol for exchanging data with memory cards, displays,
sensors, and other peripherals.
• MISO (pin 50): Master In Slave Out used to receive data from SPI devices.
• MOSI (pin 51): Master Out Slave In Used to send data to SPI devices.
• SCK (pin 52): The serial clock pin controls the timing of data transmission between the Arduino and peripherals.
• SS (pin 53): Which SPI device the Arduino Mega 2560 is interacting with is indicated by the Slave Select pin (SS).
• Applications requiring fast communication over small distances frequently employ SPI. For connecting to components that need
• 6. I2C (Inter-Integrated Circuit)
• The I2C Protocol Mega 2560 can communicate with multiple I2C-enabled devices using just 2 pins, making it ideal for projects
with many peripherals.
• SDA (pin 20): Serial Data Line (SDA) is used to send data to and receive data from I2C devices.
• SCL (pin 21): Serial Clock Line (SCL) synchronizes data transmission between Arduino Mega and I2C devices.
• I2C is generally used in sensor networks. where multiple sensors use the same bus But they are fixed separately by the main
device.
• 7. PWM Output (Pins 2–13, and Pins 44–46)
• From the 54 digital pins, 15 pins support pulse width modulation (PWM) output. These PWM pins are useful in applications
that require analog operation with digital signals, such as control motor speed or dimmable LED lights.
• PWM Supported Pins: Pins 2–13 and 44–46 can output PWM signals by changing the pulse width in a single cycle. These pins
are therefore able to simulate different voltage levels (from 0V to 5V) without using an actual DAC (digital-to-analog
converter).
• PWM Frequency: The standard PWM frequency on the Arduino Mega is approximately 490 Hz, although it can be changed
using additional code and configuration.
• Overall, the Arduino Mega 2560's large array of digital, analog, and verbal exchange pins makes it perfect for initiatives that
require substantial I/O operations. The flexibility to cope with SPI, UART, I2C, PWM, and analog inputs permits scalable
[Link] LILYPAD PINOUT
• The LilyPad's pins are arranged around its perimeter as sewable tabs. The main LilyPad board (ATmega328P) features 14 digital I/O pins and 6 analog inputs,
similar to the Uno but in a wearable-friendly form factor. The LilyPad Simple version offers a smaller set of 9 digital I/O pins.
Pins Description Function
D1 Digital input/output.
Digital I/O
D2 Digital I/O, External Interrupt Can be used for digital input/output or external
interrupt (INT0).
D3 Digital I/O, PWM PWM output pin (useful for controlling LEDs or
motors), can also be used as an interrupt pin.
A1 Analog Input, Digital I/O Similar to A0, can be used as an analog or digital
input/output pin.
A2 Analog Input, Digital I/O Another analog input pin that can be used for digital
I/O.
A3 Analog Input, Digital I/O Another pin for analog sensing or digital I/O.
a) .Power pins:
b) Power Management:
• Battery input: Designed for use with 3.7V lithium polymer (LiPo) batteries, which are ideal for wearables due to their lightweight and rechargeable nature.
c) Communication Pins:
• TX (D1) and RX (D0): Used for Serial communication, especially when communicating with other devices or peripherals.
• I2C (A4 and A5): For I2C communication, these analog pins are used for connecting to I2C-compatible sensors and devices.
END