First Results with eBlocks: Embedded Systems Building Blocks
EBlocks – Electronic Building Blocks for Sensor-Based Systems Frank Vahid Professor Dept. of...
-
date post
22-Dec-2015 -
Category
Documents
-
view
226 -
download
7
Transcript of EBlocks – Electronic Building Blocks for Sensor-Based Systems Frank Vahid Professor Dept. of...
eBlocks – Electronic Building Blocks for Sensor-Based Systems
Frank Vahid Professor
Dept. of Computer Science and EngineeringUniversity of California, Riverside
Assoc. Director, Center for Embedded Computer Systems, UC Irvine
Support provided by the National Science Foundation and Intel
Contributing students: Susan Lysecky (PhD 2006, Asst. Prof. at U. Arizona), Ryan Mannion (former UCR ug/grad student), Andrea Lyons (senior), Caleb Leak (BS 2007, now UCLA MS student), Shawn Nemetebakshi (MS 2005),
plus about a dozen undergraduate students past and present
Frank Vahid, UC Rivers
ide
2/29
The Problem What do these problems all have in common?
An aunt with a visiting niece who sleepwalks,
worried the niece will leave the house or get hurt
A working adult with an ageing parent at home –
did she get out of bed today, is she moving
around?
A small store owner wishing to track
employees – are they in the storeroom,
breakroom, or out back – or customers
A homeowner who sometimes forgets to close the garage at
night
Marines wishing to outfit a building to
detect whether someone is inside or when someone was
inside
Frank Vahid, UC Rivers
ide
3/29
The Problem What do these problems all have in common?
Put motions sensors around the house,
connected to a beeper next to the bed
Put motion sensors around the house,
monitor from the web or cell phone – or even be notified if no motion by
certain time in the morning
Put motion and sound sensors
throughout, small LEDs (lights) near
cash register
Install contact sensor and light sensor, and indicator next to
the bed
Place motion, heat, and sound sensors
in rooms, halls, doorways
Frank Vahid, UC Rivers
ide
4/29
Why Can’t We Just Do This?
LEDreceive
contact switch
light sensor
AND
transmit
Widely usable “Lego”-like sensors don’t exist today
Costly, hard to use, plugged into wall
smarthome.com (x10.org)
... But new
technology makes Lego-like sensor blocks possible...
Frank Vahid, UC Rivers
ide
6/29
Shrinking Processor Size/Cost Enables New Solution
Moore’s Law also means chips can be SHRUNK 1980 – 10,000 transistors about 1 sq cm (fingernail) Today – size of a spec of dust
3 yrs
6 yrs
9 yrs12 yrs
15 yrs
Frank Vahid, UC Rivers
ide
7/29
Shrinking Processor Size/Cost Enables New Solution
Make sensors smarter By adding processor+battery
Today, tiny and cheap Becomes a "block" easily
connected to other blocks
http://www.templehealth.orgCourtesy of Joe Kahn
Frank Vahid, UC Rivers
ide
8/29
Shrinking Processor Size/Cost Enables New Solution – eBlocks
Existing component view New "eBlock" view
Button yes/no
Light Sensor
yes/no
Magnetic Contact Switch
yes/no
LEDyes/no
yes/no Beeper
Electric Relay
yes/no
Frank Vahid, UC Rivers
ide
9/29
eBlocks Just connect blocks, and they work
No programming knowledge, no electronics knowledge
Button yes/no
LED
yes/no Beeper
yes/noLight Sensor
yes/no
Frank Vahid, UC Rivers
ide
10/29
eBlocks Add intermediate blocks that compute and
maintain state Spatial programming – more intuitive to non-CS
people than temporal programming
Button Beeper
LED
Light Sensor
Tripper
Prolong
1 2 3 4 5 6 7 8 9
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Button
Toggle
Button Light Sensor
LED
Frank Vahid, UC Rivers
ide
11/29
What's Hard (The Research Part)
(1) Finding right set of building blocks
Toggle
Splitter
Tripper
2-Input Logic
3-Input Logic
Splitter
4-Input Logic
Splitter
Prolong (short)
1 2 3 4 5 6 7 8 9
Prolong (long)
1 2 3 4 5 6 7 8 9
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Too many – Overwhelming (too much choice)
2 Yes detector
2 No detector
Too few – Overwhelming (too much configuration)
SuperBlock
1 2 3 4 5 6 7 8 9
AND OR
yes no
When A is B is
then the output is yes
1
2
3 4
5: Splitter
1 2 3 4 5 6 7 8 9
6: ...
Frank Vahid, UC Rivers
ide
12/29
What's Hard (The Research Part) (2) Making the blocks understandable
People NOT likely to read directions Those that do are unlikely to understand
A B Output
no yesno nono yesno yesno yesyes nono yesyes yes
Logic Blockconfigurable DIP switch
A B
Combine
A is yes, B is yesA is yes, B is noA is no, B is yesA is no, B is no
The output should
be yes when:
yes no:
Phrased truth table
yes no
the output should be
A B
When the input is
outCombine
A is yes, B is yesA is yes, B is noA is no, B is yesA is no, B is no
Phrased truth table embedded in sentence
yes no
The output should be
When the input is
out
A B
A BA BA BA B
CombineColored truth table embedded in sentence
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Logic Sentence
Example: Combine block
Performed extensive user testing (over 500 students,
kids, and adults) over two years
Most success
Frank Vahid, UC Rivers
ide
13/29
What's Hard (The Research Part) (3) Batteries must last years, yet
performance should appear continuous Blocks are off 99.9% of the time
time
f t f
(a)
(b)
(d)
(c)errorerror
< <
f tf f f< <
interpreted as
Developed theory to map eBlock events to continuous time
Developed custom CAD tool to automatically find the best block parameter settings out of the billions of possibilities
Frank Vahid, UC Rivers
ide
14/29
eBlocks Prototypes
>100 prototypes, size of deck of cards (trend: smaller) 2-3 years on 2 AA batteries (trend: longer) Can communicate via wire >1.5 miles, 150 ft wireless Integer blocks too
Frank Vahid, UC Rivers
ide
15/29
eBlocks Example "Garage Open at Night" detector <10 minutes to build
Need to indicate garage open at night – use LED block
LEDDetect night-time – use Light Sensor block
Light Sensor
Detect garage door open – use Contact Switch block
Magnetic Contact Switch
Plug pieces together and the system is
done!
Use Combine block to combine light sensor and contact switch into one
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Frank Vahid, UC Rivers
ide
16/29
Graphical Simulator
Welcome to the eBlocks Simulator! In this area, you’ll find helpful hints on creating your own designs.
Click and drag an eBlock off of the “Available eBlocks” panel to add it to your design.To connect two blocks, click and drag from an output port (colored circle) to an input port (gray circle).A connection can be destroyed by clicking on a connected port.To move a block around the workspace, click and drag its orange area.Blocks can be moved into the trash can to delete them.Green circles indicate that the port is sending a yes, red circles indicate that the port is sending a no, yellowCircles indicate that the port is sending an error signal, and gray circles denote an input port.
User specifies and tests block design
Java-based simulator User chooses
between pallets
Available eBlocks
Advanced ModeHide this panel
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Green/Red Light
Beeper
Output
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Available eBlocks
Advanced ModeHide this panel
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Green/Red Light
Beeper
Output
Available eBlocks
Advanced ModeHide this panel
Green/Red Light
Beeper
Output
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Frank Vahid, UC Rivers
ide
17/29
Graphical Simulator
Welcome to the eBlocks Simulator! In this area, you’ll find helpful hints on creating your own designs.
Click and drag an eBlock off of the “Available eBlocks” panel to add it to your design.To connect two blocks, click and drag from an output port (colored circle) to an input port (gray circle).A connection can be destroyed by clicking on a connected port.To move a block around the workspace, click and drag its orange area.Blocks can be moved into the trash can to delete them.Green circles indicate that the port is sending a yes, red circles indicate that the port is sending a no, yellowCircles indicate that the port is sending an error signal, and gray circles denote an input port.
User specifies and tests block design
Java-based simulator User chooses
between pallets Blocks added by
dragging
Available eBlocks
Advanced ModeHide this panel
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Green/Red Light
Beeper
Output
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Available eBlocks
Advanced ModeHide this panel
Green/Red Light
Beeper
Output
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Button
Frank Vahid, UC Rivers
ide
18/29
Graphical Simulator
Welcome to the eBlocks Simulator! In this area, you’ll find helpful hints on creating your own designs.
Click and drag an eBlock off of the “Available eBlocks” panel to add it to your design.To connect two blocks, click and drag from an output port (colored circle) to an input port (gray circle).A connection can be destroyed by clicking on a connected port.To move a block around the workspace, click and drag its orange area.Blocks can be moved into the trash can to delete them.Green circles indicate that the port is sending a yes, red circles indicate that the port is sending a no, yellowCircles indicate that the port is sending an error signal, and gray circles denote an input port.
User specifies and tests block design
Java-based simulator User chooses
between pallets Blocks added by
dragging
Available eBlocks
Advanced ModeHide this panel
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Green/Red Light
Beeper
Output
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Button
Light Sensor
Frank Vahid, UC Rivers
ide
19/29
Graphical Simulator
Welcome to the eBlocks Simulator! In this area, you’ll find helpful hints on creating your own designs.
Click and drag an eBlock off of the “Available eBlocks” panel to add it to your design.To connect two blocks, click and drag from an output port (colored circle) to an input port (gray circle).A connection can be destroyed by clicking on a connected port.To move a block around the workspace, click and drag its orange area.Blocks can be moved into the trash can to delete them.Green circles indicate that the port is sending a yes, red circles indicate that the port is sending a no, yellowCircles indicate that the port is sending an error signal, and gray circles denote an input port.
User specifies and tests block design
Java-based simulator User chooses
between pallets Blocks added by
dragging
Available eBlocks
Advanced ModeHide this panel
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Green/Red Light
Beeper
Output
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Button
Light Sensor
Available eBlocks
Advanced ModeHide this panel
Green/Red Light
Beeper
Output
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Frank Vahid, UC Rivers
ide
20/29
Graphical Simulator
Welcome to the eBlocks Simulator! In this area, you’ll find helpful hints on creating your own designs.
Click and drag an eBlock off of the “Available eBlocks” panel to add it to your design.To connect two blocks, click and drag from an output port (colored circle) to an input port (gray circle).A connection can be destroyed by clicking on a connected port.To move a block around the workspace, click and drag its orange area.Blocks can be moved into the trash can to delete them.Green circles indicate that the port is sending a yes, red circles indicate that the port is sending a no, yellowCircles indicate that the port is sending an error signal, and gray circles denote an input port.
User specifies and tests block design
Java-based simulator User chooses
between pallets Blocks added by
dragging
Available eBlocks
Advanced ModeHide this panel
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Green/Red Light
Beeper
Output
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Button
Light Sensor
Available eBlocks
Advanced ModeHide this panel
Green/Red Light
Beeper
Output
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Available eBlocks
Advanced ModeHide this panel
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Green/Red Light
Beeper
Output
Beeper
Frank Vahid, UC Rivers
ide
21/29
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Graphical Simulator
Welcome to the eBlocks Simulator! In this area, you’ll find helpful hints on creating your own designs.
Click and drag an eBlock off of the “Available eBlocks” panel to add it to your design.To connect two blocks, click and drag from an output port (colored circle) to an input port (gray circle).A connection can be destroyed by clicking on a connected port.To move a block around the workspace, click and drag its orange area.Blocks can be moved into the trash can to delete them.Green circles indicate that the port is sending a yes, red circles indicate that the port is sending a no, yellowCircles indicate that the port is sending an error signal, and gray circles denote an input port.
User specifies and tests block design
Java-based simulator User chooses
between pallets Blocks added by
dragging User is able to
configure various blocks by clicking on switches
Available eBlocks
Advanced ModeHide this panel
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Green/Red Light
Beeper
Output
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Button
Light Sensor
Available eBlocks
Advanced ModeHide this panel
Green/Red Light
Beeper
Output
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Available eBlocks
Advanced ModeHide this panel
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Green/Red Light
Beeper
Output
Beeper
Frank Vahid, UC Rivers
ide
22/29
Graphical Simulator
Welcome to the eBlocks Simulator! In this area, you’ll find helpful hints on creating your own designs.
Click and drag an eBlock off of the “Available eBlocks” panel to add it to your design.To connect two blocks, click and drag from an output port (colored circle) to an input port (gray circle).A connection can be destroyed by clicking on a connected port.To move a block around the workspace, click and drag its orange area.Blocks can be moved into the trash can to delete them.Green circles indicate that the port is sending a yes, red circles indicate that the port is sending a no, yellowCircles indicate that the port is sending an error signal, and gray circles denote an input port.
User specifies and tests block design
Java-based simulator User chooses
between pallets Blocks added by
dragging User is able to
configure various blocks by clicking on switches
Connections created by drawing lines between blocks
Available eBlocks
Advanced ModeHide this panel
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Green/Red Light
Beeper
Output
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Button
Light Sensor
Available eBlocks
Advanced ModeHide this panel
Green/Red Light
Beeper
Output
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Available eBlocks
Advanced ModeHide this panel
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Green/Red Light
Beeper
Output
Beeper
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Frank Vahid, UC Rivers
ide
23/29
Graphical Simulator
Welcome to the eBlocks Simulator! In this area, you’ll find helpful hints on creating your own designs.
Click and drag an eBlock off of the “Available eBlocks” panel to add it to your design.To connect two blocks, click and drag from an output port (colored circle) to an input port (gray circle).A connection can be destroyed by clicking on a connected port.To move a block around the workspace, click and drag its orange area.Blocks can be moved into the trash can to delete them.Green circles indicate that the port is sending a yes, red circles indicate that the port is sending a no, yellowCircles indicate that the port is sending an error signal, and gray circles denote an input port.
User specifies and tests block design
Java-based simulator User chooses
between pallets Blocks added by
dragging User is able to
configure various blocks by clicking on switches
Connections created by drawing lines between blocks
User can create, experiment, test and configure design
Available eBlocks
Advanced ModeHide this panel
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Green/Red Light
Beeper
Output
Motion Sensor
Yes/No
Button
Light Sensor
SensorsLight
Sensor
Available eBlocks
Advanced ModeHide this panel
Green/Red Light
Beeper
Output
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Available eBlocks
Advanced ModeHide this panel
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Green/Red Light
Beeper
Output
Beeper
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Light Sensor
Button
Frank Vahid, UC Rivers
ide
24/29
Graphical Simulator
Welcome to the eBlocks Simulator! In this area, you’ll find helpful hints on creating your own designs.
Click and drag an eBlock off of the “Available eBlocks” panel to add it to your design.To connect two blocks, click and drag from an output port (colored circle) to an input port (gray circle).A connection can be destroyed by clicking on a connected port.To move a block around the workspace, click and drag its orange area.Blocks can be moved into the trash can to delete them.Green circles indicate that the port is sending a yes, red circles indicate that the port is sending a no, yellowCircles indicate that the port is sending an error signal, and gray circles denote an input port.
User specifies and tests block design
Java-based simulator User chooses
between pallets Blocks added by
dragging User is able to
configure various blocks by clicking on switches
Connections created by drawing lines between blocks
User can create, experiment, test and configure design
Available eBlocks
Advanced ModeHide this panel
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Green/Red Light
Beeper
Output
Motion Sensor
Yes/No
Button
Light Sensor
SensorsLight
Sensor
Available eBlocks
Advanced ModeHide this panel
Green/Red Light
Beeper
Output
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Available eBlocks
Advanced ModeHide this panel
Compute/Communications
Prolonger
1 2 3 4 5 6 7 8 9
seconds
Once Yes, Stays Yes
rst
in
Toggle
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Motion Sensor
Yes/No
Button
Light Sensor
Sensors
Green/Red Light
Beeper
Output
Beeper
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Light Sensor
Button
Frank Vahid, UC Rivers
ide
25/29
Related Uses – Embedded System Development with Sensors Can greatly
simplify coding and reduce development time
Interface to PC, cell phone, PDA also possible e.g., Front-end to
smart home system
Button yes/no
Light Sensor yes/no 1/0
1/0 Micro-
processor
Frank Vahid, UC Rivers
ide
26/29
Other Uses – Sensor Network Front-End
Front end to existing/evolving sensor network nodes (e.g., motes)
Motion Sensor
Motion Sensor
Combine
AND OR
yes no
When A is yes no
B is
then the output is yes
Mote
Frank Vahid, UC Rivers
ide
27/29
Use virtual blocks in graphical simulator to describe desired sensor system behavior Intuitive due to spatial emphasis, not temporal emphasis
Automatically compile to code on programmable eBlocks
eBlocks as a Programming Paradigm
Programmable eBlocksPartitions
Frank Vahid, UC Rivers
ide
28/29
eBlock Tool Generates Code Tool generates C code
automatically#include <pic.h>#include “sci.h”
#include “io.h”
#include “constants.h”
Unsigned char data_val = ERROR;
...
main(void) {
unsigned I, j;
TRISB = 0;
...
}
main(void) {
ORTA = 0xff;
CMCON = 0x07;
TRISA = 0x00;
TRISB = 0x02;
asm("CLRWDT");
...
}
C Code
Download code to block with click of a button Ordinary users can “write” programs in
minutes Spatial vs. temporally-oriented language
20 high school graduates: eBlocks (spatial) vs. LEGO Mindstorms (temporal), 6 example systems, 40 minutes to build
Programmable eBlock
TypeAverage Success
Rate
Mindstorms 0%
eBlocks 54%
Frank Vahid, UC Rivers
ide
29/29
Summary and Current Focus eBlocks enable large segment of
population to build customized sensor systems themselves
Current focus – Applications Hearing/vision impaired – customize homes Aging at-home parents – privacy-respecting
monitoring (live at home longer) Middle school kids – excite them about
engineering Univ. of Arizona also researching education aspect
Engineering – fast prototypes Patent pending, likely to be commercialized
in next 5 years