0% found this document useful (0 votes)
9 views10 pages

ICT Finals 1

Uploaded by

fairybloomaj
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)
9 views10 pages

ICT Finals 1

Uploaded by

fairybloomaj
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
You are on page 1/ 10

Robots PARTS OF THE ARDUINO

● Droid
● Characteristics
○ Sense
○ Intelligence
○ Power
○ Movement
● Classification
○ Industrial
○ Service
■ Medical
■ Home
■ Education
■ Defense

AI - human like robots

Short Act
1. Robots obtain information from their
The Arduino IDE is an open-source
environment. TRUE
software, which is used to write and upload
2. Movement is being able to sense its
code to the Arduino boards. The IDE
surroundings. FALSE
application is suitable for different operating
3. Industrial Robots help simplify
systems such as Windows, Mac OS X, and
production tasks.TRUE
Linux. It supports the programming
4. Service robots don't assist humans
languages C and C++. Here, IDE stands for
in their tasks. FALSE
Integrated Development Environment.
5. ENERGY is not able to produce
power. FALSE
The program or code written in the Arduino
IDE is often called SKETCH. We need to
tx - transmitting data connect the Genuino and Arduino board
rx - receiving data with the IDE to upload the sketch written in
Digital pins - 14 pins the Arduino IDE software. The sketch is
Analog input - 6 pins saved with the extension '.ino.'
Power - 4 pins

Arrow right - upload THE TOOLBAR:


Check - verified
Arrow up - open
Arrow Down - save
Magnifying glass - serial motor

UPLOAD
The Upload button compiles and runs our ARDUINO CODE STRUCTURE:
code written on the screen. It further
uploads the code to the connected board.
Before uploading the sketch, we need to
make sure that the correct board and ports
are selected. We also need a USB
connection to connect the board and the
computer. Once all the above measures are
done, click on the Upload button present on
the toolbar.

OPEN
The Open button is used to open the
already created file. The selected file will be
opened in the current window.

SAVE
The save button is used to save the current
sketch or code.

NEW
It is used to create a new sketch or open a
new window.

VERIFY
The Verify button is used to check the
compilation error of the sketch or the written PREPARATION BLOCK
code. Preparation block uses the void setup()
statement. This is used to set up pins and
SERIAL MONITOR declare if it is an input or an output. Input
The serial monitor button is present on the pins are used for sensors to gather
right corner of the toolbar. It opens the serial information and data while output pins are
monitor. The serial monitor is the 'tether' used to issue a command. Preparation
between the computer and your Arduino. It block only executes lines of codes once at
lets you send and receive text messages, the startup.
handy for debugging and also controlling
the Arduino from a keyboard. EXECUTION BLOCK
Execution block uses the void loop()
statement. This is used to execute lines of
code to run repeatedly forever.
OTHER PART OF THE STRUCTURE - int led = 13;
Sometimes, we use variables so that we void setup() {
can easily store values in words. pinMode(led, OUTPUT);
We declare each variable at the top of the
preparation block. }

This example states that the term "led" can


IMPORTANT FUNCTIONS TO be used to replace the value of 13 inside the
REMEMBER code. Every time we use the number 13, we
pinMode Function can use the term led instead. The variable
- pinMode is a function written in the type "int" is short for integer, meaning they
preparation block that configures the can be positive or negative numbers with no
specified pin to behave either as an fractional parts. The data range of the int
input or an output. type includes numbers between -32768 and
32767.
Example: pinMode(13, OUTPUT);
- This example states that the pin 13,
in the Arduino board will be used as
an OUTPUT.
PARTS OF AN ARDUINO
UNO R3 CIRCUIT BOARD
digitalWrite / analogWrite
- digitalWrite is a function used to set
a pin with either of the two values
(HIGH or LOW). Setting a pin with
HIGH will supply a 3.3V while setting
a pin with LOW gives 0V. This is
mostly used in the execution block.

Example: digitalWrite(13, HIGH);


- This example states that we will
supply pin 13 with 3.3V. 1. POWER IN (USB TYPE-B
PORT)
analogWrite
- is a function used to set a pin with This is a printer USB port used to load a
values from 0 to 255. This function is program from the Arduino IDE onto the
mainly used to control any analog Arduino board. The board can also be
devices attached to the Arduino. powered through this port.

