<% '============= Create and Open Database Connection ============= 'OPEN THE DATABASE If blnConnectToDB Then dim blnDBconnectionDown blnDBconnectionDown = false Err.Clear on error resume next set dbConn = Server.CreateObject("ADODB.Connection") 'Open the Connnection 'dbConn.Open Application("dbConn_ConnectionString") dbConn.Open "DSN=PostgreSQL30", "eere_news", "33reNews" ''New Error trapping. KC added 2/23/2012 If Err.Number <> 0 Then ''Response.Write (Err.Description& "

") dbConn.Close Set dbConn = nothing blnDBconnectionDown = true End If On Error GoTo 0 ''error trapping not working here KC removed 2/23/2012 ''tmpDBErrorNativeError = 0 '' For Each dbErr In dbConn.Errors '' strErrMsg = strErrMsg & _ '' "Source: " & dbErr.Source & vbCrLF & _ '' "Description: " & dbErr.Description & vbCrLF & _ '' "SQL State: " & dbErr.SQLState & vbCrLF & _ '' "NativeError: " & dbErr.NativeError & vbCrLF & _ '' "Number: " & dbErr.Number & vbCrLF & vbCrLF '' tmpDBErrorNativeError = dbErr.NativeError '' Next '' If (dbConn.Errors.Count > 0) AND (tmpDBErrorNativeError <> 5703) Then '' dbConn.Close '' Set dbConn = nothing '' blnDBconnectionDown = true '' Response.write(strErrMsg) '' Response.end '' End If dim arrErrors() Redim arrErrors(2,0) End If '============================================================== Public Function GetRS2(myCommand) On Error GoTo 0 'objConn: local connection object 'objRS: local recordset object 'objComm: command object passed in to the function Dim objConn, objRS, blnErrorLogged, objComm 'Create the command object Set objComm = Server.CreateObject("ADODB.Command") Set objComm = myCommand 'Create the connection object Set objConn = Server.CreateObject("ADODB.Connection") 'Open the connection object objConn.Open "DSN=PostgreSQL30", "eere_news", "33reNews" 'Set the active connection objComm.ActiveConnection = objConn 'Create the recordset object Set objRS = Server.CreateObject("ADODB.Recordset") 'Set the cursor location for disconnected recordsets 'objRS.CursorLocation = adUseClient 'Turn on error handling for just a second ' On Error Resume Next 'Open the recordset 'objRS.Open SQL, objConn, adOpenStatic, adLockOptimistic Set objRS = objComm.Execute 'Response.Write "State = " & objRS.State & "
" 'objRS.MoveLast 'objRS.MoveFirst 'Response.Write "Count = " & objRS.RecordCount & "
" 'Response.End 'Check for an error ' If Err.Number <> 0 Then ' Response.Write "Database Error Occured

" ' Response.Write "Error #" & Err.Number & "
" ' Response.Write Err.Description & "

" ' Response.Write "SQL:
" ' Response.Write SQL ' Response.End ' End If 'Turn off error handling ' On Error GoTo 0 'Disconnect the recordset 'Set objComm.ActiveConnection = Nothing 'Close the connection 'objConn.Close 'Set the connection to Nothing 'Set objConn = Nothing 'Set the Command to Nothing 'Set objComm = Nothing 'Return the recordset Set GetRS2 = objRS On Error Resume Next End Function '=============================================================== Function GetRS(sSQL) 'Declarations dim rs 'Create Recordset Object set rs = Server.CreateObject("ADODB.Recordset") If blnConnectToDB Then 'Open Recordset based on SQL rs.Open sSQL, dbConn, 1, 3, 1 End If 'Return Recordset set GetRs = rs End Function '=============================================================== Function ExecSQL(sSQL) 'Open the Command Object dim lRecordsAffected dbConn.Execute sSQL, lRecordsAffected 'Return the Records Affected ExecSQL = lRecordsAffected End Function '======================================================================== Function sendEmail(strFrom,strTo,strSubject,strMessage) Dim sch ' Schema sch = "http://schemas.microsoft.com/cdo/configuration/" Set cdoConfig = CreateObject("CDO.Configuration") With cdoConfig.Fields .Item(sch & "sendusing") = 2 .Item(sch & "smtpserver") = "mxrelay.doe.gov" .update End With Set cdoMessage = CreateObject("CDO.Message") With cdoMessage Set .Configuration = cdoConfig .From = strFrom .To = strTo .Subject = strSubject .TextBody = strMessage .Send End With Set cdoMessage = Nothing Set cdoConfig = Nothing End Function Function removeBadChars(tmpString) tmpString = Replace(tmpString , "<", "") tmpString = Replace(tmpString , ">", "") tmpString = Replace(tmpString , "'", "") tmpString = Replace(tmpString , """", "") tmpString = Replace(tmpString , ";", "") tmpString = Replace(tmpString , "(", "") tmpString = Replace(tmpString , ")", "") removeBadChars = tmpString End Function %> <% 'If there is a mobile version of this site, check the user_agent, and forward to 'the mobile version of the site (unless cookie or querystring var is set) if "true" = "true" then tmpSeeFullPage = Mid(Request.Querystring("m"),1,1) if ((isMobile) and (tmpSeeFullPage <> "1")) then tmpMobileURL = Request.servervariables("HTTP_URL") tmpMobileFileName = mid(tmpMobileURL, InStrRev(tmpMobileURL, "/")+1) tmpMobileURL = Left(tmpMobileURL, InStrRev(tmpMobileURL, "/")) tmpMobileURL = tmpMobileURL & "m/" & tmpMobileFileName Response.Clear Response.Redirect(tmpMobileURL) end if end if %>

<% ''This code is strictly when a user clicks on a left nav and needs to be forwarded to another site/program/office if ("" <> "") then Response.Clear Response.Redirect ("") end if %>

Lighting Control Types

Characteristics of the most common lighting controls for offices and other public buildings are outlined below.

Also provided is a portable document format version of How to Select Lighting Controls for Offices and Public BuildingsPDF.

Typical Lighting Control Applications
Type of Control Private Office Open Office - Daylit Open Office - Interior
Occupancy Sensors ++ ++ ++
Time Scheduling + ++ ++
Daylight Dimming ++ ++ 0
Bi-Level Switching ++ + +
Demand Lighting + ++ ++

++ = good savings potential
+ = some savings potential
0 = not applicable

Back to Top

Occupancy Sensors

Occupancy sensors are the most common lighting control used in buildings today. Two technologies dominate: infrared and ultrasonic. Infrared sensors detect temperature changes in a room, and work well where the entire room is within the sensor's field of view. Ultrasonic sensors use high frequency sound, much like bats do, to detect motion (even around corners). Dual-technology sensors use both methods, increasing accuracy and flexibility, but at a higher price. Even though lamp running life may be somewhat shortened by increased switching due to occupancy sensors, the overall chronological life of lamps is usually extended by the reduced daily burn hours.

Back to Top

Time Scheduling

Large open office areas work well with simple time scheduling - automatic switching at fixed hours of the day. Overrides allow users to turn on the lights after hours (using wall switches or telephone dial-up codes). Time scheduling can be accomplished with simple time clocks or more sophisticated computer controls. To save more energy, time scheduling systems can be designed so that lights are turned on manually rather than automatically at the beginning of the day, but are turned off automatically at 1- or 2-hour intervals after close of business.

Back to Top

Bi-Level Switching

Some people prefer lower overhead lighting levels (especially if daylight is available). Lower light levels are often preferred for computer use, meetings or tasks that are not visually demanding. Bi-level switching can provide simple manual control. For example, in a typical 3-lamp fluorescent fixture, the outer lamps are switched separately from the middle lamp, allowing the user to switch on one, two, or all three lamps. This low-cost measure is a minimum control requirement in some state energy codes, and can provide a simple means of load-shedding during peak hours if the bi-level lighting circuits are remotely controllable.

Back to Top

Manual Dimming

In rooms where different light levels are needed at different times, such as conference rooms and some private offices, the use of manually-operated dimming controls is a common solution. These controls can be either wall-mounted or, for convenience, use wireless remote controls (like the controls for a TV or VCR).

Back to Top

Automatic Daylight Dimming

Automatic daylight dimming, or "daylighting," uses a light sensor to measure the amount of illumination in a space. Then, light output from a dimming ballast is adjusted to maintain the desired level of illumination. The combination of daylight dimming with appropriate task lighting is often very effective.

Corridors and open cubicles near windows, particularly those with task lighting, are good candidates for daylighting controls. Private offices with windows can also be equipped with individual daylight sensors. Initial commissioning and calibration of light sensors and controls is critical for effective daylighting, however; poorly calibrated daylight sensors can result in little or no savings, and may annoy occupants.

Back to Top

Demand Limiting

During peak demand periods utilities often charge significantly higher prices for electricity. Remote operation of dimming ballasts or bi-level switching helps operators to respond to price signals or utility requests to shed load to help avoid power outages.

Back to Top

Operating Cost Comparison
Private Office, 128 sq. ft.
Performance Base Case Occupancy Sensors Daylighting Occupancy Sensor + Daylighting
Annual Energy Usea 450 kWh 340 kWh 330 kWh 250 kWh
Annual Energy Cost $33 $24 $24 $18
Annual Energy Cost Savings $9 $9 $15

a Average daily "on" hours for wall switch is 14.7. Average daily occupied hours for the office is 12.9.

Back to Top

Operating Cost Comparison
Open Office Area, 1000 sq. ft.
Performance Base Case Time Scheduling Occupancy Sensors Daylighting Time Scheduling + Daylighting
Annual Energy Usea 5700 kWh 5100 kWh 5000 kWh 4200 kWh 3700 kWh
Annual Energy Cost $340 $305 $300 $250 $220
Annual Energy Cost Savings $35 $40 $90 $120

a Average daily "on" hours for wall switch is 9.1. Average daily occupied hours for the office is 6.8.

Cost-Effectiveness Assumptions: Each of the two operating cost comparisons assumes that the workspace has approximately 1.5 watts per square foot of ceiling lighting, with parabolic troffer luminaires containing T-8 lamps and electronic ballasts. Daylighting examples assume a design light level of 55 footcandles at work surfaces. Assumed electricity price: $0.06/kWh, the Federal average electricity price (including demand charges) in the U.S.

Back to Top

How to Select Lighting Controls: Where and Why

Lighting controls can save energy and reduce peak demand in offices and other facilities. Controls save money while providing user convenience and an improved lighting environment. There are several different kinds of controls. The choice of control type should be based on lighting usage patterns and the type of space served (see Lighting Control Applications).

Areas with intermittent occupancy are well-suited to occupancy sensors. In large, open office areas with many occupants, scheduled switching ("time scheduling") is often an effective energy-saving strategy. In daylit offices, properly adjusted daylight sensors with dimming ballasts make sense. Because some workers prefer lower lighting levels, bi-level manual switching is another option. Advanced lighting controls can be used for demand limiting to allow building managers to reduce lighting loads when electricity demand costs are high.

Some types of lighting are not well suited to certain controls. For example, daylight dimming and occupancy sensing are not generally appropriate for high intensity discharge (HID) lighting (which requires a delayed re-start), whereas time scheduling is usually a good match for HIDs.

The Defense Logistics Agency (DLA) offers occupancy sensors, dimmable ballasts, and other lighting controls equipment through its Energy Efficient Lighting catalog.

Back to Top

Appropriate Illumination Levels

Proper illumination levels depend on the type of work being performed, and on occupant preference. Recommended illuminance levels for offices range from 30 to 60 footcandles*, but the quality of the visual environment can have a substantial impact on the "appropriate" amount of illumination. In well-designed office spaces, with light-colored surfaces, appropriate task lighting, and careful placement of lights and furniture to avoid glare and shadows, much lower illuminance levels are acceptable, and usually even preferred.
*Metric Conversions: 1 foot = 305 mm; 1 footcandle = 10.8 lux

Back to Top

Installation and Maintenance

Proper placement and orientation of both daylight and occupancy sensors is essential. Placement of controls should take into account furniture placement as much as possible. Occupancy sensors must be able to sense all occupants to avoid turning off lights while the space is occupied. At the same time, "false-on" incidents can be triggered by an automatic on/off sensor * that is exposed to passersby in an adjoining hallway. Daylight sensors that are placed where they are exposed to an amount of daylight not proportionate to the daylight at the desktops being served will not properly control lighting levels (and will likely result in dissatisfied users who may attempt to disable the control system).

Set time scheduling controls so that the switching times and intervals make sense for the occupants and usage pattern of the space. Occupants need to know how to override the schedule easily when needed.

Choose daylight sensors that can be calibrated quickly and easily, and take the time to calibrate them correctly. The dimming adjustment should be easily accessible to the installer and provide an acceptable range of dimming.

Commissioning and calibration of lighting controls are essential if energy savings are to be achieved and maintained. Occupancy sensors with sensitivity set too high can fail to save energy, but occupancy sensors with too low a sensitivity or too short a delay time can be annoying to occupants. Similarly, improperly adjusted daylighting controls can dim the lights too low, causing occupants to override them (e.g., by taping over the sensor), or can fail to dim the lights at all.
*Automatic on/off sensors switch on when they sense an occupant and off when they don't. Better energy savings are usually attained from sensors that are manual-on/automatic-off. These avoid unneeded turn-ons.

Back to Top

For More Information

  • Illuminating Engineering Society of North America (IESNA) publishes helpful information on lighting products, including controls.
    Phone: (800) 862-2086
  • Lighting Research Center has references to documents on lighting controls, including the National Lighting Product Information Project (NLPIP).
    Phone: (518) 687-7100
  • Lawrence Berkeley National Laboratory provided supporting analysis for this recommendation.
    Phone: (202) 646-7950

Back to Top