0% found this document useful (0 votes)
3 views21 pages

REVIEWER-1

Intro to Robotics

Uploaded by

LEILA ANDAL
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)
3 views21 pages

REVIEWER-1

Intro to Robotics

Uploaded by

LEILA ANDAL
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/ 21

CPE 20 – COGNATE/TRACK COURSE 1

WHAT IS THE DIFFERENCE BETWEEN ROBOT AND ROBOTICS?


Robot- a type of automated machine that is created to reduce human effort. It can execute specific tasks
with minimal or no human intervention.

Robotics- a field of science that deals with robot design, engineering, and operation

HISTORY OF ROBOTICS

• 1921 – Czech writer Karel Capek first coined the word “Robot” in his play
“R.U.R” (Rossum’s Universal Robots)
• 1942 – Isaac Azimov formulated the “Three Laws of Robotics
• 1948-1949 – William Grey Walter created two autonomous robots that
looks like a tortoise, he named it Elmer and Elsie.
• 1970 – Creation of Freddy and Freddy II, robots that can assemble
wooden blocks and manipulate other objects.
• 1989 – Genghis, a robot created in MIT was one of the first examples of
cheap robots. It has a behavior of a real like insect.
• 21st Century – Creation of more advanced robots like self-driving cars,
humanoid robots that can do human tasks and robots for space
explorations

CHARACTERISTICS OF ROBOTS

• Sensing – to be able to sense its surroundings


• Movement – to be able to move around its environment
• Energy – to be able to have power
• Intelligence – a robot needs some kind of “smarts

Arduino Level 1
What is Robot and Robotics
Robot- A machine designed to perform tasks automatically, often programmable by a computer.
Robotics- The field of technology focused on the design, construction, operation, and use of robots.

Different Robotics Applications

1. Manufacturing: Robots are used for assembly, welding, painting, and packaging.

2. Healthcare: Surgical robots, rehabilitation robots, and robotic prosthetics.

3. Agriculture: Automated tractors, drones for crop monitoring, and harvesting robots.

4. Logistics: Warehouse robots for sorting and transporting goods, and delivery drones.
5. Service Industry: Cleaning robots, robotic waiters, and customer service robots.

6. Exploration: Space rovers, underwater robots, and drones for environmental monitoring.

7. Entertainment: Animatronics in movies, robotic toys, and interactive exhibits.

CHARACTERISTICS OF ROBOTS

• Sensing – to be able to sense its surroundings


• Movement – to be able to move around its environment
• Energy – to be able to have power
• Intelligence – a robot needs some kind of “smarts

Introduction to Arduino

Arduino is an open-source electronics platform based on easy-to-use hardware and software. It consists
of both hardware (Microcontrollers) and Software (Arduino IDE)

There are several types of Arduino Microcontroller

What is Arduino Uno?

The Arduino Uno is a widely-used microcontroller board based on


the ATmega328P microcontroller. It features 14 digital input/output pins,
6 of which can be used as PWM outputs, and 6 analog inputs. Operating
at a clock speed of 16 MHz, it includes 32 KB of flash memory, 2 KB of
SRAM, and 1 KB of EEPROM. The board is designed for ease of use, making
it ideal for beginners. It connects via USB for programming and power,
with an additional power jack for external sources. The Arduino Uno is
versatile, supporting projects from simple LED blinkers to complex
robotics.
1. Power IN (Barrel Jack)

2. Power IN (USB Port)

3. LED (RX: Receiving)

4. LED (TX:Transmitting)

5. LED (Troubleshooting)

6. Pins (Digital, Analog, Ground)

7. LED (ON/OFF)

8. Reset Button

9. Pins (Analog In, Power In, Ground Power Out, Reset)

Arduino IDE Interface

How does Arduino work?

1. Hardware: Arduino’s core is a microcontroller, with the Arduino Uno being the most common
board. It has digital and analog pins for input/output, a USB port for programming and power, and
an external power jack.
2. Software: Code is written in the Arduino IDE, using a language similar to C++. This code instructs
the microcontroller and is uploaded via USB.
3. Execution: Once uploaded, the microcontroller executes the code, reading inputs from sensors
and controlling outputs like LEDs and motors. For example, it can turn on an LED when a button is
pressed.
4. Interaction: Arduino boards can connect with various components and modules, making them
suitable for a wide range of projects, from simple DIY tasks to complex automation systems.

