First Results with e Blocks Embedded Systems Building
First Results with e. Blocks: Embedded Systems Building Blocks Susan Cotterell, Frank Vahid*, Walid Najjar and Harry Hsieh Department of Computer Science and Engineering University of California, Riverside *Also with the Center for Embedded Computer Systems at UC Irvine http: //www. cs. ucr. edu/~vahid This work is being supported by the National Science Foundation and a Department of Education GAANN Fellowship Frank Vahid, UC Riverside 1
Introduction – A Typical Problem Garage door left open at night Oops! Frank Vahid, UC Riverside 2
Introduction – Solution: Simple Embedded System n Blink LED in the bedroom if garage door is open at night n n Homeowner sees LED before sleep Components needed n n n Light sensor Contact switch Logic (no light AND switch open) Wireless transmitter Wireless receiver LED rx tx AND light contact sensor switch Frank Vahid, UC Riverside 3
Introduction – Solution is not so easy n Find components n n Parts catalogs, from different vendors, many varieties, intended for specialists Read datasheets to understand components n 10’s to 100’s of pages, intended for specialists no “light sensor” listing, it’s a photoresistor How does transmitter/receiver work? Who does encoding/decoding? What does the encoding look like? Timing Issues? Use a wireless tx/rx or a transceiver? Do we need a antenna or amplifier? Which MHz can we use given FCC regulations? What are the connections – ground, power, data, address? What does the instruction set look like? Which pins/ports can I use? How do I specify if a pin is output or input? What are the connections – power, ground, data transmitted, data received, interface to hardware? 4 Frank Vahid, UC Riverside
Introduction – Solution is not so easy n Program microcontrollers n n n Hardware n n n Software Tool Interfacing/communication Debug Breadboard or PCB Debug Other Issues. . . n n Battery drains in 2 days Need packets - requires networking skills How do I program the PIC? Which compilers can I use? How do I download/install/configure the tools? How do I interface with other components? How do I debug my program if it doesn’t work? How do I read a schematic? My circuit doesn’t work, now what? How do I use a multimeter or logic analyzer to debug a circuit? How do I test the circuit to ensure correctness? Am I missing other components – voltage regulators, capacitors, resistors? Frank Vahid, UC Riverside 5
Introduction – Solution is not so easy n We gave this as a project in an upper-division embedded systems university course, several years in a row n n Overall, 50 students attempted the project n Only 20 completed the project Problems n n Three week project Students already took courses, from various universities, involving digital design, microcontrollers, electronics, and interfacing with sensors/displays Misunderstanding (or vague) data sheets Interfacing errors Debugging difficulties Completed 29% Not Completed 71% No way a regular person could build this seemingly simple, useful system Frank Vahid, UC Riverside 6
Introduction – Not Just Garage Doors n Home monitoring n n Inventory n n Proximity doorbell (carpoolers), temporary building usage, silent doorbells, customer detection Logging/tracking applications n n Hard of hearing (vibration when sound), vision impaired, object locators “Doorbell” type applications n n Restaurants, storehouses Assistance for disabled n n Garage door open, side fence open, visitor at front door, pool occupied Log temperature, humidity, customer traffic, car speeds Ad-hoc security Voting systems Countless more applications that today either don’t exist, or are too costly n Low volume, or custom designed Frank Vahid, UC Riverside 7
Introduction – Solution: Mass-produced easy-touse monitor/control system building blocks n Shrinking processor cost and size enables new solution n Put intelligence in every sensor, in every output device, etc. n Proposed solution n n Getting awfully small. . . Courtesy of Joe Kahn light sensor Define matchbox-sized building blocks with accompanying standards, protocols, etc. n “Smart dust” Easily connected, no programming/electronics experience, battery powered Like connecting LEGOs contact switch light sensor LED light sensor tx light sensor logic LED logic rx tx rx Frank Vahid, UC Riverside tx LED 8
Design Issues n Categories of blocks n Sensors, Outputs, Communication, Logic/Timing n n Presently about 10 items in each category n n n Presently Boolean only (yes/no); now extending to integers Enough to build huge variety of systems Working iteratively with users to refine and create new blocks Definition of compute and communicate protocols n n Main constraints: good response, but 2 -3 year battery Everything is inter-related, difficult problem n n Traditional separation of concerns (compute/comm. , and networking layers) too inefficient Need tools to automate exploration Frank Vahid, UC Riverside 9
Defining Basic e. Blocks – Partial Catalog e. Block Diagram Magnetic Contact Switch Light Sensor Button yes/no LED yes/no Splitter Toggle 2 -Input Logic Block yes/no Interface Determines when contact between two sensors is made. yes = contact between sensors no = no contact between sensors Sensor detects presence of light. yes = light detected no = no light detected Indicates whether button is pressed or not. yes = button pressed no = button not pressed Device blinks a light when input is a yes. Device emits no light when input is no. yes = blink LED no = turn LED off Device receives a signal and replicates that signal on each output. yes = output yes signal no = output no signal An input of yes toggles (inverts) the current value outputted by the device. yes = toggle previous output value no = do nothing Configurable logic block programmed by the user via DIP switch. For each of the possible outcomes of a and b, there is a corresponding switch which can be set so the resulting output is a yes or no for that particular combination. yes/no Button Description Splitter LED yes/no Toggle yes/no 2 -Input Logic Frank Vahid, UC Riverside 10
Defining Basic e. Blocks – How to Implement Logic? n Logic to detect motion at night n n n Motion sensor output A = yes, light sensor output B = no Motion at night = A AND (NOT B) = A * B’ Equations too hard for regular person, plus how to enter it? In general, regular people very weak with logic From motion sensor A From light sensor B Can’t create unique e. Block for every unique 2 -input logic function Create one 2 -input logic block n n n User must configure that block Solution: print truth table on block, user sets switches for each possible input Not ideal, but sufficient for now Frank Vahid, UC Riverside A B no no yes Logic Output no no yes yes 11
Building e. Blocks Systems n Build the Garage Door Open at Night System Using e. Blocks We want to detect night – use light sensor Light Sensor yes/no Magnetic Contact Switch Configure Logic Block to turnsomething to indicate Need led on when it’s night and garage open at night – use when door is open led yes/no LED 2 -Input Logic yes/no We want to know if garage door open – use contact switch Need a function of light sensor output and contact switch output – use Logic Block Plug pieces together and the system is done! Frank Vahid, UC Riverside 12
Current Status: Working Prototypes Garage Door Open at Night (wired solution) Light Sensor Outside Magnetic Contact Switch At garage door LED 2 -Input Logic Inside house Garage Door Open at Night (wireless solution) Light Sensor Outside Magnetic Contact Switch wireless TX 2 -Input Logic wireless RX LED Inside house At garage door Frank Vahid, UC Riverside 13
e. Block System Implementations n Cafeteria Food Alert LED Splitter 2 -Input Logic Toggle Button Service Line Kitchen Frank Vahid, UC Riverside 14
Battery Lifetimes n n n Off the shelf 9 V battery Power down PIC when it is idle Use sampling techniques to reduce HW energy cost e. Blocks Energy/day (J/day) Lifetime PIC HW Button 2. 722 0 20 years Light Sensor 2. 722 44. 5 1 year LED 2. 678 14. 4 3 years Green/Red LED 2. 678 28. 8 2 years Beeper 2. 678 27 2 years 2 -Input Logic Block 2. 766 0 19 years Toggle 2. 722 0 20 years Prolonger 2. 722 0 20 years Frank Vahid, UC Riverside 15
e. Block Design Experiment n Gave garage door project in embedded systems course n n 3 -page e. Block catalog that included basic examples (30 minutes to read) All 22 students successfully designed the system n n In less than one hour Students built numerous additional designs during remaining two hours Completed 29% Completed 100% Not Completed 71% Without e. Blocks, and 3 weeks With e. Blocks, 1 hour Frank Vahid, UC Riverside 16
Conclusions and Future Work n e. Blocks n Can be used by regular people to construct useful class of embedded systems n n Can be mass produced to be cost effective Boolean e. Block prototypes shown to be effective Essentially creating higher-level digital components n n n Illusion of continuous time, but event-based packet network underneath Only recently made possible due to low-cost, low-power, tiny processors Will be useful with complementary efforts n Intelligent homes, UPn. P, IEEE smart sensor standard n n All need sensors that people can actually use Sensor networks n n No programming or electronics experience Can serve as basic sensor input system (most research focuses on networking infrastructure) Future work n n n Timing model definition; wireless protocol definition; power sharing methods Extend to integer e. Blocks, with arithmetic blocks too; Usage experience Automatic synthesis of e. Block systems from specifications Optimization of e. Block systems; use of e. Blocks as a form of spatial programming e. Blocks for those with programming experience Frank Vahid, UC Riverside 17
- Slides: 17