Blogics! Tutorial

advertisement
Blogics!
• It’s a logic circuit simulator aimed at
beginners.
• It introduces simple concepts in the design of
interactive physical computing systems such
as sensors, actuators, processing and their
relationship to the environment.
Logic Gates
• Basic operations of digital
systems.
• Each logic gate has a number
of inputs and produce an
output accordingly.
• Each input is a binary value (1
or 0) that correspond to truth
values (true or false)
Example: AND gate
• I will go to sleep if it is dark and I am tired.
+
=?
+
=?
+
=?
+
=?
Go to sleep
Stay awake
Example: AND gate
• I will go to sleep if it is dark and I am tired.
+
+
+
+
Go to sleep
‘Go to sleep’ is true only
when ‘dark’ and ‘tired’
are also true.
Stay awake
Example: OR gate
• I will go to sleep if it is dark or I am tired.
+
=?
+
=?
+
=?
+
=?
Go to sleep
Stay awake
Example: OR gate
• I will go to sleep if it is dark or I am tired.
+
+
+
+
Go to sleep
‘Go to sleep’ is true
either when ‘dark’ or
‘tired’ are also true.
Stay awake
Logic models behaviour
• By specifying the system’s behaviour with
logic gates we can determine its outputs
according to each combination of inputs.
Interactive systems
ENVIRONMENT
Inputs
Interactive System
HUMAN
Outputs
Interactive systems
ENVIRONMENT
Inputs
Sensors
Processing
HUMAN
Actuators
Outputs
Sensors
• A sensor converts a physical quantity into an electrical
signal.
• There is an enormous variety of sensors available
commercially, often for very low prices:
–
–
–
–
–
–
–
–
Sound
Chemicals
Electricity
Temperature
Proximity
Position
Humidity
And so on…
Sensors
• The signal that a sensor emits varies according
to its operating characteristics and the
measured physical quantity captured from the
environment or from human action.
• Sensors can be digital or analogue.
Sensors in Blogics!
Switch
Thermometer
Humidity Sensor
Button
Light Sensor
Presence Sensor
Sensors in Blogics!
• Each sensor measures a
different physical quantity in
the environment.
– Light Sensor: Day/Night
– Thermometer: Cold/Hot
– Humidity: Wet/Dry
– Presence: Someone/No one
– Button/Switch: Human
Action/No human action
Sensors in Blogics!
• Sensors in Blogics! are binary, i.e. they are either on or
off according to the environment variable they
measure.
High temperature
Output: 1
Low temperature
Output: 0
• We simulate changes in the environment by connecting
a different environment block to the sensor
Actuators
• The other end of an interactive system is the
actuation side.
• Actuators convert an electric signal into
mechanical motion.
• To simplify the jargon, we use the term to
denote any component that converts an
electric signal into any kind of feedback to the
user or the environment.
Actuators in Blogics!
•
•
•
•
LED - light
Fan - temperature
Buzzer - sound
Vibration motor - haptic
Processing
• The data collected by the sensors is processed
by the logic circuit.
Processing
• We combine logic gates to create more
complex logic statements.
• Example: Turn on a fan if it is dark and hot
We add the NOT gate,
because the light sensor
outputs 1 when it is bright
TTT: Tips and Tricks and
Troubleshooting
Logic gates (except the NOT) have 3 input ports (bottom, top and left) and 1 output port (right).
NOT has 1 input port (left ); and 1 output port (right)
When a value is not assigned to an input port, this port assumes the neutral value of the operation.
For the circuit to work it is necessary to use wires between logic gates and sensors/actuators.
All wires in Blogics! are directional. This means that the direction of the arrows on the wires should always
match the direction of the input-output data flow.
To delete a block, create a Bin Block and connect it to the block you want to remove. To delete a Bin, create
another Bin and connect the two.
If a circuit doesn't display the correct output, click on a logic gate to refresh the calculations.
If an environment block doesn't seem to be working, check if it corresponds to the correct sensor.
A known bug is that even though the NOT block lets you connect blocks to the top and bottom ports it
doesn't take into account their values.
Summary
• We can use logic to specify an interactive system’s
behaviour.
• When we design interactive systems, we need to think
about:
– what inputs it takes
– what sensors do we need to obtain this input from the
user or the environment
– what kind of output we want to give
– what actuators we need to use to provide this feedback to
the user or the environment
– how to process the inputs to generate the desired outputs
Download