Arduino

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 32

INSPIRING LEADERSHIP THROUGH TECHNOLOGY

Robotics
What is a Robot?
A robot is an output of the robotics industry, which
involves the creation of programmable machines that can
help people or replicate their actions.
Each robot has a different amount of control, ranging
from human-controlled bots that conduct tasks that a
human has complete control over to fully autonomous bots
that accomplish tasks without any external influences.
Robotics
Type of Robots?
 
Robots come in various types from all
shapes and sizes to perform the tasks they
are designed for. Following are some
common types of robots: Fig 4.1 Edison Programmable Robot

1. Programmable Robots,
2. Humanoid Robots,
3. Autonomous Robots,  
 
 
4. Industrials Robots,  

5. Exoskeletons,
Fig 4.5 Drones

Fig 4.2 Industrial Robot

6. Drones, etc. Fig 4.4 Exoskeleton Robot

Fig 4.3 Humanoid Robots


Robotics
What are Robots made of?
1. Control system – The Brain
2. Sensors – Inputs
3. Actuators – Outputs
4. Power Supply – The Electric Juice
5. End Effectors – The Hands
Robotics  

Nimble Bot
Fig 4.6 Nimble Bot

Nimble Bot is a Programmable Robot designed


especially for school-going kids to learn robotics
by TechTree.io.
Using Arduino as its brain, Nimble Shield for
hardware integration and different sensors.
Students can learn a lot of activities such as  
Blinking a LED and Buzzer, how to monitor current
light intensity, and programming a Light
Controlled Smart Car.

Fig 4.7 Nimble Components


Robotics
What is Arduino?

An Arduino is defined as a small portable computer,


consisting of a digital brain that is known as a
microcontroller in the world of electronics. Arduino has  

the capability of taking in inputs, i.e., interacting with


the real physical world and interpreting the received
information to control various outputs. A microcontroller Fig 4.8 Arduino UNO

is a small tiny computer contained in a single chip. You


can instruct your Arduino board to perform any task by
sending a set of instructions to it.
Robotics
What is Arduino?

Fig 4.9 Arduino UNO labelled diagram


Robotics
Programmable Circuits

CIRCUIT PHYSICAL WORLD


Robotics
What’s in Physical World
• Controlling some Machine
through some Panel, or
Software
• Wireless Telemetry (Tele
means Far)
• Wireless Telecommand
• Some Maths or storage
Robotics
What is Input?
Arduino has senses just like other species in this world. Input is the senses for Arduino.
They tell what is going on in the world. At its most basic, an input could be a switch, such as
a light switch in your home. At the other end of the spectrum, it could be a gyroscope,
telling Arduino the exact direction it’s facing in three dimensions.

What is Output?
The output allows Arduino to affect the real world in some way. An output could be subtle
and discreet, such as in the vibration of a cellphone, or it could be a huge visual display on
the side of a building that can be seen for miles around. The first sketch walks you through
blinking an LED. From there, you can go on to build your very own smart robotic car.
Arduino  

Digital I/O Fig 4.10 Digital I/O

An Arduino has 14 digital pins. The digital pins on an


Arduino board can be used for general-purpose input and
output. ● Digital I/O pins on the Arduino allow you to
connect the sensors, actuators, and other components to
the Arduino. These pins allow us to read the inputs
coming from a switch, lighting indicators, and controlling
relay outputs. ● These pins have two distinct values;
HIGH (1) and LOW (0). You use these pins in a situation
where the input or the output value will only have two
possibilities; either 1 or 0. For example, one way that you
might use a digital pin is to turn an LED on which is 1
(HIGH), or turn it off which is 0 (LOW).
Arduino
Analog I/O  

Fig 4.11 Analog I/O

● An Arduino has 6 analog pins which can also be used as


analog pins.
● The signals from sensors that measure surrounding
natural factors such as temperature, or pressure, are often
analog. On the other hand, only digital signals can be
handled by computers. For this reason, analog I/O pins are
used. They allow you to read analog signals.
● These pins have a wide range of values.
● An analog signal can only be read using Analog I/O pins,
but you can read digital signals using both Analog I/O and
Digital I/O pins.
Arduino
Microcontroller Chip – Digital Brain
At the heart of Arduino lies a microcontroller chip (ATMEGA328P
in the case of Arduino UNO). These chips are a digital brain that
makes them smart enough to decide according to their
 
surroundings

Reset Button
In electronics and technology, a reset button is a button that can
reset the device. In Arduino UNO, the reset button restarts the
code or program from the very beginning of it.
Arduino
Serial Communication Pins – (Tx, Rx)
• You can program Arduino to speak through Serial
Communication.
• It is the procedure by which information and data are sent one
 
after another ‘’bit by bit’’.  

• A bit is the fundamental building block of digital data, Fig 4.16 Tx and Rx Pins

consisting of 0 or a 1.
• Sending messages and data back and forth from Arduino to a
computer or even other hardware and Arduinos
Nimble Shield by TechTree
Voltage
Regulators
Power Jack
Power Button
 
 
  Buzzer

   

