Implementation of a Low-­‐Cost Device to Prevent Brownouts in Village Micro-­‐Hydro Systems

by

Thomas Quetchenbach

A Project

Presented to

The Faculty of Humboldt State University

In Partial Fulfillment

Of the Requirements for the Degree

Master of Science

In Environmental Systems:

Environmental Resources Engineering Option

August, 2011 Abstract

Implementation of a Low-­‐Cost Smart Grid Device to Prevent Brownouts in Village Micro-­‐ Hydro Systems

Thomas Quetchenbach

Brownouts are a common problem in micro-­‐hydro mini-­‐grid systems due to the limited supply of power and the difficulty of restricting usage. The GridShare is a device designed to alleviate brownouts by limiting peak power and encouraging load-­‐shifting to off-­‐peak times. The device is installed at each household’s electrical service entrance and measures voltage and current consumption. Indicator lights inform the customer whether a brownout is occurring; if the customer attempts to use large appliances, such as rice cookers, during a brownout, the GridShare disconnects power to the house until appliance is turned off. The objective of this master’s degree project was to advance the design of the GridShare device from a to a production design ready for small-­‐ scale manufacturing and to manufacture, assemble, and test enough GridShare devices to perform an installation in the village of Rukubji, Bhutan. Based on our testing and a field visit by the GridShare team in June 2010, several changes were made to the circuit design, and several prototype devices were built. To enable the production of 120 GridShare devices, a was designed, allowing automated fabrication and assembly. A comprehensive testing protocol was developed to evaluate the device’s ability to withstand the electrical and environmental conditions at the installation site, including exposure to low voltage and frequency and low and high ambient temperatures. The final version of the GridShare passed all tests; 120 devices were manufactured, shipped to Bhutan, and installed in Rukubji in June 2011. Further work will be needed to assess effectiveness and user satisfaction.

ii Acknowledgments

