e Blocks Electronic Building Blocks for SensorBased Systems
e. Blocks – Electronic Building Blocks for Sensor-Based Systems Frank Vahid Professor Dept. of Computer Science and Engineering University 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 (Ph. D 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 Riverside
The Problem n What do these problems all have in common? A small store owner wishing to track employees – are they in the storeroom, breakroom, or out back – or customers A working adult with an ageing parent at home – did she get out of bed today, is she moving around? An aunt with a visiting niece who sleepwalks, worried the niece will leave the house or get hurt Frank Vahid, UC Riverside 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 2
The Problem n What do these problems all have in common? Put motion and sound sensors throughout, small LEDs (lights) near cash register 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 Place motion, heat, and sound sensors in rooms, halls, doorways Put motions sensors around the house, connected to a beeper next to the bed Frank Vahid, UC Riverside Install contact sensor and light sensor, and indicator next to the bed 3
Why Can’t We Just Do This? n Widely usable “Lego”-like sensors don’t exist today n n transmit n AND receive light sensor Frank Vahid, UC Riverside contact switch LED n Costly, hard to use, plugged into wall smarthome. com (x 10. org). . . But new technology makes Lego-like sensor blocks possible. . . 4
Shrinking Processor Size/Cost Enables New Solution Frank Vahid, UC Riverside 5
Shrinking Processor Size/Cost Enables New Solution 3 yrs 6 yrs 9 yrs 12 yrs 15 yrs n Moore’s Law also means chips can be SHRUNK n n 1980 – 10, 000 transistors about 1 sq cm (fingernail) Today – size of a spec of dust Frank Vahid, UC Riverside 6
Shrinking Processor Size/Cost Enables New Solution Courtesy of Joe Kahn n http: //www. templehealth. org Make sensors smarter n By adding processor+battery n n Today, tiny and cheap Becomes a "block" easily connected to other blocks Frank Vahid, UC Riverside 7
Shrinking Processor Size/Cost Enables New Solution – e. Blocks Existing component view New "e. Block" view yes/no Button Light Sensor yes/no Magnetic Contact Switch yes/no LED yes/no Beeper yes/no Electric Relay Frank Vahid, UC Riverside 8
e. Blocks n Just connect blocks, and they work n No programming knowledge, no electronics knowledge Frank Vahid, UC Riverside Button yes/no Light Sensor yes/no Beeper LED 9
e. Blocks n Add intermediate blocks that compute and maintain state n Spatial programming – more intuitive to non-CS people than temporal programming Light Button Toggle Beeper Sensor When A is yes no AND B is OR yes no then the output is yes Combine Light Sensor Tripper LED 123456789 Button LED Frank Vahid, UC Riverside Prolong 10
What's Hard (The Research Part) n (1) Finding right set of building blocks Too many – Overwhelming (too much choice) Too few – Overwhelming (too much configuration) Splitter Toggle 2 -Input Logic Splitter Tripper 3 -Input Logic 123456789 Splitter When A is 2 Prolong (short) When A is yes no AND B is OR Combine Frank Vahid, UC Riverside AND B is OR then the output is yes 4 5: Splitter Prolong (long) 6: . . . 1 2 3 4 5 6 7 8 9 yes no then the output is yes no 3 123456789 4 -Input Logic 123456789 1 2 Yes detector 2 No detector Super. Block 11
What's Hard (The Research Part) (2) Making the blocks understandable People NOT likely to read directions n Combine n Those that do are unlikely to understand Performed extensive user testing (over 500 students, kids, and adults) over two years Example: Combine block B A yes no: A is yes, B is yes A is yes, B is no A is no, B is yes A is no, B is no The output should be yes when: n Phrased truth table A B no no yes yes no A B A is yes, B is yes When the A is yes, B is no the output input is A is no, B is yes should be A is no, B is no out Combine Output no no Logic Block yes yes configurable DIP switch Phrased truth table embedded in sentence A When the A A input is A A yes no B B The output B B should be B out Combine Colored truth table embedded in sentence Most success When A is Frank Vahid, UC Riverside yes no AND B is yes no OR then the output is yes Combine Logic Sentence 12
What's Hard (The Research Part) n (3) Batteries must last years, yet performance should appear continuous n Blocks are off 99. 9% of the time (a) Developed theory to map e. Block events to continuous time (b) f Frank Vahid, UC Riverside (d) f < (c) Developed custom CAD tool to automatically find the best block parameter settings out of the billions of possibilities t error < f interpreted as < < f t f f 13
e. Blocks n Prototypes n n >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 Riverside 14
e. Blocks Example n n "Garage Open at Night" detector <10 minutes to build Light Sensor Detect night-time – use Light Sensor block Magnetic Contact Switch When A is yes no AND B is OR yes no then the output is yes LED Need to indicate garage open at night – use LED block Combine Use Combine block to combine light sensor and contact switch into one Detect garage door open – use Contact Switch block Plug pieces together and the system is done! Frank Vahid, UC Riverside 15
Graphical Simulator w w User specifies and tests block design Java-based simulator n User chooses between pallets Available e. Blocks Sensors Output Compute/Communications When A is Button Beeper yes no AND B is OR yes no then the output is yes Motion Sensor. Combine Green/Red Light rs t in Light Sensor Once Yes, Stays Yes Toggle Yes/No 12345678 9 seconds Prolonger Hide this panel Advanced Mode Welcome to the e. Blocks Simulator! In this area, you’ll find helpful hints on creating your own designs. Click and drag an e. Block off of the “Available e. Blocks” 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, yellow Circles indicate that the port is sending an error signal, and gray circles denote an input port. Frank Vahid, UC Riverside 16
Graphical Simulator w w User specifies and tests block design Java-based simulator n n User chooses between pallets Blocks added by dragging Available e. Blocks Sensors Output Compute/Communications Button When A is Beeper yes no AND B is OR yes no then the output is yes Motion Sensor. Combine Green/Red Light rs t in Light Sensor Once Yes, Stays Yes Toggle Yes/No 12345678 9 seconds Prolonger Hide this panel Advanced Mode Welcome to the e. Blocks Simulator! In this area, you’ll find helpful hints on creating your own designs. Click and drag an e. Block off of the “Available e. Blocks” 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, yellow Circles indicate that the port is sending an error signal, and gray circles denote an input port. Frank Vahid, UC Riverside 17
Graphical Simulator w w User specifies and tests block design Java-based simulator n n User chooses between pallets Blocks added by dragging Available e. Blocks Sensors Output Compute/Communications Button When A is Button Beeper yes no AND B is OR yes no then the output is yes Motion Sensor. Combine Green/Red Light rs t in Light Sensor Once Yes, Stays Yes Toggle Yes/No 12345678 9 seconds Prolonger Hide this panel Advanced Mode Welcome to the e. Blocks Simulator! In this area, you’ll find helpful hints on creating your own designs. Click and drag an e. Block off of the “Available e. Blocks” 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, yellow Circles indicate that the port is sending an error signal, and gray circles denote an input port. Frank Vahid, UC Riverside 18
Graphical Simulator w w User specifies and tests block design Java-based simulator n n User chooses between pallets Blocks added by dragging Available e. Blocks Light Sensor Button Sensors Output Compute/Communications When A is Button Beeper yes no AND B is OR yes no then the output is yes Motion Sensor. Combine Green/Red Light rs t in Light Sensor Once Yes, Stays Yes Toggle Yes/No 12345678 9 seconds Prolonger Hide this panel Advanced Mode Welcome to the e. Blocks Simulator! In this area, you’ll find helpful hints on creating your own designs. Click and drag an e. Block off of the “Available e. Blocks” 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, yellow Circles indicate that the port is sending an error signal, and gray circles denote an input port. Frank Vahid, UC Riverside 19
Graphical Simulator w w User specifies and tests block design Java-based simulator n n User chooses between pallets Blocks added by dragging Available e. Blocks Sensors Output Compute/Communications Light Sensor When A is Button Beeper Button yes no AND B is OR yes no then the output is yes When A is yes no AND B is OR yes no then the output is yes Combine Motion Sensor. Combine Green/Red Light rs t in Light Sensor Once Yes, Stays Yes Toggle Yes/No 12345678 9 seconds Prolonger Hide this panel Advanced Mode Welcome to the e. Blocks Simulator! In this area, you’ll find helpful hints on creating your own designs. Click and drag an e. Block off of the “Available e. Blocks” 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, yellow Circles indicate that the port is sending an error signal, and gray circles denote an input port. Frank Vahid, UC Riverside 20
Graphical Simulator w w User specifies and tests block design Java-based simulator n n n User chooses between pallets Blocks added by dragging User is able to configure various blocks by clicking on switches Available e. Blocks Sensors Output Compute/Communications Light Sensor When A is Button Beeper Button yes no AND B is OR yes no then the output is yes When A is yes no AND B is OR yes no then the output is yes Combine Motion Sensor. Combine Green/Red Light Beeper rs t in Light Sensor Once Yes, Stays Yes Toggle Yes/No 12345678 9 seconds Prolonger Hide this panel Advanced Mode Welcome to the e. Blocks Simulator! In this area, you’ll find helpful hints on creating your own designs. Click and drag an e. Block off of the “Available e. Blocks” 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, yellow Circles indicate that the port is sending an error signal, and gray circles denote an input port. Frank Vahid, UC Riverside 21
Graphical Simulator w w User specifies and tests block design Java-based simulator n n 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 e. Blocks Sensors Output Compute/Communications Light Sensor When A is Button Beeper Button yes no AND B is OR yes no then the output is yes When A is yes no AND B is OR yes no then the output is yes Combine Motion Sensor. Combine Green/Red Light Beeper rs t in Light Sensor Once Yes, Stays Yes Toggle Yes/No 12345678 9 seconds Prolonger Hide this panel Advanced Mode Welcome to the e. Blocks Simulator! In this area, you’ll find helpful hints on creating your own designs. Click and drag an e. Block off of the “Available e. Blocks” 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, yellow Circles indicate that the port is sending an error signal, and gray circles denote an input port. Frank Vahid, UC Riverside 22
Graphical Simulator w w User specifies and tests block design Java-based simulator n n n 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 e. Blocks Sensors Output Compute/Communications Light Sensor When A is Button Beeper Button yes no AND B is OR yes no then the output is yes When A is yes no AND B is OR yes no then the output is yes Combine Motion Sensor. Combine Green/Red Light Beeper rs t in Light Sensor Once Yes, Stays Yes Toggle Yes/No 12345678 9 seconds Prolonger Hide this panel Advanced Mode Welcome to the e. Blocks Simulator! In this area, you’ll find helpful hints on creating your own designs. Click and drag an e. Block off of the “Available e. Blocks” 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, yellow Circles indicate that the port is sending an error signal, and gray circles denote an input port. Frank Vahid, UC Riverside 23
Graphical Simulator w w User specifies and tests block design Java-based simulator n n n 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 e. Blocks Sensors Output Compute/Communications Light Sensor When A is Button Beeper Button yes no AND B is OR yes no then the output is yes When A is yes no AND B is OR yes no then the output is yes Combine Motion Sensor. Combine Green/Red Light Beeper rs t in Light Sensor Once Yes, Stays Yes Toggle Yes/No 12345678 9 seconds Prolonger Hide this panel Advanced Mode Welcome to the e. Blocks Simulator! In this area, you’ll find helpful hints on creating your own designs. Click and drag an e. Block off of the “Available e. Blocks” 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, yellow Circles indicate that the port is sending an error signal, and gray circles denote an input port. Frank Vahid, UC Riverside 24
Related Uses – Embedded System Development with Sensors n n Can greatly simplify coding and reduce development time Interface to PC, cell phone, PDA also possible n Button yes/no 1/0 Microprocessor Light Sensor yes/no 1/0 e. g. , Front-end to smart home system Frank Vahid, UC Riverside 25
Other Uses – Sensor Network Front-End n Front end to existing/evolving sensor network nodes (e. g. , motes) Motion Sensor When A is Motion Sensor yes no AND B is OR yes no then the output is yes Combine Mote Frank Vahid, UC Riverside 26
e. Blocks as a Programming Paradigm n Use virtual blocks in graphical simulator to describe desired sensor system behavior n n Intuitive due to spatial emphasis, not temporal emphasis Automatically compile to code on programmable e. Blocks Partitions Frank Vahid, UC Riverside Programmable e. Blocks 27
e. Block Tool Generates Code n Tool generates C code automatically C Code #include <pic. h> #include “sci. h” main(void) { #include “io. h” ORTA = 0 xff; #include “constants. h” CMCON = 0 x 07; Unsigned char data_val = ERROR; TRISA = 0 x 00; . . . TRISB = 0 x 02; main(void) { asm("CLRWDT"); unsigned I, j; TRISB = 0; . . . } n n . . . } Programmable e. Block Download code to block with click of a button n Ordinary users can “write” programs in minutes Spatial vs. temporally-oriented language n 20 high school graduates: e. Blocks (spatial) vs. LEGO Mindstorms (temporal), 6 example systems, 40 minutes to build Frank Vahid, UC Riverside Type Average Success Rate Mindstorms 0% e. Blocks 54% 28
Summary and Current Focus n n e. Blocks enable large segment of population to build customized sensor systems themselves Current focus – Applications n n n Hearing/vision impaired – customize homes Aging at-home parents – privacy-respecting monitoring (live at home longer) Middle school kids – excite them about engineering n n n Univ. of Arizona also researching education aspect Engineering – fast prototypes Patent pending, likely to be commercialized in next 5 years Frank Vahid, UC Riverside 29
- Slides: 29