0% found this document useful (0 votes)
17 views3 pages

Arduino Basics: Configuration & I/O Functions

The document outlines two practical exercises involving Arduino, focusing on its configuration, architecture, and interfacing with sensors. The first practical demonstrates basic programming with an LED blinking example, while the second practical involves interfacing various sensors and utilizing I/O functions. Both exercises aim to provide a foundational understanding of Arduino's capabilities and programming environment.

Uploaded by

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

Arduino Basics: Configuration & I/O Functions

The document outlines two practical exercises involving Arduino, focusing on its configuration, architecture, and interfacing with sensors. The first practical demonstrates basic programming with an LED blinking example, while the second practical involves interfacing various sensors and utilizing I/O functions. Both exercises aim to provide a foundational understanding of Arduino's capabilities and programming environment.

Uploaded by

rahuljagtap4615
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Electronics Engineering Practicals

Practical No. 3 – Introduction to Arduino

Title: Introduction to Arduino Configuration and Architecture

Aim: To study Arduino board configuration, architecture, digital and analog ports, and to
write a basic program using Arduino IDE.

Apparatus Required: Arduino Uno board, USB cable, Breadboard, Jumper wires, LED,
Resistor (220 Ω), PC with Arduino IDE.

Theory:
Arduino is an open-source microcontroller platform used for building digital devices and
interactive projects. It consists of a hardware board (like Arduino Uno) and software
(Arduino IDE).

Arduino Architecture:
- Microcontroller: ATmega328P
- Operating Voltage: 5 V
- Input Voltage: 7–12 V
- Digital I/O Pins: 14 (6 PWM outputs)
- Analog Input Pins: 6
- Clock Speed: 16 MHz
Arduino IDE: The Arduino IDE is used to write, compile, and upload programs (called
sketches) to the Arduino board.

Program :
void setup( ) {
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}

Procedure:
1. Connect Arduino Uno to PC via USB cable.
2. Open Arduino IDE.
3. Select board type and COM port.
4. Write or load LED blinking program.
5. Connect LED to pin 13 through 220 Ω resistor.
6. Upload program and observe LED blinking.

Observation Table:

Sr. No. Pin Used Function Observation


1 13 Digital Output LED Blinks
every second

Result: LED blinks ON and OFF alternately, demonstrating Arduino basic programming and
configuration.

Conclusion: Basic understanding of Arduino board, its architecture, ports, and IDE is
achieved.

Practical No. 4 – Arduino I/O & Sensors

Title: Study of Arduino I/O functions and interfacing of sensors.

Aim: To interface sensors (like humidity, temperature, PIR, ultrasonic) with Arduino and
use I/O functions (pinMode, digitalWrite, analogRead).

Apparatus Required: Arduino Uno board, Breadboard, Jumper wires, DHT11 Sensor,
Ultrasonic Sensor (HC-SR04), PIR Sensor, Magnetic Relay Module, PC with Arduino IDE.

Theory:
Arduino I/O Functions:
- pinMode(pin, mode): Sets a pin as INPUT or OUTPUT.
- digitalWrite(pin, value): Sends HIGH or LOW signal.
- analogRead(pin): Reads analog value (0–1023).
- analogWrite(pin, value): Outputs PWM signal (0–255).
Sensors Used:
- Humidity/Temperature Sensor (DHT11)
- Ultrasonic Sensor (HC-SR04)
- PIR Sensor
- Relay Module

Circuit Diagrams:
Ultrasonic Sensor: VCC–5V, GND–GND, Trig–Pin 9, Echo–Pin 10
DHT11 Sensor: VCC–5V, GND–GND, Data–Pin 2

Program Example (Humidity Sensor):


#include <DHT11.h>

DHT11 dht11(2);
void setup() {

[Link](9600);

}
void loop() {
int temperature = 0;
int humidity = 0;
int result = [Link](temperature, humidity);
if (result == 0) {
[Link]("Temperature: ");
[Link](temperature);
[Link](" °C\tHumidity: ");
[Link](humidity);
[Link](" %");
} else {
[Link](DHT11::getErrorString(result));
}
}