Funding for the GridShare project was provided by a grant from the United States Environmental Protection Agency’s People, Prosperity, and the Planet (P3) program. My participation in the project was made possible by a fellowship from the National Science Foundation (Award #1011464) through the Division of Graduate Education. In addition, sponsorships from Sunstone Circuits, Screaming Circuits, and Industrial Electric in Arcata helped make the GridShare a reality. The Schatz Energy Research Center provided financial and administrative support as well as laboratory space and machine shop services. The GridShare project would not have been possible without the help of so many people that it is impossible to name them all. Special credit goes to my supervisory committee, which consisted of Dr. Eileen Cashman, who provided invaluable assistance in writing this report and navigating uncharted waters of administrative paperwork; Dr. Peter Lehman, who also served as a faculty mentor to the GridShare team and was instrumental in keeping the project on track; and Dr. Charles Chamberlin, whose high standards for technical writing helped prepare me for this project. In addition, special thanks are due to Dr. Arne Jacobson for getting me involved with this project and for taking time from his busy schedule while on sabbatical to continue to provide the group with valuable advice. I extend special gratitude to James Apple for laying the groundwork for my project; to Meg Harper for her organizational skills, motivation, and encouragement; to Kyle Palmer for his technical expertise; and to Nathan Chase and James Robinson for their enthusiasm and dedication. Thanks are due to Kirstin Hervin for her excellent work on the educational materials and help with assembly, as well as to the many people who helped with assembly and testing, including but not limited to Kristen Radecsky, Zachary Stanko, Mark Rocheleau, and Rowan Beckensten. I would also like to thank Allison Oakland, Carolyn Ortenberger, and Alina Taalman for their efficient handling of finances, purchasing, and administrative paperwork, as well as the rest of the staff of the Schatz Energy Research Center for their support, encouragement, and advice. The project would not have happened without our in-­‐ country contact, Chhimi Dorji, who was essential in our communications with Bhutanese corporations and the Bhutanese government and in arranging our travel, or without the support of the Bhutan Power Corporation and the Bhutan Department of Energy. Rick Mayberry provided the group with valuable technical oversight and advice. Last-­‐minute packing assistance from Jessica, Chris, and the rest of the team at Post Haste in Arcata was also greatly appreciated. I would also like to extend special thanks to everyone who assisted us with our installation efforts in Bhutan, including Chhejay Wangdi and his staff at BPC Electricity Services Division Wangdue Phodrang office, who did excellent work and helped us finish the installations ahead of schedule, and to Phub Gyeltshen and the people of Rukubji for their incredible hospitality.

Finally, I would like to thank Shilo for her assistance with proofreading and for her constant support and encouragement and for her willingness to not only put up with me during this process but to get married to me at the end of it.

iii Table of Contents

Chapter 1. Introduction and Background ...... 1 1.1. Introduction ...... 1 1.2. Project Site ...... 1 1.3. Micro-­‐Hydro overview ...... 2 1.4. Mini-­‐grids ...... 3 1.5. Mini-­‐Grids and Brownouts ...... 4 1.6. Micro-­‐Hydro in Bhutan ...... 5 1.7. Rukubji Micro-­‐Hydro System ...... 6 1.8. The Brownout Problem in Rukubji ...... 9 1.9. Cooking and Appliance Usage ...... 10 1.10. House wiring in Rukubji ...... 10 1.11. Project History and People ...... 11 Chapter 2. GridShare Circuit Design ...... 12 2.1. First ...... 12 2.2. GridShare Installation Options ...... 13 2.3. Design criteria ...... 14 2.4. Changes Identified by GridShare Team ...... 15 2.5. Voltage regulator selection ...... 16 2.6. upgrade ...... 16 2.7. Relay upgrade ...... 17 2.8. Current transformer change ...... 17 2.9. Frequency measurement ...... 17 2.10. Circuit protection ...... 18 2.11. Software changes ...... 19 2.12. PCB design and construction ...... 24 2.13. Prototypes ...... 26 2.14. Enclosure design, wiring, and termination ...... 28 2.15. Assembly ...... 29 Chapter 3. Testing ...... 31 3.1. Introduction ...... 31 3.2. Operating Conditions in Bhutan ...... 31 3.3. Calibration ...... 33

iv 3.4. Electrical and Functional Tests ...... 37 3.5. Environmental tests ...... 44 3.6. Results ...... 46 3.7. Tests not performed ...... 52 Chapter 4. Installation and Conclusions ...... 54 4.1. Results of Final Testing and Assembly ...... 54 4.2. Installation ...... 54 4.3. Reported Problems ...... 57 4.4. Next Steps ...... 57 4.5. GridShare and the Smart Grid ...... 58 4.6. Applicability to Other Situations ...... 58 References ...... 60 Appendix A. GridShare Technical Manual ...... 64 Appendix B. GridShare Specifications ...... 78 Appendix C. Parts List with Prices ...... 79 Appendix D. Construction and Prototyping ...... 82 Appendix E. Function generator interface circuit ...... 88

v List of Figures

Figure 1.1. Turbine (rear) and generator (front) in Rukubji powerhouse. Photo by Meg Harper...... 6 Figure 1.2. Rukubji distribution system map; red lines are 6.6 kV medium-­‐voltage; blue lines are 230 V...... 8 Figure 1.3. Distribution substation in the Rukubji mini-­‐grid. 6.6 kV lines are at the top of pole; the transformer is on the bottom shelf. Photo by Meg Harper...... 9

Figure 1.4. Typical service entrances in Rukubji with fuses (top) and MCBs (bottom) Photos by Meg Harper...... 11

Figure 2.1. Block diagram of original GridShare prototype circuit...... 12 Figure 2.2. 115 V GridShare prototype with CFL test load. Photo by James Apple...... 13 Figure 2.3. Three GridShare installation scenarios. (Adapted from diagram by James Apple.) ...... 14 Figure 2.4. Frequency dependence of current measurement at approximately 460 mA...... 18 Figure 2.5. GridShare state diagram...... 20

Figure 2.6. PCB assembly price quotes (as of July 21, 2011) from Screaming Circuits for a range of hybrid surface-­‐mount and through-­‐hole designs. Parameters: 30 component placements, 21 distinct component types, order of 120 boards...... 24 Figure 2.7. Manually routing PCB traces in EAGLE. The yellow lines ("airwires") indicate connections that have not yet been made; the red lines are traces that have been routed...... 25

Figure 2.8. Printed circuit board layout; high-­‐current traces are on the left side. Red areas are on the top of the board, blue is on the bottom, and green is on both sides. The large blue area on the right is the ground plane...... 26 Figure 2.9. PCB prototype enclosure with production board (version 1.0) installed...... 27

Figure 2.10. GridShare enclosure...... 28 Figure 2.11. Spanner-­‐head security screw...... 29 Figure 3.1. Histogram of voltage measurements at Rukubji powerhouse from July 2010 to January 2011, with 5-­‐minute resolution...... 33 Figure 3.2. Measurement apparatus wiring diagram for frequency response calibration. (Note that unless oscilloscope has isolated ground, oscilloscope ground must be connected to function generator ground as shown.) ...... 37

vi Figure 3.3. Test setup for multiple GridShares...... 40 Figure 3.4. GridShare test station. Terminal blocks for GridShare cables are on the left; receptacles for loads are on the right...... 41 Figure 3.5. Results of voltage calibration...... 46 Figure 3.6. Relationship between AC input and DC output voltage, showing extrapolation to maximum rated voltage regulator input...... 47 Figure 3.7. Current calibration curve with selectable-­‐gain amplifier set to 10x gain. Red points are in the nonlinear region and were not included in the linear regression...... 48 Figure 3.8. Current calibration curve with selectable-­‐gain amplifier set to unity (1x) gain, showing piecewise linear fit. Blue points are outside of the calibrated current range. 48 Figure 3.9. Error in current measurement due to variation in frequency, with a transformed version of the linear regression from Figure 3.10 for reference...... 49 Figure 3.10. Current transformer frequency response calibration curve, in the form used by the GridShare software...... 49 Figure 3.11. Infrared thermal image of prototype board (left) and production board (right) with same temperature scale (units of °C)...... 50 Figure 3.12. Temperature profile of high-­‐temperature test; noise in temperature measurement is due to interference from power and data cables...... 51 Figure 3.13. Temperature profile of second low-­‐temperature test; first 25 hours shown. ... 52 Figure 3.14. Temperature variation of oscillator period at low temperatures. Noise in temperature measurement is a result of electrical interference from power and data cables...... 52

Figure 4.1. Voltage and frequency during an evening brownout, June 18, 2011...... 56 Figure 4.2. Comparison of voltage measurements from GridShare and HOBO datalogger during the brownout of Figure 4.1...... 56 Figure A.1. GridShare functional block diagram...... 64 Figure A.2. GridShare circuit diagram...... 65 Figure A.3. Transformer and rectifier...... 66

Figure A.4. Operation of bridge rectifier and smoothing , in a simple model that ignores the forward voltage drop of the bridge rectifier diodes. The red and green lines show the output of the rectifier without without and with the capacitor...... 67 Figure A.5. Voltage regulator and associated components...... 67

vii Figure A.6. Voltage divider for voltage measurement, and associated components...... 69 Figure A.7. Current transformer, selectable-­‐gain amplifier, and RC filter...... 71

Figure A.8. Current sensor calibration curve, 10x gain...... 72 Figure A.9. Current sensor calibration curve, unity gain...... 72 Figure A.10. Frequency dependence of current measurements...... 73 Figure A.11. Circuit components to enable frequency measurement...... 74

Figure A.12. Relay with transparent case, showing coil (top) and contacts (bottom) (Sonett72 2004) ...... 75

Figure A.13. Relay contact configurations (Moxfyre 2010)...... 76 Figure A.14. Transistor, relay coil, and protection diode...... 77 Figure D.1. Solderless with several components inserted. Each vertical set of five holes is electrically connected, as are the four horizontal rows at the top and bottom...... 82

Figure D.2. Prototype GridShare device constructed on . Photo by James Apple. 83 Figure D.3. Back and front views of a circuit constructed on . (Inductiveload 2007a; Inductiveload 2007b) ...... 84 Figure D.4. A prototype Macintosh computer logic board constructed using Wire-­‐Wrap (DigiBarn 2011)...... 85 Figure E.1. Amplifier circuit for function generator...... 88

viii List of Tables

Table 2.1. GridShare state machine state outputs and descriptions...... 20 Table 2.2. Values of key parameters in GridShare software...... 21

Table 2.3. GridShare cable lengths for soldered-­‐on pigtails...... 30 Table 3.1: Monthly average high and low temperatures (°C) in Bhutan (http://www.bootan.com/bhutan/weather.shtml); elevations and distances from Rukubji are from Google Earth...... 31 Table 3.2. Steps for normal operation test. Bold text indicates changes from previous step...... 39 Table 3.3. Results of low-­‐frequency undervoltage test...... 50

Table A.1. Functions of all pins on the PIC16F688 microcontroller. For multi-­‐function pins, only the relevant name is shown...... 70

Table B.1. Specifications for GridShare device. Test conditions at room temperature (approximately 20 °C) and 50 Hz unless otherwise noted...... 78 Table C.1. GridShare parts list with prices as of April 2011...... 79

ix Chapter 1. Introduction and Background 1.1. Introduction

The objective of the GridShare project is to alleviate brownouts in an overloaded micro-­‐ hydro mini-­‐grid system in Rukubji, Bhutan. Brownouts, or drops in voltage, occur when the demand for power exceeds the capacity of the micro-­‐hydro generator during periods of peak use. During off-­‐peak times, the system generates excess power; since the system has no ability to store power, this excess off-­‐peak energy is wasted. If some of the peak power consumption could be shifted to off-­‐peak times, the generation resource could be used more efficiently and brownouts could be reduced or eliminated. The GridShare is a device designed to encourage load-­‐shifting to alleviate the problem of brownouts in a village mini-­‐grid with a limited supply of peak power. The GridShare consists of a feedback mechanism to inform users of the status of the grid and an enforcement mechanism to ensure compliance. The feedback mechanism consists of two LED indicator lights, one red and one green, mounted in the kitchen of each house. The green LED indicates acceptable voltage levels, while the red LED indicates a brownout; the lights inform the user when the supply of power is sufficient to turn on appliances such as rice cookers and water boilers. To enforce compliance with the indicator lights, the GridShare monitors the household’s current consumption and turns off power to the house if large appliances are used during a brownout. The objective of this master’s degree project was to advance the design of GridShare device from a prototype to a production design ready for small-­‐scale manufacturing and to manufacture, assemble, and test enough GridShare devices to perform an installation in the village of Rukubji, Bhutan. Design changes to the prototype were informed by laboratory testing and by data collected during a field visit by the GridShare design team in June 2010. We constructed and tested 120 GridShare devices, which were shipped to Bhutan at the end of May 2011 and installed between June 15 and June 29.

The three major components of this project were design, testing, and production. Although much of the design work had been completed before the start of this project, considerable design revisions were needed, and several revised prototype devices were constructed. A detailed test protocol was developed to ensure that the devices would operate properly under the electrical and environmental conditions expected at the installation site; testing was conducted at several stages during the prototyping and construction phases. After the design 1.2. Project was Site finalized, 120 GridShare devices were constructed for installation in Rukubji.

dzongkhag The GridShare project site is the village of Rukubji, along with the neighboring villages of Tsenpokto and Bumiloo, near the eastern border of Wangdue Phodrang (district) of Bhutan and about 40 miles east of the national capital, Thimphu. Together, the three villages have about 90 households. The village is served by a mini-­‐grid powered small hydroelectric generator.

1 Bhutan is a small landlocked country in Himalayan Asia, bordering India and the Tibet region of China and approximately 65 km east of Nepal. Bhutan was an absolute monarchy until 2008, when the country’s first constitution was ratified and parliamentary elections were held (United States Central Intelligence Agency 2011). The country opened its borders to tourists in 1974; television and Internet access were introduced in 1999 (Brown et al. 2007).

Bhutan is a rugged country, 1 with elevations ranging from 318 ft on the Indian border to 24,800 ft summit of Gangkhar Puensum (United States Central Intelligence Agency 2011). The summer monsoon season, from June to September, brings abundant rainfall, with annual averages ranging from 14 inches in the northern mountain regions to almost 200 inches along the southern border (Brown et al. 2007). The combination of a wet climate and steep topography make Bhutan ideal for hydroelectric production. In fact, electricity is Bhutan’s largest export; of the 1.48 TWh of electricity produced in 2009, only 184 GWh (12%) was consumed locally (United States Central Intelligence Agency 2011). In 2004, Bhutan had 1,505 MW of installed electric generation capacity, 1,489 MW (89%) of which is hydroelectric (Dorji 2007). This is only 6% of Bhutan’s estimated techno-­‐economically 1.3.feasible Micro hydroelectric -­‐Hydro overview generating capacity of 23.8 GW (Dorji 2007).

Hydropower is power derived from the energy of moving water. The water spins the blades of a turbine, which can be connected directly to mechanical equipment or converted to electrical energy using a generator (Dhungel 2009). Hydropower systems can be classified as large, small, mini, and micro based on generation capacity. The thresholds for these classifications vary somewhat; small hydro is generally between 1 MW and 10-­‐30 MW, mini-­‐hydro is from 100 kW to 1 MW, and micro-­‐hydro is less than 100 kW (Johansson and Burnham 1993: 85-­‐86). The term “pico-­‐hydro” is sometimes used for systems smaller than 5 kW (Williams and Maher 2008). Hydroelectric systems can also be classified based on their design as “conventional hydro,” which uses a dam and reservoir to store water and produce pressure to operate a turbine, and run-­‐of-­‐the-­‐river systems, which have little or no storage capacity (Greacen 2004). Although many small hydroelectric systems are run-­‐of-­‐the-­‐river, run-­‐of-­‐the-­‐river systems are not necessarily small; the Beauharnois Hydroelectric Generating Station on the St. Lawrence River in Quebec has an installed capacity of 1,911 MW (Hydro-­‐Québec 2010), and the Tala Hydroelectric Project in Bhutan has a capacity of 1,020 MW (Druk Green Power Corporation 2009; power-­‐technology.com). In a typical micro-­‐hydro system, an intake weir or dam is used to divert some of the flow of the river or stream into an open canal or low-­‐pressure pipe called the headrace; water then flows through a forebay, which allows sediment to settle, and enters the high-­‐pressure pipe, called the penstock, that carries the water into the powerhouse (Greacen 2004). Inside the powerhouse, the water turns a turbine, which uses the kinetic energy of

1 The exact height and the location of the summit relative to the Bhutan-­‐China border are disputed.

2 moving water to turn a shaft. For hydroelectric systems, the shaft is connected to a generator; the turbine can also be used directly to power rotating agricultural machinery. Micro-­‐hydro installations that provide both electricity and direct mechanical power are common 1.4. Mini-­‐g in rids Nepal, with 2,496 such systems installed as of 2009 (Dhungel 2009).

Connecting remote villages to the national electricity transmission and distribution system (the “national grid”) can be challenging and expensive, particularly in mountainous regions where construction of power lines is difficult. Mini-­‐grids 2 are a rural electrification scheme that is commonly used in these situations. A mini-­‐grid is an isolated low-­‐voltage electrical distribution network within a village or neighborhood, supplied by a single generator (ESMAP 2000). (Medium-­‐voltage distribution may also be used in cases where electricity must be transmitted over longer distances, as is the case in the Rukubji system.) Mini-­‐grids vary in size and functionality. Some systems are designed to meet only the village’s lighting needs; in these systems, power outlets may not be installed in homes. Other systems are designed to meet the lighting load plus a few small devices, such as televisions. Other systems allow cooking appliances, such as rice cookers, curry and water boilers. These devices use much more power than lights and televisions, but there are several advantages, including convenience, reduced fire danger, improved indoor air quality, and, if the mini-­‐grid uses a renewable source of electricity, reduced carbon dioxide emissions and decreased fuel costs for villagers.

Low-­‐cost mini-­‐grids have been used in many countries, including Bhutan (Dorji 2007), Ivory Coast, Laos, Indonesia, the Dominican Republic, Nepal (ESMAP 2000), and others. Diesel generators and micro-­‐hydro systems are commonly used to supply power for mini-­‐ grid systems (ESMAP 2000). Hybrid designs, combining a renewable source such as solar PV or wind and a diesel backup generator, have also been used (Alliance for Rural Electrification 2011). Diesel systems have low initial cost and can be used in locations without access to renewable resources; however, they rely on expensive fuel and emit greenhouse gases. To reduce fuel costs, such systems may only be operated during certain hours; for example, a diesel mini-­‐grid used only for lighting may be turned on at sunset and turned off after bedtime. Of renewable sources, micro-­‐hydro is the most commonly used because it is a mature technology that can provide a constant supply of electricity throughout the day without relying on a backup generator.

Since mini-­‐grids are used in low-­‐income areas, low cost is essential for successful implementation, limiting the types of materials and devices that can be used. Some materials taken for granted in developed countries, such as wire connectors, 3 may be difficult or impossible to find in the areas where mini-­‐grids are built . Ensuring safety and

2 The term “mini-­‐grid” is sometimes used to refer grid-­‐connected systems that can also 3operate as isolated “islands,” but this type of mini-­‐grid is not a focus of this project. For example, twist-­‐on wire connectors (“wire nuts”) are nearly unheard-­‐of in Bhutan, and adherence to wire color codes is difficult since most stores only stock one or two colors of wire.

3 reliability while minimizing construction costs is a challenging task. Some groups have developed kits and pre-­‐built assemblies; for example, the Andhi Khola Rural Electrification Project uses prefabricated wiring harnesses with light sockets and outlets, which can be connected to a and installed in the home (Smith 1995). The wires are designed to be longer than needed, so that the homeowner can move lights and outlets without having to cut and splice wires. In South Africa, “readyboards,” self-­‐contained distribution units with circuit breakers, outlets, and sometimes a built-­‐in light, are used for rural electrification (Smith 1995; ESMAP 2000); some readyboards also include prepayment meters. In the lowest-­‐income homes, the built-­‐in light may be the only appliance. Wiring harnesses and readyboards are built in advance under controlled conditions and can be installed by trained villagers under the supervision of the utility; additionally, they reduce the cost of housewiring and allow the homeowner to know costs in advance.

In some mini-­‐grid systems, energy use is metered and customers are billed for energy as is common in traditional utility systems. However, there are several problems with this approach. Energy meters are relatively expensive, and requiring customers to purchase a meter may reduce the accessibility of power in poor communities. In addition, energy meters must be read each billing period; this can add considerably to the cost of operating a mini-­‐grid system (ESMAP 2000). A common scheme that addresses these problems is a power-­‐based tariff; in this system, a current-­‐limiting device is installed instead of an energy meter, and the customer is billed a fixed amount proportional to the maximum allowed current. This scheme makes sense when the total supply of peak power is limited, which is often the case on mini-­‐grids with limited generation capacity, and there is no meter to read. However, current-­‐limiting devices can be subject to tampering. An alternative form of power-­‐based tariff relies on a written agreement limiting the type and number of allowed appliances; however, such an agreement is difficult to enforce (ESMAP 2000).

Prepayment meters offer another possible billing scheme; with a prepayment system, the customer purchases a prepaid card, token, or code in advance and inserts the card or token (or enters the code) into their energy meter to purchase electricity. Once the customer uses the purchased amount of energy, their supply is automatically disconnected. With prepayment meters, no billing is necessary and there are no disconnection or reconnection charges for customers who fail to pay their bills; however, the expense of prepayment meters 1.5. Mini -­‐ prevents Grids and them Brownouts from being a viable option in mini-­‐grid systems (ESMAP 2000).

Once homes are connected to a village power system, it is difficult to restrict access to electricity (Greacen 2004). The electricity supply from the system, however, is limited by the flow in the stream and the capacity of the turbine and generator. When the demand for power exceeds the system’s capability to supply it, the voltage drops; this condition is referred to as a brownout. Brownouts are a common problem in village micro-­‐hydro systems; of 59 systems operated in Thailand between 1982 and 2004, users of 48 complained of low voltages (Greacen 2004), especially during evenings. During a

4 brownout, fluorescent lights can fail to start, incandescent lights dim, televisions malfunction, and rice cookers do not reach proper operating temperatures. In addition to causing the symptoms of brownouts, overloading can put excessive stress on the mechanical components of the system, and low voltage can damage utility voltage regulators and household (Greacen devices 2004).

Several solutions have been developed to the problem of overloading in village mini-­‐grid systems. The simplest solution is simply to restrict the number or types of appliances that customers are allowed to use (ESMAP 2000). The smallest mini-­‐grids are designed to meet only the community’s lighting load, and houses are not provided with plug receptacles. Larger systems might allow televisions and radios but not cooking appliances. However, such restrictions are difficult to enforce, mall especially in s systems without energy meters or current-­‐limiting devices.

A solution commonly used in Nepal (ESMAP 2000) and other countries is to use -­‐ a current limiting device to restrict the peak power consumption of each household. The current-­‐ limiting device is used instead of an energy meter, and the customer pays a power-­‐based tariff. The device may be a fuse, miniature circuit breakers (MCBs), breakers (ECBs), and positive temperature coefficient (PTC) thermistors (ESMAP 2000). In addition to limiting power consumption, these devices can save costs; they are inexpensive and do not require meter reading. Some types, such as PTC thermistors and thermal MCBs, also suffer from poor accuracy and strong temperature dependence (Smith and Ranjitkar 2000). Some MCBs can be unreliable and can be damaged if reset before the overload is removed; an annual failure rate of 9% was reported for Chitungwiza township in Zimbabwe (ESMAP 2000). Load-­‐limiting devices can be easily bypassed or tampered with; one utility in Zimbabwe found that customers replaced 5-­‐amp MCBs with 15-­‐amp breakers (ESMAP 2000). Such tampering is difficult to detect, since there is no energy meter and thus no record of energy consumption (ESMAP 2000). The GridShare is another form of current-­‐limiting device. The difference between the GridShare and the devices discussed above is that the ts GridShare only limi the current when the supply of power on the grid is insufficient. When combined with an awareness of load-­‐shifting, this feature could result in more efficient use of the available generation resource. With a simple current-­‐limiting device, all households are limited even when the generator is producing a surplus of power. With the GridShare, a household can exceed the 1.6.current Micro limit -­‐Hydro as in long Bhutan as the overall demand on the system is low.

Bhutan’s Tenth Five Year Plan, established in 2008, set a goal of 100% rural electrification by 2013 (Gross National Happiness Commission 2009). Bhutan’s rugged terrain makes extension of the national electric grid to rural areas challenging. The average cost of grid extension in Bhutan was estimated to be $1,425 per household in 2003 (Asian Development Bank 2003). As the grid is extended to more remote areas, the cost increases; the current cost may be closer to $2,000 to $8,000 per household (Personal communication (email) from Ngawang Choeda, BPC engineer, to Meg Harper, 2010). In cases where the

5 cost of grid connection is ff too high, o -­‐grid systems are installed; these include solar PV, micro-­‐hydro, and diesel generator systems (Dorji 2007). There are about 23 small hydroelectric systems operating in Bhutan (Uddin, Taplin, and Yu 2007; e7 Fund for Sustainable Energy Development), including approximately 15 off-­‐grid systems with a capacity of 200 kW or less (Dorji 2007). Two additional systems have been decommissioned due to landslide damage (Dorji 2007). Most of these are owned, operated, and managed by the Bhutan Power Corporation; the most recently commissioned system, in Chendebji, is a pilot project for a new community-­‐based management model (Dorji 2007)1.7. Rukubji . Micro-­‐Hydro System

The Rukubji micro-­‐hydro system has a nominal capacity of 40 kW, although in practice the power output is about 25-­‐30 kW. A section of the headrace channel was replaced with undersized plastic piping after a washout; this accounts for some, but not all, of the reduction in peak power. Equipment wear and tear or improper adjustment may also account for some of the 3 capacity loss. The system 0 uses a 4 kW cross-­‐flow turbine with design flow of 7 0.1 m /s (6.0 cfs) and net head of 40 m (130 ft) and 0 a 5 kVA, 4 415/240 V three-­‐phase brushless (Figure 1.1). The actual gross head of the system is about 45 m (150 ft). The generator operates 0 at 100 RPM, corresponding to a 50 Hz line frequency. The system was constructed in r 1987, with funding fo equipment and installation donated by the government of Japan, and is managed and operated by the BPC. An operator lives in the village and performs system maintenance and other operations tasks, including repairing power lines, installing meters for new customers, reading meters, distributing bills, and collecting payments.

Figure 1 .1. Turbine (rear) and generator (front) in Rukubji powerhouse. Photo by Meg Harper.

4 This is a very rough estimate based on a photograph taken by the team that visited Rukubji in July 2010.

6 The distribution system (Figure 1.2) consists of both -­‐ low and medium-­‐voltage lines. There are three distribution substations, each consisting of a single pole-­‐mounted transformer (Figure 1.3): one at the powerhouse, one at Rukubji, and one at the neighboring village of Bumiloo. The substations are connected by a single 6.6 kV line; the low-­‐voltage distribution lines are 230 V. The system neutral conductor is grounded (earthed) at the transformer. All customers have 230 V single-­‐phase service; customers have energy meters and are billed on a per-­‐kWh tariff. Electric space heaters and immersion water heaters are prohibited by a village agreement.

A 33 kV transmission line, connected to the national electric grid, is being constructed near Rukubji; the lines will pass within a few meters of the micro-­‐hydro forebay tank. The BPC plans to connect some or all customers in Rukubji to the grid, possibly as early as October 2011. The micro-­‐hydro system will be retained to power any customers not connected to the grid or to serve as backup power.

7 Figure 1 .2. Rukubji distribution system map; red lines 6 are 6. kV medium-­‐voltage; blue lines are 230 V. Map created by James Apple GIS based on data provided by Dorji Namgay (BPC).

8 Figure 1 .3. Distribution substation in the mini Rukubji -­‐grid. 6.6 kV lines are at the top of the pole; transformer is on the bottom shelf. Photo by Meg Harper.

1.8. The Brownout Problem in Rukubji

The Rukubji micro-­‐hydro system is unable to meet the village’s , and brownouts are common during periods of peak load. During the 174 days from January 1 to June 24, 2011, the voltage on the B 0 phase dropped below 20 V on 203 occasions; brownouts occurred 196 times on the R phase and 117 times on the Y phase. In about 20% of the brownout events and on the R B phases, the voltage was 170 V or less for at least two five-­‐minute intervals; this represents a 26% drop from the nominal voltage of 0 23 V. Brownouts occur during peak cooking times around 6 AM and 6 PM. Brownouts have several negative effects for villagers. In the survey conducted by the GridShare team in June 2010, 92% of Rukubji residents said that their rice cookers did not work properly during brownouts; 63% complained that their TVs flickered, 71% complained of lights 5 dimming, and 42% stated that fluorescent tube lights didn’t work or didn’t start during brownouts .

5 Flickering and failure to re start we observed in fluorescent tube lights during the installation site visit.

9 While the system is unable to meet the village’s peak power demand, during off-­‐peak times the system produces more power than can be consumed. This excess power is dissipated by a dump load. Between January 1 and June 24, 2011, the generator produced 105 MWh of energy, of which 0 only 4 MWh was delivered to customers; 62% of the energy generated by 1.9.the Cooking system and was Appliance not used. Usage

The most common electric cooking appliances in Rukubji are rice cookers, curry cookers, and water boilers. In the survey conducted by the GridShare team in the summer of 2010, 96% of households had at least one rice cooker, and about 31% had more than one. 65% of respondents owned a oker, curry co and 54% owned a water boiler. bukhari (The village is served by a spring water source, and residents boil their water before drinking it.) In addition to electric appliances, 85% of households had one or more LPG stove, 93% had a (metal wood stove), and 64% had a traditional wood-­‐burning stove. Rice is eaten with most meals; many villagers cook rice with electricity and the rest of the meal using LPG. Many households have multiple rice cookers of different sizes; the larger cookers are used if guests or visiting family members are present.

Most rice cookers have two settings: “cook” and “keep warm”; for a typical 6 rice cooker, the “cook” setting uses 500-­‐1000 W and the “warm” setting uses less than 100 watts . When the rice is done, the cooker automatically to the “warm” setting. This feature makes load-­‐shifting possible, since rice can be cooked unattended and kept warm for several hours. Some “digital” rice cookers have a heating element that cycles on and off to maintain a constant temperature, but these are not common in the village. Some water 1.10.boilers House also wiring have a in Rukubji “keep warm” setting and function similarly to the rice cookers.

A typical service entrance in Rukubji (Figure 1.4) consists of an energy meter and miniature circuit breakers (MCBs) and/or 2 fuses. The service cable running from the power pole to 2 the electric meter is usually either 4 or 6 mm copper, although at least one house has 6 1 mm cable, and aluminum wire is common. The official color code requires red insulation for the phase (hot) wire and black or green insulation for the neutral, but this is not commonly followed; often, both phase and neutral are the same color. Some houses have a main fuse or breaker and several branch circuits; others have only the branch circuit breakers or fuses. In houses with fuses, the neutral conductor is often fused as well the phase conductor. The most common MCB ratings are 16 A and 32 A. A few houses have no fuses or circuit breakers. The BPC supply ( rules require MCBs Bhutan Power Corporation); however, these rules are not strictly enforced.

6 The Sanyo 230-­‐volt rice cooker that we purchased for testing uses 600 W on the “cook” setting and 40 W on “warm.”

10 Figure 1 .4. Typical service entrances in Rukubji with fuses (top) and MCBs (bottom) Photos by Meg Harper.

1.11. Project History and le Peop

The GridShare project started in 2008 with a team of students from the Renewable Student Union, a student group at Humboldt State University, in consultation with Karma Dorji (MS, Energy, Environment, and Society, 2007) hris and Dr. C Greacen, founder of the nonprofit organization Palang Thai. The original student team James consisted of Apple, Nathan Chase, James Robinson and Joey Hiller, undergraduates in the Environmental Resources Engineering program at HSU, and Jenny Tracy, Chhimi Dorji, and Meg Harper in the ERE MS program. Professors Arne Jacobson, Peter Lehman, and Eileen Cashman served as faculty advisers. The team submitted a proposal to the EPA People, Prosperity, and the Planet (P3) design competition and was awarded Phase I funding to develop a prototype in April of 2009. In April of 2010, the team demonstrated their prototype device at the National Sustainable Design Expo in Washington, DC, and won $75,000 in phase II funding. In July 2010, Meg Harper, James Apple, and Chhimi Dorji traveled to the village of Rukubji, Bhutan, to perform surveys, install datalogging equipment, and evaluate the feasibility of a GridShare installation. I joined the GridShare team in June 2010 and replaced James Apple, who was leaving the project to begin an MS program at Stanford University, as technical and programming lead. My role was to update the GridShare design based on Meg Harper and James Apple’s fieldwork and further testing, put the device into small-­‐scale production for illage the v of Rukubji, and assist with the installation of the device in summer of 2011.

11 Chapter 2. GridShare Circuit Design

This chapter describes the original circuit design and the changes made to the design between the first prototype and the final production device. For a detailed description of the final idShare Gr circuit, see Appendix A; for more information on electronics prototyping and construction methods, see Appendix D.

The GridShare is a voltage-­‐ and current-­‐controlled switching and monitoring device designed for reducing brownouts in overloaded mini-­‐grid systems. Each GridShare is designed to serve -­‐ a single family household or an apartment with a single family. The device serves two rposes: pu to inform the customer whether a brownout is occurring and to prevent the use of large appliances during a brownout. The original GridShare circuit consisted of five basic functional blocks (Figure 2.1). The circuit is controlled by a PIC16F506 microcontroller. Current was measured by a current transformer and MCP6G01 selectable-­‐gain amplifier; voltage was measured using a voltage divider connected to gulated the unre side of the DC . Red and green LED indicator lights provided visual feedback, and a 5 amp relay (Panasonic JS1A-­‐5V-­‐F) was used to turn off power to the load. A power transformer and 7805 linear voltage regulator provided 5-­‐volt DC power to the circuit.

Power supply LED status indicators

Voltage Microcontroller sensing

Current Relay sensingFigure 2 .1. Block diagram of original GridShare prototype circuit.

2.1. First Prototypes

At the beginning of this project, the GridShare team had constructed several prototype GridShare units. The circuit was built on perfboard and placed in a steel load center enclosure with a hinged cover; the prototype included let a duplex out for connecting test loads (Figure 2.2). Separate 115 V and 230 V versions were built using different power . A more portable prototype in a plastic enclosure with a Bhutanese power outlet was also constructed and taken to Rukubji for field trials.

12 Figure 2.2 . 115 V GridShare prototype with CFL test load. Photo by James Apple.

2.2. GridShare Installation Options

The original GridShare team examined three possible installation scenarios for the GridShare device (Figure 2.3). The GridShare was originally envisioned as a “smart outlet” device, in which each outlet would be controlled separately. This scenario would be simple to install: no changes to the house wiring would be necessary. However, multiple GridShare Smart Outlets would be needed for each house, and users would be able to circumvent power limits to some extent by plugging appliances into different outlets.

The Circuit-­‐Specific GridShare solves the problems with the Smart Outlet scenario. The GridShare is installed near the home’s circuit breakers. Only circuits with outlets are connected to the GridShare; lighting circuits remain directly connected to the electric meter. This scenario requires a larger current capacity for the GridShare, although multiple GridShares could be installed to alleviate this problem. This solution requires that outlets and lighting be on separate circuits; houses with mixed lighting and outlet circuits would need to be rewired. In addition, residents could circumvent the GridShare by connecting appliances to lighting circuits, either by modifying the house wiring or by installing socket adapters; either of these actions could result in a dangerous situation. The Whole-­‐House GridShare is the simplest scenario; in it, all of the circuits in house are connected through the GridShare. This installation method does not require rewiring the house, and the GridShare can only be circumvented by connecting to the wires “upstream” of the GridShare. Additionally, the GridShare can be installed upstream of the utility meter, meaning that the customer is not required to pay for the energy necessary to operate the GridShare device. However, the power consumption of the entire household is

13 limited by the current capacity of the GridShare, and all electrical devices in the house, including light fixtures, will be turned off if the GridShare turns off the power. Whole-House Circuit-Specific Smart Outlet GridShare GridShare GridShare

Grid Grid Grid MCB MCB MCB MCB MCB GridShare GridShare(s)

MCB MCB MCB MCB MCB MCB MCB MCB MCB MCB Smart Outlet Smart Outlet Smart Outlet

Lighting

Outlets Lighting Outlets Lighting

Figure 2.3 . Three GridShare installation scenarios. Adapted ( from diagram by James Apple.)

2.3. Design criteria

Our main design criteria were safety, reliability, and low cost. Since the GridShare is installed in remote areas, access for repairs or replacement will be limited, and most replacement parts will not be available at the installation site. The GridShare is installed on exterior walls, so a weatherproof enclosure is a design requirement. The device must not present a shock or fire hazard, even when exposed to brownouts, power surges, or sustained overvoltage or overcurrent conditions. In addition, the device must be constructed to discourage tampering, which could result in shock or fire or simply render the GridShare non-­‐functional. Since the Rukubji area will be connected to the national grid within approximately one year of the initial installation, the device was designed to have at least a one-­‐year lifetime.

Since we had less than one year for the entire design and manufacturing process, manufacturability was also an important design criterion. We attempted to avoid dependence on hand soldering, since reliability of hand-­‐soldered joints depends strongly

14 on soldering skill; the final design required -­‐ only six hand soldered joints and one manually applied crimp connection. Cost was a key design factor; however, we placed a higher weight on safety and reliability. For example, to protect the relay from overcurrent, we selected a magnetic-­‐hydraulic instead of a thermal MCB; thermal MCBs take longer to trip and the tripping characteristics are strongly temperature-­‐dependent, and the more expensive magnetic breaker doubled as a disconnect allowing the power to the GridShare enclosure to be turned off for servicing. Similarly, we chose an IC socket with machined pins rather than spring contacts for greater reliability under varying environmental conditions and with repeated chip extractions and insertions. Despite -­‐ these trade offs, we chose to minimize cost whenever possible; for example, we used an inexpensive plastic electrical box rather 2.4.than Changes a more Identified expensive by purpose-­‐built GridShare device Team enclosure.

Based on their field testing of the GridShare prototypes and household surveys, the GridShare team identified several recommendations for design improvements:

1. The power limit should be based on nominal power consumption at 230 volts rather than power consumption during a brownout. 2. Current sensing should be based on a moving average rather than an instantaneous value, to accommodate “digital” rice cookers, which cycle on and off. (We did not implement this recommendation since a moving average on a timescale of minutes would be necessary, and a response time of less than a minute is needed for restoring power after a large appliance is unplugged. “Digital” rice cookers are not common in Rukubji.) 3. The circuit should be redesigned to provide higher voltage to the board during severe brownouts. There was insufficient voltage to energize 120 the relay at about volts. 4. The 10-­‐amp capacity of the relay was insufficient for the “whole-­‐house” GridShare option. 5. The brownout threshold voltage should be high enough to cook rice, as suggested by the BPC. Rice-­‐cooking trials should be conducted to determine an appropriate voltage. Based on these recommendations, a second prototype version, with hardware and software changes, was constructed on perfboard. After functional testing and calibration of this prototype, we designed a printed circuit board (PCB) layout for the circuit. We then fabricated and assembled a prototype PCB GridShare in the lab. Based on the results of testing of this prototype, we ordered five additional prototype boards, with only minor changes, from a PCB fabrication company (“board house”), Sunstone Circuits. We performed further software and hardware testing on these prototype boards and used them to develop the enclosure design for the GridShare. Finally, after some design changes (including the addition of frequency measurement capability and some parts substitutions due to supply shortages), we ordered 125 boards fabricated by Sunstone Circuits and assembled by their partner Screaming Circuits.

15 2.5. Voltage regulator selection

The field team reported severe brownouts, with voltages in their residence dropping as low as 120 V. In addition, the voltage during off-­‐peak hours reached up to 300 V. The wide range of voltages made the identification of an adequate voltage regulator challenging; a relatively high maximum voltage and low dropout voltage were necessary to allow the device to operate over the full expected voltage range.

Many low-­‐dropout regulators have tight constraints on the equivalent series resistance (ESR) of the output capacitor; for example, the inexpensive LM2940 from National Semiconductor requires an ESR between 0.1 and 1 ohms for stability at load currents less than 150 mA. This narrow operating region is sometimes referred to as the “Tunnel of Death” (Lee, 1999). Since the ESR of aluminum electrolytic can vary significantly with temperature, we selected a low-­‐dropout regulator with a relatively wide operating ESR range, the Micrel MIC2954. This regulator requires an ESR of 5 ohms or less and provides a guaranteed 5 V output from 5.6 V to 30 V DC input and can tolerate transients from -­‐20 V to 60 V.

Due to a temporary supply shortage, the regulator used for the production run was the National Semiconductor LP2954, which has similar specifications to the MIC2954. However, for new production, the MIC2954 is recommended due to the higher transient 2.6.tolerance Transformer and slightly upgrade better dropout voltage.

The first prototype used a power transformer with a nominal output voltage of 9 V and a maximum current rating of 111 mA (corresponding to a maximum apparent power of 1 VA). While this was sufficient to meet the DC load requirements, it did not take into account the current required to charge and discharge the smoothing capacitor. Various rules of thumb exist for sizing transformers for use with bridge rectifiers and capacitors; generally the required DC current is multiplied by a factor from 1.6 to 1.8 calculate the transformer current rating (ON Semiconductor 2001; Elliott 2010).

The Pulse BV030 -­‐7585.0 encapsulated power transformer was selected for the first PCB prototype. This transformer is rated for 9 V, 1 31 mA (2.8 VA); this value may be exceeded if the relay remains on at high input voltages, but only briefly. The main advantages of this transformer are the voltage ratio, which enables operation with the selected voltage regulator, and the small size. In addition, this model is rated “inherently short-­‐circuit-­‐ proof” according to the IEC 61558 standard, meaning that the device temperature remains below a specified limit, and the transformer is not damaged, even f i the output -­‐ is short circuited (International Electrotechnical Commission 2005). Due to a supply shortage, the run production used the Tamura 3FD-­‐324 transformer, which is rated 2 for 1 V at 0.2 mA (2.4 VA). The apparent power rating can be exceeded for up to six minutes if the grid voltage changes suddenly from below the brownout threshold to near the highest observed voltage; however, these conditions are unlikely to occur in practice. There are several manufacturers that make drop-­‐in replacements for this part;

16 any such replacement would need to be tested, and the voltage calibration would need to be 2.7. Relay adjusted. upgrade The Pulse BV030-­‐7585.0 is still preferred due -­‐ to its short circuit-­‐proof rating.

The field team reported that the only feasible GridShare installation scheme was the whole-­‐ house GridShare, in which the GridShare is placed upstream of the house’s ctric ele meter and turns off power to the entire house. This design change necessitated a relay with higher current rating. Since the current rating of the relay would limit the current to the entire household, the choice of a relay was a difficult one. A deciding factor was the availability of inexpensive normally closed relays with current ratings 6 of 1 A or less. The relay we selected, the Tyco Electronics RTD14005F, 6 is rated at 1 A and 250 V AC, but can operate at 0 2 A and 277 V AC with a 40% reduction in contact lifetime. At 230 V, 20 A is 4600 W, enough 1 power for a rice cooker (400-­‐2000 W), water boiler (700 W), and curry cooker (750-­‐1000 W) ; 0 2 A is also higher than the highest observed household current usage. The RTD14005F has a 5 V DC coil, meaning it can operate from the same power supply as the PIC microcontroller and other circuit components.

In addition to mechanical relays, we -­‐ considered solid state relays (SSRs), semiconductor devices that work like standard relays but without moving parts. SSRs are available for high currents and do not wear out. However, they are more expensive than mechanical relays and difficult are to find in a normally closed configuration. In addition, ate they dissip some power when “closed” and require cooling fans, which would add additional cost and complicate 2.8. Current the transformer enclosure design. change

Due to a supply shortage, we replaced the current transformer, Zettler Magnetics ACST-­‐257-­‐1, with a similar model, ACST-­‐260-­‐1. The new transformer has a turns ratio of 1:500 instead of 1:150; this results in somewhat higher sensitivity, which may improve accuracy of current measurements but also reduces the maximum measurable current 2.9.(since Frequency less current measurement is required for the output to exceed . the power supply voltage)

One of the major findings from testing of the first PCB prototype was that the voltage output of the current transformer is frequency-­‐dependent Figure ( 2.4). To compensate for this frequency dependence, we modified the circuit to allow the GridShare to measure line frequency in addition to voltage and current. The frequency measurement is mostly performed in software; the microcontroller amples simply s the AC output of the power transformer and measures the time between rising edges of the waveform. The circuit changes required for this added feature were relatively small, requiring the addition of two , a capacitor, and a zener diode.

1 These values are based on a survey by Meg e Harper and James Appl of appliances available for sale in a store in Thimphu in July 2010.

17 20%

10%

0% y' = 12.43/x + 0.7644 %err = (1 -­‐ y') / y' -­‐10%

-­‐20%

-­‐30% Percent error in current

-­‐40%

-­‐50%

-­‐60% Frequency (Hz) 10 20 30 40 50 60 70 80 90 Figure 2 .4. Frequency dependence of current measurement at approximately 460 mA.

2.10. Circuit protection

Two types of protective devices were added to the GridShare circuit board: protection from measurement inputs outside the safe range and protection from transient surges in the power supply. In the first category, zener diodes, which work by “clamping” the input voltage (that is, preventing it from exceeding a specified limit), were added to the voltage divider and the current transformer secondary. These protect the microcontroller and selectable-­‐gain amplifier from excessive voltage. Two types of devices were added to protect against power supply transients. On the primary side of the power transformer, a metal-­‐oxide varistor (MOV) was added; MOVs have very high resistance at normal operating voltage but become conductive at higher voltage. They are designed to handle large amounts of current for very short periods of time; the MOV used in the GridShare can withstand a peak current of 3500 A in a 20 µs pulse. The downside of MOVs is that they break down with repeated surges and eventually fail, sometimes in a short-­‐circuit condition, tripping the upstream circuit breaker. The MOV used in the GridShare can withstand 10,000 surges of 50 A or 100,000 surges of 35 A, using an industry-­‐standard surge waveform with rise time of 8 µs and fall time of 20 µs.

On the DC side of the GridShare power 0 supply, a 3 V transient voltage suppression (TVS) diode provides additional surge protection. A TVS diode -­‐ is essentially a high current zener diode, which limits the voltage across its terminals. To protect the relay vercurrent from o (and to protect against possible MOV failure), the GridShare uses a 20 amp hydraulic-­‐magnetic circuit breaker in a separate enclosure. We selected a hydraulic-­‐magnetic breaker instead of a less expensive thermal circuit breaker since the magnetic breaker has a faster response time and consistent operation over a large

18 ambient temperature range. The circuit breaker also serves as a disconnect in case the 2.11. Software GridShare changes enclosure must be opened.

For the second prototype, ware the soft was modified to use a finite state machine (FSM), a common technique for embedded systems. In an FSM, the system’s outputs depend on the value of a state variable, and the value of the state variable at any given time is a function of the inputs and the previous value. The GridShare has five states (Figure 2.5, Table 2 .1); every 20 seconds, the new state is computed based on the inputs and the current state. (The four states not including “Normal” are consecutive_high collectively referred to as “brownout mode.”) consecutive_low The GridShare state machine has four inputs. Two counters, and brownout_wait, count the number of voltage and measurements above and below the brownout threshold. If the number of consecutive low measurements resume_wait is larger than a threshold value, , the device enters one of the brownout states; if the number of consecutive high measurements is larger than a threshold, , the brownout is considered to have ended. The other two inputs are the current and the elapsed time in the current state. Values of the threshold parameters are given in Table 2 .2. (Frequency is also an input to the GridShare code, but it is only used to correct the current measurements and does not directly influence state transitions.) The “brownout threshold” discussed above ually is act a set of two thresholds. In order to add hysteresis to the transition between normal and brownout modes, the voltage threshold to enter a brownout is lower than the threshold to exit brownout mode. This prevents the GridShare from oscillating between brownout and normal modes when the voltage is close to the threshold. There is also a small amount of hysteresis in the current threshold.

19

Startup consecutive_high > resume_wait consecutive_low > consecutive_low > brownout_wait brownout_wait current ≥ i_cutoff current < i_cutoff Normal

consecutive_high

> resume_wait

consecutive_low ≤ brownout_wait consecutive_high

≤ resume_wait consecutive_high> resume_wait

time consecutive_high

< cook_time_limit time ≥ cook_time_limit ≤ resume_wait consecutive_high ≤ resume_wait current < i_resume CookTimer BrownoutOn

time

consecutive_high≥ cook_time_limit current< resume_wait

≥ i resume consecutive_high ≤ resume_wait current < i_resume

current < i_resume CurrentTest PowerOff current ≥ i_resume

consecutive_high ≤ resume_wait

Figure 2 .5. GridShare state diagram.

Table 2 .1. GridShare state machine state outputs and descriptions.

State name Red Green Relay Description

Normal Off On De-­‐energized Normal operation, no brownout, no power limit. CookTimer On On De-­‐energized Brownout, cooking in progress, waiting for timer to elapse, no power limit. BrownoutOn On Off De-­‐energized Brownout, power below limit Off On Off Energized Brownout, power to house turned off. CurrentTest On Off Energized 10 seconds Brownout, testing current to De-­‐energized 10 seconds decide whether to continue cutting power.

20 Table 2 .2. Values of key parameters in GridShare software.

Name in code Value or range Units Description

TICK_TIME 20 seconds Time between measurements and state transitions CURRENT_TEST_TIME 10 seconds Time to close relay to test if large appliance has been unplugged cook_time_limit 60-­‐65 minutes Duration of CookTimer mode WARNING_TIME 5 minutes Duration of flashing light warning before timer expires brownout_wait 1-­‐4 Number of consecutive low voltage measurements required to start brownout (20-­‐80 seconds) resume_wait 3-­‐18 Number of consecutive high voltage measurements required to end brownout (1-­‐6 minutes) VNOM 230 volts Nominal voltage for threshold calculations VLOW 200 volts Voltage threshold to start brownout VHIGH 208 volts Voltage threshold to end brownout IHIGH 1.76 amps Current threshold to cut off power (405 W at 230 V) ILOW 1.72 amps Current threshold to restore power (396 W at 230 V)

The GridShare enters the Normal state upon startup; in this state, the green LED is on indicating acceptable voltage, and the user can use any appliance. If the voltage drops below the low voltage threshold for a sufficient amount of time, the device enters brownout mode. If the current is less than the limit, the device enters the BrownoutOn state; otherwise it switches to CookTimer. In the BrownoutOn state, the red LED is illuminated, indicating that a brownout is occurring.

While in BrownoutOn, current exceeding the limit causes the GridShare to enter the Off state and turn off the power to the load. From the Off state, the device transitions to the CurrentTest state, in which the load power is turned back on for 10 seconds to test the current; f i the current still exceeds the threshold, the device returns to the Off state (and the power is turned off); otherwise, the device returns to BrownoutOn. In either the BrownoutOn or Off states, if the voltage remains above the high threshold for a sufficient amount of time, the device returns to Normal state.

If a brownout occurs while a large appliance is in use, the GridShare transitions from the Normal state to the CookTimer state. In this state, the user has approximately one hour to finish using the appliance. Both LEDs are lit until 5 minutes before the end of the timer, at which point the LEDs flash to warn the user that the timer is about to expire. At the end of the timer, the GridShare enters BrownoutOn if the appliance is no longer in use; if the

21 appliance is still on, the GridShare enters the Off state. From this point, the process proceeds as in the previous paragraph. If the voltage exceeds the threshold in CookTimer state, the timer is canceled and the GridShare returns to the Normal state.

To help prevent sudden changes in load as multiple GridShare devices turn on or off at the same time, random delays are inserted at several points in the GridShare logic. The number of consecutive low or high voltage measurements required t to enter or exi brownout mode is randomized, as is the duration of the CookTimer state. There is also a random delay of up to 20 seconds at startup before the GridShare begins normal operation; since all other delays are multiples of 20 seconds, this startup delay is necessary to ensure that -­‐ the 20 second clocks of multiple GridShare units are not synchronized. (The minor variations in oscillator frequency due to temperature and manufacturing tolerances also help avoid synchronization.)

Since the GridShare device t does no have a hardware-­‐based random number generator, the software pseudorandom number generator (PRNG) built into the Microchip C compiler was used. A PRNG is an algorithm that generates a sequence of numbers that share many of the statistical properties ue of tr random numbers. However, the sequence is deterministic; if the current position in the sequence is known, the next number in the sequence is also known. Typically, a PRNG is initialized (“seeded”) with some initial state derived from a source whose e valu is unpredictable. In personal computer software, the system clock is often used for this purpose, since the time is different every time the program is started; however, the GridShare has no system clock. Instead, the seed (initial value) is taken from a combination of the current, frequency, and voltage measurements at startup.

Rice cookers and other cooking appliances are essentially resistive loads; that is, the current drawn by the device is proportional to the voltage. Therefore, or the cutoff current f a “large” appliance should also be proportional to the voltage. The GridShare calculates the cutoff current according to the following formula: i_cutoff IHIGH VNOM = ∙ i_cutoff where IHIGH = minimum current required to cut power during brownout VNOM = high current threshold at nominal voltage V = latest voltage measurement = nominal voltage There is an analogous formula to calculate the “resume current,” that is, the maximum amount of current for which the power will be restored if t it has just been cu off due to use of a large appliance during a brownout:

22 i_resume ILOW VNOM = ∙ i_resume where ILOW = maximum allowed current to resume from power cut = low current threshold at nominal voltage The high current threshold IHIGH is a constant calculated from the desired power limit, according to the formula VNOM IHIGH VNOM = +   where  = current drawn by maximum allowed load at nominal voltage  = lowest expected voltage under normal operating conditions  = resolution of current measurements

Similarly, the low current threshold is given by VNOM ILOW VNOM = −   These formulas are designed so that the amount of hysteresis at the lowest expected voltage is equal to twice the resolution of the current measurements. (In theory, hysteresis in this threshold helps prevent the GridShare from oscillating between the Off and BrownoutOn states when the household power consumption is very close to the threshold; in practice, uctuations fl in voltage IHIGH and current ILOW are likely to make this feature unnecessary.) Since the resolution of current measurements using the most sensitive amplifier gain setting is 0.01 A, the difference between and is 2(0.01 A)(230/150) or 0.04 A.

To assist with debugging and troubleshooting, the GridShare outputs data over a “modified RS-­‐232” serial interface, using -­‐ the RS 232 protocol with -­‐ 0 5 V logic levels. While this scheme does not comply with the RS-­‐232 standard (which specifies -­‐ 3 to -­‐ 15 V for a logic “1” and +3 to +15 V for a logic “0”), it works with USB-­‐to-­‐serial adapters using the common Prolific 2303 chipset. This feature allows the GridShare to send data to a computer for troubleshooting; the data output includes voltage, current, and period measurements, thresholds, and the previous and current states of the The FSM. interface is unidirectional; the GridShare has no capability to receive data from the computer. The PIC16F688 microcontroller has 256 bytes of non-­‐volatile EEPROM memory. This memory is used to store the number of brownouts, timers, relay cycles, and power cuts initiated by the GridShare over its lifetime. This information can be read via the serial interface or by inserting the microcontroller chip into a programmer.

23 2.12. PCB design and construction

Although several prototype GridShare devices were constructed is on perfboard, th is a time-­‐consuming process; to make construction of 120 GridShare devices practical, we designed a printed circuit board (PCB) for it. the production circu After comparing assembly prices (Figure 2.6) from several vendors, we decided to use a hybrid surface-­‐ mount (SMT) and through-­‐hole design, with surface-­‐mount components used when possible. The power supply capacitor, power transformer, current transformer, relay, and MOV were only available in through-­‐hole packages. A through-­‐hole voltage regulator was selected to provide sufficient power dissipation h capacity at hig input voltages. While SMT sockets for DIP ICs are available, -­‐ a through hole socket was chosen for ease of soldering. Surface-­‐mount versions were selected for all other components.

We used the free EAGLE software produced by CadSoft to design the printed circuit board version of the GridShare. The free version is limited 0 to two layers and 10 x 80 mm of board area; the GridShare PCB easily met these constraints. (The free version is also limited to non-­‐commercial use.) While EAGLE features an autorouter, we chose to manually route all traces (Figure 2.7) for maximum control over the design.

60

50

40 Turnaround time 24 hours 30 48 hours 20 5 days 10 days

Unit cost of assembly (US dollars) Unit 10

0 Surface-­‐mount placements as percent of total 0% 20% 40% 60% 80% 100%

Figure 2 .6. PCB assembly price quotes (as of July 21, from 2011) Screaming Circuits for a range of hybrid surface-­‐ mount and through-­‐hole designs. Parameters: 30 component placements, 21 distinct component types, order of 120 boards.

24 Figure 2 .7. Manually routing PCB traces in EAGLE. The yellow lines ("airwires") indicate connections that have not yet been made; the red lines are traces that have been routed.

Following best design practices, -­‐ low and high-­‐voltage components are kept separate whenever possible, with the high-­‐voltage and high-­‐current components on the left side of the board (Figure 2.8). While routing traces, we paid particular attention to three traces on the PCB that can carry up to 20 A of current. These traces must be sized to prevent overheating due to the resistance of the -­‐ copper layer. IPC 2221, a voluntary standard for printed circuit board construction, provides a plot of current vs. minimum trace size for various amounts of temperature rise. 0 For a 1 °C rise, with copper thickness of 2 ounces per square foot, the recommended trace thickness is 0.37 inches. Due to the spacing of the relay contacts, this width was not possible in all places. For the thinnest high-­‐current trace, large copper areas were added as heatsinks on both sides of the board, with vias (copper-­‐ plated holes) connecting the two layers. 2 To meet our PCB manufacturer’s requirements for 2 oz/ft copper, the minimum trace width and minimum spacing between traces was set to 14 mil; for high-­‐voltage traces, the minimum clearance was 32 mil, as recommended by IPC-­‐2221 for coated conductors up to 500 V peak (350 V rms). EAGLE’s design rule check feature was used to verify these sizes and spacings. To provide low ground impedance and reduce noise, we used a ground plane on the -­‐ low voltage side of the board.

25 Figure 2 .8. Printed circuit board layout; high-­‐current traces are left on the side. Red areas are on the top of the board, blue is on the bottom, and green is on both sides. The large blue area on the right is the ground plane.

The circuit board does not onnector provide a c for serial communication with a computer, since this feature is expected to be used mostly in the laboratory. A “test clip” can be purchased which fits over the microcontroller and allows for the connection of wires or test probes; this clip can be used for serial communication as well as testing of other circuit functions.2.13. Prototypes

During the course of the project, several prototype GridShare devices were constructed. Early in the project, to test the new relay and voltage regulator, an additional perfboard prototype was constructed; the existing metal enclosure was used with the new board.

After validating these component choices, we constructed one printed circuit board prototype in the lab. We fabricated the circuit board using the toner transfer method

26 described in (Williams 2004) using a Brother HL-­‐5370DW laser printer and Staples Photo Basic Gloss inkjet photo paper; for details of this method see 0. As an etchant, we used a mixture of one part 31.45% hydrochloric acid solution and two parts 3% hydrogen peroxide solution. The prototype board was mounted in one of the plastic enclosures originally intended for field-­‐testing the perfboard GridShare circuit (Figure 2.9). This board, labeled version 0.1, included all of the revisions tested in the second perfboard prototype plus the MOV and TVS protection devices.

Figure 2 .9. PCB prototype enclosure with production board (version 1.0) installed.

While we obtained good results with in-­‐house fabrication, we decided to use a commercial PCB fabrication service, Sunstone Circuits, to construct five additional prototypes. A major reason for this decision was that the formulation of Staples Photo Basic photo paper was changed in 2009; electronics hobbyists report that the new paper does not work with the toner transfer method (Lyons 2009), and we had only a limited supply of the old paper. The entire fabrication process is also time-­‐consuming, especially with two-­‐layer boards, and using Sunstone Circuits for prototypes gave us an opportunity to evaluate their service. The five commercial PCB prototypes were mounted in the same type of plastic enclosure that we used for the final production run. The professionally fabricated boards were labeled version 0.2; the only s difference between the two versions were minor adjustments to hole sizes and spacings for -­‐ through hole components.

Last-­‐minute supply shortages of several components forced a significant redesign between the second prototype version (0.2) and the final production version (1.0); the power transformer TRANS1 and 10 0 µF electrolytic capacitor C4 had to be replaced with components with different physical footprints. In addition, testing of the earlier prototypes revealed the need to measure line frequency in addition to current and voltage (see section

27 2.9); the components necessary for this measurement were added to the board. To help dissipate heat from the relay and high-­‐current traces, the traces on the front of the board were enlarged to fill the available space, a copper pad was added to the back of board, and 63 vias were added to help transfer heat from the front to the back. (For a comparison of the thermal properties of board versions 0.2 and 1.0, see section 3.6, Figure 3.11.)

We did not order any prototypes of the final board version prior to making the final order for 120 assembled boards; however, we added an extra five boards to the production order and had these shipped to the lab while the remaining 120 were shipped directly to the assembler. We hand-­‐assembled two of these boards and replaced the PCBs in two of the five PCB prototypes with the new version. In addition, before placing the order, we soldered the replacement components to one of the old boards, using wires to connect the component leads to the existing holes. We found no problems in testing of these production version 2.14. Enclosure “prototypes.” design, wiring, and termination

The GridShare enclosure (Figure 2.10) was designed to be inexpensive and weather resistant. The GridShare circuit board is 4 enclosed in a x 4 x 4-­‐inch plastic electrical box with gasketed lid. The box has a NEMA 4X rating; it provides protection against dust, rain, hose-­‐directed water, and corrosion (NEMA 2005). The circuit breaker is enclosed in a separate 4 x 4 x 2-­‐inch box from the same manufacturer. The lids are secured with spanner-­‐head security screws (Figure 2.11) to discourage tampering.

Figure 2 .10. GridShare enclosure.

28 Figure 2 .11. Spanner-­‐head security screw.

The red and green LEDs are mounted in a separate enclosure, which is to be installed in the kitchen of each home. The enclosure is a small black plastic box purchased from electronics surplus retailer All Electronics.

The power cables for the GridShare -­‐ consist of two conductor 2 1 AWG tray cable (type TC), rated for direct burial and sun exposure. Compression fittings (“gland nuts”) are used to secure the cables to the enclosure and provide a weathertight seal. A separate grounding conductor is not necessary because the enclosure is plastic and the device is upstream of the electric meter. The LED enclosure is connected to the GridShare using -­‐ 3 conductor 18 AWG cable with a UL 440 CMX-­‐Outdoor rating. To streamline installation, the power and LED cables were soldered directly to the circuit board and the GridShare enclosures were sealed prior to shipping. During the installation, the service cable from the power pole will be disconnected from the electric meter and connected to 2 the circuit breaker inside the breaker enclosure. If the service cable is 10 AWG (5.2 mm ) or smaller, a crimp-­‐on ring lug will be used to connect to the screw terminal on the breaker; otherwise a short pigtail of 12 AWG wire will be attached to the service cable with a wire nut to allow the use of ring lugs. The power input cable from the GridShare will then be connected to the circuit breaker, and the neutral conductors will be connected with a wire e nut. Th load output cable from the GridShare will be connected to the screw terminals on the energy meter. The LED cable was connected to the “pigtails” from the GridShare and the LED enclosure using heat-­‐shrinkable adhesive-­‐lined butt splice connectors; for installations with two sets 2.15.of LEDs, Assembly step-­‐down (14-­‐16 AWG to 18-­‐22 AWG) splices were used.

While we fabricated one PCB prototype in the lab and hand-­‐soldered all of the PCB prototypes, hand fabrication and assembly were not practical for all 120 production boards. Our PCBs were manufactured by Sunstone Circuits; for assembly, we used their partner Screaming Circuits. Both companies specialize in prototyping and short-­‐run production. The GridShares were assembled by members of the GridShare team and other volunteers. First, the heat sink was mounted to the voltage regulator and the relay vent hole was

29 opened on each board. During this step, the boards were also inspected for any obvious damage or defects. (Two boards required rework due to defective components.) The power and LED cables were then soldered to each board, using lengths from Table 2 .3. A short -­‐ (3 inch) 4 1 AWG pigtail was used for the neutral connection to the circuit board, which does not carry high current. This pigtail was attached to the neutral conductors of the power cables with an IDEAL Buchanan Splice-­‐Cap crimp sleeve connector. During the crimping step, hot glue was applied to the base of the voltage regulator heat sink to prevent the regulator leads from bending during assembly and shipping. A knot was tied in the LED cable for strain relief. Table 2 .3. GridShare cable lengths for soldered-­‐on pigtails. Cable Length (ft)

Power input 2.5 Load output 3.5 LED 1.5

After the boards were prepared, they were visually inspected, and any faulty solder joints found were repaired. Programmed microcontroller chips were inserted into each board. The boards were then glued into the enclosures using hot melt glue; to allow some amount of air circulation, glue was applied only to the low-­‐current side of the board. Hot glue was also used to secure the cable gland locknuts. After the boards were glued in place, the completed GridShares were visually inspected and the lids attached using security screws. Each GridShare was then tested using the quality control test procedure (section 3.4); after a final inspection to ensure that all screws and nuts were fully tightened, the GridShare logo sticker was applied and the GridShare was packaged for shipment.

30 Chapter 3. Testing 3.1. Introduction

In Rukubji, the GridShare device will be subjected to challenging conditions, in terms of both the physical operating environment and the conditions on the . Rukubji is at high elevation (between 8,800 and 9,900 ft) and experiences cold conditions in the winter and monsoon rainfall in the summer. In addition, the electrical system is not subject to the same strict limits on voltage and frequency that apply to the power grid in the United States. (Indeed, if it were, then the GridShare would not be necessary.) The GridShare was subjected to a testing protocol designed to evaluate its ability to withstand both of these types 3.2. Operating of conditions. Conditions in Bhutan

Temperature

Detailed weather data are not available for Rukubji; however, we can get an idea of the operating Table 3.1 : temperature Monthly average high conditions and ow l temperatures by looking (°C) in at Bhutan other nearby locations ; (Bootan.com) elevations (Table and 3.1). distances from Rukubji are from Google . Earth

Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Paro 53 mi 7,400 ft 9.4/ 13.4/ 14.5/ 17.6/ 23.5/ 25.4/ 26.8/ 25.3/ 23.4/ 18.7/ 13.9/ 11.2/ Thimphu -­‐5.8 1.5 0.6 4.6 10.6 13.1 14.9 14.7 11.7 7.4 1.4 -­‐1.7 39 mi 7,600 ft 12.3/ 14.4/ 16.4/ 20.0/ 22.5/ 24.4/ 18.9/ 25.0/ 23.1/ 21.9/ 17.9/ 14.5/ Punakha -­‐2.6 0.6 3.9 7.1 13.1 15.2 13.4 15.8 15.0 10.4 5.0 -­‐1.1 24 mi 4,300 ft 16.1/ 19.6/ 21.2/ 24.4/ 27.2/ 31.2/ 32.0/ 31.4/ 29.9/ 27.8/ 22.3/ 15.0/ Wangdue 4.2 5.3 9.2 11.9 14.8 19.5 21.6 19.8 20.0 18.9 13.0 7.9 22 mi 4,100 ft 17.0/ 19.0/ 22.8/ 26.2/ 29.1/ 29.2/ 18.4/ 29.1/ 27.5/ 26.1/ 22.6/ 19.1/ Trongsa 4.3 7.8 10.4 12.9 17.7 20.1 16.2 20.0 19.1 14.7 9.6 6.3 14 mi 7000 ft 13.0/ 13.9/ 16.7/ 20.1/ 21.0/ 22.2/ 25.3/ 23.8/ 22.6/ 21.8/ 19.8/ 18.2/ Bumthang -­‐0.2 0.4 4.4 6.6 11.6 13.6 15.3 15.0 14.2 11.7 6.4 2.5 (?) Mongar 10.8/ 10.0/ 16.2/ 18.7/ 21.3/ 22.5/ 14.1/ 23.0/ 21.6/ 19.5/ 16.1/ 12.3/ 61 mi -­‐5.1 -­‐1.4 3.5 3.9 9.5 13.5 10.9 13.7 12.1 5.9 -­‐0.5 -­‐2.3 5,400 ft 15.5/ 15.9/ 20.0/ 22.8/ 25.1/ 26.1/ 16.1/ 25.4/ 24.7/ 22.7/ 19.9/ 15.7/ Trashigang 8.2 8.3 11.6 14.0 17.4 19.5 15.8 19.6 19.4 15.8 11.2 9.5 79 mi 3,700 ft 20.4/ 21.7/ 24.8/ 28.3/ 30.0/ 30.7/ 31.5/ 30.2/ 30.0/ 29.1/ 26.1/ 23.0/ 10.5 11.5 14.4 17.0 20.6 22.6 23.1 22.7 23.9 17.7 13.6 11.6

31 Trongsa is geographically closest to Rukubji, although Paro and Thimphu are closer in elevation. The average low in January in Paro is -­‐5.8 °C (21.6 °F); the average high temperature in July is 26.8 °C. Low temperatures may be a concern, especially since the equivalent series resistance of electrolytic capacitors can increase significantly in cold conditions. Extreme high temperatures are unlikely to be a concern; however, exposure to direct sunlight could result in high internal temperatures even with moderate ambient air temperature. Elevation

According to both GPS surveys and Google Earth, the highest house surveyed by the field team was 9,870 ft (3,008 m). The lowest is 8,842 ft, or 2,695 m. The standard atmospheric pressure at that elevation is 10.1 psia, 4.6 psi lower than at sea level (Engineering ToolBox). The dielectric strength of air decreases with elevation; the IPC-­‐2221A standard requires different spacings for exposed printed circuit board traces below and above 3,050 Power m grid elevation. conditions

The mini-­‐grid in Rukubji is a three-­‐phase system, with three conductors carrying voltage waveforms 120° out of phase. Three-­‐phase AC power is an efficient way to deliver electricity since the three phases can share a common neutral conductor; in a well-­‐ balanced three-­‐phase system, the neutral currents sum to zero, meaning the neutral conductor can be eliminated or reduced in size. Three-­‐phase power also simplifies the design of generators and motors, since the three phases can be used to generate a rotating magnetic field. However, to perform well, a three-­‐phase system must be balanced, meaning that the loads on each phase must be approximately identical. In the Rukubji mini-­‐grid, the loads are not well-­‐balanced, 1 resulting in significant voltage differences between the three phases (arbitrarily labeled R, Y, and B) . Based on data collected between July 4, 2010, and January 11, 2011, the voltage in Rukubji at the powerhouse is below 200 V 4.9% of the time and at or above 270 V 3.8% of the time (Figure 3.1). The lowest nonzero voltage observed was 13.8 V and the highest voltage observed was 302 V. High voltages are sustained for long periods of time; the 302 V maximum occurs during a period in which the voltage exceeded 290 V for around 6.5 hours. The three phases have different voltages when unloaded, and brownouts occur less frequently on phase Y than on R or B.

1 The R, Y, and B labels are based on the insulation color code, which specifies red, yellow, and blue insulation for phase conductors; however, the color code is rarely if at all followed in Rukubji, where the insulation color is usually determined by what the hardware store had in stock at the time of installation.

32 40

35 20% 30

25 15%

20 Phase Y 10% 15 Phase R Thousands of observations of observations Thousands Phase B 10

5% of total observations (all phases) Percent 5 20 30 40 50 60 70 80 90 0 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 0% Voltage (V)

Figure 3.1 . Histogram of voltage measurements at Rukubji powerhouse from July 2010 to January 2011, with 5-­‐ minute resolution.

Frequency was not measured during the field visit and there is no datalogging equipment in the field capable of measuring frequency. The frequency meter at the powerhouse 2 goes down 3.3. Calibration to 45 Hz and one of the field team remembers it being pegged at the low end .

The voltage and current scales of the GridShare must be 3 calibrated before the device is deployed. The calibration must be repeated if the circuit is changed or if significant component substitutions are made; however, the procedure does not need to be repeated for each individual device. A small amount of variation between devices can actually be desirable, as it introduces an additional layer of randomness into the system. There are four different calibration curves that must be defined for accurate operation: voltage with relay energized, voltage with relay de-­‐energized, current, and frequency response. The two voltage curves are necessary because of the output impedance of the power transformer; when the relay is energized, the increased current draw causes the

2 During the installation in Rukubji, values as low as 35 Hz were observed during 3brownouts. A “significant” substitution is one in which the new part is not known to have the same characteristics as the old one. For example, replacing a transformer with a part from different manufacturer is a significant substitution, but replacing a with another of the same value from a different manufacturer is not.

33 secondary voltage to drop. To avoid this problem, a second transformer could be used exclusively for voltage measurements, or the power transformer could be oversized so that its output impedance is negligible. Since the relay coil resistance drops (and current increases) as the coil heats up, the calibration with the relay energized is less accurate unless the relay has been energized long enough to reach a steady-­‐state temperature.

The GridShare software has a calibration mode that can be selected when the program is compiled. In calibration mode, the uncalibrated gridshare_cal.py current and voltage output codes are sent to the computer via the serial port as fast as possible, and the AC line period measurement is output without averaging. On the computer, the program can be used to compute time averages of the output codes. There is also a verification mode that is used for verifying the device calibration. In this mode, the calibrated current and voltage values Voltage are calibration written to the serial port once per second.

Materials and equipment: frequency converter, multimeter. This test must be repeated twice, once with the relay de-­‐energized and once with the relay energized. The GridShare is connected to the frequency converter 110 V output; a multimeter is also connected to the frequency converter output to measure the voltage. The following test procedure is used:

1. Compile software with calibration mode enabled. Be sure to set the correct relay state for the calibration curve you wish to generate. 2. Program a PIC, insert into the GridShare, and attach the serial test clip. 3. Connect the GridShare to the frequency converter 110 V output. Also connect a multimeter to the frequency converter output. A cable with a power plug on one end and banana plugs on the other is useful for this purpose; however, it is essential that all connections be well insulated. Connect the cable to the multimeter first, then the power plug. 4. Although this is not essential to calibrate the voltage measurements, it may also be useful to obtain a calibration curve for the power transformer and rectifier at the same time. If this is desired, connect additional multimeters to the input and output of the bridge rectifier; set the input meter to AC volts and the output meter to DC volts. 5. Turn the power on and wait for the startup sequence to complete. 6. Vary the output of the frequency converter in 5 V increments from 90 V to 130 V. For each measurement, record the voltage, ADC output code, and any additional data you are collecting. 7. After 130 V, disconnect the GridShare, return the frequency converter to its lowest setting, and connect the GridShare to the 220 V output. Repeat step 6 from 180 V to 260 V. 8. Plot input voltage vs. ADC output code and perform linear regression to obtain the calibration 2 curve. The linear fit should be excellent; it is reasonable to expect R > 0.9999. With the relay on, there will be a nonlinear region at low voltages where the regulator is in dropout; these points should be excluded from the regression.

34 GetVoltage()

Current 9. Update calibration the function with the new calibration equation.

Materials and equipment: frequency converter, multimeter with high current range (10-­‐ 20 A), test load(s). Some loads also require safety equipment, such as lineman’s gloves. The current calibration process is similar to the voltage calibration, but it is more challenging to obtain good results. The calibration requires a multimeter capable of accurately measuring the highest current that will be used; the current range for calibration depends on the range setting in the GridShare software. A suitable resistive load is also required; SERC’s “Ohm on the Range” high-­‐power variable resistor is useful; however, additional types of loads may be required to obtain low-­‐current data points. Since the large loads expected in the field are resistive, the device should be calibrated using resistive loads such as high-­‐power rheostats, carbon-­‐block variable resistors, incandescent light bulbs, rice cookers, hotplates, or space heaters (without fans). While linear inductive loads, such as motors, may be acceptable, they are not recommended since they do not match the conditions expected in the field. Nonlinear loads, such as fluorescent bulbs and DC power supplies (including computers) are not acceptable for calibration; the current waveforms of these types of devices have high-­‐frequency components, which the GridShare will not measure accurately.

When using resistors such as the “Ohm on the Range” at high voltage, several precautions must be observed. Ensure that all connections and electrically live parts are insulated, if possible; if it is not possible to insulate all live contacts, arrange the apparatus to minimize the possibility of accidental contact and clearly label live parts. Do not leave the apparatus unattended when parts are energized, and wear lineman’s gloves while working around the equipment. Inspect the inner and outer surfaces of the gloves before use. If using alligator clips to select terminals, as with the “Ohm on the Range,” use clips with insulated handles, wear gloves, and disconnect the power before moving the clips. The power limit of the frequency converter (2100 W) must not be exceeded; in addition, when the frequency converter is powered by a 120 V supply, the input current will be more than twice the output current; thus, drawing more than 7-­‐10 A may trip the breaker for branch circuit that powers the unit. Using a power strip with a built-­‐in circuit breaker can protect against inadvertently tripping the branch circuit breaker.

1. Compile software with calibration mode enabled. Be sure that the relay is de-­‐ energized. 2. Program a PIC, insert into the GridShare, and attach the serial test clip. 3. Connect the GridShare to the frequency converter. Use the voltage range that is best suited to the type of load that you are using for the test. As long as the voltage regulator is not near dropout, the exact voltage is not critical for this test. 4. Connect the load to the output of the GridShare through a multimeter set to AC amps.

35

5. Turn on the power and begin making measurements. For each measurement, record the current and ADC output code. If the load has discrete resistance steps, and intermediate values are needed, vary the voltage; be sure that the regulator remains out of dropout. 6. Plot input voltage vs. ADC output code to obtain the calibration curve. The curve may be GetCurrent() nonlinear; a piecewise linear regression may be necessary depending on the current range selected in the GridShare software. Frequency 7. Update response the calibration function with he t new calibration equation.

Materials and equipment: function generator, two multimeters, high-­‐power resistor, oscilloscope (optional).

This test measures the frequency response of the current transformer; that is, the dependence of the output voltage on the frequency of the AC waveform at a constant current. The test requires a function generator -­‐ with high power output; if one is not available, a low-­‐power function generator can be used along with the amplifier circuit described in Appendix E. Unless the function generator frequency control is known to be accurate and can be set with at least 0.1 Hz of precision, a multimeter that can measure frequency (such as the Fluke 179 or 287) is also necessary. An oscilloscope is also useful, but not required, to verify that the function generator is configured correctly and is working properly. 1. Compile software with verification mode enabled (not calibration mode, since the calibrated current measurements are used for this procedure). Be sure that the relay is -­‐ de energized. 2. Program a PIC, insert into the GridShare, and attach the serial test clip. 3. Set the function generator to produce a sine wave at 50 Hz. Set the amplitude so that the regulator is not in dropout and the maximum voltage limit is not exceeded. This may require some experimentation, but 10 V rms 8 (2 V peak-­‐to-­‐peak) is a good starting point. 4. Connect the equipment to the GridShare as shown in Figure 3 .2. The GridShare must not be connected to the frequency converter or an AC power outlet. The GridShare’s neutral wire must be capped, since 120-­‐300 V is present across the transformer primary even though the power supply is low voltage. A piece of electrical tape can be placed across the transformer primary pins to reduce the shock hazard.

36 Load Function Generator

Multimeter Multimeter AC Hz A

Oscilloscope (optional)

Figure 3 .2. Measurement apparatus wiring diagram for frequency response calibration. (Note that unless oscilloscope has isolated ground, oscilloscope ground must be connected to function generator ground as shown.)

5. Turn on the function generator; verify that the GridShare turns on. 6. Take measurements at 5 Hz intervals from 20 Hz (or as low as possible) to 100 Hz. For each measurement, record the frequency (as measured by the multimeter), actual current (from the multimeter), and measured current (from the GridShare). Since the current correction factor is relative to the 50 Hz value, one measurement must be as close to 50 Hz as possible. 7. Plot the ratio of actual current to measured current vs. period (expressed in units of 2 µs). The GetCurrent() result should be nearly a straight line; perform linear regression to determine the calibration equation. 3.4.8. Electrical Update the and Functional function Tests with the new calibration equation.

Quick calibration check

Materials required: frequency converter, multimeter, rice cooker. Scope: whenever hardware design changes or calibration is redone or suspect. 1. Compile software with verification mode enabled. Program PIC and insert into GridShare.

37

2. Connect serial cable using test clip. Connect device to 110 V output of frequency converter at lowest voltage setting. 3. Verify that voltage reported by GridShare matches voltage on frequency converter over entire range of both 110 V and 220 V outputs. You will have 5 minutes before the relay engages. 4. After the relay engages, repeat the test. 5. Connect rice cooker and set to COOK. Reset GridShare (or wait for relay to be de-­‐ energized). Allow rice cooker to warm up for few minutes, and then vary voltage to control current. (Reset GridShare again if necessary.) The resistance of the rice cooker at operating temperature is 90.9 ohms. The GridShare reports current in Normal hu ndredths Operation of Test an Protocol amp, so the expected reading is V/0.909.

Materials and equipment: frequency converter, multimeter, rice cooker. Scope: one unit, whenever software is modified DEBUG_SCALE Before performing test, verify that PIC installed in device is programmed with standard software (not calibration or verification mode). If testing time is limited, the parameter can be used to increase the system speed.

Currently vhigh = 208 V and vlow = 200 V. (Table 3 .2 shows the inputs and outputs at each step.)

1. Start with voltage below vlow and load set to “low”; ensure device enters BrownoutOn state. 2. Increase voltage above vhigh; ensure device enters Normal state. 3. Connect “high” load; reduce voltage to below vlow. Ensure device enters CookTimer state. 4. Before timer expires, increase voltage above vhigh. Verify device returns to Normal state. 5. Reduce voltage below vlow. Ensure device enters CookTimer state. Allow timer to expire; verify device enters Off state, then cycles on 10 seconds out of every 40 to test current. 6. Reduce load to “low”; verify power restored (wait more than 10 seconds after relay closes). 7. Increase load to “high”; verify power cut off after less than 40 seconds. 8. Increase voltage above vhigh; verify device returns to Normal state. 9. Reduce voltage below vlow; verify device enters CookTimer state. 10. Reduce load to “low.” Allow timer to expire; verify device enters BrownoutOn state.

38 Table 3 .2. Steps for normal operation test. Bold text indicates changes from previous step.

Step Set and and wait LED Load State load voltage s Power

> vhigh G R 1 HIGHLOW < vlow vlow < 80 s ON BrownoutOn 2 LOW > vhigh < 380 s ON Normal 3 < vlow < 80 s ON CookTimer 4 HIGH 60< -­‐ 65 380 s min ON Normal 5 HIGH 30 < s 80 s ON CookTimer HIGH < vhigh 10 s OFF Off LOWHIGH < vhigh ON CurrentTest HIGH < vhigh OFF Off 6 > < vhigh vhigh > 40 s ON BrownoutOn 7 < vlow vhigh < 40 s OFF Off 8 LOWHIGH 60< -­‐ 65 160 s min ON Normal 9 HIGH < 80 s OFF CookTimer Normal 10 operation with < vhigh multiple units ON BrownoutOn

Materials and equipment: frequency converter, SERC light bulb load, ten 100 W 230 V incandescent light bulbs, Ohm on the Range, data-­‐logging multimeter (optional). Scope: prototype units only

This test looks for interactions between multiple GridShares operating together. The output of each GridShare d is connecte to two 0 10 W 230 V incandescent light bulbs. A high-­‐ power 12.3-­‐ohm, 1500-­‐watt resistor (the “Ohm on the Range”) is connected between the output of the frequency converter and the GridShares to cause a drop in voltage that increases under load, to simulate the operation of an overloaded generator. In an actual induction generator the frequency drops as load increases; however, the GridShare already compensates for frequency drop. This test is a relatively realistic approximation that can be easily performed in the lab. Figure 3.3 is a schematic diagram of the test setup.

39

GridShare

GridShare 12.3 Ω 1500 W

Frequency GridShare converter

GridShare

GridShare Figure 3 .3. Test setup for multiple GridShares.

Quality control test

Required equipment and materials: GridShare test station, frequency converter, two multimeters, small flathead screwdriver, permanent marker.

Total time: about 8-­‐10 minutes Scope: all production units This -­‐ test should take about 10 minutes and verifies that: -­‐ -­‐ The PIC is programmed and functioning. -­‐ The red and green lights work and are wired correctly. The relay operates and switches the load. The current and voltage measurements are approximately accurate. The test uses a -­‐ specially constructed GridShare test ( station Figure 3.4) which consists of terminal blocks wired to a standard power plug and standard electrical outlets; this allows the GridShare to be connected temporarily for testing without fitting a plug and receptacle to the GridShare. The test station uses -­‐ bi color LEDs to simulate the kitchen LED boxes.

40 Figure 3 .4. GridShare test station. Terminal blocks for GridShare cables are on the left; receptacles for loads are on the right.

1. Using an ohmmeter, Between verify the and resistances Resistance in the should following table: be

Hot in Hot out 0 Hot in Neutral in >1 kΩ Neutral in Neutral out 0 2. Verify that test station is unplugged. 3. Connect GridShare(s) to test station; set load(s) to LOW. 4. Set voltage to 205 V; plug in test station. 5. Verify startup sequence (five flashes red/green, amber up to 20 seconds, green). 6. Verify that green light remains lit. (Wait at least 90 seconds.) 7. Set voltage to 195 V. 8. Wait for red light (up to 80 seconds). 9. Set load(s) to HIGH. Wait for load(s) to turn off (up to 20 seconds) and then back on (30 seconds). 10. Unplug test station. If Sustained device overvoltage passes test, write “FT PASS” on back of GridShare enclosure.

Scope: prototype units only

Equipment and materials: frequency converter and variac OR DC power supply, multimeter. Use a variac combined with the frequency converter to test at 315 V for 12 hours. This can also be a destructive test, if a high enough voltage can be reached.

41 The temperature of the transformer, voltage regulator, and TVS diode are of interest during this test. Alternatively, use a DC power supply and the rectifier calibration curve to perform the test excluding the transformer and regulator. This test can be performed on equipment available Undervoltage at and SERC, low but frequency is not as exhaustive.

Equipment and materials: function generator, frequency converter, two multimeters.

Scope: prototype units only This test verifies that the GridShare circuit operates normally at w lo voltages and low frequency.

1. Program the PIC to hold the relay energized and insert into the GridShare. 2. Connect the GridShare to the frequency converter and measure the transformer secondary voltage while varying the input voltage to develop a calibration curve. The curve should be piecewise linear. (These data may be available from the voltage calibration test, as long as the circuit design has not changed.) 3. If the output impedance of the transformer is not known, measure it by creating an IV curve. Use a transformer that is not connected to the GridShare circuit. a. Connect the primary side of the transformer to the frequency converter. Insulate the primary terminals to avoid a shock hazard. For a dual-­‐primary transformer, connect the primary coils in series as specified in the transformer datasheet. b. Connect the secondary side of the transformer to a load resistor through a multimeter set to measure AC current. For a dual-­‐secondary transformer, connect the primary coils in series or parallel as specified in the transformer datasheet for the required operating voltage. c. Connect a multimeter set to measure AC voltage across the secondary terminals. (Do not connect across the load resistor; this neglects the voltage drop across the multimeter.) d. Turn the frequency converter on and record current and voltage for various load resistor values. e. Plot voltage vs. current and fit a line to the data. The absolute value of the slope of the line is the output impedance. 4. Unplug the GridShare from the frequency converter. 5. Connect a function generator to the secondary side of the transformer through a resistor equal in value to the output impedance of the transformer. Connect a multimeter across the secondary side of the transformer and set to measure AC volts; connect a ultimeter second m across the voltage regulator output and set to measure both the AC and DC voltage components. (The Fluke 287 has this setting; with other multimeters, switch back and forth between AC and DC volts as necessary.) 6. Turn on the function nd generator a apply a sine wave at 50 Hz. Set the amplitude so that the regulator output is 5 V with negligible AC component.

42

7. Vary the input voltage and record the value when the following events occur: a. The regulator begins to drop out. (The DC voltage begins to drop and the AC component begins to increase.) b. The DC output voltage reaches the relay “must operate” voltage (3.5 V). c. The relay disengages. High 8. Repeat current steps operation 6 and (relay 7 performance) at frequencies down to 20 Hz, or as low as practical.

The relay should be tested for multiple cycles at high current. Measurement of the voltage drop across the relay before and after the test may provide some indication of the degradation of the relay as a result of the test. For this test, an AC voltage as close to the intended operating voltage as possible should be used; however, 20 A at 230 V is above the capacity High current of the operation frequency (PCB converter. thermal performance)

Materials and equipment: high-­‐current DC power supply, load, electronic clamp-­‐on ammeter, thermocouple and thermocouple reader, stopwatch, thermal imaging camera (optional).

Scope: prototype units only This test measures the temperature -­‐ of the high current traces on the board during sustained operation at maximum current.

1. Connect the DC power supply, electronic load, and GridShare board (HOT IN and HOT OUT terminals) in series. 2. Place the GridShare board on a flat surface with no air space between the surface and the board. (Alternatively, for a more realistic test, place in the bottom of the enclosure.) 3. Clamp the ammeter to one of the current-­‐carrying wires. Note the reading at zero current and subtract from future current readings. 4. Affix the thermocouple to the board at the hottest point, which is the point directly below the center contacts of the relay. Connect to the thermocouple reader. 5. Note the starting temperature before current is applied. 6. Turn on the power supply to a low voltage (about 5 volts) and adjust the electronic load so that the current is 20 amps. Start the stopwatch. 7. Record the thermocouple temperature at 5, 10, 15, 30, 45, and 60 minutes. Optionally, take thermal images at these times as well. (Note that parameters including the emissivity of the circuit board material affect the accuracy of the thermal image; the thermocouple reading should be considered the most accurate temperature measurement.) Note that adhesive has a tendency to soften at high temperatures; be sure that the thermocouple remains in the desired location, making good contact with the board, throughout the test.

43 3.5. Environmental tests

For these tests, the goal is to determine whether the device continues to operate normally under extreme conditions, whether the accuracy of measurements is affected, and whether protection Heat Endurance devices continue to operate normally.

Materials and equipment: lab oven, three thermocouples, two HOBO thermocouple loggers, thermocouple reader, thermometer, frequency converter, rice cooker. Scope: prototype units only

This procedure tests the on operati and calibration of the GridShare at high ambient temperature.

1. Attach the serial test clip to the PIC and plug the serial cable into the computer. 2. Place one of the HOBO thermocouples inside the GridShare enclosure to measure ambient temperature. Avoid contact with circuit components. Also place a separate thermocouple, connected to the thermocouple reader, to allow visual monitoring of the interior temperature while the test is in progress. 3. Close the GridShare enclosure. Tape the other HOBO thermocouple to the outside of the enclosure to measure ambient temperature. 4. Place the GridShare in the lab oven. Connect the rice cooker to the GridShare output. Run all cords through the thermometer opening in the top of the oven or, for small cables, through the oven door. For more accurate measurements, keep thermocouple wires away from power and data cables. 5. Launch the HOBO dataloggers. Since thermocouple measurements can be noisy, use a short logging interval, such as 10 seconds. 6. Turn on the power and configure the equipment for the “worst case” thermal conditions: a. Turn off the rice cooker. Be sure the cooker is filled with water. b. Reduce the voltage to below the brownout threshold and wait for the red light to illuminate. c. Increase the voltage to just below the end-­‐of-­‐brownout threshold. d. Turn the rice cooker to “cook” mode. 7. Use the gridshare_log.py program to record all serial output variables on the computer. 8. Set the oven thermostat to 40 °C and turn on the power. Wait for the temperature to level off inside the enclosure. Continue the test for as long as is practical, but do not leave the oven unattended. Monitor the oven temperature with a thermometer and adjust as necessary. 9. When the test is complete, turn off the oven and remove the apparatus.

44 Cold endurance and temperature cycling

Materials and equipment: frequency converter, cooler, dry ice (15-­‐20 lb), three thermocouples, thermocouple reader, multimeter, two HOBO thermocouple dataloggers. Scope: prototype units only This procedure tests the ability idShare of the Gr to operate at low temperatures. A temperature of -­‐20 °C or lower is recommended. Parameters of interest are the oscillator frequency, the voltage regulator stability, and the voltage and current calibration.

1. Connect a long wire to pin 1 of the serial test clip (to allow measurement of the regulator output voltage). Attach the test clip to the PIC and plug the serial cable into the computer. 2. Place one of the HOBO thermocouples inside the GridShare enclosure to measure ambient temperature. Avoid contact with circuit components. Also place a separate thermocouple, connected to the thermocouple reader, to allow visual monitoring of the interior temperature while the test is in progress. 3. Close the GridShare enclosure. Tape the other HOBO thermocouple to the outside of the enclosure to measure ambient temperature. 4. Launch the HOBO dataloggers. Since thermocouple measurements can be noisy, use a short logging interval, such as 10 seconds. 5. Place the GridShare enclosure in a cooler. For more accurate measurements, keep thermocouple wires away from power and data cables. Connect an extension cord to the GridShare output so that a load can be connected outside the cooler. 6. Cover the GridShare enclosure with a towel. Place 10-­‐20 lb of dry ice on the towel, then fill the remainder of the cooler with additional towels and close the lid. Be sure that the ambient temperature thermocouple has free air circulation and is not in contact with the dry ice. 7. Turn on the power. Reduce the voltage to the le lowest possible value whi still remaining above the regulator dropout voltage to minimize heating from the circuit components. Use the gridshare_log.py program to record all GridShare serial output parameters. 8. Allow the temperature to reach between -­‐20 °C and -­‐40 °C; if the erature temp is outside this range, add or remove towel layers between the dry ice and the GridShare. 9. Once enough data have been collected to characterize the temperature dependence of the oscillator frequency, the frequency converter can be turned off and the GridShare can be left in the cooler overnight or indefinitely. 10. After the target temperature has been reached, use the multimeter to measure the voltage between the regulator output and ground. (For access to ground while the cooler is closed, use able.) the LED c Verify that the output is 5 V DC with negligible AC component. An oscilloscope can also be used for this step. 11. When the test is complete, remove the GridShare from the cooler. Turn on the power and set up the “worst case” thermal conditions as described in the heat endurance test procedure. Since condensation will form on the inside and outside of the enclosure, use caution when handling the device.

45

12. Continue the test until the internal temperature stabilizes. (For additional thermal stress testing, the device could be placed immediately in the lab oven; however, this Rain testing exposure has not been performed.)

Scope: prototype units only This test could be performed during actual rainfall or using a shower, sink, or hose with an appropriate nozzle. (A lawn sprinkler is one possibility.) The enclosure is opened after the test and passes if there is no evidence of leakage. The device should not be powered during the 3.6. Results test.

Each test was conducted on one prototype unit. Unless otherwise noted, the tests were performed on the final PCB version; however, tests that were performed on a previous revision Voltage calibration of the circuit board were not repeated if no change in results was expected.

The voltage calibration Figure curve ( 3.5) is an excellent linear fit except for the region below approximately 115 V, where the regulator is in dropout. Below 115 V, the voltage output code is roximately app constant. Since the current threshold is only calculated when the relay is not energized, this lower limit should not cause problems with normal operation.

300

y = 0.4444x + 49.244 250 R² = 0.99997

200 Relay de-­‐ y = 0.4191x + 19.225 energized R² = 0.99999

AC line voltage (V) AC line 150

Relay energized 100

50 ADC output code 100 200 300 400 500 600 700

Figure 3 .5. Results of voltage calibration.

The DC output from the rectifier was also recorded during the calibration process. Based on a linear extrapolation Figure ( 3.6), the regulator operating voltage limit (30 V) is exceeded for voltage 0 above 36 V. This is more than 19% higher than the highest observed voltage at the powerhouse over six months of monitoring.

46 35 y = 0.08795x -­‐ 1.70084 30 R² = 0.99998

25

20

15 Recti�ier output (V DC) 10

5

0 Input voltage (V rms) 0 50 100 150 200 250 300 350 400

Figure 3 .6. Relationship between AC input and DC output voltage, showing extrapolation to maximum rated voltage regulator input.

Current calibration

For the amplifier gain setting of 10, the current calibration relationship is linear up to about 2.2 A (Figure 3.7). With a piecewise linear curve, the measurement range could be extended up 5 to 3. A; however, with the power threshold currently used there is no reason for this added complexity. More data points between 2.5 and 3.5 A would be necessary for this calibration. Although the amplifier gain setting is fixed at 10 in the code, a calibration curve (Figure 3.8) was obtained for a gain setting of 1, which was previously used in the software. The gain value can be changed in the code at compile time and the appropriate calibration curve will be used. The unity gain setting can be used to measure current up to at least 16 A (the highest current that could safely be measured during calibration), but the curve is not linear. A piecewise linear approximation that 4 works well up to about 6 A and is approximately correct up to 12 A was used in the software .

4 This calibration curve was used in the field, since individual GridShare units with higher current thresholds were needed for some installations.

47 3.5 805

3.0 690 y = 0.006757x + .004655 R² = 0.99965 2.5 575

2.0 460

1.5 345 Power at 230 V (W) Measured current (A) Measured current 1.0 230

0.5 115

0.0 0 ADC output code 0 50 100 150 200 250 300 350 400 450

Figure 3 .7. Current calibration curve with selectable-­‐gain amplifier set to 10x gain. Red points are in the nonlinear region were and not included in the linear regression.

18 4.14

16 3.68

14 3.22

12 y = 0.154x -­‐ 5.52 2.76 R² = 0.995341 10 2.30 Current (A) Current 8 1.84 Power at 230 V (kW) 6 1.38 y = 0.106x -­‐ 1.78 4 R² = 0.996519 0.92

2 y = 0.0676x + 0.170 0.46 R² = 0.9994428 0 ADC output code 0.00 0 20 40 60 80 100 120 140 Figure 3 .8. Current calibration curve with selectable-­‐gain amplifier set to unity (1x) gain, showing piecewise linear fit. Blue points are outside of the calibrated current range.

Frequency response calibration

The error in current due to frequency is significant, with almost 30% error at 20 Hz (Figure 3.9). For calibration, e th ratio between actual and measured current is more useful than the percent error; when this quantity is plotted against period (the inverse of frequency), the relationship is linear Figure ( 3.10). The test was performed at approximately 0 46 mA,

48 which was the highest current obtainable without distortion from the frequency generator interface circuit (Appendix E).

20%

10%

0% y' = 12.43/x + 0.7644 %err = (1 -­‐ y') / y' -­‐10%