Declaring Variables
- A variable is a place to store a piece
of data. It has a name, a value, and
a type.

Example:
( a major microcontroller manufacturer).
Atmega328P has the following components
in it:

● Flash memory of 32KB. The


program loaded from Arduino
IDE is stored here.
● RAM of 2KB. This is a runtime
memory.
● CPU: It controls everything that
goes on within the device. It
fetches the program instructions
from flash memory and runs
them with the help of RAM.
● Electrically Erasable
Programmable Read Only
Memory (EEPROM) of 1KB.
This is a type of nonvolatile
2. POWER IN (BARREL-JACK 9V memory, and it keeps the data
even after device restart and
- 12V PORT)
reset.
The Arduino board can be powered through
Atmega328P is pre-programmed with a
an AC-to-DC adapter or a battery. The
bootloader. This allows you to directly
power source can be connected by plugging
upload a new Arduino program into the
in a 2.1mm center-positive plug into the
device, without using any external hardware
power jack of the board.
programmer, making the Arduino UNO
board easy to use.

3. MICROCONTROLLER
(ATMEGA AVR, ATMEGA328P) 4. ANALOG INPUT PINS
It is the most prominent black rectangular The Arduino UNO board has 6 analog input
chip with 28 pins. Think of it as the brains of pins, labeled “Analog 0 to 5.” These pins
your Arduino. The microcontroller used on can read the signal from an analog sensor
the UNO board is the Atmega328P by Atmel
like a temperature sensor and convert it into 6. RESET BUTTON
a digital value so that the system
understands. These pins just measure When this switch is clicked, it sends a
voltage and not the current because they logical pulse to the reset pin of the
have very high internal resistance. Hence, Microcontroller, and now runs the program
only a small amount of current flows through again from the start. This can be very useful
these pins. Although these pins are labeled if your code doesn’t repeat, but you want to
analog and are analog input by default, test it multiple times.
these pins can also be used for digital input
or output.

5. DIGITAL PINS 7. VOLTAGE REGULATOR


You can find these pins labeled “Digital 0 to
The voltage regulator steps down the 9 to
13.” These pins can be used as either input
12 volt input power to 5 volts, which is the
or output pins. When used as output, these
operating voltage of the Arduino.
pins act as a power supply source for the
components connected to them. When used
as input pins, they read the signals from the
component connected to them. When digital
pins are used as output pins, they supply 40
milliamps of current at 5 volts, which is more
than enough to light an LED. Some of the
digital pins are labeled with the tilde (~)
symbol next to the pin numbers (pin
numbers 3, 5, 6, 9, 10, and 11). These pins
act as normal digital pins but can also be
used for Pulse-Width Modulation (PWM),
which simulates analog output like fading an
LED in and out.
8. TX-RX LED INDICATOR
(Transmitting - Receiving)
The TX and RX LEDs light up whenever
data is transferred between the Arduino and
your computer. TX LED Indicator blinks
when Arduino sends signal to the output
component, while RX LED Indicator blinks
when the board receives a signal from
sensors. 10. POWER AND GROUND PINS
The power pins can be used to supply
electrical power from 3.3V to 5V
respectively. Ground pins on the other hand,
were used to ground electrical supply
(Mostly negative charges).

9. ON/OFF LED INDICATOR


(Power LED Indicator)
The power LED turns on when the Arduino
is powered up.
ARDUINO BASIC "solderless" board using the same iconic
name.
COMPONENTS
HOW TO USE A
BREADBOARD?

We use a breadboard to create a circuit


without soldering any components. All holes
in the middle of the breadboard are
BREADBOARD internally connected. (see the blue
highlighted part) In the middle of the
A breadboard is a device used in creating breadboard, we can see a divider. This
and testing simple circuits in electronics. divides the breadboard into two parts. Holes
Breadboard is useful because it connects from the upper part of the breadboard are
multiple points instead of soldering (binding) not connected to the holes at the other side
them together. This makes the circuit easy of the divider.
to re-create and to disassemble.
At both edges of the breadboard, we can
see the Power Rails. These are connected
internally (see the pink highlighted part)
When building a circuit, you tend to need
power in lots of different places. The power
rails give you lots of easy access to power
wherever you need it in your circuit. Power
rails are labeled as positive(+) and
negative(-).

Breadboards many years ago were made


