[go: up one dir, main page]

0% found this document useful (0 votes)
5 views12 pages

Arduino Uno

The document provides an overview of various Arduino boards, including the Arduino Uno, Nano, and Micro, detailing their specifications, pin configurations, and common applications. It includes project examples demonstrating how to use these boards with components like LEDs and temperature sensors, along with corresponding code snippets. Each board's advantages and limitations are also discussed, highlighting their suitability for different types of projects.

Uploaded by

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

Arduino Uno

The document provides an overview of various Arduino boards, including the Arduino Uno, Nano, and Micro, detailing their specifications, pin configurations, and common applications. It includes project examples demonstrating how to use these boards with components like LEDs and temperature sensors, along with corresponding code snippets. Each board's advantages and limitations are also discussed, highlighting their suitability for different types of projects.

Uploaded by

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

Arduino Uno (R3)

Arduino Uno is the most standard board available and probably the best choice for a beginner. We can
directly connect the board to the computer via a USB Cable which performs the function of supplying
the power as well as acting as a serial port.

Vin: This is the input voltage pin of the Arduino board used to provide input supply from an external
power source.
5V: This pin of the Arduino board is used as a regulated power supply voltage and it is used to give
supply to the board as well as onboard components.
3.3V: This pin of the board is used to provide a supply of 3.3V which is generated from a voltage
regulator on the board
GND: This pin of the board is used to ground the Arduino board.
Reset: This pin of the board is used to reset the microcontroller. It is used to Resets the
microcontroller.
Analog Pins: The pins A0 to A5 are used as an analog input and it is in the range of 0-5V.
Digital Pins: The pins 0 to 13 are used as a digital input or output for the Arduino board.
Serial Pins: These pins are also known as a UART pin. It is used for communication between
the Arduino board and a computer or other devices. The transmitter pin number 1 and receiver pin
number 0 is used to transmit and receive the data resp.
External Interrupt Pins: This pin of the Arduino board is used to produce the External interrupt and
it is done by pin numbers 2 and 3.
PWM Pins: This pins of the board is used to convert the digital signal into an analog by varying the
width of the Pulse. The pin numbers 3,5,6,9,10 and 11 are used as a PWM pin.
SPI Pins: This is the Serial Peripheral Interface pin, it is used to maintain SPI communication with
the help of the SPI library. SPI pins include:
1. SS: Pin number 10 is used as a Slave Select
2. MOSI: Pin number 11 is used as a Master Out Slave In
3. MISO: Pin number 12 is used as a Master In Slave Out
4. SCK: Pin number 13 is used as a Serial Clock
LED Pin: The board has an inbuilt LED using digital pin-13. The LED glows only when the digital
pin becomes high.
AREF Pin: This is an analog reference pin of the Arduino board. It is used to provide a reference
voltage from an external power supply.
Specifications of Arduino Uno:
1. Microcontroller: ATmega328P
2. Operating Voltage: 5V
3. Input Voltage: 7-12V recommended (6-20V limits)
4. Digital I/O Pins: 14 (6 provide PWM output)
5. Analog Input Pins: 6
6. DC Current per I/O Pin: 20 mA
7. Flash Memory: 32 KB (0.5 KB used for bootloader)
8. SRAM: 2 KB
9. EEPROM: 1 KB
10. Clock Speed: 16 MHz
Common Uses:
1. Robotics projects
2. Home automation systems
3. Interactive art installations
4. Weather stations
5. LED control and lighting projects
6. Simple game controllers
7. Temperature and humidity sensors
8. Motor control (DC, servo, stepper motors)
9. Sound and music projects
10. Data logging and monitoring
PROJECT BASED on ARDUNIO UNO
A simple project that demonstrates how to use a digital input and output on the Arduino Uno.
Create a circuit and write code for a push button that controls an LED.
1. Arduino Uno
2. Breadboard
3. LED
4. 220-ohm resistor (for the LED)
5. Push button
6. 10k-ohm resistor (for the button)
7. Jumper wires
To set up the circuit:
1. Connect the longer leg (anode) of the LED to digital pin 13 on the Arduino.
2. Connect the shorter leg (cathode) of the LED to the 220-ohm resistor, then to GND.
3. Connect one side of the push button to digital pin 2 on the Arduino.
4. Connect the other side of the push button to GND.
5. Connect the 10k-ohm resistor between digital pin 2 and 5V (this is a pull-up resistor).
Ardunio Code
const int buttonPin = 2; // Push button connected to digital pin 2
const int ledPin = 13; // LED connected to digital pin 13
int buttonState = 0; // Variable to store the button state
void setup() {
pinMode(ledPin, OUTPUT); // Set the LED pin as an output
pinMode(buttonPin, INPUT); // Set the button pin as an input
}
void loop() {
// Read the state of the push button
buttonState = digitalRead(buttonPin);
// Check if the button is pressed // (note: the logic is inverted because of the pull-up resistor)
if (buttonState == LOW)
{
digitalWrite(ledPin, HIGH); // Turn on the LED
}
else
{
digitalWrite(ledPin, LOW); // Turn off the LED
}
}
The code does the following:
1. Define constants for the pin numbers being used
2. In the setup() function, set the LED pin as an output and the button pin as an input.
3. In the loop() function, continuously read the state of the button.
4. If the button is pressed (which gives a LOW signal due to the pull-up resistor), we turn on the
LED.
5. If the button is not pressed, turn off the LED.
To use this code:
Open the Arduino IDE.
Create a new sketch and paste this code into it.
Select your board (Arduino Uno) and port from the Tools menu.
Click the Upload button to send the code to your Arduino.

