Report on Arduino Board Configuration
and Basic Programming
1. Introduction
Arduino is an open-source electronics platform that consists of both hardware (microcontroller
boards) and software (Arduino IDE). It is widely used for prototyping and developing interactive
projects, ranging from simple LED blinking to complex robotics. This report covers the pin
configuration of Arduino boards (UNO, Nano, and Mega), installation of the Arduino IDE, and
basic programming functions.
2. Arduino Board Pin Configuration
2.1 Arduino UNO
The Arduino UNO is one of the most commonly used boards. Its pin configuration includes:
1. Power Pins
- Provides power supply: 5V, 3.3V, GND, Vin (input voltage).
- Used to power external components.
2. Analog Pins (A0 – A5)
- Measures analog voltage (0-5V) and converts it to a digital value (0-1023).
- Can also be used as digital I/O pins if needed.
3. Digital Pins (D0 – D13)
- Used for digital input/output (e.g., reading sensors or controlling LEDs, relays).
- D0 (Rx) and D1 (Tx) are used for serial communication.
4. PWM Pins (~3, ~5, ~6, ~9, ~10, ~11)
- Generate Pulse Width Modulation signals to simulate analog output.
- Used for dimming LEDs, controlling motors, and servo positioning.
5. ICSP (In-Circuit Serial Programming) Pins
- Used for direct microcontroller programming (e.g., uploading bootloader).
- Allows reprogramming without using USB.
6. Analog Reference Pin (AREF)
- Sets a custom reference voltage for analog-to-digital conversion.
7. Power LED Pin
- Indicates if the board is powered ON/OFF.
8. Reset Pin (RST)
- Used to reset the program execution.
9. Voltage Regulator
- Controls variable voltage input to stabilize power supply.
10. Crystal Oscillator (16 MHz)
- Provides clock pulses for timing operations.
11. USB Port
- Enables communication between Arduino and PC.
2.2 Arduino Nano
- A compact version of the UNO with similar functionality.
- 30 Pins in total:
- 14 Digital I/O Pins (6 PWM-capable).
- 8 Analog Input Pins .
- 2 Reset Pins, 6 Power Pins .
- Operating Voltage: 5V (Input: 6-12V).
- Uses ATmega328P microcontroller.
2.3 Arduino Mega
- Designed for large-scale projects requiring more I/O.
- 54 Digital I/O Pins, 16 Analog Pins .
- 4 Hardware Serial Ports (useful for GPS, Bluetooth).
- Operating Voltage: 5V.
- Uses ATmega2560 microcontroller.
3. Installation of Arduino IDE
1. Download:
- Open a browser and search for ”Download Arduino IDE” .
- Visit the official Arduino website and select the appropriate version (Windows 10, macOS,
Linux).
2. Installation:
- Run the setup file and follow the instructions.
- Connect the Arduino board via USB.
3. Board Selection:
- Open Arduino IDE → Tools → Board → Select Arduino UNO/Nano/Mega .
4. Upload a Test Program:
- Write a simple LED blink code and upload it to verify installation.
4. Basic Programming Functions
4.1 Data Types
- int – Integer values (e.g., 10, 20 ).
- float – Decimal numbers (e.g., 4.5, 6.7 ).
- char – Single characters (e.g., a , B ).
- boolean – True/False conditions.
- String – Text data.
4.2 Variables
- Local Variable: Declared inside a function.
- Global Variable: Declared outside functions (accessible everywhere).
4.3 Key Functions
1. void setup()
- Runs once at startup (used for pin configuration).
- Example:
Void setup() {
pinMode(LED_BUILTIN, OUTPUT); // Set LED pin as output
}
2. void loop()
- Runs repeatedly after setup() .
- Example:
Void loop() {
digitalWrite(LED_BUILTIN, HIGH); // Turn LED ON
delay(1000); // Wait 1 second
digitalWrite(LED_BUILTIN, LOW); // Turn LED OFF
delay(1000);
}
3. pinMode(pin, mode)
- Configures a pin as INPUT or OUTPUT .
4. digitalRead(pin)
- Reads a digital input (returns HIGH or LOW ).
5. digitalWrite(pin, state)
- Writes a digital output ( HIGH or LOW ).
6. analogRead(pin)
- Reads analog input (0-1023).
7. analogWrite(pin, value)
- Writes PWM output (0-255).
8. delay(ms)
- Pauses execution for milliseconds.
9. Serial Communication
- [Link](baud_rate) – Starts serial communication.
- [Link](data) – Prints data to the Serial Monitor.
5. Example:
LED Blinking Program
Void setup() {
pinMode(LED_BUILTIN, OUTPUT); // Initialize LED pin as output
}
Void loop() {
digitalWrite(LED_BUILTIN, HIGH); // Turn LED ON
delay(1000); // Wait 1 second
digitalWrite(LED_BUILTIN, LOW); // Turn LED OFF
delay(1000); // Wait 1 second
}
BUTTON BEEPS
Int pos=0;
Void setup() {
pinMode(A0, INPUT);
pinMode(8, OUTPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
}
Void loop() {
// If button pressed on A0 is detected
If (digitalRead(A0) == HIGH) {
Tone(8, 440, 100);
}
// If button pressed on A1 is detected
If (digitalRead(A1) == HIGH) {
Tone(8, 494, 100);
}
// If button pressed on A2 is detected
If (digitalRead(A2) == HIGH) {
Tone(8, 523, 100);
}
Delay(10);
}
6. Conclusion
Arduino provides an easy-to-use platform for beginners and professionals alike. Understanding
pin configurations, IDE setup, and basic programming functions is essential for developing
embedded projects. With its versatility, Arduino can be used in robotics, automation, IoT, and
more.