using a piece of wood or plank used in
cutting loaves of bread. Wires are being
bound together using thumb tacks and pins,
to create a circuit. Since then, electronic
components have become smaller and
smaller, that's why we created a modern
LED plugging it in backwards. Rather, it just won't
work.

The longer leg is called Anode which is the


positive terminal of an LED. The shorter leg
is the Cathode which is the negative
terminal of an LED." Current flows from the
anode to the cathode and never the
opposite direction. Cathode is usually
terminated by connecting it on ground.

RESISTORS
LED or Light Emitting Diodes are used in
our cars, in our homes, even in our
smartphones. LED converts energy into
light and looks like a tiny lightbulb. However,
LEDs require a lot less power to light up by
comparison. They're also more energy
efficient, so they don't tend to get hot like
conventional light bulbs do, unless you
supply them with a high voltage supply. This
makes them ideal for mobile devices and
other low-power applications. Resistors are electronic components which
can limit the flow of electrons through a
circuit. Each resistor has a certain value of
resistance that can diminish a current in a
LED PIN OUT AND POLARITY
circuit. Resistors are passive components.
In This means they are not polarized, they do
not generate power and they only consume
it.

electronics, polarity indicates whether a


circuit component is symmetric or not.
LEDs, being diodes, will only allow current
Resistors have a certain value and use the
to flow in one direction. And when there's no
omega (Ω) sign as its unit.
current-flow, there's no light. Luckily, this
also means that you can't break an LED by
MIXING RGB LED COLORS CONTROLLING RGB LED

Single colored Different codes can be used to produce


LED has an random colors from the RGB module.
Anode for Variations in intensity of the three colors can
positive, and produce a different range of colors.
Cathode for
negative. Other Each LED can have an intensity ranging
LEDs such as from 0-255. By adjusting the value for each
RGB LEDs have color using the analogWrite function, we
four(4) pins. can adjust and mix each color.
RGB LED is a
special type of
LED that can digitalWrite and analogWrite
show multiple
Function
colors by mixing
three base colors Digital pins have only two modes - ON (1) or
which are Red, Green, and Blue. The OFF (0). We use the constants HIGH (On)
longest pin is the Ground pin. Depending on and LOW (Off) since this makes it easier to
the type of the RGB LED, it can be an read code. Digital pin always gives the
Anode or a Cathode. The pin next to the output power of 5V when HIGH and 0V
Ground from the left side is the Red pin, when LOW. For this, we use digitalWrite
followed by the Green pin and the Blue for turning ON and turning OFF a
pin. We can mix colors in an RGB LED by component. Analog pins and digital pins
turning each color on. Turning the Red and with pulse-width modulation (~) can be used
Blue at the same time will bring out the to Input and Output Analog signals. This
means we can adjust the voltage manually
as we control how much voltage we can
supply to the connected component. Using
an analog signal to a digital component
such as an LED, we can adjust the intensity
of the light it emits using analog values.

Purple color in the LED.


The other word for ROBOT is Droid What is the name of this arduino code
structure?
One of a robot's characteristics is the ability void setup()
to lift large objects, aid humans with their {
peripheral functions, or perform any pinMode(RedLED, OUTPUT);
dynamic motion. Movement pinMode(GreenLED, OUTPUT);
Serial.begin(9600);
This kind of robot facilitates the Serial.println("Serial Connection :
simplification of manufacturing and logistical Ready to detect Flame");
production activities Industrial }
preparation block
To make the LED turn on, what will be the
code statement you should put in the void What pin does the variable BlueLED plug
loop(). into?
*assume that the LED is a variable for the int RedLED = 5;
pin number int BlueLED = 6;
digitalWrite(LED, HIGH); int inPin = A0;

How many volts can an Arduino port int sensorValue = 0;


handle?
9V to 12V void setup()
{
Which built-in led in Arduino lights up when pinMode(BlueLED, OUTPUT);
transmitting data? pinMode(GreenLED, OUTPUT);
tx led 6

A characteristic of a robot that imitates the


thinking capability of a human.
Artificial Intelligence

How many digital pins are there inside the


Arduino UNO?
14

Which part of the Arduino is used to reset or


clear the uploaded code inside the
microcontroller? Reset button

void loop() is a line of code in Arduino that


is being repeated indefinitely.

This part of arduino will light up when the


program is running. power indicator

You might also like