-­‐20%

-­‐30% Percent error in current

-­‐40%

-­‐50%

-­‐60% Frequency (Hz) 10 20 30 40 50 60 70 80 90 Figure 3 .9. Error in current measurement due to variation in frequency, with a transformed version of the linear regression from Figure 3 .10 for reference.

Frequency (Hz)

100 50 33.3 25 20 1.5 1.4 y = 0.0124x + 0.7644 R² = 0.99843 1.3 1.2 1.1 1.0 0.9

Actual current / measured current / measured Actual current 0.8 Period (ms) 10 15 20 25 30 35 40 45 50 55

Figure 3 .10. Current transformer frequency response calibration curve, in the form used by the GridShare software.

Undervoltage and low frequency

No significant change in operation was found at 0 frequencies down to 2 Hz (Table 3 .3). The relay “must operate” voltage is reached at slightly lower input voltages at lower frequencies, but the difference is less than 2 percent.

49 Table 3 .3. Results of low-­‐frequency undervoltage test. Freq. Must operate voltage (V) Dropout voltage (V) Relay release voltage (V) (Hz) Secondary Primary Secondary Primary Secondary Primary

50 4.51 90.4 5.87 120 3.25 63 35 4.50 90.3 5.82 119 3.24 63 25 4.47 89.6 5.91 121 3.24 63 High 20 current 4.44 operation 88.9 5.86 120 3.24 63