ARDUNIO NANO
The Arduino Uno and nano are similar, but the only difference is that its size. The UNO size is 2 times
the nano size, so the Arduino nano is more breadboard friendly. It is used for portable projects. The
board has a mini USB cable slot.
It uses the same ATmega328P microcontroller as the Uno, so it has similar processing capabilities.
It's much smaller than the Uno, making it excellent for wearable or space-constrained projects.
It has more analog input pins (8 vs 6 on the Uno).
It lacks a DC power jack, so it's typically powered via USB or the VIN pin.
Programming is identical to the Uno, using the same Arduino IDE.
Vin: This is the input voltage pin of the Arduino board used to provide input supply from an external
power source.
5V: This pin of the Arduino board is used as a regulated power supply voltage and it is used to give
supply to the board as well as onboard components.
3.3V: This pin of the board is used to provide a supply of 3.3V which is generated from a voltage
regulator on the board
GND: This pin of the board is used to ground the Arduino board.
Reset: This pin of the board is used to reset the microcontroller. It is used to Resets the
microcontroller.
Analog Pins: The pins A0 to A7 are used as an analog input and it is in the range of 0-5V.
Digital Pins: The pins D0 to D13 are used as a digital input or output for the Arduino board.
Serial Pins: This pin is also known as a UART pin. It is used for communication between
the Arduino board and a computer or other devices. The transmitter pin number 1 and receiver pin
number 2 is used to transmit and receive the data resp.
External Interrupt Pins: This pin of the Arduino board is used to produce the External interrupt and
it is done by pin numbers 2 and 3.
PWM Pins: This pins of the board is used to convert the digital signal into an analog by varying the
width of the Pulse. The pin numbers 3,5,6,9,10 and 11 are used as a PWM pin.
SPI Pins: This is the Serial Peripheral Interface pin, it is used to maintainSPI communication with
the help of the SPI library. SPI pins include:
1. SS: Pin number 10 is used as a Slave Select
2. MOSI: Pin number 11 is used as a Master Out Slave In
3. MISO: Pin number 12 is used as a Master In Slave Out
4. SCK: Pin number 13 is used as a Serial Clock
I2C: This pin of the board is used for I2C communication.
1. Pin A4 signifies Serial Data Line (SDA)and it is used for holding the data.
2. Pin A5 signifies Serial Clock Line (SCL) and it is used for offering data synchronization
among the devices.
LED Pin: The board has an inbuilt LED using digital pin-13. The LED glows only when the digital
pin becomes high.
AREF Pin: This is an analog reference pin of the Arduino board. It is used to provide a reference
voltage from an external power supply.
Overview
 Compact and breadboard-friendly microcontroller board
 Based on ATmega328P (same as Arduino Uno)
 Designed for space-constrained projects
Technical Specifications
 Microcontroller: ATmega328P
 Operating Voltage: 5V
 Input Voltage: 7-12V
 Digital I/O Pins: 14 (6 provide PWM output)
 Analog Input Pins: 8
 DC Current per I/O Pin: 40 mA
 Flash Memory: 32 KB (2 KB used for bootloader)
 SRAM: 2 KB
 EEPROM: 1 KB
 Clock Speed: 16 MHz
Programming
 Uses same Arduino IDE as other Arduino boards
 Uploadable via USB using on-board USB-to-serial converter
Common Applications
 Wearable electronics
 Drone and robotics projects
 IoT sensors and compact data loggers
 Embedded systems prototyping
Advantages
 Breadboard friendly
 Smaller size allows for more compact projects
 Compatible with most Arduino shields (with adaptation)
Limitations
 No DC power jack
 Fewer pins broken out to headers
 Less prototyping area on board

Variants
 Arduino Nano Every: Updated version with more powerful processor
 Arduino Nano 33 series: IoT, BLE, and AI-focused variants.
ARDUNIO NANO PROJECT
A practical example that demonstrates some key features of the Arduino Nano. This example will
use a temperature sensor (TMP36), an LED, and the serial monitor. It's a simple temperature
alarm system that lights up an LED when the temperature exceeds a certain threshold.
This example demonstrates several key concepts for working with the Arduino Nano:
1. Analog Input: Reading from an analog sensor (TMP36 temperature sensor) connected to pin
A0.
2. Digital Output: We're controlling the built-in LED connected to pin 13.
3. Serial Communication: We're using the serial monitor to display temperature readings.
4. Basic decision making: We use an if-else statement to decide when to turn on the LED.
To use this code:
1. Connect a TMP36 temperature sensor to the Arduino Nano:
o VCC to 5V

o GND to GND

