Week 2
Week 2
=
=> we need to give the Arduino
eyes, voice, hands, legs...
• Interfacing with an analog/real world
- sensors (switch, light...)
- actuators (lamps, speakers, motors...)
• Power
- battery, solar cell, dynamo...
• Enhanced functions:
- More memory and speed
- real time clock,
- wireless communication (Wifi, GPS,
GSM…)
- even face recognition!
Electronics 101: Introduction
4
Why Electronics?
• Everything needs power.
• Power need to be controlled….to be interactive.
What is Electronics?
What is Electronics? (Cont.)
Electricity: the hydraulic analogy
6
We have mastered electricity exactly like water!
• we can guide electricity
• extract its energy
• use it for heating or work (computing is work…)
7
43
a) we can extract or store energy
b) we can guide it where we need it:
c) we can transmit information (here digital)
MONIAC (Monetary
National Income
Analogue Computer)
an analog hydraulic
computer (1949)
Electronics VS. Electricity
Electricity
Electronics
Atom Circuits
Microwave ovens
use electronics to
control electricity
for heating up food
Electronics
• The art of creating “pluming installations” to transport electricity
• The “pipes” carrying electricity are called wires or traces.
A battery is a
chemically based
“electric pump”
Water pumps
high pressure
• Voltage is the difference of “pressure of the electricity” between two points on the pipe.
• It creates a flow, or ”current” in the cables (pipes) if it can (circuit is not open)
• Measured in Volts (V)
c) Current (and polarity)
• The ”flow” of electricity is the electrical current, measured in
Amperes (A)
• As explained, it is generated by a difference of voltage (electrical
pressure) between two points in the “pipes” (the circuit)
A + - B
A B
Water pressure in A is higher than B Voltage in A is larger than in B
(then water moves from A to B) Then, electric current flows from A to B
How to indicate current.
• Unit: Amperes or Amps (A)
Batteries and polarity: what is that?
a metal
always
conduct
https://youtu.be/9iKD7vuq-rY
The circuit
30
Series and parallel circuits: “Kirchhoff's laws”
Series:
• Components “in series” with each other through the wires
• The current flowing through them is therefore be the same!
Parallel:
• Components “in parallel” over two points of the circuit
• The voltage they see must therefore be the same!
Calculate the total resistance
40
Calculate the total resistance
41
Electronic components: overview
• An “active” component can control the flow of a pipe… depending on the flow
on another one! (like a valve)
• An active electronic component may not have a constant resistance:
transistor!!
Switches
50W
Note: for the same voltage, a low resistance will produce a large current => large
heat. Therefore, low resistances can burn your hand even with 5V!! beware.
45
Resistors
46
Potentiometers – variable resistors (manually)
Turning the wheel changes the resistance: manual control of the resistance
... for the same voltage, you are controlling the current: dimming a light!
47
iconductors
amily of Sem
The F
Clockwise from top: A chip, an LED and a transistor are all made
from semiconductor material.
Diodes
50
Transistor: an example of an active component
• a switch controlled by the current (or voltage) => a revolution!!
• A transistor can be used to amplify and switch electronic
signals and electrical power.
Note on using a transistor
• There are three pins in a transistor.
• Identify each pin in the real component by reading the
datasheet.
Note on using a transistor (Cont.)
• Important Parameter Ratings.
Why can a transistor be a controllable
switch?
Why can a transistor be a controllable
switch?
Vbe
-
Use a transistor as a switch
Integrated Circuit (IC)
• An integrated circuit is a set of electronic circuits on one
small plate ("chip") of semiconductor material, normally
silicon. This can be made much smaller than a discrete
circuit made from independent components.
How to use an IC chip
• Follow the datasheet.
• Identify pins.
Common ICs
• Voltage Regulator
• Logic Gates
• 555 Timer IC
• Microcontroller
Power supplies
If you understand this (at least you are not scared anymore), then congratulations:
• A led cannot handle more than 20 or 30mA. It has a forward voltage of about 2V..
so you need a resistor to limit the current or it will burn!
simplified schematics
prototyping board (real)
Soldered Printed Circuit Board (PCB)
Details protoboard circuit
(a)
(c)
(a)
(b)
9V (b)
(c)
Note:
• the LED polarity
• how the protoboard rows are connected
• how the columns (on the sides) are connected
• the corresponding points (a, b, c) from the schematic and the protoboard
Voltages at different points
9.0
(-)
9V
(+) “GND”
Voltages between:
2V • battery terminals: 9V
• LED terminals: 2V 2V is the operating
7V voltage of an LED
• Resistor: 7V
Calculate the needed resistor value:
R = 7V / 0.02 A
= 350 Ohms 20mA is the forward
current of an LED
LEDs in parallel and in series
Note the different values for the resistors (in series, it is smaller).
Try this: adding a switch
Add a push-button switch to the resistor-led circuit
Individual Hands-on Tasks (will be graded)
9v
GND
[In-class Task 2]
Make a circuit using one battery, one resistor, one potentiometer and one
LED. Turn the potentiometer to dim the light.
ATTENTION: how to be sure you will not burn it? ADD the resistor you used in previous
tasks and put it in series with the potentiometer!
78
Next week
Arduino
Coding