Observation Table:

Sensor Pin Used Output Value Observation


DHT11 2 Temp & Humidity Working

Result: Arduino successfully interfaces with various sensors and performs I/O operations
using appropriate functions.

Conclusion: Basic understanding of Arduino input/output functions and sensor interfacing


is achieved.

Common questions

Powered by AI

Interfacing the DHT11 sensor with an Arduino enables it to measure and report temperature and humidity data, which can be used in real-world applications like home automation systems for monitoring environmental conditions, weather stations, or any systems requiring climate data collection. This enhances the Arduino's functionality by allowing it to interact with the physical world in a meaningful way .

Setting up an Arduino project with a DHT11 sensor involves several steps: connecting the sensor to the Arduino board using jumper wires (power and ground to 5V and GND, and the data pin to a digital input pin), opening the Arduino IDE, writing or loading a program that initializes communication with the DHT11, reading data using library functions like readTemperatureHumidity, and printing out the data to the serial monitor. Essential coding elements include library inclusion, setup and loop functions, and error handling to ensure data integrity .

PWM signals in Arduino, used in the analogWrite function, represent Pulse Width Modulation, which simulates an analog output signal between 0 and 5 volts by varying the pulse width of the output signal. It is often used to control devices like motors and LEDs. On the other hand, the analogRead function is used to read the voltage level from an analog input pin, converting it into a digital value between 0 and 1023. Thus, analogWrite outputs PWM to simulate analog outputs, while analogRead inputs actual analog voltage levels .

The hardware requirements for a basic Arduino setup to control an LED include an Arduino Uno board, a USB cable for connecting the board to a PC, a breadboard, jumper wires for connections, an LED, and a 220 Ω resistor to limit the current flow to the LED. These components are assembled and connected appropriately to enable the LED to be programmed using the Arduino IDE .

Using the Arduino platform for educational purposes significantly aids in understanding microcontroller architecture. It provides a practical, hands-on approach to learning, from basic concepts of digital and analog I/O, hardware-software interfacing, to the execution of simple to complex programs. By directly interacting with hardware components such as sensors and actuators, students are exposed to real-world applications and problem-solving, which helps them comprehend the underlying principles of microcontroller operations effectively .

The digitalWrite function in Arduino is used to send a HIGH or LOW signal to a specified digital pin. In the context of controlling an LED, it can turn the LED on by sending a HIGH signal and turn it off by sending a LOW signal, thus enabling simple control of digital devices connected to the Arduino board .

The LED blinking circuit program uses basic elements of programming, such as pin initialization with pinMode, digital output controls with digitalWrite, and control structures for repeated execution with loop and delay functions. This demonstrates how Arduino can be used to control output devices with simple logical instructions, illustrating the process of setting up a circuit, programming for toggling outputs, and achieving desired results .

Digital and analog pins significantly contribute to the versatility of Arduino boards. Digital pins allow connection and control of digital devices through high and low states, enabling straightforward interfacing with components like LEDs, buttons, and relays. Analog pins, which support analog input, allow the board to interact with various sensors that provide continuous range signals. This facilitates complex projects ranging from simple control systems to complex sensor-based interactions, showcasing the board's adaptability to different tasks and projects .

The analogRead function can be used to create a threshold-based alert system by continuously monitoring an analog signal, such as from a temperature sensor. By reading the sensor's voltage and converting it to a digital value, the program can compare this value against defined threshold levels. If the sensor value exceeds or falls below these thresholds, it can trigger alerts, such as activating a buzzer or LED, indicating specific conditions are met, thus enabling real-time monitoring and response in the Arduino-driven device .

The Arduino IDE is used primarily for writing, compiling, and uploading programs, known as sketches, to the Arduino board. These programs allow interacting with connected components, like sensors, by using specific I/O functions such as pinMode for setting the pin mode, digitalWrite for sending HIGH or LOW signals, and analogRead/analogWrite for handling analog inputs and PWM signals, respectively .

You might also like