0% found this document useful (0 votes)
40 views8 pages

Untitled Document

Uploaded by

ashishsinha36722
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)
40 views8 pages

Untitled Document

Uploaded by

ashishsinha36722
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/ 8

DAWR(DEVELOPEMENT OF AUTONOMOUS WHEELED ROBOT)

NAME----RIDDHI CHAKRABORTY

ROLL------22051875

EXPERIMENT--1

FACULTY---Dr. Ranjan K. Behera


AIM OF THE EXPERIMENT

Explore basic digital output by controlling the blinking of onboard and external
LEDs using an Arduino Uno/Mega.

Gain practical experience with circuit design, coding, and interfacing components.

COMPONENTS REQUIRED:-
● HARDWARE:-
1. Arduino Uno board
2. LED (Light diode)
3. Resistor (220 ohms)
4. Breadboard
5. Jumper wires
6. USB cable

● SOFTWARE:-
1. Arduino IDE
THEORY:-
Both Arduino Uno and Arduino Mega are popular microcontroller boards widely
used for electronics prototyping and hobbyist projects. While they share similar
functionalities, they differ in key aspects like memory, pin count, and size, making
them suitable for different applications.

Basic Theory:-
1.Arduino Mega/Uno:-
At its core, both boards are single-board microcontrollers, meaning they integrate
all the essential components like a processor, memory, and input/output
(I/O) pins onto a single board. This allows users to easily connect various
electronic components like LEDs, sensors, and motors without complex circuitry.
Central Processing Unit (CPU):
● Arduino Uno: Uses an ATmega328P microcontroller, an 8-bit AVR
microcontroller with a clock speed of 16 MHz.
● ATmega328P microcontroller
● Arduino Mega: Utilizes an ATmega2560 microcontroller, a more powerful
8-bit AVR microcontroller with a clock speed of 16 MHz.
● ATmega2560 microcontroller

Memory:-
● Arduino Uno: Has 32 KB of flash memory for storing code, 2 KB of SRAM
for temporary data storage, and 1 KB of EEPROM for non-volatile data
storage.
● Arduino Mega: Boasts 256 KB of flash memory, 8 KB of SRAM, and 4 KB
of EEPROM, offering significantly more space for complex projects.
Input/Output (I/O) Pins:-
● Arduino Uno: Provides 14 digital I/O pins (of which 6 can be used as PWM
outputs) and 6 analog input pins.
● Arduino Mega: Offers a much larger set of I/O pins, with 54 digital I/O pins
(of which 15 can be used as PWM outputs) and 16 analog input pins.
Programming:-
Both boards are programmed using the Arduino Integrated Development
Environment (IDE), a free and open-source software that allows users to write,
compile, and upload code to the board. The code is written in a simplified C/C++-
like language that is beginner-friendly.

Choosing the Right Board:-


The choice between Arduino Uno and Arduino Mega depends on your project's
specific needs:
● For simpler projects with limited components and code, Arduino Uno is a
cost-effective and beginner-friendly option.
● For more complex projects requiring many sensors, motors, or large
display outputs, Arduino Mega's increased memory, pin count, and
processing power make it a more suitable choice.
2.Sensors:
● Sensors are devices that detect and capture information from the environment,
converting it into electrical signals. Examples include temperature sensors, light
sensors, and pressure sensors.
● In the LED blinking experiment, no sensors are directly involved.
3.Actuators:
● Actuators are devices that convert electrical signals into physical actions. In this
case, the LED itself is the actuator.
● When you apply voltage to the LED through the Arduino, it emits light. By turning
the voltage on and off, you create the blinking effect.

Designing & testing:-


Designing:-
1. Schematic: Draw a simple schematic showing the connections between
the Arduino Uno, LED, resistor, breadboard, and jumper wires. Label the
components and pin numbers used. This helps visualize the circuit and
verify connections before building it.
2. Code Structure: Outline the basic structure of your Arduino code. Define
variables for the LED pin and define functions like setup() and loop().
Include comments to explain each code section.
3. Blinking Pattern: Decide on the desired blinking pattern. Will it be a
simple on/off, a specific delay, or a more complex sequence? Plan the
timing and behavior in your code.
Testing:-
1. Breadboard Assembly: Carefully connect the components on the
breadboard according to your schematic. Double-check the connections
and pin numbers to avoid damage.
2. Code Upload: Open the Arduino IDE and write your code based on your
design plan. Upload the code to the Arduino Uno board.
3. LED Observation: Observe the LED behavior. Does it blink as
expected? If not, troubleshoot the issue step-by-step. Check connections,
code logic, and timing values.
4. Code Modifications: Experiment by modifying the code to change the
blink pattern, timing, or add conditional statements based on other inputs
(e.g., button press). Retest after each modification.
About connection of Sensor(s)/Actuator(s):-

● Internal LED:

No additional connections are needed.

● External LED:

Positive lead (anode) to a digital output pin through a resistor.

Negative lead (cathode) to ground (GND).

A. To blink the LED using an Arduino UNO (LED built-in):-

B. To blink the LED using an external LED:-


.

Interfacing code:-

int internalLedPin = 13; // Internal LED pin (may vary for different boards)

int externalLedPin = 9; // External LED pin

void setup() {

// Set internal LED pin as output:

pinMode(internalLedPin, OUTPUT);

// Set external LED pin as output:

pinMode(externalLedPin, OUTPUT);
}

void loop() {

// Turn on internal LED:

digitalWrite(internalLedPin, HIGH);

// Turn on external LED:

digitalWrite(externalLedPin, HIGH);

// Delay for 1 second:

delay(1000);

// Turn off LEDs:

digitalWrite(internalLedPin, LOW);

digitalWrite(externalLedPin, LOW);

// Delay for 1 second:

delay(1000);

OUTPUT OF THE RESULT:-


1. Standard Blink:-
● If you follow the code I provided in the previous response, connecting the LED to
pin 13 with a 220-ohm resistor and setting the delay to 1 second in both
digitalWrite statements, you will see the LED turn on for 1 second, then turn off
for 1 second, and repeat continuously. This creates a steady blinking pattern.
2. Customized Blink:-
● By modifying the code, you can change the blinking behavior:
○ Different Delays: Change the values in the delay functions to alter the
"on" and "off" durations, creating faster or slower blinks.
○ Multiple Blinks: Add more digital Write and delay statements to create
multiple blinks before pausing or changing patterns.
○ Varying On/Off: Experiment with different "on" and "off" durations for
creative patterns.
3. Troubleshooting:-
● No Light: Double-check connections, resistor values, and code syntax. Ensure
the LED is correctly oriented (anode to longer leg).
● Continuous On/Off: Verify connections and code logic. Check for infinite loops or
incorrect pin settings.
● Unexpected Behavior: Analyze your code and ensure the timing aligns with your
desired pattern. Use debugging tools in the Arduino IDE if needed.
COMCLUSION:-

To conclude, blinking an LED using an Arduino Uno is a fundamental and


introductory project in the world of microcontrollers and embedded systems.
Through this project, you've learned how to set up your Arduino Uno board, write
a simple program in the Arduino IDE, and upload it to the board.
By connecting an LED to one of the digital pins of the Arduino Uno and
controlling its state using the digitalWrite() function in combination with delay(),
you were able to make the LED blink at a certain interval. This project serves as
a foundational step towards understanding more complex projects and
applications using Arduino and other microcontroller platforms.

You might also like