Daily Applications of Arduino

Arduino is incredibly versatile and finds applications in various aspects of daily life. Here are some common
uses:

1. Home Automation

2. Wearable Technology

3. Robotics

4. Internet of Things (IoT)

5. Educational Tools

6. Environmental Monitoring

7. Health Monitoring

Building your first Arduino Project

LED BLINKING

Components:

• 1 x 220 OHMS Resistor


• 1 x LED
• Jumper Wires
• Arduino Uno
• Arduino Cable
• Breadboard

Step 1: Cathode of LED is connected to the GND of breadboard

Step 2: Anode of LED is connected to 1 leg of 220 ohms resistor

Step 3: the other leg of resistor is connected to Digital Pin 8

Step 4: 5v of Arduino is connected to the positive rail of breadboard

Step 5: Gnd of Arduino uno is connected to the Gnd rail of breadboard

MULTIPLE LED
What is UltraSonic Sensor?

HC-SR04

a device that measures distance by using ultrasonic sound waves. It emits sound
waves at a frequency higher than humans can hear, and then calculates the
distance to an object based on the time it takes for the sound waves to bounce
back.

Arduino Serial Monitor

a built-in feature that allows users to view and


interact with data sent from the Arduino board via serial
communication. It is a tool for real-time communication
between the Arduino and your computer, and it's essential
for debugging, testing, and monitoring data from the Arduino
board.

Interfacing with Sensors (Ultrasonic Sensor)

What is DHT11?

Temperature and Humidity

The DHT11 is a low-cost digital sensor used to measure both temperature and
humidity. It is commonly used in various applications such as weather
stations, HVAC systems, and environmental monitoring.

Key Features:

- Temperature Range: 0°C to 50°C with an accuracy of ±2°C.


- Humidity Range: 20% to 80% with an accuracy of ±5%.
- Operating Voltage: 3.5V to 5.5V.
- Sampling Rate: 1 Hz (one reading per second).
Interfacing with Sensors (DHT11)

Components:

• Arduino Uno
• DHT11 Sensor
• Jumper Wires

NOTE: MAKE SURE TO INSTALL DHT LIBRARY FROM ARDUINO BY ADAFRUIT

DHT11 Facing towards you: the leg at the left side is the vcc,
the middle is the Signal and last leg on the right is the gnd

Step 1: Connect the middle leg of dht11 to Digital Pin


8 of Arduino

Step 2: Connect the Leg in the left side to the 5V of


Arduino

Step 3: Connect the Right Leg in GND of Arduino


What is 16x2 LCD Display with I2C

LCD Display with I2C

a type of liquid crystal display that can show 16 characters per line on
2 lines. The I2C (Inter-Integrated Circuit) interface simplifies the
connection to microcontrollers like Arduino by reducing the number
of pins needed from 7 to just 2 (SDA for data and SCL for clock).

Interfacing with Sensors (LDR/PHOTORESISTOR with LCD)

Components

• Arduino Uno
• 16X2 LCD DISPLAY WITH I2C

CONNECTIONS:

• CONNECT SDA TO A4
• CONNECT SCL TO A5
• CONNECT VCC TO 5V

What is Photoresistor/LDR?

Light Dependent Resistor

A Light Dependent Resistor (LDR), also known as a photoresistor,


is a passive electronic component whose resistance decreases as
the intensity of light falling on it increases. This property makes
LDRs ideal for use in light-sensing circuits, such as those found in
street lighting, alarm systems, and light meters. By converting variations in light intensity into changes in
electrical resistance, LDRs enable automatic control of devices based on ambient light conditions.

Interfacing with Sensors (LDR/PHOTORESISTOR with LCD)

Components

• Arduino Uno
• LDR
• Jumper Wires
• 3 x 100 OHMS RESISTOR
• 1 X 220 OHM RESISTOR
• 1 x LCD with I2C

