3. Topics to be Covered
• Analog Electronics
1. Resistors,Capacitors,Diodes ,Transistors and
their use in circuits.
2. Relays,Transformers,Op-amp,comparators
and schmitt trigger.
• Digital electronics
1. Logic levels,basic gates,digital IC’s,flip flops
and its applications in counters .
13. • Zener diodes are used to "clamp" a voltage in
order to prevent it rising higher than a certain
value.
• This might be to protect a circuit from
damage or it might be to "chop off" part of an
alternating waveform for various reasons.
• Zener diodes are also used to provide a fixed
"reference voltage" from a supply voltage that
varies. They are widely used in regulated
power supply circuits.
18. • My transistor runs on water current. You see there
are three openings which I have labelled "B" (Base),
"C" (Collector) and "E" (Emitter) for convenience. By
an amazing coincidence, these also happen to be the
names used by everyone else for the three
connections of a transistor!
• We provide a reservoir of water for "C" (the "power
supply voltage") but it can't move because there's a
big black plunger thing in the way which is blocking
the outlet to "E". The reservoir of water is called the
"supply voltage". If we increase the amount of water
sufficiently, it will burst our transistor just the same
as if we increase the voltage to a real transistor.
• We don't want to do this, so we keep that "supply
voltage" at a safe level.
19. • If we pour water current into "B" this current
flows along the "Base" pipe and pushes that
black plunger thing upwards, allowing quite a
lot of water to flow from "C" to "E". Some of
the water from "B" also joins it and flows
away. If we pour even more water into
"B", the black plunger thing moves up further
and a great torrent of water current flows
from "C" to "E".
20. • 1. A tiny amount of current flowing into "B" allows a large amount
to flow from "C" to "E" so we have an "amplification effect". We
can control a BIG flow of current with a SMALL flow of current. If
we continually change the small amount of water flowing into "B"
then we cause corresponding changes in the LARGE amount of
water flowing from "C" to "E". For example, if we measure the
current flow in gallons/minute: Suppose 1 gallon/minute flowing
into "B" allows 100 gallons/minute to flow from "C" to "E" then we
can say that the transistor has a "gain" or "amplification" factor of
100 times. In a real transistor we measure current in thousandths
of an Ampere or "milliamps". So 1mA flowing into "B" would allow
100mA to flow from "C" to "E".
• 2. The amount of current that can flow from "C" to "E" is limited by
the "pipe diameter". So, no matter how much current we push into
"B", there will be a point beyond which we can't get any more
current flow from "C" to "E". The only way to solve this problem is
to use a larger transistor. A "power transistor".
21. • 3. The transistor can be used to switch the current flow on and off. If we
put sufficient current into "B" the transistor will allow the maximum
amount of current to flow from "C" to "E". The transistor is switched
fully "on".
• If the current into "B" is reduced to the point where it can no longer lift
the black plunger thing, the transistor will be "off". Only the small
"leakage" current from "B" will be flowing. To turn it fully off, we must
stop all current flowing into "B".
• In a real transistor, any restriction to the current flow causes heat to be
produced. A transistor must be kept cool or it will melt. It runs coolest
when it is fully OFF and fully ON. When it is fully ON there is very little
restriction so, even though a lot of current is flowing, only a small
amount of heat is produced. When it is fully OFF, provided we can stop
the base leakage, then NO heat is produced. If a transistor is half on
then quite a lot of current is flowing through a restricted gap and heat is
produced. To help get rid of this heat, the transistor might be clamped to
a metal plate which draws the heat away and radiates it to the air. Such
a plate is called a "heat sink". It often has fins to increase its surface area
and, thereby, improve its efficiency.
22. Rules for Operation
• Let's start by stating what needs to be done to a transistor to
make it operate as a transistor.
• Suppose we have the following:
• 1. VC > VE, by at least a few (0.1) V.
• 2. VB > VE
• 3. VC > VB
• 4. We do not exceed maximum ratings for voltages or currents.
• When these conditions are not met, then (approximately) no
current flows in or out of the transistor.
• When these conditions are met, then current can flow into the
collector (and out the emitter) in proportion to the current
flowing into the base:
• IC = (hfe)IB
where hFE = is the current gain.
25. • When a transistor is used as a switch it must
be either fully on or off. If driving a inductive
load like a relay or any type of coil you should
connect a diode in reverse bias across the load
so that back EMF will not flow into the
transistor, destroying it.
27. • The pull-up resistor assures that the wire is at a
defined logic level even if no active devices are
connected to it.
• When the switch is open the voltage of the gate
input is pulled up to the level of Vin. When the
switch is closed, the input voltage at the gate goes to
ground.
34. TERMINOLOGY ASSOCIATED WITH
DIGITAL CIRCUITS
• PROPOGATION DELAY: A TIME DELAY
INTRODUCED BY THE DIGITAL ENTITY LIKE A
GATE.
• ACTIVE HIGH :A HIGH PULSE ON THE PIN WILL
CAUSE AN EVENT TO BE RECOGNISED
• ACTIVE LOW:A LOW PULSE ON THE PIN WILL
CAUSE AN EVENT TO BE RECOGNISED
• POSITIVE EDGE TRIGERRED:ONLY DURING THE
RISING EDGE OF THE CLOCK(CONTROL)
SIGNAL,THE INPUTS ARE EFFECTIVE.
41. Microprocessors and Microcontrollers
Microprocessor :
Central processing unit (CPU) on a single integrated circuit (IC).
Ex: AMD Athlon, Intel Pentium.
http://en.wikipedia.org/wiki/Microprocessor
Microcontroller :
An integrated CPU, memory (a small amount of RAM, program memory, or both)
and peripherals capable of input and output.
Ex: Atmel AVR, PIC.
http://en.wikipedia.org/wiki/Microcontroller
42. Atmel AVR
The AVR is a Modified Harvard architecture 8-bit RISC single chip
microcontroller developed by Atmel in 1996.
The AVR was one of the first microcontroller families to use on-chip flash
memory for program storage.
Basic Families:
•tinyAVRs. Ex: ATtiny11
•megaAVRs. Ex: ATmega8, ATmega16, ATmega32
•XMEGA. Ex: ATxmega64
43. Device Architecture
ALU: Fetching, Decoding and Execution of Instructions.
Registers: Usually 32x8bit registers. The CPU does all
the calculations on these registers.
Program Memory: Storage of instructions that form the program. A non-
volatile Flash memory is used to store the program.
The size of the program memory is occasionally indicated in the naming of the
device itself (e.g., the ATmega64x line has 64 kB of Flash).
SRAM: Storage of data-variables, stack etc.
EEPROM: Internal Electrically Erasable Programmable Read Only Memory
(EEPROM) for semi-permanent data storage. Like Flash memory, EEPROM can
maintain its contents when electrical power is removed.
44. Types of sensors
Infrared LEDs
Photodiodes & Phototransistors
Photointerrupters
Photoreflectors
Photoresistors (LDR)
IR-Receiver modules
Light Sensors
Digital Hall Sensors
Programmable Hall Sensors
Analog Hall Sensors
Magneto-resistive Sensors
Vibration Sensor
Air Pressure Change Sensor
Thermistors
Thick-film Thermistors
Thermopiles
Ultrasonic Sensors
Pyroelectric Sensors
45. Infrared-LEDs emit light over a range of 700nm
up to
1,000nm, which is no longer visible to the
human eye, but can
be very well detected by silicon photodiodes
and phototransistors.
The wavelength emitted depends upon the
material used
for the semiconductor chips. Standard
wavelengths are 880nm
and 950nm, whereby the 950nm are generally
more favourable
priced. Apart from the wavelength and
switching speed, important
characteristics of infrared LEDs are the
direction of emission
(sideways, upwards or downwards) and the
angle of beam
(decisive for the optical power in the forward
direction).
46. Silicon Photodiodes and Phototransistors can
detect
radiation ranging between 400nm and
1,100nm. Since the
maximum sensitivity is approx.
880nm, infrared radiation is particulary
well detected by silicon components.
Photodiodes and
phototransistors are available with black epoxy
resin mold, which
suppresses the sensitivity within the visible
spectral area. For
slow optical switching
applications, phototransistors are generally
used, wherby photodiodes are used for
measuring applications
or data transmission.
47. Photoresistors (LDRs) are light-sensitive
resistors. The
resistance value can vary strongly depending
on incident light. The
dark resistance is typically within the range of
MΩ, at 10 Lux however
in the lower range of kΩ. The advantage by
comparison
with silicon photodiodes is in the spectral
sensitivity of the LDRs.
Whereas photodiodes are sensitive from 400
nm (blue) up to
1100 nm (infrared area) LDRs are only sensitive
within the visible
spectral range. LDRs are therefore particularly
suitable as light
sensors because these sensors do not detect
the infrared radiation
generally present in daylight that could lead to
inaccurate measuring
results.
48. Ultrasonic sensors use a piezo element to
generate
acoustic oscillations in a range above 25 kHz,
which is beyond
the human auditory threshold. The ultrasonic
wavelength is in a
range of a few centimeters or less. This can
measure objects or
distances with a high level of precision.
Transmitter and receiver
can either be produced as separate units
(transmitter and receiver
type) or one transmitter can be operated
jointly as transmitter
and receiver (common type).
Applications
» Distance measurement (parking devices)
» Spatial monitoring
(burglary alarm for motor vehicles)
49. VIBRATION SENSOR
The vibration sensor VS1 is ideally suited for detecting
small oscillations and vibrations. The well-known principle of
ball switch gave birth to this component. Here, it is miniaturised
to the size of a TOPLED and integrated within a hermetically
sealed package. A 0.8 mm high-grade steel ball is set within a
small tube with 1mm diameter tube. The wall and base of the
tube constitute two contacts that are bridged by the ball when in
the quiescent state. With the smallest movement, the contact is
briefly interrupted and detected. The sensor is suitable for the
qualitative measurement of any vibration or shaking.
50. Applications
THERMISTORS » Battery packs
» Heat meters
Thermistors generally refer to a temperature- » Temperature measuring devices
dependent resistor that has a negative » Precision temperature compensation
temperature coefficient (NTC). » Temperature monitoring
The resistance decreases exponentially with
increasing temperature
of the component. SEMITEC thermistors
consist of sintered
metallic oxide ceramics. Thermistors are
characterised by
the resistance value at 25°C (R25) and the
material constant B,
which defines the increase in the resistance
curve in the log R-
1/T diagram. SEMITEC thermistors have a
tolerance in R25 and
B of 1% or less. This makes highly precise
temperature measurement possible. The NTCs
can also be assembled in accordance
with customers’ wishes.
54. How to select a battery?
• Current rating(in terms of mAh)
• Load
• Weight
• Voltage
• Battery life
• Cost
55. Alkaline Batteries
• Alkaline batteries are the most common,
easiest to get, and cheapest too.
• Low power capacities
• Short battery life
56. Ni-Mh & Ni-Cad
• These batteries are good for small
to medium size range robots
• They have memory effect problem
• To prevent memory
effect, whenever you wish to
recharge your NiCad, you must
first fully discharge it.
• NiMH battaries can last many
more cycles than your typical
NiCad battery.
57. Li-ion Batteries
• Very Small in size and weight
compared to Ni-Cd, Ni-MH and Lead
Acid Batteries
• Normally full charge in 60 minutes
with special charger
• Long life with full capacity for upto
1000 charge cycles
• Low maintenance
58. Li-Po batteries
• Very Small in size and weight compared to
Ni-Cd, Ni-MH and Lead Acid Batteries
• Full Charge in 180 minutes with special
charger
• Long life with full capacity for upto 1000
charge cycles
• Low maintenance
• For example,
– 3X Li-Po 4.2V 2200mAh cells
– 192Grams Weight
– Discharge Current: 20*2200maH = 44Amp
– Max Charging Current: 1A
– Price:Rs.3500
61. Arduino
ARRRR, like a pirate /
/ DWEE, just say "do we“ fast /
/ NO, as in no.
”ARRR-DWEE-NO”
62. What is Arduino?
• Open Source Hardware Development Platform
• Serial Programmable Microcontroller (MCU)
Investment!
63. Why Arduino?
• It is Open Source, both in terms of Hardware and Software.
• It is cheap(1300 – Original, 800 - Clone), the hardware can be built from
components or a prefab board can be purchased online.
• It can communicate with a computer via serial connection over USB.
• It can be powered from USB or standalone DC power.
• It can work with both Digital and Analog electronic signals. Sensors and
Actuators.
• You can make cool stuff! Some people are even making simple robots, and
we all know robots are just cool.
65. Let's get it started, hah!
Let's get it started in here, yeah
Lose control, all body, all soul
Don't move too fast, people just take it slow
Don't get ahead, just jump into it!
66. Programming an Arduino
• Write program
• Compile(Check for errors)
• Reset board
• Upload to board
67. An Arduino “Sketch”
• Declare variables at
top
• Initialize
– setup() – run once at
beginning, set pins
• Running
– loop() – run
repeatedly, after
setup()
68. • 14 Digital I/O (pins 0 - 13)
• 6 Analog In (pins 0 - 5)
• 6 Analog Out (pins 3,5,6,9,10,11)
73. Demonstration
Start up the Arduino software and
open up the Blink sketch.
For the most basic kind of program you’ll need a simple actuator, an LED with
the long leg (+) pushed into pin 13 and the short leg (-) in the adjacent ground
pin (GND). Pin 13 is special, in the sense that it has a built in resistor to
correctly control the voltage going into a testing LED just like this.
94. EXPLAINATION
• This is a simple yet effective IR proximity sensor built around the TSOP 1738
module.
• Commonly found at the receiving end of an IR remote control system; e.g., in
TVs, CD players etc.
• These modules require the incoming data to be modulated at a particular
frequency and would ignore any other IR signals. It is also immune to ambient IR
light, so one can easily use these sensors outdoors or under heavily lit conditions.
• Such modules are available for different carrier frequencies from 32 kHz to 42 kHz.
• In this particular proximity sensor, we will be generating a constant stream of
square wave signal using IC555 centered at 38 kHz and would use it to drive an IR
led. So whenever this signal bounces off the obstacles, the receiver would detect it
and change its output.
• Since the TSOP 1738 module works in the active-low configuration, its output
would normally remain high and would go low when it detects the signal (the
obstacle).
96. Pulse Width Modulation
aka
PWM
• Not all digital pins allow PWM
– Pin 13 does not work
– Pin 11,10,9,6,5,3 does
• analogWrite function takes care of this
97. PWM
• Microcontroller only
allows 2 states – HIGH
or LOW
• “fake” analog using
PWM
• Virtual digital to analog
converter
• It is a technique for
getting analog results
with digital means
98. P…What!?
Digital control is used to create a square wave, a
signal switched between on and off. This on-off
pattern can simulate voltages in between full on (5
Volts) and off (0 Volts) by changing the portion of
the time the signal spends on versus the time that
the signal spends off. The duration of "on time" is
called the pulse width. To get varying analog
values, you change, or modulate, that pulse width.
If you repeat this on-off pattern fast enough with an
LED for example, the result is as if the signal is a
steady voltage between 0 and 5v controlling the
brightness of the LED.
99. PWM on Arduino?
The green lines represent a
regular time period. This duration
or period is the inverse of the
PWM frequency. In other words,
with Arduino's PWM frequency at
about 500Hz, the green lines
would measure 2 milliseconds
each. A call to analogWrite() is on
a scale of 0 - 255, such that
analogWrite(255) requests a
100% duty cycle (always on), and
analogWrite(127) is a 50% duty
cycle (on half the time) for
example.
103. Actuators
• An actuator is something that converts energy
into motion.
• They are the part of a robot that actually
makes it to move and do stuffs.
• Actuators can create a linear motion, rotary
motion or oscillatory motion.
104. Rotational and linear actuators
• Dc gearless motor
• Dc geared motor
• Brushless motor
• Stepper motor
• Servo motor
• DC Linear Actuator
• Solenoid
105. Dc gearless motor
• Moderately high
speed(rpm)
• Less torque
• Can be used for low
power application
• Usually used as
propeller in small boats,
in beambots and other
solar bots
106. Geared dc motor
• Good torque
• Relatively lesser speed
• Used where the torque
is the main criteria
• Low speed application
• Usually used to drive a
robot and for robotic
arm
107. A simple npn transistor can be used to drive a motor with variable
speed.
Note: the direction of rotation of motor cant be controlled using
this setup.
108. Brushless motor
• Very high speed(rpm)
• Low torque
• Used as propellers in
UAV, aerial robot and as
air propeller RC
controlled boats
• Requires a good power
source(like LiPo
batteries)
109. Stepper motor
• Pretty good torque
• Speed is variable
• Used where precise
rotation is
• Require special circuit
to make it work
• Usually used with a
microcontroller
110. Servo motor
• Good torque
• Rotates a maximum of
180 degree (360 degree
in some case)
• Rotates to a particular
position depending of
the duty cycle of pwm
111. DC Linear Actuator
• Provide linear
movement
• made up of a DC motor
connected to a lead
screw
• Similar to dc motor and
hence speed can be
controlled using pwm
112. Solenoid
• They can be
electromechanical, hydr
aulic, or pneumatic
driven
• Stroke is usually very
small but they are
pretty fast
• Can be made to work
using a simple MOSFET
or transistor
113. Choosing an Actuator
• Is the actuator being used to move a wheeled
robot?
• Is the motor being used to lift or turn a heavy
weight?
• Is the range of motion limited to 180 degrees
and need good torque?
• Does the angle need to be very precise?
• Is the motion in a straight line?
114. Types of LEDs
• Single (polar) LEDs
• Bi-colour LEDs
• Tri-colour LEDs
• RGB LEDs
115. Choosing series resistor for LEDs
Colour Current Voltage
{I} {VL}
Red 30mA 1.7V
Bright red 30mA 2.0V
Yellow 30mA 2.1V
Green 25mA 2.2V
R = (VS - VL) / I
Blue 30mA 4.5V
116. Drive multiple LEDs
using transistor
• Easier to use, simpler
circuit
• Not many components
are required
• Can be used with any
controller(even with the
low power
microcontrollers)
117. Home Lighting
• Why can’t we directly
use the circuits for
home lighting?
• Any simpler solution for
that?
118. Relays
• Works on both AC and
DC
• Easier to use (compared
to transistor)
• Require no extra
components(like
resistors)
119.
120. Pros Cons
• Can be used to switch both • Bulkier than transistors for
AC and DC (transistors can switching small currents.
only switch DC) • Relays cannot switch
• Can switch higher rapidly (except reed relays)
voltages than standard • Require use more power
transistors. • Require more current than
• A better choice for many ICs can provide(low
switching large power transistor can be
currents (> 5A). used)
• Can switch many • Relatively costlier when
contacts at once. used in smaller circuits
121. A better solution
OPTOISOLATORS
• Cheaper than relays
• Works well even for AC
power supply(some of
them… moc3021 for
eg)*
• Easier to use
• No extra circuit needed
to make the ic work
• Fast switching rate
* not preferred in most of the case though
135. Activities
1-simple functions to do with serial communication-
begin, print,read,available
2-send data from arduino to computer using serial
monitor
3-send data from computer to arduino
136. Activity-Controlling the speed of motor based on
the temperature
Important steps involves:
1-interfacing temperature sensor and
motors appropriately.
2-getting the analog values of the
temperature sensor.
3-depending on the sensor inputs, supply
pwm to the motors.
4-code :)