The relay was tested 0 at 12 V, 5 1 A for 1300 cycles with no significant change in the voltage drop across the contacts. The high-­‐current thermal test was conducted using the prototype PCB at 20 A, 5 V DC for 30 minutes. The temperature at the hottest point on the board at the end of the test was 54.2 °C (measured using a type K thermocouple and the Fluke 701 process calibrator). 2 The test was conducted using the prototype 2 1 PCB, which has oz/ft copper thickness. Based on the results of this test, we decided to use 2 oz/ft copper for the on producti boards. The test was repeated with the production board (Figure 3.11); the temperature at the hottest point after one hour was 41.7 °C.

Figure 3 .11. Infrared thermal image of prototype board (left) and production board (right) with same temperature scale (units of . °C)

Heat endurance

The GridShare was heated 0 to above 4 °C for approximately one hour (Figure 3.12) and continued to function normally. The test was conducted using the prototype GridShare device, but the results for the production board are not ntly expected to be significa different. No significant change was noted in the current or voltage calibration.

50 55 50 45 40 35 30 Temperature (°C) 25 20 15 10 Elapsed time (minutes) 0 20 40 60 80 100 120 140

Figure 3 .12. Temperature profile of high-­‐temperature test; noise in temperature measurement is due to interference from power and data cables.