NOTE: INSTALL LIQUID CRYSTAL LIBRARY IN ARDUINO


Buzzer

Components needed:

• Buzzer
• 100 ohms Resistor

1. Connect 1 leg of buzzer to 100 ohms resistor, and the other leg of the resistor connected to Digital
Pin 7
2. The other leg of buzzer is connected to the ground

COMBINE LDR AND DHT11 TOGETHER WITH LCD WITH I2C and Buzzer

LCD SHOWS:

• CURRENT TEMP
• CURRENT HUMIDITY
• CURRENT LDR VALUE

LED

• GREEN IF LDR VALUE IS LESS THAN 20


• YELLOW IF LDR VALUE IS BETWEEN 20 AND 150
• RED IF LDR VALUE IS 151 AND ABOVE
LABORATORY 1

For the circuit configuration in this activity, the LED setup from the first activity was duplicated to create 3
LED combinations, red, yellow, and green, to replicate the colors in a traffic light. The cathode side of the
LED is connected to the ground while the anode side is connected to one of terminals of the 220-ohm
resistor, and the other side is connected to the digital pins 8, 9 and 10, respectively via jumper wires. The
ground of the Arduino Uno is also connected to the ground line in the breadboard.

The code uploaded to the Arduino starts off with the making variables for each LED to the pins assigned.
Red is in pin 8, yellow on pin 9 and green in pin 10. ledColor was the variable given to easily label the
connected color in the LED to the digital pins. For the void setup, pinMode is used to initialize the pins that
will be receiving an output signal for each LED. It means that the digital pins 8,9, and 10 are expected to
be an output. For the void loop, the first one to be set up was the green light, based on the function of a
traffic light, where it is to be set to 10 second delay, hence the 10000 values on the HIGH delay since the
IDE reads the quantity in milliseconds. No delay on the LOW because we want no downtime in the color
switching of the lights. Next to be coded was the Yellow, where its delay is set to 4 seconds (4000
milliseconds) as set by our instructor. After which, red is coded and also set with the same code as the
Green one. Since this code is under the void loop, after the 10 second delay of the red one, the green LED
will light up and the cycle continues. We chose this arrangement to fully mimic the behavior of a traffic
light: the green light is followed by the warning yellow light and then shows a full stop at the red light.

5 LED Succession

The activity uses an Arduino Uno, which controls a series of LEDs connected to a breadboard. For this
activity we used 5 LEDs which are white, blue, green, red, and yellow. We used resistors to limit the current
as they connect each LED to Arduino. The ground connections on the LEDs have been shared with no
further connections. We connect the laptop or computer using a USB cable to Arduino that provides power
and uploading code in Arduino.

The code in the 5 LED succession controls 5 LEDs that are hooked up to an Arduino in sequence. One LED
is connected to a specific digital pin. Pin 8 through 12 are used. In the setup () function the that
configuration sets the pins as output so the Arduino can determine if LED shall be on or off. The main logic
of the function is to run infinite loops. It initially lights the LED one by one from left to right, using 100
milliseconds delay after each step in order to create a sequence in turning on effect for the lighting. Then,
it extinguishes the LED one by one in reverse from right to left with a similar delay of 100 milliseconds. It
then turns on all five LEDs together for 450 milliseconds and then switches them off. This gives an effect
of LEDs lighting up sequentially in both directions and then flashing on all together.

CODE: TRAFFIC LIGHTS


5 LED lights from left to right, vice versa and all on
LABORATORY 2

Interfacing Ultrasonic Sensor And 16x2 Lcd with I2c

In this laboratory, the distance measurement system with the use of an Arduino, Ultrasonic sensor and an
LCD display is demonstrated. The ultrasonic sensors work in such a way that an ultrasonic wave emitted
from the trigger pin of the sensor bounces back after hitting an object and falls into the echo pin of the
sensor. The arduino then computes for the distance based on the speed sound taken by this process. The
result is viewed in real time on a 16x2 I2C LCD. Using projects would need the Wire.h the
LIquidCrystal_I2C.h libraries to communicate with the LCD. Installation includes the ultrasonic sensor being
attached to Arduino. The trigger pin will be connected to the digital pin 7 and the echo pin will be attached
to the digital pin 8 of the Arduino. The LCD is connected using I2C connectivity; its SDA and SCL pins are
plugged into A4 and A5 respectively on the Arduino.