LED   SONAR
Connection
 
Battery Indicator
  Servo Connection
 
Motor Connections  
Bluetooth
    Connection
TCRT Connections  

     

Motor Driver/H-Bridge

LDRs
Fig 4.18 Nimble Shield labelled diagram
Nimble Shield
LED
• A light-emitting diode (LED) is a
semiconductor device that emits light when
an electric current flows through it.
• LED is a two legged device.
• By connecting a resistor with the LED, we
can allow voltages to drop against the LED
to avoid damaging it.
Symbol
Nimble Shield
Buzzer
• A buzzer or beeper is an audio device.
• Typical uses of buzzers and beepers
include alarm devices and timers.

Difference between
buzzer and speaker?
Symbol
Let’s code
Let’s code

Any code in curly brackets is code body

Setup Body (runs first and once)

Loop Body (runs after setup and infinity)


Code Bodies
Project I – LED Blinking
Blinking LEDs is the simplest project ever - it’s as simple as turning a light on and off.
It always serves as an important stepping stone toward more complex experiments.

A forever loop
can be infinite
Like the sunrise
and the sunset
Project I – LED Blinking
Commands (Methods)
pinMode(pin #,INPUT or OUTPUT);

pinMode(13,OUTPUT);
pinMode(7,INPUT);

Use to initialize any pin as digital input


or output
Use in setup body most of the time
Project I – LED Blinking
Commands (Methods)
digitalWrite(pin #,state);

digitalWrite(13,1);
digitalWrite(13,0);
digitalWrite(7,1);

Use to control high or low on any digital


pin
Project I – LED Blinking
Commands (Methods)
delay(milliseconds);

delay(500);
delay(1000);
delay(20);

Use to add delay in program at desired


portion of code
Control program time, tricky tool
Project I – LED Blinking
This project comprises turning the LED on and
off repeatedly. Lots of programs have repetition
involved in them, where a certain part of the
code is being used over and over again.
The computer is efficient in terms of
performing repetition. If you want to blink the
LED infinite times, then what do you do? Do you
write infinite code? Of course, not, that’s not
practically possible.
There’s an easy and efficient way in which you
can get the computer to repeat a certain set of
code whatever number of times you want. This
method is called looping
Project II – Buzz! Buzz!
In this project, we will be using a piezo
buzzer that makes a small “click” when
you apply a voltage to it (try it!). By itself,
that isn’t exciting, but if you turn the
voltage on and off hundreds of times a
second, the piezo buzzer will produce a
tone. Let’s get to make a tone.
Project II – Buzz! Buzz!
We are using a forever loop, which is an infinite loop,
because we want the buzzer to beep continuously.
For the buzzer to buzz in repetition, it should
remain on for certain amount of time and then goes
off and then again on. To achieve this, initially, the
buzzer is set to a HIGH state which means that it is
turned on. We include some time delay by asking the
code to wait for 0.5 seconds before moving on to the
next line of the code. After 0.5 seconds, the buzzer
state is changed to LOW, which means that it is
turned off. It remains off for a period of 0.5
seconds. The code is then repeated from the first
line in the loop. You can change the wait time and
alternate the buzzer states as per your wish.
Nimble Shield
Light Dependent Resistor–LDR
• A Light Sensor is a device that converts the light
energy into an electrical signal; understandable to
the Arduino. These devices are commonly known as
“Photoelectric Device” or “Photo Sensor”.
• “TechTree Arduino shield is equipped with a light
sensor. The most basic component of a Light sensor
is the LDR (Light Dependent Resistance). This
sensor works on the principle of photoconductivity.
As soon as the light intensity strikes the LDR, it. By
connecting a resistor with the LED, we can allow
voltages to drop against the LED to avoid damaging Symbol
it.
Nimble Shield
Light Dependent Resistor–LDR
• Light-dependent resistors, LDRs, or photoresistors
are often used in electronic circuit designs where it
is necessary to detect the presence or the level of
light. When light falls upon it, then the resistance
changes. Values of the resistance of the LDR may
change over many orders of magnitude the value of
the resistance falling as the level of light increases.

Symbol
Project III – Reading LDR Data
In this project, we will use one of the two
LDRs in Nimble Shield to monitor the
current light condition. To monitor the
light value, we have to use Serial Monitor.
Note: Every time we use Serial Monitor,
we need to connect the serial port.

Left LDR = A4

Right LDR = A5
Project IV – If/Else with LDR
In this project, we will use the LDR to detect
light, then if there is darkness in the
surroundings LED will turn ON else it will be
OFF. For this project to work we need to find
the value between Light and Darkness. For
this project, the value is 400. We will compare
the current light value with this value. If the
value is greater than 400 this means darkness
hence LED is ON otherwise, it is OFF.

Note: The value between light and darkness


upon the surroundings. It may vary for you.
Thank You

You might also like