One prototype board was inadvertently left at 140 °C (280 °F) for approximately 26 hours. The board was tested after returning to room temperature and functioned normally for about 5 minutes before failing. We did not investigate the cause of the failure; however, the electrolytic power supply capacitor was visibly bulging. Aside from discoloration, the other PCB Cold components endurance and were temperature not visibly cycling damaged.

The cold test was performed twice, once with the unmodified prototype PCB and once with the prototype PCB modified to use the components from the production board. In both tests, the temperature was maintained below -­‐30 °C overnight; afterward, the device was allowed to warm to room temperature while operating with the relay energized, to maximize the rate of temperature rise (Figure 3.13). In a third test, the temperature dependence of the PIC16F688 internal oscillator RC was characterized Figure ( 3.14). The variation in oscillator period over the temperature range tested was less than 1%; based on this test, we decided to use the internal oscillator rather than the external ceramic resonator. Using the resonator would have added either significant cost or significant assembly time to the project, since our PCB assembler considers the resonator to be a leadless part, which requires an expensive X-­‐ray inspection. Hand soldering of the resonator after receiving the assembled boards would have been difficult due to the part’s small size and the proximity of other components.

51 20

10

0

-­‐10

Temperature (°C) Internal

-­‐20 Ambient

-­‐30

-­‐40 Elapsed time (hours) 0 5 10 15 20 25

