CTPS - 2018 ACTIVITY PHYSICAL COMPUTING
CTPS -2018ACTIVITY PHYSICAL COMPUTING
Detectable
physical
phenomena in
the Real
world
Acoustic
Biological & Chemical
Electric
Magnetic
Optical
Thermal
Mechanical
Stimulus
Response to stimulus is an Electrical Signal
• By electrical we mean a signal
which can be channeled,
amplified and modified by
electronic devices:
• Voltage
• Current
• Charge
• The voltage, current or charge may
be describe by:
• Amplitude
• Frequency
• Phase
• Digital code
Detectable Physical
phenomena in Real
world Sensor
Detects/measures a stimulus
A sensor receives stimulus and coverts it into electrical signals
Detectable
Physical
phenomena in
Real
world
Sensor
Detects/measures a stimulus
actuator
Generates a stimulus
Sen
sors
an
d A
ctu
ato
rs
Detectable
Physical
phenomena in Real
world
6 We can measure …• Motion, position, displacement
• Velocity and acceleration
• Force, strain
• Pressure
• Flow
• Sound
• Moisture
• Light
• Temperature
• Radiation
• Chemical presence
Sti
mu
lus
& r
esp
on
ses Stimulus Quantity
Acoustic Wave (amplitude, phase, polarization), Spectrum, Wave Velocity
Biological &
Chemical
Fluid Concentrations (Gas or Liquid)
Electric Charge, Voltage, Current, Electric Field (amplitude, phase, polarization),
Conductivity, Permittivity.
Magnetic Magnetic Field (amplitude, phase, polarization), Flux, Permeability
Optical Refractive Index, Reflectivity, Absorption
Thermal Temperature, Flux, Specific Heat, Thermal Conductivity
Mechanical Position, Velocity, Acceleration, Force, Strain, Stress, Pressure, Torque
• A Sensor converts the physical parameter ( temperature, blood pressure,
humidity, speed, etc.) into a signal which can be measured electrically.
• It responds to any change in physical phenomena or environmental variables like heat,
pressure, humidity, movement etc.
• This change affects the physical, chemical or electromagnetic properties of the sensors
which is further processed to a more usable and readable form.
• Sensors are used to measure a particular characteristic of any object or device.
• The signal produced by the sensor is equivalent to the quantity to be
measured.
• An analog sensor converts the physical quantity being measured to analog
form (continuous in time). A digital sensor produces output in the form of
pulse.
Temperature, Light sensors
• Temperature sensors appear in building, chemical
process plants, engines, appliances, computers, and
many other devices that require temperature
monitoring
• Many physical phenomena depend on temperature,
so we can often measure temperature indirectly by
measuring pressure, volume, electrical resistance,
and strain
• Light sensors are used in cameras, infrared
detectors, and ambient lighting
applications
• Sensor is composed of photoconductor
such as a photoresistor, photodiode, or
phototransistor
Gas, Motion sensors
• CO2 sensor measures gaseous CO2
levels in an environment. Measures
CO2 levels in the range of 0-5000
ppm.
• Monitors how much infrared
radiation is absorbed by CO2
molecules
• Motion sensors measure displacement, velocity,
acceleration, force, and stress.
• These measurements are used in mechanical
equipment such as servo-systems, robots, and
electrical drive systems.
• Motion sensors include the following types of
devices: potentiometers, resolvers, optical encoders,
variable inductance sensors (displacement),
tachometers (velocity), piezo-resistive sensors (strain).
Sensor
Inputsignal
(measurand)
Arduinosensor data
Network
Display
A s
en
sor
syst
em
SCRATCH WITH ARDUINO BOARD
Arduino
Arduino is an open source computer hardware and
software company, project, and user community that
designs and manufactures single-board
microcontrollers and microcontroller kits for building
digital devices and interactive objects that can sense
and control objects in the physical world.
A typical board layout
Labels : 1 to 5
• The Arduino UNO can be powered
from a USB cable coming from your
computer or a wall power supply
(like this) that is terminated in a
barrel jack.
• The USB connection is labeled (1) and
the barrel jack is labeled (2).
• GND (3): Short for ‘Ground’. There
are several GND pins on the Arduino,
any of which can be used to ground
your circuit.
• 5V (4) & 3.3V (5): the 5V pin supplies
5 volts of power, and the 3.3V pin
supplies 3.3 volts of power.
Labels: 6 to 9
• Analog (6): A0 through A5 are Analog
In pins. These read the signal from
an analog sensor (like a temperature
sensor) and convert it into a digital
value.
• Digital (7): The digital pins 0 through
13 can be used for both digital input
(like telling if a button is pushed)
and digital output (like powering an
LED).
• PWM (8): (~) next to some of the digital
pins (3, 5, 6, 9, 10, and 11. These pins
act as normal digital pins, but can also
be used for something called Pulse-
Width Modulation (PWM). ----these pins
as being able to simulate analog output
(like fading an LED in and out).
• AREF (9): Analog Reference. It is
sometimes used to set an external
reference voltage (between 0 and 5
Volts) as the upper limit for the analog
input pins.
Labels: 10 to 13
• The reset button (10). Pushing it
will temporarily connect the
reset pin to ground and restart
any code that is loaded on the
Arduino.
• Power LED Indicator: A tiny LED
next to the word ‘ON’ (11). This
LED should light up whenever
you plug your Arduino into a
power source.
• TX is short for transmit, RX is short for
receive… indicate the pins responsible for
serial communication. TX and RX appear –
once by digital pins 0 and 1, and a second
time next to the TX and RX indicator LEDs
(12). These LEDs will give us some nice
visual indications whenever our Arduino is
receiving or transmitting data (like when
we’re loading a new program onto the
board).
• Main IC: The black thing with all the
metal legs is an IC, or Integrated Circuit
(13). --- the brains of our Arduino.
Lay out of the Physical computing kit ( Arduino Uno with sensors )
Invert
ed logic
Scratch for Arduino
Scratch for Arduino (S4A) is a Scratch modification
that brings the easiness of programming with Scratch
to the Arduino prototyping board. It provides new
blocks for managing sensors and actuators connected
to Arduino Board.
Th
e S
4A
In
terf
ace
STEP 2: Download Arduino Environment
➢ Download and install the Arduino environment by
following the instructions on
http://arduino.cc/en/Main/Software.
STEP 3: Download Firmware
➢ This firmware is a piece of software you need to install
into your Arduino board to be able to communicate with
it from S4A.
➢ Download firmware from
http://vps34736.ovh.net/S4A/S4AFirmware16.ino
STEP 4: Open Firmware
Connect your Arduino board to a USB port in
your computer.
Open the firmware file (S4AFirmware16.ino) from
the Arduino environment.
Op
en
Fir
mw
are
STEP 5: Select board and port
In the Tools menu,
select the board version and the serial port
where the board is connected.
Bo
ard
sele
cti
on
Po
rt s
ele
cti
on
STEP 6: Load firmware
Load the firmware into the Arduino board
through File > Upload.
Lo
ad
Fir
mw
are
Lo
ad
Fir
mw
are
Trouble Shooting : Failure of STEP 6
The issue may be because the appropriate
driver (USB2UART) has not been installed
in your system.
*Go to Device Manager
*Download the USB2UART driver
STEP 7: Communicating with Arduino from S4A
Open S4A
The Arduino board should be detected (2
green LEDs will blink in the USB2UART
component )
Now, program to communicate
Searc
hin
g b
oard
Ard
uin
o f
rom
S4A
EX
#1:
BU
ZZ
ER
EX
#2:
INF
RA
-RE
D
MU
SIC
EX
#3:
LE
D O
N,
OF
F
WIT
H M
US
IC
EX
#4:
SO
UN
D
EX
#5:
PU
SH
BU
TT
ON
EX
#5:
PU
SH
BU
TT
ON
EX
#6:
LE
D F
AD
E A
ND
B
RIG
HT
EX
#7:
LIG
HT
EX
#8:
CO
LO
R C
OD
E
EX
#9:
PO
TE
NT
IOM
ET
ER
EX
#9:
PO
TE
NT
IOM
ET
ER
EX
#10
: P
AP
ER
CH
EC
K