In the code, the function setup() initializes the LCD, sets up the trigger and echo pins and starts serial
communication for debugging. In the loop(), a 5 microsecond pulse will be sent from the trigger pin to
initiate the measuring process. The time taken for the pulse to return is measured using the pulseIn()
function and this duration is converted into a distance using a simple formula that divides the time by 29
and then by 2, which is the distance that it takes for the sound wave to travel to the object and then come
back. The calculated distance is then displayed on the LCD, which is updated every 100 milliseconds.
LABORATORY 3

Traffic Light Simulation using 7 segment and 16x2 LCD w/ I2C

TRAFFIC LIGHT

Traffic light, sometimes referred to as a stoplight or traffic signal, has a purpose to regulate the flow of
traffic at intersections, pedestrian crossings, and other locations. It notifies vehicles and pedestrians of
various actions through the use of a universal system of lights—red, yellow, and green. Each universal light
has a meaning, which is that a red light gives a signal to all vehicles to stop, the green light means to go
and the yellow light means to slow down. Having a traffic light with each intersection will help to have a
good flow of vehicles and will help to avoid traffic, misunderstanding of all drivers and accidents. In this
laboratory , it focuses on the designing and programming of traffic lights using arduino uno and seven-
segments.

The circuit was set up in the breadboard by first connecting the Vcc and ground of the components to their
respective ports. After which, the wiring for the 7 segment was made. Since it was a common cathode
type, the common pins are connected to the ground and each of the 7-segment LEDs are connected to a
resistor and then connected to digital pins 2-8 for the segment a to g respectively. The setup also was
made to the 3 LEDs (green, yellow, and red) and was connected to the digital pins 10-12 in the Arduino,
respectively. The wiring for the lcd is also done by connecting the SCL and SDA pins to the A4 and A5 pins
in the arduino.

For the code, the needed code to initialize the LCD to function was first called out and set up. Following
this is the initialization for the pins of the seven segment and the traffic light LED indicators are initialized
to their respective pin numbers, based on the physical wiring. The void setup() was called and there the
pinMode was initialized for all the components (7 segment and LEDs) and the lcd.init and lcd.backlight was
for the LCD. In the void loop(), the program was set to simulate a traffic light that is why the green LED was
first, and the LCD was programed to display the word “GO” and was set in the middle using the code of
setCursor in the value of 7, which is the midpoint of 16, the indicated size of the LCD. The code was
followed by the function trapiklights() which is the code for the 7-segment display for it to display the
numeric numbers. Each part of the code has a 1 second delay in between. After the green LED, the yellow
was next and the only difference here was that it only lasted for 4 seconds. That is why it has a different
function code for the 7-segment display, which was called trapiklightsYellow(). And finally, the red one was
programmed to light on last, with the same code as the green one. After this void loop, the functions
trapiklights() and trapiklightsYellow() elaborated to initialize and accurately display the digits. Since it was
a common cathode type, the behavior of the LEDs inside is directly proportional to the HIGH and LOW
functions, meaning it turns on when it is indicated HIGH and off when LOW. To display a digit 0 , all
segments are on high output except segment g . To display a digit 1 , segments b and c are the only ones
on. To display digit 2, segments a, b, d, e, and g must be in high output. To display digit 3, segments a, b,
c, d, and g must be in high output.To display digit 4, segments b, c, f, and g must be in high output.To display
digit 5, segments a, c, d, f, and g must be in high output.To display digit 6, all segments except segment b
must be turned on. To display digit 7, segments a, b, and c must be in high output. To display digit 8, all
segments are in high output. And to display digit 9,all segments except segment e must be turned on. In
the functions, this was arranged from highest to lowest to imitate a countdown since the Arduino IDE
reads the code from top to bottom.
LABORATORY 4

You might also like