Figure 3 .13. Temperature profile of second low-­‐temperature test; first 25 hours shown.

0.2%

0.1%

0.0%

-­‐0.1% y = 0.0001x -­‐ 0.0015 -­‐0.2% R² = 0.97359

-­‐0.3%

-­‐0.4% Percent error in oscillator period error Percent -­‐0.5%

-­‐0.6% Temperature (°C) -­‐30 -­‐20 -­‐10 0 10 20 30 Figure 3 .14. Temperature variation of oscillator period at low temperatures. Noise in temperature measurement is a result electrical of interference from power and data cables.

3.7. Tests not performed Sustained overvoltage

This test has not been performed and was a relatively low priority because the transformer calibration curve is linear and simple extrapolation indicates that voltages observed in the field are well within the rated operating range of the circuit components except the

52 transformer. (The transformer is rated for a nominal operating voltage of 0 23 V; however, the manufacturer states that the resistance between primary windings is 100 MΩ or more at Rain 500 V exposure DC, which suggests periodic operation at 315 V rms 5 (44 V peak) is acceptable.

Given the quality and NEMA 4X rating of the enclosures, we did not feel that this test was necessary. We added drain holes to the bottoms of all enclosures, which should prevent damage from minor water leaks. In most cases, the GridShare is installed under an overhang Elevation and is usually not exposed directly to the rain.

We discussed performing a test in a low-­‐pressure chamber to simulate operation at high elevation, but decided that the test would be difficult to perform with the available equipment and would take too much time away from other tests that were more likely to reveal problems.

53 Chapter 4. Installation and Conclusions

GridShare devices were installed between June 16 and 29, 2011, in Rukubji, Bhutan, with the assistance of electricians from the BPC Electricity Services Division (ESD) Wangdue 4.1.office. Results of Final Testing and Assembly

We assembled and tested 120 GridShare devices. Three devices failed the final functional test; however, all of the failures were easily repaired. One unit had a microcontroller which had not been programmed; the microcontroller was replaced and the device passed the test. One failure was due to a faulty solder joint on one of the bridge rectifier pins, which could have been due to a manufacturing defect or damage during handling; all four pins were resoldered by hand. The third failure was due to a cracked surface-­‐mount resistor; the damage may have occurred due to a defective component or moisture contamination during PCB assembly; the damaged part was replaced. The assembled devices were shipped to Bhutan on May 24, 2011, and received in excellent condition in Thimphu by our in-­‐country team member Chhimi Dorji on June 1.

The final cost of parts and assembly services was $93.37 per GridShare, or $56.26 including sponsorships and discounts. (See Appendix C for a detailed price breakdown.) This value does not include the cost of prototypes, extra parts, test equipment and tools, or shipping charges. The cost of shipping via FedEx International Economy was approximately $5,026, 4.2.or Installation $41.88 per GridShare; the shipment included tools and supplies for the installation.

Some minor changes were made in the field, both to the planned installation procedure and to the GridShare software. The most significant change to the installation procedure was that the GridShare was not allowed to be installed upstream of the energy meter. The team was informed of this regulation while meeting with the manager of ESD Wangdue the day before our arrival in Rukubji; as a result, the devices were installed between the meter and the MCBs or other protection 2 devices. To connect the GridShare circuit breaker to the energy meter, we purchased 4 mm insulated wire from a hardware store in Wangdue. While the additional wire was not rated for outdoor use or sun exposure, it is the standard type of wire used for electrical installations in Bhutan; sheathed cable with copper conductors was not available. One advantage of the change in installation procedure is that it allowed us to perform installations without turning off power at the substation.

In some cases, a single energy meter served more than one household; in these circumstances, we installed multiple GridShares if separate families were served by separate fuses or MCBs. Where this was not sed possible, we increa the power limit to 600 W in software.

Indicator-­‐only GridShares were installed at the milk processing plant and the school. For these installations, a standard GridShare device was used, with the “line” or “input” cable

54 connected to one of the building’s MCBs and the left “load” or “output” cable disconnected and capped with wire nuts and electrical tape. The building therefore continues to receive power directly, not through the GridShare, and the GridShare serves only as a brownout indicator. A significant setback occurred when the headrace channel was damaged due to rain, necessitating the shutdown of the system for repairs. The washout occurred on June 27, about 3 days after most of the installations were completed. I returned to Wangdue on June 29 to conduct training with Kyle Palmer and BPC engineer Kuenley Dorji; the rest of the team remained in Rukubji to conduct surveys until July 3. On July 6, due to personal time commitments, I returned to the United States. Power was restored in Rukubji on July 7, and the rest of the team (Meg, Kyle, Nathan, and Chhimi) returned to Rukubji on July 9 to finish education and troubleshooting. The generator was operating 5 at nearly 3 kVA due to the recently completed channel repairs. To test the system with GridShares installed, the team reduced the generation slightly to induce rownouts b during peak times. usage The full generation capacity was restored on July 12; the system was turned down to about 33.5 kVA to reduce oscillations in output. The team also used a variac (variable autotransformer) to simulate brownouts in individual homes where problems had been reported. For testing and demonstration purposes, we constructed a “portable” GridShare with a power plug and outlet. We used this device to log voltage and frequency during several brownouts (Figure 4.1). We also compared the voltage measurements from the GridShare with those from a HOBO datalogger; we observed good agreement during the first few days of the installation Figure ( 4.2). After the installation, we observed some disagreement between the GridShare and an Extech true-­‐RMS multimeter, with the GridShare reading low by as much as 5-­‐10 volts at times. After power was restored, Meg and Kyle investigated this phenomenon and found no significant difference between the GridShare and the voltmeter. However, they noted a delay in the GridShare’s response to voltage changes, probably due to the power supply capacitance. Since the voltage was fluctuating rapidly when the unusual behavior was noted, the delay could have been the source of discrepancy.

Frequency ranged from as low as 35 or 36 Hz to 51 Hz. There appears to be a sharp transition from values around 50 Hz to 40 Hz or below during brownouts; this probably corresponds to a threshold in the micro-­‐hydro system’s load controller.

55 260 55

250

240 50

230

220 45

Voltage (V) 210

Frequency (Hz) Frequency Voltage 200 40 Frequency 190

180 35

170

160 30 Time of day 17:00 18:00 19:00 20:00 21:00

Figure 4 .1. Voltage and frequency during an evening 18, brownout, June 2011.

260

250

240

230

220

Voltage (V) 210 HOBO 200 GridShare 190

180

170

160 Time of day 17:00 18:00 19:00 20:00 21:00

Figure 4 .2. Comparison of voltage measurements from GridShare and HOBO datalogger during the brownout of Figure 4 .1.

56 4.3. Reported Problems

The most common problem reported was that the GridShare entered timer mode or cut off power even when no appliances were plugged in. Possible causes include spurious high current readings, use of low loads such as TVs and uncorrected CFLs and fluorescent tube lights, and user misunderstanding. After returning to Rukubji, the team found that many family members who had not been present during the initial installation and follow-­‐up survey had not been informed about the GridShare. The team also found and repaired some GridShares in which the microcontroller was not fully inserted into the socket. Using non-­‐contact voltage detectors, he t team also identified several houses in which the phase and neutral conductors of the service cable were reversed at the connection to the energy meter. While this condition should not interfere with the operation of the GridShare, it does reduce the safety of the house wiring; the team elected to test most of the houses and correct the wiring if necessary. Based on conversations with Arne Jacobson and ESD Wangdue manager Chhejay Wangdi, the GridShare team also created a maintenance schedule and logbook for the -­‐ micro hydro system operator. Following a regular maintenance schedule may enable the generator to 4.4.operate Next closer Steps to its design capacity.

Over the next few months, we will continue to work with the BPC to provide technical support for the GridShare installation. Data loggers were left in place at the powerhouse and in some houses; in the next phase of the project, the voltage and current data will be analyzed and compared with data from before the installation to determine whether the GridShare was effective in reducing everity the s of brownouts. The GridShare should result in some households shifting their cooking times; this change in usage may result in longer, but “shallower,” brownouts. In addition to the data analysis, a follow-­‐up survey will be conducted to assess mer custo reactions to the device. In addition to assessing satisfaction with the GridShare, the survey will help determine whether the GridShare was successful in encouraging load-­‐shifting or whether users simply shifted to other fuels. The Rukubji distribution system may be connected to the national electrical grid as early as October 2011. Connection to the national grid should result in higher-­‐quality and more reliable electrical service, and will also enable Rukubji residents to use more high-­‐power electrical devices, including space heaters and immersion water heaters, which are currently prohibited by a village agreement. To obtain good data, the follow-­‐up survey should be performed as soon as possible after the grid connection is completed. The GridShare evices d can remain installed after the grid connection occurs, but since brownouts are not expected, the devices will not serve any useful purpose, and the 20 amp limit of the GridShare may prove overly restrictive. (Most homes have energy meters rated for only 5 or 10 amps.) Eventually, the GridShares should be removed and disposed of properly; before disposal, the condition of the circuit board should be noted and the data stored on the microcontroller should be retrieved; this inspection should provide me so

57 insight into the reliability and lifetime of the GridShare as well as the effectiveness of the enclosure 4.5. GridShare design. and the Smart Grid

The “smart grid” is currently a hot topic in industry, academic research, and public policy; however, there is no standard definition of the term “smart grid,” and no specific technology or set of technologies is agreed to make a grid “smart.” Broad definitions of the term include an “electricity network that can intelligently integrate the actions of all users connected to it . . . in order to efficiently deliver sustainable, economic, and secure electricity supplies” (SmartGrids European Technology Platform 2011) and “digital technology that allows for two-­‐way communication between the utility and its customers, and the sensing along the transmission lines” (United States Department of Energy). Most authors agree that two-­‐way communication between grid-­‐connected devices is al essenti for a true smart grid. Since such communication is not part of the design of the GridShare, installation of GridShare devices does not in itself create a smart grid by this definition. In a report prepared for the US Department of Energy, Litos Strategic Communication (2008) makes a distinction between “a smarter grid,” using upcoming or currently available technologies, and the true “Smart Grid.” The GridShare would almost certainly qualify as a “smarter grid” device. In a simple village mini-­‐grid, the highly advanced and “Smart Grid” envisioned in the Litos report is likely overkill. In remote villages like Rukubji, where funding for advanced technology is limited, simple, inexpensive devices like the GridShare may be a more realistic vision for achieving many of the benefits of the smart 4.6.grid, Applicabili such as ty to improved Other efficiency Situations and reliability.

Several factors make Bhutan an ideal setting for the GridShare device. Bhutan’s topography and climate result in a large hydropower resource and a large number of isolated villages, which are difficult to serve with a centralized transmission and distribution system. Rice, which can be prepared in advance and kept warm in a rice cooker with no user intervention, is a staple food; other foods may be less conducive to -­‐ load shifting. In poorer areas, mini-­‐grid systems are often usively used excl for lighting; load-­‐shifting would be difficult in these systems. In addition, cultural issues are a factor; while 94% of Rukubji residents agreed that an enforcement mechanism that cut off power to a house was reasonable, Americans may be less likely to agree to such a solution. Despite these limitations, there are many possible applications for the GridShare or similar devices. The GridShare device is programmable, and the control software could be redesigned to meet the needs of different types of mini-­‐grid systems. Isolated mini-­‐grids are used in many countries around the world, and brownouts due to excess peak load are common in such systems. In the developing world, even the national grid may suffer from brownouts, particularly in rural areas; while a solution similar to the GridShare could be useful, the larger scale of the system and the presence of commercial and industrial users means that a more sophisticated system, possibly with the capability to communicate

58 between devices, would likely be needed. (Larger loads would also require larger relays or contactors, which would increase the cost, and possibly the complexity, of the system.) The microcontroller which controls the GridShare circuit has some nonvolatile data storage, and it is possible that more sophisticated software could allow the GridShare to adapt to varying conditions; for example, it may be possible for the GridShare to “learn” what types of loads to allow instead of having a preset power limit that must be manually specified. This capability would simplify installation (by eliminating the need to individually program some devices, for example those serving multiple families, with higher current limits) and could allow the device to adapt a seasonally varying supply of power. However, extensive testing of the control algorithm, both in the laboratory and the field, would be necessary to ensure that the device works as intended. Although a sophisticated adaptive algorithm may exceed the capability of the specific microcontroller used in the GridShare, the basic design could be easily adapted to work with a more advanced device.

59 References

Alliance for Rural Electrification. 2011. Hybrid Mini-­‐Grids for Rural Electrification: Lessons Learned. Alliance for Rural Electrification, Brussels, Belgium. Available from: http://www.ruralelec.org/fileadmin/DATA/Documents/06_Publications/Position_ papers/ARE_Mini-­‐grids.pdf

Asian Development Bank. 2003. Report and Recommendation of the President to the Board of Directors on a Proposed Loan and Technical Assistance Grants to the Kingdom of Bhutan for the Rural Electrification and Network Expansion. Asian Development Bank, Manila, Philippines. Available from: http://www.adb.org/Documents/RRPs/BHU/rrp_bhu_34374.pdf

Bhutan Power Corporation. Draft Revised Terms and Conditions of Supply. Bhutan Power Corporation, Thimphu, Bhutan. Available from: http://www.bpc.bt/wp-­‐ content/downloads/SupplyRules.pdf

Bootan.com. Bhutan Weather Page. Available from: http://www.bootan.com/bhutan/weather.shtml

Brown, L., B. Mayhew, S. Armington, and R. W. Whitecross. 2007. Bhutan, 3rd edition. Lonely Planet, Melbourne, Victoria, in Australia.

Conaghan, B. F. 2007. Imaging. Chapter 26 C. F. Coombs, editor. Printed Circuits Handbook. 6th ed. McGraw-­‐Hill, New York, New York.

Dhungel, P. 2009. Financial and Economic Analysis of Micro-­‐Hydro Power in Nepal. Master’s thesis. Hubert H. Humphrey Institute of Public Affairs, University of Minnesota, Minneapolis, Minnesota.

DigiBarn. 2011. DigiBarn Parts: Macintosh e wir wrap logic board #5. DigiBarn Computer Museum. Available from: http://www.digibarn.com/collections/parts/mac-­‐ wirewrap5-­‐board/index.html

Dorji, K. 2007. The sustainable management of micro hydropower systems for rural electrification : the case of Bhutan. Master’s thesis. Department of Environmental Resources Engineering. Humboldt State University, Arcata, California. Available from: http://humboldt-­‐dspace.calstate.edu/xmlui/handle/2148/287

Druk Green Power Corporation. 2009. Druk Druk Green at Work. Green Power Corporation, Thimphu, Bhutan. Available from: http://www.drukgreen.bt/Content2.aspx?c=223 e7 Fund for Sustainable Energy Development. e7 Bhutan Micro Hydro Power CDM Project. United Nations Framework Convention on Climate Change, Clean Development Mechanism Project 0062. Available from: http://cdm.unfccc.int/Projects/DB/JACO1113389887.76/view

60 Elliott, R. 2010. Linear Power Supply Design. Elliott Sound Products, Thornleigh, New South Wales, Australia. Available from: http://sound.westhost.com/power-­‐supplies.htm

Engineering ToolBox. Air Pressure and Altitude above Sea Level. Available from: http://www.engineeringtoolbox.com/air-­‐altitude-­‐pressure-­‐d_462.html.

ESMAP (Energy Sector Management Assistance Program). 2000. Mini-­‐Grid Design Manual. Energy Sector Management Assistance Program, The World Bank, Washington, DC. Available from: http://www.esmap.org/esmap/node/1009

Greacen C. 2004. The Marginalization “ of Small is Beautiful”: Micro-­‐, Common Property, and the Politics of Rural Electricity Provision in Thailand. Doctoral Dissertation. Energy and Resources Group, University of California, Berkeley, Berkeley, California. Available from: http://www.palangthai.org/docs/GreacenDissertation.pdf

Gross National Happiness Commission. 2009. Tenth Five -­‐ Year Plan: 2008 2013. Gross National Happiness Commission, Royal Government of Bhutan, Thimphu, Bhutan. Available from: http://planipolis.iiep.unesco.org/upload/Bhutan/Bhutan_TenthPlan_Vol1_Web.pdf

Horowitz, P. and W. Hill. 1989. The Art of Electronics. 2nd ed. Cambridge University Press, Cambridge, United Kingdom.

Hydro-­‐Québec. 2010. Hydroelectric generating stations. Hydro-­‐Québec, Montréal, Québec, Canada. Available from: http://www.hydroquebec.com/generation/centrale-­‐ hydroelectrique.html

Inductiveload (Wikimedia Commons username). 2007a. File:Stripboard AM Receiver.jpg. Wikimedia Commons. Available from: http://commons.wikimedia.org/wiki/File:Stripboard_AM_Receiver.jpg

Inductiveload (Wikimedia Commons username). 2007b. File:Stripboard AM Receiver Reverse.jpg. Wikimedia Commons. Available from: http://commons.wikimedia.org/wiki/File:Stripboard_AM_Receiver_Reverse.jpg

International Electrotechnical Commission. 2005. IEC 61558-­‐1: Safety of power transformers, power supplies, reactors, and similar products — Part 1: General requirements and tests. International Electrotechnical Commission, Geneva, Switzerland.

Johansson, T. B. and L. Burnham. 1993. Renewable energy: sources for fuels and electricity. Island Press, Washington, DC . in

Kelley, E. J. 2007. Introduction to Base Materials. Chapter 6 C. F. Coombs, editor. Printed Circuits Handbook. 6th ed. McGraw-­‐Hill, New York, New York.

61 Litos Strategic Communication. 2008. The Smart Grid: An Introduction. Report to United States Department of Energy. Available from: http://www.oe.energy.gov/ DocumentsandMedia/DOE_SG_Book_Single_Pages(1).pdf

Lyons, J. 2009. Etching WARNING: Staples “Photo Basic ” Gloss has been changed for the worse. DIYstompboxes.com (Internet forum post). Available from: http://www.diystompboxes.com/smfforum/index.php?topic=78859.0

Moxfyre (Wikimedia Commons username). 2010. File:Relay symbols.svg. Wikimedia Commons. Available from: http://commons.wikimedia.org/wiki/File:Relay_symbols.svg

ON Semiconductor. 2001. Rectifier Applications Handbook. ON Semiconductor, Denver, Colorado. Available from: http://www.oldradios.co.nz/downloads/Rectifier%20Applications%20Handbook.p df

Personal communication (email) from Ngawang Choeda, BPC engineer, to Meg Harper, 2010. power-­‐technology.com. Tala Hydroelectric Project, Bhutan. Net Resources International, London, United Kingdom. Available from: ttp://www.power h -­‐ technology.com/projects/tala/

Ricci Bitti, A. 2011. Make PCBs at home with magazine paper and your laser printer. Available from: http://www.riccibitti.com/pcb/pcb.htm in

Ritchey, L. W. 2007. Physical Characteristics of the Chapter PCB. 13 C. F. Coombs, editor. Printed Circuits Handbook. 6th -­‐ ed. McGraw Hill, New York, New York.

Scherz, P. 2000. Practical Electronics for McGraw Inventors. -­‐Hill, New York, New York

SmartGrids European Technology Platform (ETP). 2011. A new vision for ty electrici networks: SmartGrids, an open and accessible platform. Available from: http://www.smartgrids.eu/documents/TRIPTICO%20SG.pdf

Smith, N . and G. Ranjitkar. 2000. Nepal Case Study -­‐ Part Two: Distribution, Safety, and Costs. Pico Hydro newsletter, University of Nottingham, Nottingham, United Kingdom. Available from: http://www.eee.nottingham.ac.uk/picohydro/docs/NepalCaseStudy_2.pdf

Smith, N. 1995. Low Cost Electricity Report Installation. of Intermediate Technology Consultants to Overseas Development Administration, United Kingdom. Available from: http://www.dfid.gov.uk/R4D/PDF/Outputs/R5685.pdf

Sonett72 (Wikimedia Commons username). 2004. File:Relay2.jpg. Available from: http://en.wikipedia.org/wiki/File:Relay2.jpg

62 Sterling, K. 2010. What’s the right term – PCB or PWB?. Connections (IPC Blog), IPC, Bannockburn, Illinois. Available from: http://blog.ipc.org/2010/01/22/whats-­‐the-­‐ right-­‐term-­‐pcb-­‐or-­‐pwb/

TCO Development. 2005. Report No. 5: Ecology Requirements for Displays, System Units, and Keyboards. TCO Development, Stockholm, Sweden. Available from: http://www.tcodevelopment.com/tcodevelopmentnew/TillverkareFr1200/ 99ecology_report_5_ed_4_0.pdf

Uddin, S. N., R. Taplin, and X. Yu. 2007. Energy, environment and development in Bhutan. Renewable and Sustainable Energy Reviews 11:2083-­‐2103.

United States Central Intelligence Agency (CIA). 2011. Bhutan. The World Factbook, United States Central Intelligence Agency, Washington, DC. Available from: https://www.cia.gov/library/publications/the-­‐world-­‐factbook/geos/bt.html

United States Department of E nergy. What is the smart grid?. Department of Energy (DOE), Washington, DC. Available from: http://www.smartgrid.gov/the_smart_grid#smart_gridin

Vianco, P. T. 2007. Assembly Processes. Chapter 40 C. F. Coombs, editor. Printed Circuits Handbook. 6th ed. McGraw-­‐Hill, New York, New York.

Williams, A. 2004. Build Your Own Printed Circuit Board. McGraw-­‐Hill, New York, New York.

Williams, A. and P. Maher. 2008. Mini-­‐grid design for rural electrification: optimisation and applications. International Conference on Energy Technologies and Policy 2008, Birmingham, United Kingdom. Available from: http://portal.clic.bham.ac.uk/U21/ Shared%20Documents/Williams%20A%20ext.doc

63 Appendix A. GridShare Technical Manual

This section provides a detailed description of the components and operation of the GridShare circuit. The GridShare Technical Manual was originally written by James Apple and A.1. Introd has uction been significantly revised to include the changes made since the first prototype.

The GridShare is a programmable voltage-­‐ and current-­‐controlled switch designed for reducing brownouts in overloaded mini-­‐grid systems. The device is intended to serve a single-­‐family home and can be connected upstream of the home’s electric meter. The GridShare consists of circuitry to measure the voltage and current entering the home, LED indicators to provide the user with information about the status of the power grid, a relay to switch the power to the home, and a microcontroller to process the inputs and control the output devices (Figure A.1). The GridShare works by encouraging users to shift load to off-­‐peak times when the mini-­‐ grid’s generator is not overloaded. The LED indicators inform the user when a brownout is occurring so that the can user avoid using high-­‐power appliances such as rice cookers during a brownout. If the user connects a large appliance when the LEDs indicate a brownout is occurring, the GridShare turns off the power to the house until the appliance is disconnected. If the grid voltage drops below the brownout threshold while a large appliance is already in use, the user is given approximately one hour to finish using the appliance before the power is cut off.

Power supply LED status indicators

Voltage

sensing Microcontroller

Current sensing

Frequency Relay sensing Figure A .1. GridShare functional block diagram.

The circuit diagram (Figure A.2) shows all of the components mounted on the circuit board. In addition to the board-­‐mounted components, there are two LEDs, one connected between the GRN and COM terminals and one between RED and COM, which provide a visual indication of the grid status. There is also a 20 A circuit breaker mounted in a separate enclosure upstream of the GridShare; this protects the relay and GridShare wiring from excessive current.

64 Figure A .2. GridShare circuit diagram.

65 A.2. Transformer and Rectifier

The GridShare uses a linear power supply to provide . DC power to the circuit The power supply consists of a transformer, bridge rectifier with capacitor filter, and linear voltage regulator; Figure A.3 shows the transformer and rectifier, while the r voltage regulato is described in section A.3. The transformer is rated 0 for 23 V input and 2 1 V output at 200 mA; the actual output voltage depends on the input voltage and the current drawn by the circuit. The circuit requires less than 150 mA under normal conditions; the transformer in a linear rectified power supply must be oversized to account for the current required to charge and discharge the capacitor C1.

Figure A .3. Transformer and rectifier.

The bridge rectifier B1, consisting of four diodes in a single package, inverts the negative half of the AC waveform, producing an output that is always positive. (Essentially, the output waveform is the absolute value of the input.) The result is similar to the red line in Figure A.4. The capacitor C1 smooths the output of the rectifier by charging while the voltage is high and then gradually discharging to produce a nearly constant DC output voltage. The size of the capacitor is determined by the output current requirement, input frequency, and maximum tolerable output ripple, and is usually calculated by assuming that the capacitor charges instantaneously at the peak of the input waveform and then discharges at constant current. The output voltage ripple is then approximately equal to the drop in capacitor voltage over one half cycle:   ∆ ≈ 2 With 3300 μF of output capacitance and an input frequency 5 of 2 Hz (possible in a severe brownout), the voltage ripple at 100 mA output current is about 0.6 volts. MOV1 is a metal-­‐oxide varistor (MOV), which protects against transient overvoltages (surges). The MOV only conducts above ltage, a certain vo which is higher than the highest expected working voltage. The MOV in the GridShare has a maximum working voltage of 385 V AC (rms) and conducts above 620 V. The MOV can absorb a surge containing up to 67 joules of energy at a maximum current of 2500 A. The MOV is degraded with each surge and will eventually fail. If the device fails in an open state, the circuit will continue to work normally but without the surge protection; if the device fails closed, the overcurrent protection (circuit breaker) will trip, and the GridShare will have to be replaced. Due to the short duration of the GridShare experiment, MOV failure is not expected to be a problem.

66 8 6 4 2

Voltage (V) 0 -­‐2 -­‐4 Input Output, C=0 -­‐6 Output, C=3300 µF -­‐8 Time (ms) 0 10 20 30 40 50 60 70 80 90

Figure A .4. Operation of bridge rectifier smoothing and capacitor, in a simple model that ignores the forward voltage drop of the bridge rectifier diodes. green The red and lines show the output of the rectifier without without and with the capacitor.

On the DC side of the bridge rectifier, ent the transi voltage suppressor (TVS) diode D5 also provides overvoltage protection. A TVS diode is -­‐ essentially a high current zener diode (see A.3.section Voltage A.4 ). regulator

To produce a constant 5 volts to power the circuit, the GridShare uses a linear series voltage regulator Figure ( A.5). This device essentially acts resistor as a variable that adjusts itself to maintain a constant 5-­‐volt output. Linear regulators are cheap and require few external components; however, they are inefficient, since they reduce the input voltage by dissipating power. In addition, linear regulators ys alwa produce a drop in voltage between the input and output; a linear regulator cannot step up an input voltage that is too low.

Figure A .5. Voltage regulator and associated components.

67 At high input voltages and output currents, the regulator must dissipate a large amount of power. The 1 maximum power dissipation is given by the maximum rated junction temperature and the thermal resistance between the junction and the ambient air:

 −   =  where  = maximum power dissipation  = maximum rated junction temperature  = ambient temperature  = total thermal resistance from junction to ambient air

If a heatsink is used, the overall thermal resistance  is the sum of the thermal resistance between the junction and the case () and the thermal resistance of the heatsink (). The values of  and  (with no heatsink) are given in the device datasheet. The joint between the heatsink and the case also adds thermal resistance, which should be taken into account; thermal compound can be used to provide better thermal conductivity. Another important characteristic of a linear regulator is the dropout voltage, which is the minimum voltage difference between the input and output. If the input drops too low, the device will “drop out” of regulation. For example, if a 5-­‐volt regulator has a dropout voltage of 1 volt, the input must stay above 6 volts for the regulator to operate. If the input voltage drops to 5 volts, the output will drop to 4 volts, and any ripples or spikes in the input will pass through the regulator to the output. A “standard” regulator can have a dropout voltage of 2 V or more; low-­‐dropout regulators can have dropout lose voltages c to 0.2 V. The exact dropout voltage depends on the load and is higher at higher currents. The GridShare circuit must be able to operate over a large range of input voltages, from 120 V to near 300 V; over this range, the unregulated DC output of the rectifier ranges from less than 4 V to more than 25 V. The relay manufacturer guarantees that the relay will operate at 5 3. V or above, so a low-­‐dropout regulator is required. The regulator used in the GridShare is the National Semiconductor LP2954A, which has a dropout voltage of 0.8 V or less and a current limit of 250 mA. The maximum junction temperature is 125 °C and the thermal resistance  is 2.5 °C/W. The heatsink used has a  of 15.6 °C/W; with these values, at an ambient temperature of 30 °C, the maximum power dissipation is 5.2 W, corresponding to 0 26 mA at a 20 V drop. Since the actual current is less than 150 mA, the regulator will operate at well below its maximum rated temperature, even with the added resistance of the joint e between th heatsink and . the case A voltage regulator is a type of amplifier with feedback and can oscillate if external capacitors are not provided. The 22 μF capacitor C3 prevents the GridShare power supply

1 The “junction temperature” is the internal temperature of a semiconductor device, at the junction between P-­‐ and N-­‐type silicon layers. (Complex devices have more than one PN junction, but the term is still used.)

68 from oscillating; the value is specified by atasheet. the LP2954 d (The datasheet requires 2.2 µF or greater; 2 2 µF was carried over from an earlier design using a different regulator.) The 1 0. μF input capacitor C2 is not manufacturer required by the unless the distance between the regulator and the AC filter capacitor (C1 in Figure A.3) is 10 inches or A.4.more; Voltage however, divider it is typically included.

To measure the grid voltage, the GridShare uses a voltage divider (Figure A.6) connected to the unregulated DC output of the rectifier, which is linearly related to the AC input voltage. The voltage divider scales down the unregulated DC output of the rectifier to a value between 0 and 5 V; the microcontroller uses the output of the divider to determine the AC input voltage.





Figure A .6. Voltage divider for voltage measurement, and associated components.

Ignoring the zener diode D1 and capacitor C7, the divider output is given by 2  =  1 + 2 If the input voltage  exceeds 32.45 V, the output voltage from the divider () will exceed 5 V, potentially damaging the microcontroller. The zener diode D1 protects against this situation. A zener diode is designed to maintain an approximately constant voltage when reverse-­‐biased over a large current range. D1 prevents the voltage divider output from exceeding approximately 4.7 V. The diode introduces some nonlinearity at the high end of the voltage measurement range; however, the decision of whether to enter or leave brownout mode occurs at lower voltages. The capacitor C7 provides some additional smoothing of the output voltage, helping to remove ripple. The value is not critical and was chosen to be identical to C3 reduce the number A.5. Microcontroller of unique parts.

A Microchip PIC16F688 8-­‐bit microcontroller (abbreviated PIC) implements GridShare logic to control the circuit. The microcontroller can be programmed (and -­‐ re programmed) by a computer. The PIC supports in-­‐system programming, in which the chip is

69 reprogrammed without being removed from the circuit; however, due to the impracticality of programming devices in the field in Bhutan, we chose not to include an in-­‐system programming connector.

The PIC monitors the voltage of the grid (provided by the voltage divider), the current drawn by appliances (provided by -­‐ the selectable gain amplifier), and the frequency of the grid. These analog signals are converted to digital values by the microcontroller’s built-­‐in analog-­‐to-­‐digital converter (ADC), which converts an analog voltage between 0 and 5 V to an integer between 0 and 1024. The LEDs, amplifier, and relay are connected to digital outputs, 2 which can output a “low” (approximately 0 V) or “high” (approximately 5 V) voltage or can be set to a high-­‐impedance (open) state. Table A .1 lists the function of each pin Table of A .1. the Functions microcontroller. of all pins on the PIC16F688 microcontroller. For -­‐ multi function pins, only the relevant name is shown.

Pin Diagram Pin # Pin Name Type Function

1 VDD Power Power, 5 + V 1 14 2 OSC1 Special External resonator 3 OSC2 Special External resonator 2 13 4 MCLR Special Enable power-­‐on reset 3 12 5 RC5 Digital output Amplifier gain select 4 11 6 RC4 Digital output Green LED 7 RC3 Digital output Relay 5 10 8 RC2 Digital output Red LED 6 9 9 RC1/AN5/C12IN-­‐ Unused in/out Not used 7 8 10 RC0 Digital output Serial output 11 AN2 Analog input Current input 12 AN1 Analog input Frequency input

13 AN0 Analog input Voltage input 14 VSS Power Ground A.6. Current Transformer and Selectable-­‐Gain Amplifier

The current consumed by the household is measured using a current transformer, amplifier, and RC filter (Figure A.7). The current transformer produces an AC voltage across the resistor R4 that is related to the AC primary current. The AC voltage is amplified and by a Microchip MCP6G01 selectable-­‐gain amplifier and converted to a DC signal by an RC filter consisting of R5 and C4. The zener diode D2 clips the waveform at approximately -­‐0.6 V and +4.7 V, preventing damage to the amplifier.

2 The PIC16F688 datasheet guarantees that the “low” output voltage is less than 0.6 V and the “high” output voltage is greater than 4.3 V when the power supply is 5 V.

70 Figure A .7. Current transformer, selectable-­‐gain amplifier, and RC filter.

An amplifier is a device that converts a low-­‐power signal into a high-­‐power signal; the ratio of the magnitude of the output to that of the input is called the gain. Gain can be in terms of voltage, current, or power; for the MCP6G01, the voltage gain can be set to 1 (also referred to as “unity”), 10, or 50. (A unity-­‐gain amplifier is useful because it can serve as a “buffer” between parts of the system; for example, if a sensor outputs a signal between 0 and 5 V, but can only source a few microamps of current, a unity-­‐gain amplifier could be used to connect it to a microcontroller input pin.) The MCP6G01 gain is set by the voltage on pin 2 (GSEL); this pin is connected to a microcontroller output pin so that the gain can be set in software. The gain setting performs a similar function to the range setting on a multimeter; at high gain, low currents can be measured more accurately, but the measurement range is reduced. R5 and C4 form a low-­‐pass filter, which averages the AC output of the amplifier to produce a DC signal. The cutoff frequency of the RC filter (the frequency above which the signal is attenuated by a factor of 2) is 1/(2πRC), or 0.16 Hz for the given component values. The choice of this value is a trade-­‐off between immunity from noise and time required for measurement. The high end of the measurement range is determined by the gain setting and the power supply voltage. At 5 V, with the gain set to 10, the circuit can measure current from 0 A up to approximately 2.3 A; the calibration curve is shown in Figure A.8. With the gain set to unity, the circuit can measure up to at least 16 A; however, the calibration curve is nonlinear (Figure A.9). Nonlinearity is due to the effect of the zener diode as l wel as the ESD protection diodes built into the amplifier IC and possibly the magnetic properties of the transformer. A piecewise linear approximation is reasonably accurate. It is possible to switch between the two ranges in software. However, the software must give sufficient time for the capacitor C4 to charge or discharge after switching the gain. This can take 7-­‐10 seconds, depending on the desired accuracy.

71 3.5 805

3.0 690 y = 0.00676x + .00466 R² = 0.9997 2.5 575

2.0 460

1.5 345 Power at 230 V (W) Measured current (A) Measured current 1.0 230

0.5 115

0.0 0 ADC output code 0 50 100 150 200 250 300 350 400 450

Figure A .8. Current sensor calibration curve, 10x gain.

18 4.14 16 3.68 14 3.22

12 y = 0.154x -­‐ 5.52 2.76 10 R² = 0.9953 2.30 Current (A) Current 8 1.84 6 1.38 Power at 230 V (kW) y = 0.106x -­‐ 1.78 4 R² = 0.9965 0.92 2 y = 0.0676x + 0.170 0.46 0 R² = 0.9994 0.00 ADC output code 0 20 40 60 80 100 120 140

Figure A .9. Current sensor calibration curve, unity gain.

The calibration of the current transformer is frequency-­‐dependent; our testing showed that the current measurement must be multiplied by a correction factor, which is a linear function of the inverse of the Figure frequency ( A.10):

72  =  where  = corrected current measurement  = current measured using 50 Hz calibration curve  = frequency correction factor and 12.4  = + 0.764  where F is the frequency in hertz.

1.6 1.4 1.2

1.0 y = 12.4x + 0.764 0.8 R² = 0.9984 0.6

Current correction factor correction Current 0.4 0.2 0.0 Period (1/F), seconds 0 0.01 0.02 0.03 0.04 0.05 0.06

Figure A .10. Frequency dependence of current measurements.

A.7. Frequency Measurement Components

In a large interconnected power grid, the inertia of rotating machinery connected to the grid provides frequency stability. However, in a mini-­‐grid with a single generator, there is no such inertia to provide stabilization, and the frequency can vary significantly as the load changes. Since the current transformer is frequency-­‐dependent, the GridShare must be able to measure the frequency of the AC power supply. Figure A.11 shows the components that enable frequency measurement.

73 A Figure A .11. Circuit components to enable frequency measurement.

To measure frequency, the AC voltage across one of the diodes of the bridge rectifier is fed directly into the microcontroller, where the software measures the time between rising edges of the signal. The zener diode D4 limits the output voltage to 4.7 V or less; the resistor R9 limits the current through D4. C8 and R9 form a low-­‐pass filter, which removes high-­‐frequency noise from the signal. The resistor R10 also helps remove noise from the signal.

The microcontroller continuously samples the output of this circuit at a rate much higher than the AC frequency. The software uses the microcontroller’s built-­‐in timer to measure the time between one “edge” of the waveform and the next. To reduce the impact of a transient voltage spike or dip, which could be mistaken for an “edge”, the measurement is averaged over a period of one second. The timer has a maximum limit of 131,072 µs, so the minimum A.8. LEDs frequency that can be measured is 7.63 Hz.

The GridShare uses two LEDs, one red (Lumex SSL-­‐LX3052ID) and green one (Lumex SSL-­‐ LX3052GD), as indicators of grid status. Each LED is driven directly by a microcontroller pin with a 510 ohm series resistor to limit current. The LED forward current is given by ( − )  =  where  = LED forward current  = voltage across LED and series resistor  = forward voltage drop across LED  = value of series resistor For both LEDs the typical forward voltage given by the manufacturer is 2.0 V; with a 5 V input, the forward current 9 is 5. mA, well below the maximum rated continuous operating current of 25 mA. The value of 510 ohms was selected so that two sets of LEDs could be placed in parallel for homes with two kitchens, while still maintaining sufficient brightness even in a severe brownout. With allel, two LEDs in par the 5.9 mA current is split approximately equally between the two LEDs. For this setup to work, the two LEDs must be well matched; if the forward voltages of the LEDs are even slightly different, the LED with

74 the higher  will not illuminate. The best practice is to use a separate resistor for each LED; however, since all of our LEDs are the same model, and slight variations in brightness are acceptable, we chose to simplify assembly by mounting the resistors on the circuit board. The 510 ohm resistor is also sufficient to protect the microcontroller from excessive current if the LEDs are shorted through damage to the wiring or LED enclosure. The maximum short-­‐circuit current is 8 about 9. mA (the maximum is 25 mA), and the maximum possible current for the entire I/O port -­‐ (pins 5 10) with the relay coil energized (see section A.9) is 6 24. mA, less than the limit of 90 mA. The power dissipated in the resistor when the LED is shorted is:  5 V , = = 0.049 W 510 Ω This A.9. Relay is less than the maximum rated power of 0.125 W.

A relay is an electromechanical switch actuated by an electromagnet (the “coil”). A voltage across the coil produces a magnetic field, which physically moves a set of contacts. Contacts can be “normally open” or “normally closed.” Normally open contacts are open (disconnected) when the relay coil is not energized; normally closed contacts are closed (connected) when the coil is zed not energi and open when it is energized. Figure A.12 shows the components of a typical relay.

Figure A .12. Relay with transparent case, showing coil (top) and contacts (bottom) (Sonett72 2004)

As with a manually operated switch, a relay can contain several sets of contacts; the number of sets is referred to as , the number of “poles ” and the number of positions for each set is the number of “throws.” For example, a switch with one set of contacts that can be either on or off -­‐ is single pole single-­‐throw (SPST), a switch with one set of contacts with two positions is single-­‐pole double-­‐throw (SPDT), and a switch with two sets of two-­‐

75 position contacts is double-­‐pole double-­‐throw (DPDT) (Figure A.13). In a 3 typical -­‐ double throw relay, one set of contacts is normally closed and one set is normally open ; these sets may have different current ratings.        

         

Figure A .13. Relay contact configurations (Moxfyre 2010).

The GridShare uses an SPDT relay, RTD14005F, Tyco Electronics with the load connected to the normally closed contacts. This configuration reduces the energy consumption of the GridShare, since the relay is usually not interrupting power to the house; it also provides some increased fault tolerance and allows the GridShare to be disabled by removing the microcontroller or disconnecting power to the circuit board. The GridShare relay has a nominal coil voltage of 5 V DC. According to the manufacturer’s datasheet, the relay must operate at 70% of the rated voltage (3.5 V) and must release at 10% (0.5 V); if the voltage is between these values, the relay may or not operate. (If the voltage drops while the coil is energized, the voltage may be sufficient to keep the coil from releasing but not high enough to re-­‐engage the contacts if the -­‐ relay is de energized and then re-­‐energized.) The coil resistance is 62 ohms (±10%), which gives a current of 81 mA at 5 V. A single microcontroller pin is limited to 25 mA, so the relay cannot be driven directly by the microcontroller; a transistor is needed to switch Figure the relay ( A.14). A general-­‐purpose NPN bipolar junction transistor (BJT), the NXM Semiconductor PMBT2222A, is used. A BJT has three terminals: the base, collector, and emitter; a small current from base to emitter allows a large current from collector to emitter. The relationship between base and collector current is

 = ℎ where  = DC collector current ℎ = DC current gain  = DC base current subject to the constraint that the collector voltage must be more positive than the emitter voltage (Horowitz & Hill, . 1989) The constant ℎ is the DC current gain, ed also denot β.

3 Also available are latching relays, which retain their previous position when de-­‐energized. The switch position may be set by reversing the polarity of the current in the coil, or there may be two separate coils, one for each contact position.

76 The value ℎ of  varies depending on the operating point and the individual transistor; the datasheet for the PMBT2222A gives a minimum value of 35 at 10 mA collector current and -­‐55 °C. For a collector current of 89 mA (81 mA + 10%), the base current must be at least 2.5 mA. Since the base voltage is approximately 0.7 V (corresponding to the forward voltage drop across -­‐ the base emitter junction), and the microcontroller ltage output vo is 5 V, the 1 kΩ resistor R3 gives a base current of 4.3 mA, more than enough to provide sufficient collector current to operate the relay. (Under reasonable operating conditions, the current gain will be more than 35; at 25 °C and 10 mA the minimum value is 75, and at 150 mA collector current the minimum value is 100.)

Figure A .14. Transistor, relay coil, and protection diode.

The protection diode (also referred to as a “flyback” or “snubber” diode) D3 protects the transistor from the voltage spike that can occur when the relay disengages. A relay coil can act as an inductor, in which the voltage is proportional to the time derivative of the current. Without the diode, when the transformer turns off, the current drops quickly to zero, resulting in a voltage hat spike t can damage the transistor. The diode provides an alternative current path when the transistor is turned off, allowing the current to decay slowly A.10. Ceramic until the resonator energy stored in the relay coil is dissipated.

The microcontroller may use an optional 4 MHz ceramic resonator to provide more reliable timing. Timing is especially important when using serial output; however, 4 the internal RC oscillator is rated to within 4 2% of MHz under most operating conditions . The resonator connects to pins 2 and 3 of the microcontroller. The resonator package includes the two loading capacitors that are required for proper operation; the other components of the oscillator circuit are built into the microcontroller. The clock source used by the microcontroller can be selected when the code is compiled; in addition, the PIC16F688 supports a “fail-­‐safe clock monitor” mode in which the oscillator hardware switches to the internal oscillator if the external clock source fails.

4 Supply voltage 2.5-­‐5.5 V; temperature 0 °C -­‐ 85 °C

77 Appendix B. GridShare Specifications

Table B .1. Specifications for GridShare device. Test conditions at room temperature (approximately 20 °C) and 50 Hz unless otherwise noted.

Parameter Conditions Min Typ Max Units

Load current 0.1 20 A Supply voltage 90 230 >300 V

Supply frequency 20 50 >80 Hz Ambient temperature -­‐40 >40 °C (1) Voltage sense resolution 1 V Current sense I < 2.3 A (2) 10 mA resolution I < 3.7 A 70 3.7 A < I < 6.5 A 100 I > 6.5 A 150 Operating current 180 V 3.9 mA (rms) (relay not energized) 200 V 5.6 230 V 9.9 250 V 17 Operating current 180 V 10 mA (rms) (relay energized) 200 V 11 220 V 12 Power consumption 200 V 0.33 W (relay not energized) 230 V 0.55 Power consumption 200 V 1.8 W (relay energized) Power factor 200 V 0.33 (relay not energized) 230 V 0.22 Power factor 200 V 0.79 (relay energized) Relay lifetime 2 A, 230 V 800,000 operations at 25 °C (3) 8,900 hours (4) 16 A, 250 V 50,000 60,000 operations 550 670 hours (4) 20 A, 277 V 30,000 operations 330 hours (4)

1 Components are rated for enclosure internal temperature up to 70 °C. Ambient 2temperature rating reflects testing at sea level with no wind and no direct sun exposure. 3 With current sense amplifier set to 1x gain setting in software. Relay lifetime for general purpose/resistive load. Large inductive loads, such as motors, 4will reduce relay lifetime. Hours of continuous operation in brownout mode with relay operating.

78 Appendix C. Parts List with Prices

Table C .1. GridShare parts list prices with as of April 2011.

Manufacturer’s Part Price per Qty Units Manufacturer Number Description Unit price device GridShare circuit components 4 ea Yageo CC0603KRX7R9BB104 Ceramic capacitor 0.1µF 50V X7R 0603 $ 0.0087 $ 0.03 1 ea National Semi LP2954AIT/NOPB Voltage regulator 5V 250mA LDO TO-­‐220 $ 3.7512 $ 3.75 1 ea Tamura 3FD-­‐324 Transformer dual pri/dual sec, 12VAC .20A $ 2.498 $ 2.50 1 ea Assman AR14-­‐HZL-­‐TT-­‐R IC socket, machined pins, DIP-­‐14, tin finish $ 0.6548 $ 0.65 1 ea Panasonic ECA-­‐1VM332 Capacitor 3300µF 35V electrolytic $ 0.9149 $ 0.91 1 ea Cornell Dubilier AVE107M25E16T-­‐F Capacitor 100µF 25V electrolytic SMD $ 0.1595 $ 0.16 2 ea Cornell Dubilier AFK226M35C12T-­‐F Capacitor 22µF 35V electrolytic SMD $ 0.2613 $ 0.52 1 ea Stackpole RNCP1206FTD100RCT Resistor 100 ohm 1/2W 1% 1206 $ 0.0271 $ 0.03 2 ea Rohm Semi MCR10EZPF6491 Resistor 6.49K ohm 1/8W 1% 0805 $ 0.02205 $ 0.04 1 ea Rohm Semi MCR10EZPF1001 Resistor 1.00K ohm 1/8W 1% 0805 $ 0.0268 $ 0.03 3 ea Stackpole RMCF0603JT1K00 Resistor 1K ohm 1/10W 5% 0603 $ 0.0052 $ 0.02 1 ea Stackpole RMCF0603JT10K0 Resistor 10K ohm 1/10W 5% 0603 $ 0.0052 $ 0.01 1 ea NXP Semi PMBT2222A,215 Transistor NPN 600mA 40V SOT23 $ 0.11 $ 0.11 1 ea Diodes Inc HD01-­‐T Rectifier, bridge, gen. purpose, 100V 0.8A $ 0.273 $ 0.27 1 ea TE Connectivity RTD14005F Relay SPDT 16A 5VDC $ 1.455 $ 1.46 3 ea NXP Semi BZX84-­‐C4V7,215 Diode, zener, 4.7V 250mW SOT23 $ 0.06824 $ 0.20 1 ea Fairchild LL4148 Diode, small signal, gen. purpose, SOD80 $ 0.05 $ 0.05 1 ea Bourns SMBJ30A Diode, TVS, 30V 600W unidirectional 5% SMB $ 0.159 $ 0.16 1 ea Panasonic ERZ-­‐V10D621 Surge absorber 10mm 620V 2500A ZNR $ 0.2956 $ 0.30 1 ea Microchip MCP6G01-­‐E/SN Selectable-­‐gain amplifier 1.8V 1CH 8SOIC $ 0.36 $ 0.36 1 ea Zettler Magnetics ACST-­‐260-­‐1 Current transformer 30A 530uOhm 60mH $ 0.96 $ 0.96 1 ea Aavid Thermalloy 507002B00000G Heatsink for TO-­‐220 $ 0.2174 $ 0.22 1 ea Microchip PIC16F688-­‐I/P PIC flash microcontroller 14-­‐DIP 4Kword $ 1.32 $ 1.32

79 Manufacturer’s Part Price per Qty Units Manufacturer Number Description Unit price device GridShare circuit components (continued) 2 ea Stackpole RMCF0603JT510R Resistor 510 OHM 1/10W 5% 0603 $ 0.0052 $ 0.01 Subtotal $ 14.07 GridShare enclosure and wiring 1 ea IDEAL 2006S Open end wire crimp ("Splice-­‐Cap") $ 0.1046 $ 0.10 1 ea IDEAL 2007 Insulator for Splice-­‐Cap $ 0.18414 $ 0.18 6 ft Various 12AWG/2 cond. Tray cable 1 (type TC) $ 0.445 $ 2.67 1.5 ft Coleman Cable 95218 18AWG/3 cond. Stranded shielded cable $ 0.2859 $ 0.43 1 ea PECO VJB-­‐444 PVC junction box 4"x4"x4" $ 11.42 $ 11.42 Cable Glands 2 ea Direct NPT-­‐38 NPT-­‐3/8" cable gland $ 0.54 $ 1.08 Subtotal $ 15.89 Breaker box components 1 ea PECO VJB-­‐442 PVC junction box 4"x4"x2" $ 6.79 $ 6.79 1 ea TE Connectivity W91-­‐X112-­‐20 Circuit breaker, hydraulic-magnetic, 20A $ 12.27 $ 12.27 1 ea APM Hexseal HE1015 Sealing boot for circuit breaker $ 13.528 $ 13.53 Cable Glands 2 ea Direct NPT-­‐38 NPT-3/8" cable gland $ 0.54 $ 1.08 Subtotal $ 33.67

1 The price of wire fluctuates according to the market price of copper. The wire prices shown were in effect when the majority of our wire was purchased.

80 Manufacturer’s Part Price per Qty Units Manufacturer Number Description Unit price device LED box components 1 ea Lumex SSL-­‐LX3052ID LED 3MM red $ 0.236 $ 0.24 1 ea Lumex SSL-­‐LX3052GD LED 3MM GREEN $ 0.192 $ 0.19 1 ea Lumex SSH-­‐LX3050 LED holder, snap-in plastic panel-mount $ 0.11252 $ 0.11 1 ft Coleman Cable Inc 95218 18AWG/3 cond. Stranded shielded cable $ 0.2859 $ 0.29 1 ea All Electronics MB-­‐96 Plastic enclosure $ 1.35 $ 1.35 Subtotal $ 2.18 Services Sunstone Circuits PCB fabrication (1 week build time)2 $ 739.75 $ 6.16 Screaming Circuits PCB assembly (5-day turnaround) $ 2,568.00 $ 21.40 Subtotal $ 3,307.75 $ 27.56 Discounts Sunstone Circuits Sponsorship -­‐$ 500.00 -­‐ $ 4.17 Screaming Circuits University discount -­‐$ 256.80 -­‐ $ 2.14 Screaming Circuits First-time customer discount -­‐$ 256.80 -­‐ $ 2.14 Screaming Circuits Sponsorship -­‐$ 2,000.00 -­‐ $ 16.67 Industrial Electric Discount on enclosures (4”x4”x4”) -­‐$ 537.60 -­‐ $ 4.48 Industrial Electric Discount on enclosures (4”x4”x2”) -­‐$ 301.20 -­‐ $ 2.51 Industrial Electric Donation -­‐$ 600.00 -­‐ $ 5.00 Subtotal -­‐$ 4,452.40 -­‐ $ 37.10 Total before discounts $ 93.37 Total after discounts $ 56.26

2 The PCB fabrication cost includes materials and labor.

81 Appendix D. Electronics Construction and Prototyping

This appendix describes some technologies used for constructing lectronic e circuits: solderless , perfboard, stripboard, Wire-­‐Wrap, and printed circuit boards. Solderless breadboards were used in the early prototyping of the GridShare as well for constructing temporary circuits for testing, such as the function generator interface circuit described in Appendix E. Later prototypes were built using perfboard and printed circuit boards. Stripboard and Wire-­‐Wrap, while not used for the GridShare project, are common D.1.techniques Solderless for Breadboard prototyping and construction of electronic circuits.

A solderless breadboard (Figure D.1) is a plastic block with rows of holes into which electronic component leads can be inserted (Horowitz and Hill . 1989) Each hole contains spring contacts to hold the wire or lead in place and provide an electrical connection; generally, holes in the same row are internally connected, and additional connections can be made using short lengths of wire (Scherz 2000). The spacing between holes is usually 0.1 inches, and one or more 0.3 inch gaps are usually provided to accommodate DIP integrated circuits. Breadboards are used during the first stages of prototyping and experimentation, not for permanent construction (Horowitz and Hill . 1989)

Figure D .1. Solderless breadboard with several components inserted. Each vertical set of five holes is electrically connected, as are the four horizontal rows at the top and bottom.

While the term “breadboard” alone usually refers to a solderless breadboard, perfboard and prototyping PCBs are sometimes also considered types of breadboard (as in Horowitz and D.2. Perfboard Hill 1989).

Perforated board, perfboard, or ( protoboard Figure D.2) is an insulated board with holes drilled at regular intervals. Connections are made by soldering together component leads and wires on the back of the board. As with solderless breadboards, to accommodate dual inline package (DIP) integrated circuits (ICs), the spacing usually between holes is

82 1 0.1 inches , although other spacings are available. The holes may be plated through with copper and equipped with solder pads; in this case, components can be soldered to the board for better durability and ease of assembly.

Figure D .2. Prototype GridShare device constructed on perfboard. Photo by James Apple.

Perfboard circuits are relatively nd durable a reliable, but not as reliable as printed circuit boards. Perfboard assembly -­‐ is time consuming, and surface-­‐mount components require special D.3. Stripboard adapters and (“breakout PC prototyping boards”) board to be mounted to perfboard.

Stripboard (Figure D.3) is similar to perfboard, but rows of holes are connected by parallel strips of copper on one side of the board. Components to be connected are soldered to holes on the same track. To break the built-­‐in electrical connections, the tracks can be cut using a knife or special tool.

1 Horowitz and Hill (1989) use the term “perfboard” to refer to a board with larger spacings (3/16 inch). With this type of board, special terminal pins are inserted into the holes; the component leads are inserted into the terminals and wires are soldered between the pins on the back of the board.

83 Figure D .3. Back and front views of a circuit constructed on stripboard. (Inductiveload 2007a; Inductiveload 2007b)

In addition to stripboard, printed-­‐circuit (PC) prototyping boards are available, which have a pre-­‐etched pattern of traces connecting components (Scherz 2000). Often, the layout is similar D.4. Wire to -­‐Wrap that of a solderless breadboard.

2 Wire-­‐Wrap (Figure D.4) is an electronics construction method in which a special tool is used to wrap thin wire tightly around the square pins on specially-­‐designed sockets. Wire-­‐ Wrap tools can be hand-­‐operated or electric; the tool forms a gas-­‐tight joint that does not require soldering. -­‐ is most convenient for digital circuits with many ICs and few discrete components (Horowitz and Hill . 1989)

2 Wire-­‐Wrap is a registered trademark of er, Gardner Denv although -­‐ “wire wrap” is often used in lower case as a generic term (e.g. Scherz . 2000)

84 Figure D .4. A prototype Macintosh computer logic board constructed using Wire-­‐Wrap (DigiBarn 2011).

D.5. Printed Circuit Boards

3 Printed circuit boards (PCBs) are the most reliable electronic circuit construction technology currently available for production in quantity, and are routinely used in spacecraft, military systems, and other high-­‐reliability devices (Horowitz and Hill . 1989) A printed circuit board is a rigid board with copper traces that connect components. The board substrate is usually an epoxy resin material; the most common is FR-­‐4, which uses woven fiberglass cloths impregnated with an epoxy resin (Kelley 2007). Other glass and paper-­‐based materials are also used. Components are soldered to copper pads on the surface of the PCB. Typically, the pads and conductors (traces) are formed by starting with a copper-­‐plated board and chemically etching the areas where copper is not desired. A single-­‐sided board has copper only on -­‐ one side; double sided boards have copper layers on both sides, typically with plated-­‐through holes connecting the two sides. Single-­‐sided boards are simpler and cheaper to produce but are impractical for complex designs; on a single-­‐sided board, if two conductors must cross, a small wire (“jumper”) must be soldered

3 PCBs are sometimes referred to as printed wiring boards (PWBs). The IPC (formerly Institute for Printed Circuits) defines a PCB as a printed board in which the width and spacing of conductors has an effect on circuit operation; in 1999, the IPC Technical Activities Executive Committee mandated the term PCB for all new documents (Sterling 2010). However, some authors (e.g. TCO Development 2005) use PWB to avoid confusion with polychlorinated biphenyls.

85 to the board. Complex boards can also have multiple internal copper layers; boards with 50 or more layers are possible (Ritchey 2007). Traditionally, components were mounted on printed circuit boards by inserting their leads or pins through holes drilled in the board and then soldering the leads to copper pads. These are referred to -­‐ as “through hole” components. Surface-­‐mount technology (SMT) is increasingly common; surface-­‐mount devices (SMDs) are soldered to pads on the surface of the board. Surface-­‐mount components allow higher density of components and interconnects and are easier to place on the board using automated methods (Vianco 2007); however, they are more difficult to solder by hand. Both types of components can be used on the same board.

PCBs can be designed by hand, by creating the desired copper pattern on a transparent plastic sheet using opaque tape and pre-­‐cut component footprint patterns (Horowitz and Hill 1989); however, computer-­‐aided design (CAD) and manufacture (CAM) is by far the most common method. In this process, CAD software is used to draw a schematic diagram, representing the electrical ctions conne between components; this information is then used to create a board layout. Generally, component “footprints” are placed on the board by hand, and the traces connecting components are routed manually or automatically. Free CAD software, such as Cadsoft’s EAGLE, has made this design process available to hobbyists as well as professional designers (Williams 2004). photoresist Printed circuit boards are typically manufactured using a photolithographic process (Conaghan 2007). The board is coated with a light-­‐sensitive material ( ), the photoresist is exposed to light in the desired pattern, and the pattern is then developed. Depending on the manufacturing process, the developed board pattern house is then etched to remove unwanted copper or plated with copper to produce the board. Generally, the designer of the board outsources this work to a PCB fabrication company, known as a . The cost of fabrication depends on the quantity of boards ordered, the size of board, required manufacturing capabilities, and the desired build time. For example, boards with very small copper features are likely to be more expensive. Electronics hobbyists have developed some alternative methods for PCB fabrication using readily available materials and equipment. One method, described by Williams (2004), involves printing the board artwork using and a laser printer using heat and pressure to transfer the toner to the board. The board is then etched with ferric chloride or ammonium persulfate. Other etchants can be substituted; a mixture of hydrochloric acid and hydrogen peroxide is popular among hobbyists. The success of the toner transfer method is dependent on the model of printer and type of paper used. While specially-­‐designed toner transfer paper is available, it is somewhat expensive; inkjet photo paper, label-­‐backing paper, transparencies (Williams 2004), and glossy magazine pages (Ricci Bitti 2011) have been used successfully. Through-­‐hole components can be placed by hand or machine; oddly shaped through-­‐hole components typically must be inserted by hand. Soldering can also be done by hand or machine; the most common automated soldering method for through-­‐hole components is wave soldering. First, a fluxer applies flux to the board; board is then moved over a

86 solder bath containing a wave, created by pumping the molten solder through a nozzle; this allows the solder to wet the pads and component leads (Vianco 2007). Surface-­‐mount components are usually soldered using reflow soldering. For surface-­‐mount devices, the placement and soldering process is highly automated. First, solder paste, a mixture of powdered solder and flux, is applied to the board using a screen-­‐printing process. Next, the components are placed on the board using a pick-­‐and-­‐place machine. Finally, the board passes through a furnace, which melts the solder paste and allows it to wet the joint. Some surface-­‐mount components can be soldered by hand, but hand assembly is not practical for very small components or components with hidden solder joints underneath the device (Vianco 2007).

A single PCB can contain both surface-­‐mount and through-­‐hole components. In this case, the surface-­‐mount components on the top of the board are soldered first using reflow soldering; through-­‐hole devices are then soldered using wave soldering. If there are surface-­‐mount components on the bottom of the board, these can be wave-­‐soldered in some cases; if this is not possible (for example, because direct contact with solder would damage the components), or if there are only a few through-­‐hole components, the bottom-­‐ side components may be soldered using reflow soldering and the through-­‐hole components by hand (Vianco 2007).

87 Appendix E. Function generator interface circuit

This circuit ( Figure E.1) can be used to power the GridShare circuit using a function generator with a 50 ohm output for the “frequency response calibration” and “undervoltage and low frequency” tests (Chapter 1).

Figure E .1. Amplifier circuit for function generator.

Capacitors C1 and C2 and potentiometer R1 form a high-­‐pass filter to remove any DC offset. These components were necessary for our testing because our function generator was malfunctioning and we were unable to adjust the amplitude or DC offset of the output. With a properly working function generator, the ould input c be connected directly to the operational amplifier; if AC coupling is still desired but amplitude adjustment is not needed, R1 could be replaced with a fixed resistor. A bipolar (audio) electrolytic capacitor could be used instead of C1 and C2. The operational amplifier IC1A, with resistors R2 and R3, is configured as a noninverting amplifier with voltage gain of approximately 15. (The type of op amp is not critical; the CA3240EN was used due to its availability in the lab.) Complementary power transistors Q1 and Q2 form a push-­‐pull output driver. (There is no compensation for crossover distortion; this was felt to be negligible compared to other sources of error.) A bypass capacitor (0.1 µF) should be installed across the power supply terminals of the op amp.

88