o Output to A0

2. The built-in LED on pin 13 will be used, so no additional LED connection is needed.
3. Upload the code to your Arduino Nano using the Arduino IDE.
4. Open the Serial Monitor to view the temperature readings.
ARDUNIO CODE
int sensorValue = analogRead(temperaturePin);

// Convert the analog reading to voltage


float voltage = (sensorValue / 1023.0) * referenceVoltage;

// Convert voltage to temperature in Celsius


float temperatureC = (voltage - 0.5) * 100;

// Print the temperature to the serial monitor


Serial.print("Temperature: ");
Serial.print(temperatureC);
Serial.println(" °C");
// Check if temperature is above the threshold
if (temperatureC > thresholdTemp) {
digitalWrite(ledPin, HIGH); // Turn on LED
Serial.println("Temperature Alert!");
} else {
digitalWrite(ledPin, LOW); // Turn off LED
}
delay(1000); // Wait for a second before next reading
}
Code Explanation
Detailed Code Explanation:
1. Pin and Constant Definitions:
cpp
Copy
const int temperaturePin = A0;
const int ledPin = 13;
const float thresholdTemp = 25.0;
const float referenceVoltage = 5.0;
These lines define the pins we're using and set up important constants. The temperature sensor is
connected to analog pin A0, and we're using the built-in LED on pin 13. The threshold
temperature is set to 25°C, and we define the reference voltage of the Arduino Nano (5V).
2. Setup Function:
cpp
Copy
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
This function runs once when the Arduino starts. It initializes serial communication at 9600 baud
and sets the LED pin as an output.
3. Main Loop:
cpp
Copy
void loop() {
int sensorValue = analogRead(temperaturePin);
The loop() function runs continuously. It starts by reading the analog value from the temperature
sensor using analogRead().
4. Voltage Conversion:
cpp
Copy
float voltage = (sensorValue / 1023.0) * referenceVoltage;
This line converts the raw analog reading (0-1023) to a voltage (0-5V). We divide by 1023.0 (not
1023) to ensure floating-point division.
5. Temperature Calculation:
cpp
Copy
float temperatureC = (voltage - 0.5) * 100;
This formula is specific to the TMP36 sensor. It converts the voltage to temperature in Celsius.
6. Serial Output:
cpp
Copy
Serial.print("Temperature: ");
Serial.print(temperatureC);
Serial.println(" °C");
These lines print the temperature to the serial monitor.
7. Temperature Check and LED Control:
cpp
Copy
if (temperatureC > thresholdTemp) {
digitalWrite(ledPin, HIGH);
Serial.println("Temperature Alert!");
} else {
digitalWrite(ledPin, LOW);
}
This if-else statement checks if the temperature exceeds the threshold. If it does, it turns on the
LED and prints an alert.
8. Delay:
cpp
Copy
delay(1000);
This pauses the program for 1 second before the next reading.

ARDUNIO MICRO
Arduino Micro is the smallest board in the Arduino Community. The Arduino Micro has more number
of analog input pins than the UNO board. It is essentially a shrunk-down version of the Arduino
Leonardo
Vin: This is the input voltage pin of the Arduino board used to provide input supply from an external
power source.
5V: This pin of the Arduino board is used as a regulated power supply voltage and it is used to give
supply to the board as well as onboard components.
3.3V: This pin of the board is used to provide a supply of 3.3V which is generated from a voltage
regulator on the board
GND: This pin of the board is used to ground the Arduino board.
Reset: This pin of the board is used to reset the microcontroller. It is used to Resets the
microcontroller.
Analog Pins: The pins A0 to A11 are used as an analog input and it is in the range of 0-5V.
Digital Pins: The pins 4, 6, 8, 9, 10, and 12 are used as a digital input or output for the Arduino board.
External Interrupt Pins: This pin of the Arduino board is used to produce the External interrupt and
it is done by pin number 0, 1, 2, and 3.
PWM Pins: This pins of the board is used to convert the digital signal into an analog by varying the
width of the Pulse. The pin numbers 3, 5, 6, 9, 10, 11, and 13 are used as PWM pins.
Serial Pins: This pin is also known as a UART pin. It is used for communication between
the Arduino board and a computer or other devices. The transmitter pin number 1 and receiver pin
number 0 is used to transmit and receive the data resp.
I2C: This pin of the board is used for I2C communication.
1. Pin number 2 signifies Serial Data Line (SDA)and it is used for holding the data.
2. Pin number 3 signifies Serial Clock Line (SCL) and it is used for offering data
synchronization among the devices.
SPI Pins: This is the Serial Peripheral Interface pin, it is used to maintainSPI communication with the
help of the SPI library. SPI pins include:
1. SS: It is used as a Slave Select
2. MOSI: It is used as a Master Out Slave In
3. MISO: It is used as a Master In Slave Out
4. SCK: It is used as a Serial Clock
LED Pin: The board has an inbuilt LED using digital pin-13. The LED glows only when the digital
pin becomes high.
AREF Pin: This is an analog reference pin of the Arduino board. It is used to provide a reference
voltage from an external power supply.

You might also like