3D Measurement Test Bench for Luminaires

4 downloads 0 Views 3MB Size Report
The most commonly used light measuring equipment is the Lux Meter which only ...... device rotate the light fixture (Luminaire) in precise angles to feed the ...
3D Measurement Test Bench for Luminaires

M.M.A.Weerasinghe, May 2016.

3D Measurement Test Bench for Luminaires

A thesis submitted for the Degree of Master of Science in Applied Electronics

M.M.A.Weerasinghe, Faculty of Science University of Colombo May 2016.

i

DECLARATION

This thesis is my original work and has not been submitted previously for a degree at this or any other university / institute. To the best of my knowledge it does not contain any material published or written by another person, except as acknowledged in the text. Author’s name :- ………………………. Date :- ……………… ………………….. Signature: - ……………………………… This is to certify that this dissertation is based on the work carried by Mr M.M.A.Weerasinghe under my supervision. The dissertation has been prepared according to the format stipulated and is of acceptable standard. Certified by, Supervisor Name :-…………………………………. Date :-……………………………………

Signature:-………………………………

ii

ACKNOWLEDGMENTS

I wish to express my sincere thanks to the Department of Physics of University of Colombo, who offered me the great opportunity to do this research project. My heartfelt gratitude is extended to Dr. C.M. Edirisinghe, Department of Physics, University of Colombo, who was supervising this research project. His contribution to this research project was immense. From the selection phase to the completion he has been constantly backing me with essential guidance and encouragement that I will be ever in debt for. My sincere appreciation is also extended to Mr.H.Gurusinghe , Mr.L.Wijesinghe, Mr.P.Hewamadduma and Mr.S.Baddewela for the great friendship which blossomed a learning culture within my path of education. Most importantly, I thank my Mother, Father, Brother and my late grandmother for being the inspiration of all I do. Finally I thank Ms.Sajeni Pandithage for her continuous encouragement and thank all who supported me in many ways to make this research a reality.

iii

ABSTRACT

3D Measurement Test Bench for Luminaires M.M.A.Weerasinghe Due to the exponential growth of demand and depletion of natural energy resources, electricity has become a costly commodity at present, whilst environmental pollution and ‘carbon footprint’ made through electricity generation has also become major concern. In order to mitigate these issues, entire world has started making efforts towards generation of renewable energy and production of energy efficient products. In the interest of energy conservation and user applications, lighting industry has changed rapidly. Incandescent, CFL and LED are recognized as main lighting sources which are still in use. Despite the availability of various lighting sources, verities and models, testing of them has become a limitation due to many reasons. Cost, Bulkiness of instruments, inaccuracy and unavailability of testing equipment can be highlighted as major factors of limitation. The most commonly used light measuring equipment is the Lux Meter which only provides single point measurements. Single pointed measurements are inadequate in most of the precision applications and if it is used to acquire multipoint readings it may lead to inaccuracies. Conversely Integrated Sphere is an accurate measuring equipment commonly used in many optical laboratories. It is capable of providing many measurements such as Lumens, Colour Temperature, Optical Radiation etc. of the light source. The main drawback of this equipment is its cost and the bulkiness. Luminaires produce Electro Magnetic Radiation which belongs to the visible and nonvisible segments of the electromagnetic spectrum. Measuring primary properties such as intensity, propagation direction and wavelength / frequency are pivotal not only for precise applications but also to evaluate products according to the global standards due to the possibility of health risks caused by low quality products. The ultimate objective of this research is to produce a test bench which has the ability to acquire readings of a luminaire in a three dimensional plain. This test bench is intended to be much more cost effective and portable than the Integrated Sphere. The test bench is expected to analyse all the main properties of the spectral output with the introduction of interchangeable sensors. As a prototype model, it is developed to measure photometric values only.

iv

TABLE OF CONTENTS DECLARATION …………………………………………………….…………… ACKNOWLEDGEMENT ……………………………………….………………... ABSTRACT ….. ……………………………………………………………… TABLE OF CONTENTS ………………………………………………………. LIST OF FIGURES ………………………………………………………….. LIST OF TABLES …………………………………………………………. ABBREVIATIONS ……………………………….……………………….....

i ii iii iv vi viii ix

CHAPTER 1 - INTRODUCTION 1.1 Project background……………………………….…….……………….….…. 1.2 Research problem…………………… …………………..……………………. 1.3 Literature survey………….……..……………………..……………………… 1.3.1 Scientific background of light …..…………………………………………… 1.3.2 Evolution of lighting…………………………………………………………... 1.3.3 Light measuring equipment…... ………….……………………….…………. 1.3.3.1 Illuminometer……………………………………….……………….………. 1.3.3.2 Integrated sphere…………………………………….….……………….….. 1.3.3.3 Facilities in the proposed measuring bench………………………………... 1.3.4 Basics on microcontrollers……………………………………………………`

1 1 2 2 3 4 5 6 7 8

CHAPTER 2 -THEORETICAL BACKGROUND 2.1 An approach to luminaire data gathering………………………………….…….. 2.1.1 Design 1……………………………………...………………………….………. 2.1.2 Design 2………………………………………………………………….……… 2.1.3 Design 3………………………………………………………………….……… 2.2 Motorized arm…………………………….………………………………………. 2.2.1 Servo Motors…………………………………………………………………. … 2.3 Controlling and processing unit …………………………………………………. 2.3.1 PIC Microcontrollers ………………………………………………..…………. 2.3.2 Arduino…………………………………………………………………………. 2.3.2 Comparison between PIC and AVR…………………………………………… 2.4 Basics of Light Sensors…………………………………………………………… 2.4.1 Digital Light Sensors……………………………………………………………

9 9 11 11 12 12 14 14 16 17 18 19

v

CHAPTER 3 -METHODOLOGY AND IMPLEMENTATION 3.1 Functional block diagram of the 3D measurement test bench for luminaire……. 3.2 Main components of the 3DMTBL…………………………….…….………….. 3.3 Program development …………………………………………………………… 3.4 Programming flowcharts ………………...………………………….………….. 3.5 Programming the AVR 328 via Arduino ……………………………………….

23 24 29 32 36

CHAPTER 4 -FINAL TESTING 4.1 Testing Arduino with external power supply…………….…………………… 4.2 Testing servos with serial communication………………...………………….. 4.3 Testing of the lux sensor…………………………………...………………….. 4.4 Testing mechanical components………………...…………………………….. 4.5 Complete test scan using the prototype bench ……………………...……….. 4.5 Observations and analysis of testing…………………………………………..

45 49 46 46 48 49

CHAPTER 5 -DISCUSSION AND CONCLUSION

50

REFERENCES ………………………………………………………

51

APPENDIX A……………………………………………………………..

I

APPENDIX B……………………………………………………………..

VI

vi

LIST OF FIGURES Chapter 1 Figure 1.1 Figure 1.2 Figure 1.3 Figure 1.4

Electromagnetic spectrum with visible light expanded ………………… Incandescent lamp by Thomas Edison ………………………………..... Lux Meter………………………………………………………………… Integrated Sphere with sensor equipment……………………………….

2 3 5 6

Chapter 2 Figure 2.0 Integrated Sphere function …………...………………………………….. Figure 2.1 Model of Design Concept 1...…………………………………………….. Figure 2.2 Model of Design Concept 2……………………………………………… Figure 2.3 Model of Design Concept 3…………………………...…………………. Figure 2.4 Types of DC Motors ……………………………………………………… Figure 2.5 Servo motor description ………………………..………………………… Figure 2.6 MG995 Servo Motor Dissected …………………………………..……… Figure 2.7 Image of 40 pin PIC18F452 ……………………………………………… Figure 2.8 Atmega328P …………………..………………………………………….. Figure 2.9 Arduino Uno I/O …………………………….…………………………… Figure 2.10 Characteristics of an LDR …………………..…………………………… Figure 2.11a Characteristics of Photodiode ………………..…….…………………….. Figure 2.11b Characteristics of Phototransistor……………….….…………………….. Figure 2.2 Functionality sample of a digital light sensor ………………………...…….

9 10 11 12 12 13 13 14 16 17 18 19 19 19

Chapter 3 Figure 3.1 Functional block diagram of the 3DMTBL ………………………………… Figure 3.2 Servo Motor Function …………………….………………………………… Figure 3.3 Servo Motor Wire Connection ………….………………………………….. Figure 3.4 Luminaire Holder Design …………………………………………………… Figure 3.5 One step of luminaire (bulb) manipulation of complete scan …………….. Figure 3.6 Moderate scan option …………………….……………………………….... Figure 3.7 BH1750 Sensor Module …………………………………………..………… Figure 3.8 Schematic Diagram of BH170……………………………………………….. Figure 3.9 Atmega 328……..……………………………………………………………. Figure 3.10 Sketch of the total setup …………………………………………………… Figure 3.10a Complete Prototype test bench …………..………………………………. Figure 3.15 Program developing process……………………………………..………….

23 24 24 25 25 26 26 27 28 29 29 30

vii

Figure 3.16 Macro view of the program ………………………………………………… Figure 3.17 Successfully compiled program …………………………………………….. Figure 3.18 Compiled Program Uploaded ……………………………………………… Figure 3.19a Built in Serial Window …………………………………………………….. Figure 3.19b CoolTerm Serial Window …………………………………………………. Figure 3.20a Extract of the comma separated data text file ………….………………… Figure 3.20b Graphical interpretation of a Moderated Scan …………………………...

30 36 37 38 38 39 39

Chapter 4 Figure 4.1a Testing with power supply …………………………………………….…… Figure 4.1b Input voltage through adapter ……………………………….……………. Figure 4.2 Screen shot of servo motor positions during a moderate scan ………… …… Figure 4.3a Lux meter reading ………………………………………………………… Figure 4.3b Digital sensor reading …………………………………………………….. Figure 4.3c Digital sensor readings on serial monitor ………………………………… Figure 4.4a Luminaire manipulator testing………………………………..…………… Figure 4.4b Extracts of the servo motor angles ……………………………………. Figure 4.4c Graphical interpretation of the luminaire holder movement under Moderate scan option……………………………………………………… Figure 4.5a Screenshot of the data extraction obtained from the full data set………… Figure 4.5b Extraction of the data representation………………………………………..

45 45 45 46 46 46 46 47 47 48 48

viii

LIST OF TABLES Chapter 1 Table 1.1 Light measurement basics ………………………………………………….

4

Chapter 2 Table 2.1 Shows features of the PIC18F452 (40/44-PIN) ………………………… Table 2.2 PIC vs AVR…………………………………………………………………

15 17

Chapter 4 Table 4.1 Test details…………………………………………………………………

49

ix

ABBREVIATIONS

3DMLTB.. 3 Dimentional Measurement Test Bench for Luminaires PWM.. .....Pulse width modulation PIC …. Peripheral Interface Controller RF …... Radio frequency LED …… Light Emitting Diode ICSP …… In-Circuit Serial Programmer AC……….Alternating Current DC……….Direct Current I2C……… Inter-Integrated Circuit ID………...Identification MCU…….Microcontroller Unit TX……….Transmit RX……….Receive

1

CHAPTER 1 INTRODUCTION 1.1

Project background

Lighting industry is a rapidly growing field in the world today. With exponential growth in the field of construction, the demand for innovative and energy efficient lighting solutions are at its peak. Especially there is higher focus on selecting the most suitable solution, depending on the lighting characteristics. Measuring lighting characteristics require special instruments. These instruments may spread across from a simple lux meter to an integrated sphere. Price, accuracy, availability, size are the elements that could make an impact on actual usage of these instruments. Lux meter is a good solution for measuring light in a given area. From open areas to rooms, the lux meter has the ability to provide intensity of the available light. Whilst the lux meter is fixed on giving light intensity, it is not suitable to use to measure overall intensity of a luminaire due to its inaccuracy. Furthermore it does not provide facilities to analyse intensity performances graphically. The Integrated Sphere on the other hand is an accurate instrument used in most of the laboratories to test the performance of luminaires. It is considered to be highly sophisticated and holds a reputation for its accuracy, but the instrument itself is bulky and the affordability is low. The main focus of this research is to model an accurate and cost effective scanning mechanism for luminaires. 1.2 Research Problem In consideration with the following aspects of the lighting industry, 1. Major demand for luminaires in the construction industry 2. Availability of novel and innovative luminaire solutions 3. Requirement of precision lighting solutions 4. Unavailability of affordable practical luminaire testing instruments Results in a requirement for a testing device as discussed in this paper. Affordability, accuracy and data representation are key performance indicators of the discussed solution.

2

1.3 Literature survey This research focusses on “luminaire testing” and implementation of a cost effective, accurate testing instrument. Scientific background of light, history and evolution of artificial lighting, latest in the field of luminaires and current luminaire testing equipment will be taken into consideration within this section. 1.3.1 Scientific Background of Light [1] Light is a portion of electromagnetic spectrum that is visible to the human eye. It is a type of electromagnetic radiation and typically all visible light (Visible to the human eye) falls between the wavelengths of 400 to 700 nanometres. These wavelengths correspond to a frequency of 430 to 750 terahertz.

Figure 1.1- Electromagnetic spectrum with visible light expanded Visible light consist of the following properties 1. Intensity 2. Propagation direction 3. Frequency 4. Polarization All electromagnetic waves (EMRs) which are inclusive of visible light travel in vacuum at the speed of 299,792,458 metres per second. And this figure is also seen as one of the most fundamental constants in existence. Emission and absorption of visible light takes place in the form of photons that exhibits the properties of wave and particle. This property is referred to as wave-particle duality.

3

1.3.2 Evolution of lighting The most common and the most important source of light is the sun. Sun light provides not only the visibility but also acts as the most critical source of energy to living beans. One of the most important aspects of the sunlight is its contribution towards photosynthesis process of trees and plants which eventually nourishes all other animals. As the light of sun restricted to the day time, humans required a source of light for their survival. As historians believe it was during the Lower Palaeolithic stage of humans the discovery of fire was made. Fire was one of the most astonishing and vital discoveries in the human history as it full filled many needs such as light, warmth, security and preparation mode for food. With the development of oil based lamps, fire prolonged many centuries as a source of lighting which is still used in remote areas in the globe.

Figure 1.2- Incandescent lamp by Thomas Edison In the history of artificial lighting, filament based electrical lighting dates back to 1802 in which Humphry Davy attempted to create artificial light using a platinum filament. This experiment laid the foundation for many of the experiments that were followed by many other scientists. Finally Thomas Edison was able to produce a carbon filament lamp, which gained popularity over the years. His invention was based on a carbon filament that was covered with a nitrogen filled glass globe. With this invention of filament lighting, due to its practicality the fundamental technology survived many years. Even at present it is in use yet slowly becoming unpopular due its inefficiencies. Due to inefficiencies of the incandescent lamp, researches were carried out to produce a lamp with lower watt to lumens ratio. Florescent lamp and Compact florescent lamps are the other types of lamps that gained popularity with its efficiency being much higher compared to incandescent lamp. The florescent lamp also commonly known as the ‘tube lamp’ is a mercury vapour gas discharge lamp that produces florescence. When current is flown through the gas, it excites mercury vapour which creates ultra violet waves. This ultra violet waves then causes the phosphorus coating of the tube to glow producing visible light. The CFL bulbs also operate in the same principal yet it is compact and can be used in the same fixtures of incandescent bulb. Both fluorescent and compact fluorescent lamps are treated as toxic waste at the expiry of them due to its mercury content. Furthermore scientists believe that florescent lamps including the compacts may cause ailments such as skin cancer, if humans are exposed

4

to such lighting in close proximity for long periods of time. Variety of draw backs in different lighting solutions keeps the lighting industry searching for efficient and non-hazardous solutions. The latest finding in domestic lighting is the application of LED based lighting solutions. Currently is renowned for its energy efficiency and is readily available in multiple fixture types. Although the fixture types are many, there are main two types of LEDs used in these fixtures. Namely the standard LED and the surface mount LED. As discussed above, the industry of lighting has been growing rapidly serving variety of purposes. This is expected to continue further as the construction industry grows creating opportunities for domestic lighting solutions. As the lighting industry grows, it is essential to have the necessary equipment to measure certain as properties of light. The next section discusses regarding such measuring equipment. 1.3.3 Light measuring equipment Prior to the discussion of equipment this section will discuss various terminologies and SI units used in measuring properties of light. Table 1.1 Light measurement basics SI unit Candela

Lumen Lux

Candela Per Square Meter

Lumen per watt

Name of measurement Luminous intensity

Description Luminous power per unit solid angle emitted by a point light source in a particular direction. Luminous flux / Luminous Total number of visible light power emitted by a source Illuminance Intensity, as perceived by the human eye, of light that hits or passes through a surface Luminous exitance / luminous Luminous power emitted by a emittance surface Luminance Luminous power per unit solid angle per unit projected source area. Luminous efficacy Ratio of luminous flux to radiant flux or power consumption, depending on context.

Optical property measuring equipment dates back to early 19th century despite the fact that, speed of light measuring dates back even further. There are wide variations of measurements used in light testing that falls under Intensity, Propagation Direction, Frequency and Polarization. In a fully equipped laboratory following measurements of light can be obtained. Total luminous flux, colour temperature, spectral distribution, light-source colour, general

5

colour rendering index, distribution of luminous intensity, illuminance right under the light source with illuminometer, and ultraviolet rays. As the lighting industry progresses demand for testing equipment increases for standardising and evaluating lighting solutions. Following sections elaborates some of the most commonly used equipment in lighting fixture testing. 1.3.3.1 Illuminometer Luminous flux is the rate of flow of light energy. Rate of flow of light energy on a specific area is known as illuminance. Lumen is the SI unit for light energy and Lux is the SI unit for lumens per square metre also known as the unit of illuminance. Lux metre is a most basic illuminometer that measures the intensity of light. Lux meters or simple illuminometers are used in wide variety of practical applications. Primarily it is used to measure the amount of light in an open or close environment. The main purpose of light testing through an illuminometer is not to test the light source but to make decision on the actual light that is present. As an example, in places such as offices light is measured to decide whether the available light is adequate or not. Depending on which the decisions are made either to increase or decrease lighting.

Figure 1.3- Lux Meter The basic operation of a Lux Meter can be described as follows. The lux meter consists of a Photo Cell that absorbs available light. In accordance to the absorption amount, an electrical signal is generated. This signal is then used for calculations which results in a lux figure that is displayed through the meter. Lux meters are commonly used by professionals such as photographers to adjust the shutter speed of the camera accordingly. For health and safety regulations in working environments, this device is used to check whether the lighting regulations are met. In sporting activities such as cricket, lux meters are used to measure the ambient light to determine the suitability to play. Advantage : Easy to use, Relatively inexpensive compared to other complex devices, Portable, Readily available , Quick response to ambient light

6

Disadvantages : Insufficient accuracy to evaluate light sources, Inability to measure the distance from the light source, Unavailability of a graphical summery, Inability to measure other properties of light 1.3.3.2 Integrated Sphere The integrated sphere also known as the Ulbricht sphere was invented by R.Ulbricht and was published in 1900. The device is commonly used as a standard instrument in photometry and radiometry. This device has the capability of measuring the total power of a luminaire with a single measurement. Integrated sphere is a hollow spherical cavity coated with white reflective coating. This white coating has the ability to diffuse light. Once a device is under testing, the light generated within the cavity will be scattered in a uniform manner. Hence the direction of light propagation is not taken into consideration; rather it is designed to measure the total power of the light source. Furthermore an integrated sphere can be used to measure the diffuse reflectance of surfaces, providing an average over all angles of illumination and observation and it can also be used to create a light source with apparent intensity uniform over all positions within its circular aperture, and independent of direction except for the cosine function inherent to ideally diffuse radiating surfaces.

Figure 1.4- Integrated Sphere with sensor equipment Advantages: Higher accuracy levels, Ability to use with different equipment to measure different photometric properties, Graphical data interpretation (With use of necessary equipment) Disadvantages: Expensive, Bulkiness, Issues related to availability, Complexity of operation, Requirement of other expensive add-ons.

7

1.3.3.3 Facilities in the proposed measuring bench As stated above, different light measuring equipment has various drawbacks attached to them. This section will discuss the facilities of the proposed system. 1. The proposed test bench would consist of user options - Different users may have different required levels of information regarding a particular luminaire. Hence the proposed system would include user selectable testing options. (For the prototype version lux sensor will be used)

2. Simplified operation - Most of the contemporary light measurement instruments complex in its operation, creating difficulty in using. Proposed test bench will be developed to eliminate such issues.

3. Ability to obtain measurements on a three dimensional plain - This system will be designed to obtain data sets with different depths if required. Ideally the developed system will be attached to an optical test bench.

4. Single sensor - The device will be designed to have a single sensor. This will enable the device to be cost effective. Furthermore it would create opportunity to use different types of sensors depending on the requirement.

5. Cost effective - Proposed device will be developed as a cost effective solution compared to equipment such as the Integrated Sphere.

6. Graphical Summaries – The system will provide the user with graphical summaries. Viewing of graphical summery would be possible in simple software such as excel and will have compatibility with software such as Matlab depending on the user requirement.

8

1.3.4 Basics on microcontrollers Since a micro controller will be used to process data and control luminaire holder in the proposed test bench, it would be essential to have a deep understanding in the electronics, programming and architecture of the micro-controller technology before a most suitable micro-controller can be selected(Further discussions are made in Chapter 3). Microprocessor technology which was developed in the 1950’s, experienced a huge growth in the period between 1970 and 1980, was quickly replaced with more reliable and smaller Large-Scale Integration chips. The first micro controller that was developed had a 4-bit architecture, which means that the processor could deal with 4-bit width of data. These 4-bit micro controllers were cheap and had fast response. It also consumed low power and could handle just about any data processing application or any control imaginable in those days. With more complicated designs, there was a need for smaller and low power systems. 8-bit micro-controller, which still dominates the market, was introduced. The typical 8-bit microprocessor has an 8-bit wide data bus and a 16-bit wide address bus. This means that 8 bit microprocessors can directly access 28 or 256 memory locations. About 55% of all CPUs sold in the world are 8-bit microcontrollers with today's advanced VLSI technologies, 16, 32 and 64-bit architectures micro controllers were introduced. They are cheaper, faster, consume less power, and are more powerful. These micro-controllers are usually reserved for supercomputer and minicomputer applications. Modern micro-controllers still retain this RAM/ROM/IO structure along with data and address buses. This configuration allows the most expandability and allows the highest performance when designing large systems.

9

CHAPTER 2 THEORETICAL BACKGROUND This chapter will discuss basically about the luminaire holder designing, luminaire holder automation and central data processing unit. Also focuses briefly about component and systems used. 2.1 An approach to luminaire data gathering Luminaire testing devices that are available in the market has various methodologies of light data gathering. When the most discussed devise in the industry, the integrate sphere is taken into consideration, it consists of a cavity coated with reflective material. There is a single sensing component that feeds the CPU with adequate data which is then given as the total spectral flux of the light source. Integrated sphere is not capable of measuring photo data with respect to direction of propagation. The ideology behind the implementation of 3D Luminaire Test Bench is to design a device with this capability. The following figure 2.0 depicts the working principal of an integrated sphere.

Figure 2.0- Integrated Sphere function 2.1 .1 Design 1 In the integrated sphere the luminaire is lit up in the centre of the sphere , propagating light within the cavity of the sphere. Design 1, the first methodology designed for data gathering was influenced by this integrated sphere mechanism. The ideology behind was to replace the reflecting points of the sphere with sensor modules. Each sensor would be demarcated with coordinates and these sensors would transmit incident light data to the central processing unit with the sensor identity(coordinates). The objective of the CPU would be to receive all sensor data , map them with sensor identity and save according to a usable format so that the data could be represented graphically.

10

Figure 2.1- Model of Design Concept 1 As shown in the model , the ideology initially was to design a robust and high efficiency system by modifying the setup of the integrated sphere. The bulb icon in at the centre of the sphere indicated the position of the luminaire and the arrows propagating out of the surface of the sphere indicate the sensing points. Initially the attempt was to use a 1 foot radius sphere but it was observed that the radius was not sufficient. The luminaire in the sphere produces a large amount of visible light within, which compensated for the areas where light could not have been as intense as sensed. In order to overcome this issue the radius had to be made larger which in return increased the number of sensors on the sphere surface. This resulted in a vast increment in the implementation cost as well. Although this model(with a higher radius sphere) was proven to produce accurate results, due to the complexity of the operation and cost of implementation the Design 1 model was not preceded any further.

11 2.1 .2 Design 2

Luminaire

Sensor grid panel

Figure 2.2- Model of Design Concept 2

This model was developed as an alternative to Design 1, precisely to reduce the usage of higher number of sensors. Instead of using higher number of sensors this design uses only a single sensor. The sensor grid panel is a special panel in which the sensor will move autonomously. The sensor will receive data at each coordinate and will transmit to the CPU with the coordinate. In order to move sensor, the panel will be equipped by 2 motors. These two motors would manoeuvre the sensor from point to point on the two axis panel. This design was cost effective yet had few drawbacks. One of the main concerns was the moving sensor. The accuracy of the readings with the moving sensor was arguable. Secondly the grid could not cover a 360º around the luminaire. Readings were restricted to the size of the panel. The other major concern was the irregular distance from the source of light to the various points of the panel. The sensor coordinate directly in front of the luminaire being the shortest distance where as other coordinate points differed accordingly. This was a main issue with this design which made the sensing of data irregular. Due to these drawbacks this particular concept was not implemented.

2.1 .3 Design 3 With previous design concepts, many features were extracted to this final design. The requirement was to design a device that could provide a 360º readings of the luminaire. Furthermore simplicity and cost efficiency was also recognized as a primary requirement. In order to make the device cost effective it was essential to use minimal amount of sensors for this device. The concept of controlling the luminaire instead of the sensor was developed as a result. This final design is elaborated furthermore in chapter 3.

12 2.2 Motorized arm With the decision of executing design 3 concept, it was required to first design a motorized luminaire holding arm. Figure 2.3 presents the initial design of the arm.

Figure 2.3- Model of Design Concept 3 As per the above figure, the concept 3 was equipped with the motorized luminaire holder as shown on the left, a test bench bed and a single sensor on the right. The two circles illustrate the positioning of the motors. One motor is to control the yaw of the light source and the other to control the roll. Initial requirement was to develop this section. Hence it was required to select suitable motors. 2.2.1 Servo Motors

Figure 2.4- Types of DC Motors

13 DC motors have been used in industrial applications for years Coupled with a DC drive, since DC motors provide very precise control, DC motors can be used with conveyors, elevators, extruders, automobile, aircraft, and portable electronics, in speed control applications. For the implementation of design concept 3, it was obvious that a DC motors were required. The type of DC motor was selected depending on the requirement. The real requirement was the precision of the motor rotations.

Figure 2.5- Servo motor description

Servo Motors are mechanical devices that can be instructed to move the output shaft attached to a servo wheel or arm to a specified position. Servo Motors are designed for applications involving position control, velocity control and torque control. A servo motor mainly consists of a DC motor, gear system, a position sensor which is mostly a potentiometer, and control electronics. Furthermore information related to servo motors are discussed in chapter 3.

Figure 2.6 – MG995 Servo Motor Dissected

14 2.3 Controlling and processing unit With the completion of the design concept, it was required to make decision on the controlling and processing unit. Clearly the processor is to be process oriented. The function of the processor is to control the motors accordingly while receiving and transmitting the sensor data to the computer. Microprocessors are comprised of only the processing unit. Peripherals such as RAM , ROM etc; does not include in single chip. These microprocessors are used for purposes such as software, games and other application that are complex and not specifically task oriented. Microcontrollers on the other hand are equipped with all the required peripherals and are heavily task oriented. The ability to function in accordance to a given input is its main priority. Microcontrollers are much more cost effective compared to a microprocessor. For the implementation of this project few option were taken into consideration. 2.3.1 PIC Microcontrollers PIC stands for ‘Peripheral Interface Controller’, general instrument as small, fast, inexpensive embedded microcontroller with strong input/output capabilities. The PIC18F452 is CMOS Flash-based 8 bit microcontroller. It packs into a 40-pin package with 5 ports for input/output which are Port A, Port B, Port C, port D and Port E. In this project, PIC18F452 will be use. PIC microcontrollers are broken up into two major categories: 8-bit microcontrollers and 16bit microcontrollers. Each category is further subdivided into product families. The microcontrollers in the PIC10 through PIC14 families are considered low-end microcontrollers. PIC microcontrollers in the PIC16 and PIC18 families are considered mid-level microcontrollers while 16-bit PICs are considered high-end microcontrollers. The PIC18 microcontroller family provides Pismire devices in 18- to 80-pin packages that are both socket and software upwardly compatible to the PIC16 family. The PIC18 family includes all the popular peripherals, such as MSSP, ESCI, CCP, flexible 8- and 16-bit timers, PSP, 10-bit ADC, WDT, POR and CAN 2.0B Active for the maximum flexible solution. Most PIC18 devices will provide FLASH program memory in sizes from 8 to 128 Kbytes and data RAM from 256 to 4 Kbytes; operating from 2.0 to 5.5 volts, at speeds from DC to 40 MHz Optimized for high-level languages like ANSI C, the PIC18 family offers a highly flexible solution for complex embedded applications. the image of PIC 18F452 is shown in figure-2.7.

Figure 2.7- Image of 40 pin PIC18F452

15 PIC18F452 microcontroller is a high performance RISC CPU. It has a C compiler optimized architecture/instruction set, a linear program memory addressing to 32 Kbytes and a linear data memory addressing to 1.5 Kbytes. It support up to 10 MIPS operation at DC - 40 MHz osc./clock input and 4 MHz - 10 MHz osc./clock input with PLL active .The CPU is based on16-bit wide instructions, 8-bit wide data path and has priority levels for interrupts. It has some peripheral features which includes         

High current sink/source 25 mA/25 mA Three external interrupt pins Timer0 module: 8-bit/16-bit timer/counter with 8-bit programmable prescaler Timer1 module: 16-bit timer/counter Timer2 module: 8-bit timer/counter with 8-bit period register (time-base for PWM) Timer3 module: 16-bit timer/counter Secondary oscillator clock option - Timer1/Timer3 Two Capture/Compare/PWM (CCP) modules I2C Master and Slave mode Addressable USART module: Supports RS-485 and RS-232

It has some Analog features which includes 

Compatible 10-bit Analog-to-Digital Converter module (A/D) with: Fast sampling rate Programmable Low Voltage Detection (PLVD)

Table 2.1 - Shows features of the PIC18F452 (40/44-PIN)

16 The following paragraph explains about the USART of the PIC18F452.The Universal Synchronous Asynchronous Receiver Transmission, which is also known as a Serial Communications Interface or SCI, is a general–purpose serial data bus for Synchronous /Asynchronous communication. The Universal Synchronous Asynchronous Receiver Transmitter (USART) module is one of the two serial I/O modules. The USART can be configured as a full duplex asynchronous system, which can communicate with peripheral devices, such as CRT terminals and personal computers. It can also be configured as a halfduplex synchronous system that can communicate with peripheral devices, such as A/D or D/A integrated circuits, serial EEPROMs, etc. For transmission at 9600 baud, each bit has a bit time of 1/9600 second. USARTs integrated in micro controllers can transfer data at speeds ranging from a few hundred bits per second up to 1.5Mbps. However, when the serial port is enabled, the USART will control both pins and one cannot be used for general purpose I/O when the other is being used for transmission or reception. The USART is most commonly used in the asynchronous mode. The most common use of the USART in asynchronous mode is to communicate to a PC serial port using the RS232 protocol. A typical USART data frame is also shown in figure-2.6. 2.3.2 Arduino Arduino is a single-board microcontroller to make using electronics in multidisciplinary projects more accessible. The hardware consists of a simple open source hardware board designed around an 8-bit Atmel AVR microcontroller, or a 32-bit Atmel ARM(Depends on the type of development board). The software consists of a standard programming language compiler and a boot loader that executes on the microcontroller. For the execution of this project different models of Arduinos were considered. The point of focus was then narrowed to the Arduino Uno, as the most suitable development board for a project of this architecture. Theoretical background with regard to the Arduino uno is discussed further in this chapter. Features of Atmega328p • AVR 8-bit RISC architecture • Available in DIP package • Up to 20 MHz clock • 32kB flash memory • 1 kB SRAM • 23 programmable I/O channels • Six 10-bit ADC inputs • Three timers/counters • Six PWM outputs

Figure 2.8- Atmega328P

17 Arduino platform is recognized as one of the most versatile development board in electronics mainly due to its simplicity. Originally the development board is made in Italy and at present there are many manufacturers who are using the same architecture to manufacture copies of the Arduino. Since it is an open source development tool , there are many compatible peripherals that can be attached , minimizing time spent on issues related to compatibility and saving much needed time for the process of actual development. The figure given below shows the pin configuration of an Arduino uno development platform.

Figure 2.9- Arduino Uno I/O 2.3.2 Comparison between PIC and AVR Table 2.2 – PIC vs AVR Advantages of PIC over AVR Simplicity in coding with limited instruction set Accurate RC oscillators Lower power consumption Constant interrupt latency Faster ADC

Better drive capability in I/O ports

Advantages of AVR over PIC Precision arithmetic with a good range of conditional branching. Wider range of RC oscillator speeds Possibility of higher baudrates Registers can be reserved for interrupt-only use to speed up context save for low latency Separate PORT and PIN registers avoid readmodify-write issues with capacitively loaded pins TX and RX can be enabled separately

Considering the above factors as well as through lengthy research carried out via internet the two microcontrollers were evaluated. During the previous microcontroller projects it was observed; despite the simpler programmability of the PIC , the amount of unpredictable behaviour of such systems was on the higher end. This was also another factor that AVR was a favoured option during this project. Additionally in the case of a PIC microcontroller the user is compelled to use programmer software and a programmer board such as PIC Kit2. The Arduino uno was versatile in this manner where the vendor provided the development and execution platform on the same board. Furthermore with the extensive online support on

18 Arduino platform, developers are supported with the fulfilment of the actual development required, rather than focusing on time consuming technical constraints faced in other development platforms. 2.4 Basics of Light Sensors Light sensors are devices that have the capability of measuring the radiating energy from a light source. Light is an energy type which lays its frequency ranges from Infra-red to Visible and even up to ultraviolet in the light spectrum. The task of a light sensor is to read the amount of energy radiating as light and produce an electrical signal in correspondence. These sensors are also referred to as photoelectric devices or Photo sensors due to its ability to convert the photonic power into electrical power. Light sensors are divided into two major categories. One segment of sensors which directly produces electricity depending on the incident light, other is the set of segment which changes electrical properties depending on the incident light. Apart from afore mentioned, photo sensors can be classified as given below. Photo emissive cells – These devices releases free electrons, when the light sensitive material is been struck by photons. Caesium is one of the most commonly used materials as the photon reactive material in many of the devices. Photo conductive cells – The resultant of photon incidence in these devices is the change of electrical resistivity. Semiconductor materials such a cadmium sulphide used in these devices change the electrical current within a given voltage. This in result varies the resistance.

Figure 2.10- Characteristics of an LDR

Photo voltaic cells – In these devices, an electromotive force in generated proportionately to the light intensity. Two semiconductor layers are used in these cells which has the capability of producing 0.5V when light is present. Selenium is the most common photovoltaic material used in solar cells.

19

Photo junction devices – These devices are basically either photodiodes or phototransistors, consisting of PN junctions, which control the flow of electrons and holes. Commonly used in detection applications, these devices can be tuned to a certain wavelength to get the required response.

Figure 2.11a- Characteristics of Photodiode

Figure 2.11b- Characteristics of Phototransistor

2.4.1 Digital Light Sensors Discussed above are the most basic light sensors that are available for applications. Depending on various needs from a given application or a development, the sensor that can be used differs. Sensors in general can be divided into active and passive where active sensors require separate supply of power for its operation and passive does not. Furthermore, sensors can be also segregated into two groups that are analogue and digital. Analogue sensors produce a continuous output of data with respect to time depending on the input, whereas digital sensors produce discrete digital data. Analogue sensors slower in it response and considered to be low in its accuracy. The digital sensors has a better reputation on response time and accuracy hence it is used in many contemporary developments. Digital sensors produce a binary signal that can be a bit (communicated through serial connections) or a bite (communicated through parallel connections).

Figure 2.2 – Functionality sample of a digital light sensor Compared to analogue signals, digital signals or quantities have very high accuracies and can be both measured and “sampled” at a very high clock speed. The accuracy of the digital signal is proportional to the number of bits used to represent the measured quantity.

20

CHAPTER 3 METHODOLOGY AND IMPLEMENTATION This chapter explains the methodologies used for the project and more significance is given to describe the concept of luminaire movement. It also focuses on data gathering and data interpretation sections as well. Integration of hardware and software elements which depicts the functionality of the system will be elaborated finally at the implementation section.

Motorized Luminaire Holder

Sensor Module

Optical Bench

Control Unit

Control Signals

User selected Option

User Controls

User Computer

Data

Motor Values & Sensor Data Microsoft Excel Data File /Data Plot

Figure 3.1-Functional Block Diagram of the 3D Measurement Test Bench for Luminaires Above block diagram in figure 3.1 explains the flow of the overall system. As per the figure, the actuating device which is the Motorized Luminaire Holder is mounted on the Optical Bench enabling movement along the bench. This device manipulates the lighting fixture in order to feed the Sensor Module with values from different angles in a structured manner (Further description on this device can be found in the below section). A control unit sends signals to the actuating device while receiving sensor data from the Sensor Module. Furthermore these Control Signal Data and Sensor Data are passed on to the User Computer for data logging purposes, whilst the performance analysis is achieved through the computer itself in the form of Excel Data Sheet and Data Plot.

21

3.2 Main components of the 3DMTBL      

MG995 Servo Motors(Motorized Luminaire Holder) BH1750 Lux Sensor(Sensor Module) Arduino Platform Atmega328P-PU(Control Unit) Optical Test Bench Power Supply Standard Computer with Serial Communication and data interpretation Software

Motorized Luminaire Holder This particular devise is comprised of two servo motors. Servo motor is a high quality geared DC motor type equipped with an electronic circuit, specifically designed to rotate into a commanded position or an angle with great precision. The two standard servos utilized in this device rotate the light fixture (Luminaire) in precise angles to feed the stationery sensor with readings. Tower Pro brand MG995 standard servos are used because the holder only required rotation of 0-180 degree rotations. The two motors are powered with 5 VDC from the Arduino platform itself. In order to meet the power requirement, the Arduino platform is powered up with a 240 VAC to 12 VDC power adapter that has the capability of providing 250 mA.

Figure 3.2- Servo Motor Function(Wayne Storr 2012) MG995 Servo motors are equipped with three coloured wires namely orange, red, brown which signifies connection of Control Signal, 5VDC and GND respectively. As depicted in Figure 3.2 the motor is controlled using Pulse Width Modulation. In this particular project, the servo motors are manipulated autonomously using the program embedded to the ATMEGA 328P-PU. “Servo.h” header file was used within the program for the motor commanding purposes. Use of header file enabled the rotation of the motors according to a given angle directly with precision and the delay function provided the ability of controlling the speed of the motor.

Ground 5VDC Control Signal

Figure 3.3- Servo Motor Wire Connection

22

Function of the Motorized Luminaire Holder G

E

A- Yaw controlling servo motor B- Main arm C- Vertical arm D-Bulb Height adjuster E-Bulb holding arm F- Bulb extension adjuster G-Bulb extension arm H-Roll controlling servo motor

H

F D C B A

Figure 3.4- Luminaire Holder Design

This luminaire holder functions in three different methods according to the given user instruction. User has three options to select, that would determine the execution of complete or moderate or quick scan respectively. Depending on each selection, the Luminaire Holder manipulates the bulb in different methods. Prior to testing the bulb it is essential to manually set the alignment of the bulb held by the Luminaire holder in line with the sensor (Light intensity sensor is used in the prototype). As shown in figure 3.4 the bulb should not exceed the dotted line during the alignment process. Once the alignment process is completed, the user has the option of selecting the scanning program required. If the complete scan option is selected, the Motor A rotates in 180° , panning the bulb from one side to another , feeding the sensor with a data set corresponding to one cross section of the bulb surface. Then the Motor B rotates 5° clockwise after which the Motor A will rotate again scanning the bulb surface on a 180° pan. This procedure continues until the whole bulb surface is covered. This scanning mechanism is highly recommended for asymmetrical surfaced bulbs.

Till completion

180° bulb surface scan

5° surface rotation

nd

2 180° bulb surface scan

Figure 3.5- One step of luminaire (bulb) manipulation of complete scan The second user option is the moderate scan which is a faster method of scanning the light source. In this mode the Motor A makes the surface of the light source pan across the sensor field 180° and then the Motor B turns the light source 90° degrees. At the completion of the

23

Motor B rotation , Motor A pans the light source once again and completes the scan. This procedure is clearly elaborate in figure 3.6.

Figure 3.6- Moderate scan option The third option is the quickest scanning option which is panning the light source 180° on the horizontal axis to capture data. This method is suitable for symmetrical lighting fixtures that do not require complete set of data as elaborated on the complete scan mode. Sensor Module This test bench is equipped with a high precision light sensor that complements well with the arduino platform. Although a light sensor is used for the prototype, due to the significant advantage of only using one sensor, it is quite simple to use any other sensor module (Thermo sensors, IR sensors, Radiation sensor etc) with relevant circuitry, as per the requirement.

Figure 3.7- BH1750 Sensor Module BH1750 is a Digital Light Sensor IC module designed for I2C bus interface. It is equipped with 16bit Digital output that provides a resolution of 1 to 65535 lx. The maximum lux output of the sensor is 100000 and the minimum is 0.11. Below mentioned are the features of this particular sensor module. 1) I2C bus Interface ( f / s Mode Support ) 2) High spectral responsibility 3) Illuminance to Digital Converter 4) Wide range and High resolution.

Measurement Mode

Measuremen t time (ms)

H-Resolution mode 2 H-Resolution mode L-Resolution mode

120

Resolution (lx) 0.5

120 16

1 4

24

5) Low Current by power down function 6) 50Hz / 60Hz Light noise reject-function 7) 1.8 V Logic input interface 8) Less light source dependency. 9) Possibility to select 2 type of I2C slave-address. 10) Adjustable measurement result for influence of optical window ( It is possible to detect min. 0.11 lx, max. 100000 lx by using this function. ) 11) Small measurement variation (+/- 20%) 12) Low infrared influence

Figure 3.8- Schematic Diagram of BH170 (ROHM 2014) Function of the Sensor Module Regardless of the user program selected, the sensor module performs the same duty of transmitting the lux values constantly to the Arduino via I2C bus interface. Lux values are read corresponding to the motor positions. To increase the accuracy of the readings a light window also can be used with this light sensor. Since the motors are rotated stepwise, at each step the lux meter is commanded to measure and transmit the lux value. Which is then stored with respect to motor positions. Although a lux meter is included for the prototype, any other compatible sensor module can be used with this bench according to the requirement. Arduino Platform Arduino is an open source hardware and software platform which mainly comprises of microcontroller and digital/analog, input/ output ports. It is also enabled with communication interfaces that allow user to program the microcontroller and transmit data during a program execution. Arduino also provide an integrated development environment that support C and C++ programing languages. For the prototyping of this project Arduino Uno Revision 3 development board was utilized. Arduino Uno Revision 3 was released in 2014 adding SDA/ SCL pins which enables I2C interface and IOREF pin for voltage adaptations of the peripherals connected. The key highlights of this particular Arduino platform is listed below,

25

          

Microcontroller: ATmega328 Operating Voltage: 5 V Recommended Input Voltage: 7 – 12 V Digital I/O Pins: 14 total – 6 of which can be PWM Analog Input Pins: 6 Maximum DC Current per I/O pin at 5 VDC: 40 ma Maximum DC Current per I/I pinat 3.3 VDC: 50 ma Flash Memory: 32 kb (0.5 kb used by bootloader) SRAM Memory: 2 kb EEPROM: 1 kb Clock Speed: 16 MHz

Figure 3.9- Atmega 328 (Prostack 2015)          

Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode One 16-bit Timer/Counter with Separate Prescaler, CompareMode, and Capture Mode Real Time Counter with Separate Oscillator Six PWM channes Six channel 10 bit ADC including temperature measurement Programmable Serial USART Master/Slave SPI Serial Interface Byte-oriented 2 wire Serial Interface (Philips I2C compatible) Programmable Watchdog Timer with Separate On-chip Oscillator On-chip Analog Comparator Function of the Arduino Platform

The microcontroller of the Arduino is programmed to execute all required action from data generation to transmission. Both servo motors are controlled by this platform to provide precise rotational commands, depending on the user selected option. The task of the Arduino is to manipulate the luminaire holder and transmit the rotational data with the corresponding lux values to the computer. The data is transmitted to the computer via serial communication. All the transmitted data is then absorbed by serial data communication software that has the capability of recording and storing. This stored data is then can be opened through plotting software for data interpretation.

26

Optical Test Bench For the prototype discussed in this paper, an optical bench is utilized to obtain readings of the luminaire corresponding to various depths. The ability to analyse and compare data depending on the depth, adds on another dimension to the data gathering. Due to this reason this is named as a 3D Luminaire Test Bench.

Figure 3.10- Sketch of the total setup

Function of Optical Test Bench On to the left of the test bench the luminaire holder is mounted whereas the sensor module is mounted on to the right. The speciality is that the sensor module has the capability of sliding down the test bench, arranging various depths in accordance to the requirement. Hence multiple sets of readings can be obtained for the same luminaire, in different depths with the inclusion of the optical bench.

Adjustable Motorized bulb holder

Adjustable Sensor Holder

Point of Rotation

Figure 3.10a- Prototype test bench

3.3 Program Development Software development is a structure imposed on the development of a software product. Synonyms include software life cycle and software process as shown below in figure 3.15. There are several models for such processes, each describing approaches to a variety of tasks or activities that take place during the process.

27

Figure 3.15- Program developing process Requirement is the early part that can be consider as planning. Design is the part to develop general process of the system for example by developing a flow chart and list all possible input output (I/O) related. Implementation is the part of the process where beneficent actually programs the code for the project. Verification is also called Software testing is an integral and important part of the software development process. This part of the process ensures that defects are recognized as early as possible. Maintaining and enhancing software to cope with newly discovered problems or new requirements can take far more time than the initial development of the software. It may be necessary to add code that does not fit the original design to correct an unforeseen problem or it may be that a project requirement are more functionality and code can be added to accommodate needs of the project. The program of this project is coded under in Arduino software platform commonly known as Arduino IDE(Integrated Software Development). Arduino IDE consists of a source code editor, development tools and a debugger. Arduino 1.6.5 revision 2 IDE was downloaded and installed in a 64bit 2.3 GHz Intel Core i5 processor computer for the purpose of source code development. Arduino uno r3 development board was purchased for the execution of this project and coding was done on the integrated development environment. Prior to the execution of the code development, it was required to install device drivers separately. Figure 3.16 shows the macro view of the program developed.

Initialisation

User Option

Luminaire Holder Controlling

Data Acquisition

Figure 3.16 -Macro view of the program Initialisation This is the foremost step of the program where multiple header files are included to the program. Namely Servo.h , Wire.h and BH1750.h . Servo.h comprises of different functionalities which allows the Arduino platform to control the servo motors with precision. For I2C communication purposes , Wire.h library has been used. There are various communication points within the program where both serial and I2C links are used. For the board to communicate with the light sensor the board utilizes I2C method. BH1750.h is the header file corresponding to the light meter that is been used in the program. With the aid of this header file it is possible to receive lux values corresponding to a light input received by the sensor.

28

User option As mentioned previously, at the development of this source code, the user requirements were considered. In this program the user gets three options to choose from. This include the quick scan , which is a simple pan of the lighting fixture, moderate scan that scans two cross sections of the lighting fixture and the complete scan which scans the whole lighting fixture. Depending on the user requirement the program gets directed to three different functions. User is given instructions to press the appropriate number depending on the requirement. These commands are viewed through a serial data receiving software and the same software is used to transmit the user requirement to the processing unit. Luminire holder controlling Based upon the user selection separate functions of the program are executed. In the execution process of the complete scan , the yaw controlling motor is commanded to move the luminaire in the horizontal axis incrementing 1degree at a time and this continues for 180 degrees. Thereafter the roll controlling motor is commanded to rotate 5 degree on to right. And again the yaw controlling motor takes command to sweep the luminaire horizontally 180 degrees. This process continues and at each point the sensor takes a reading and stores it coma separated columns as shown below. The complete scan provides 6516 data points on the surface of the luminaire. Roll Position

XXX,XXX,XXXX

Lux Value

Yaw Position Within the Moderate and Quick scan options the data points are created through the program coding as 362 and 181 respectively. As mentioned previously the moderate scan provides scan the luminaire in along one vertical and horizontal line which are perpendicular to each other. Whereas the quick scan is a simple horizontal sweep of the luminaire. Data acquisition All generated data is transmitted to the computer via serial communication. In this prototype a third party freeware is used for this purpose and the generated data is recorded through this software. With the aid of the computer, generated data file can be viewed graphically, using software programs such as Matlab , Windows excel etc;. This option has become viable due to the program generated data representation method (comma separated values).

29

3.4 Programming Flowcharts Program Macro Map

Start

Include Header Files

Define Servo Objects

Create variables

Open Setup Function

Attach Pins

1. Assign and define Pins 2. Setup Serial Communication

Display User Options

Close Setup Function

Open User Option Read Function Return the Option value to the main Function

YES

Valid option entered?

Close User Option Read Function

Run Main Function

End

NO

Display Error Message

30

Main Function- Complete Scan Option Flowchart Start Main 3.Quick scan

1. Complete scan User Option? 2. Moderate scan NO

Is Roll servo value ≤ 180º

YES

Reset Counters Is 0 ≤ Yaw servo value < 180º ?

NO

Display Completion YES

End

Store Yaw servo value

Increase Roll servo value by 5º

Read & store lux value

Call delay function

Call delay function

Display Roll,Yaw,Lux values

Is 0 < Yaw servo value ≥ 180º ?

NO

YES

Increase Yaw servo value by 1º

Store Yaw servo value

Increase Roll servo value by 5º

Call delay function

Read & store lux value

Call delay function

Call delay function

Display Roll,Yaw,Lux values Decrease Yaw servo value by 1º

Call delay function

31

Main Function- Moderate Scan Option Flowchart

32

Main Function- Quick Scan Option Flowchart

33

*The overall program is attached in the Appendix A & Appendix B . 3.5 Programming the AVR 328 via Arduino Once the development platform was purchased (Arduino Uno R3) , the Software package was downloaded via www.arduino.cc. The package includes the integrated development environment software as well as other required libraries and header files for the programing function. Upon the installation of the IDE , the development kit is required to be connected and it will automatically detect all divers and install by itself, in the instance which it does not the user will have to manually install drivers via device manger(in windows). When the connection was completed the development of the program was carried out.

Figure 3.17- Successfully compiled program

Coding corrections may have to be implemented depending on the error type shown on the information widow. In case of an error the information window will display it with the relevant line number. Once the program is identified as error free and compiled successfully, the program is then uploaded to the AVR via USB connection.

34

Figure 3.18- Compiled Program Uploaded During the uploading process COM port errors and connection busy errors are commonly encountered. Com port error can be resolved by setting the correct com port configuration via the programing window. Tools -> Port is the path in the command window that can be used to select the appropriate com port. This selection should be as same as the selection at the device manager. Serial port busy error occurs in the case of data traffic in the communication line. Since the same line is used for both programming and data transmission this error was commonly encountered. To resolve this matter, coding was modified to execute termination of the data transmission at completions of scanning procedures.

Transmitting and receiving data For the purpose of data transaction, there are two possible methodologies available in this system. Primary option is to utilize the inbuilt serial window of Arduino as shown in Figure 3.19a. This method limits the user to observe only the numerical output of the test data. Usage of serial software such as ‘cool term’ allows the user to gather data and analyse them using graphical software such as Matlab or Windows Excel. Since the output of the system is in comma separated values, converting them into graphical formats is easier.

35

Figure 3.19a- Built in Serial Window

Figure 3.19b- CoolTerm Serial Window

Data interpretation As shown above using the two methods, data can be interpreted easily. For analyzing purposes this method can be used in the quick scan option since the number of data points are limited. Above two methods results in comma separated numerical values which are not suitable in analyzing large number of data. For this purpose graphical interpretation methodologies are used. Firstly a comma separated data text file is generated (sample shown in Figure3.20a ) and then this file is graphically interpreted(Figure3.20b).

36

Figure 3.20a- Extract of the comma separated data text file

3000

100 90

2500

2000

Roll Position

80 70

Lux value

1500

Yaw Position 1000

60 50

Series3

40

Series1

30 20

500

10 0 1 15 29 43 57 71 85 99 113 127 141 155 169 183 197 211 225 239 253 267 281 295 309 323 337 351

0

Figure 3.20b- Graphical interpretation of a Moderated Scan

37

CHAPTER 4 TESTING 4.1 Testing Arduino with External Power Supply During the prototype development process each stage of the development was tested. This section describes the step by step approach that was followed in validating the functionalities of this prototype. The two servo motors that were utilized were of type Tower pro MG995 that required generally 100mA of current in operation condition. During regular testing it was also observed that the indicator LEDs were flickering due to lack of power. In order to mitigate this issue a standardized 12V 500mA power adapter was used. This provided adequate power for the operation of the device.

Figure 4.1a- Testing with power supply

Figure 4.1b- Input voltage through adapter

4.2 Testing Servos with Serial Communication One of the most important sections of this prototype is the motorized luminaire holder which manipulates the position of the light fixture with the aid of servo motors. Servo motors are reputed for its precision angular rotation. It was vital to receive motor positioning on a serial platform in order to produce a final performance graph. The figure given below provides the servo motor angle data obtained through serial communication software. Yaw angles Roll angle

Figure 4.2- Screen shot of servo motor positions during a moderate scan

38 4.3 Testing of the Lux sensor BH1750 is a digital lux sensor that is used in this device. The accuracy of the sensor was compare with an actual Lux meter with incident light. A flash light beam was used under same conditions for both the lux meter as well as BH1750. The distance from the sensing surface to the flash light is the same in both occasions. There was a mere difference of 3 lux between the two sensing devices. Figure 4.2c gives the screen shot capture image of the readings obtained through the digital sensor.

Figure 4.3a – Lux meter reading

Figure 4.3b – Digital sensor reading

Figure 4.3c – Digital sensor readings on serial monitor

4.4 Testing mechanical components Portability and the ability to attach the equipment to an actual optical test bench were also considered as objectives of this development. In order to demonstrate the device performance, a functional prototype was developed to emulate the functions of the device. The entire development relied on the key component which was the luminaire holder; the component which helps the sensor receive, light rays from the light source in different angles. Figures shown below were extracted from testing carried out on the luminaire holder for its mechanical functions. Bulb yaw controller section

Bulb roll controller section

Centre of rotation adjuster

Figure 4.4a – Luminaire manipulator testing

39 In order to test the rotations of the luminaire holder, it was instructed to perform a ‘Moderate scan’. In this scan the luminaire was panned across the sensing field twice. Firstly, when the roll position was at 0° and then at 90°. A section of the excel sheet and the graphical interpretation of the ‘Luminaire holder’ performance is stated below.

Figure 4.4b – Extracts of the servo motor angles

Yaw

Roll

Figure 4.4c – Graphical interpretation of the luminaire holder movement under Moderate scan option

40 4.5 Complete test scan using the prototype bench The prototype test bench (figure 4.4a) was put under an actual testing scenario. A complete scan was selected for this purpose. Figures given below would elaborate the process completed in obtaining luminaire performance. Complete scan produces 3420 data points at completion, the figures shown below are only extractions of the larger data set. Table 4.1 – Test details Test condition Test subject Stated Wattage Manufacturer Source

Dark Room Domestic LED Lamp 9W ACE electronics Pettah market

Figure 4.5a – Screenshot of the data extraction obtained from the full data set

Figure 4.5b- Extraction of the data representation

41 Figure 4.5a is the set of data which was exported using the serial communication software. The serial communication software has the data recording option which enables the entire data set to be recorded in a text file. The text file is then opened in a software such as MATLAB or Microsoft Excel(Figure 4.5b is an Excel Graph) for data representation purpose. 4.6 Observations and analysis of testing As shown above, the entire device was separated into sections to test its functionalities. In this analysis section with the aid of the observations made during the testing, the performance of the two key components namely hardware and software will be critically analyzed. Software Thorough the entire testing process the coding that was developed on the Arduino performed as per the expectation. Unexpected errors or unpredictable behavior did not occur from the software component. However during the initial, undocumented tests it was observed that the BH1750 sensing ambient light intensity, hindering the acquisition of absolute lux values produced by the luminaire under testing. This diverted the tests to be carried out in a ‘dark room’ condition. But it was realized that this requirement of ‘dark room’ could be avoided by readjusting the coding to sense the ambient light prior to testing in order to subtract each and every lux value reading there by obtaining only the actual lux value produced by the source. Furthermore during the process of data communication, random errors were observed. Especially with regard to the ‘COM Port’. It was revealed that improper exiting of program instructions caused these types of errors and remedial actions were made on the program code. All the data produced by the device were displayed horizontally in the text file which made analyzing the data from the text file difficult. Especially in the case of a complete scan, the number of lines required to save data was 3420. The user has the option of overcoming such difficulty be directly referring to the graphical data interpretation. Hardware BH 1750 digital lux sensor was initially tested against a common lux meter which resulted in a difference of 3 lux. However the lux sensor proved to be highly responsive to incident light which was a major requirement of this concept development. In considering the prototype mechanical test bench, the overall functionality was satisfactory, however the luminaire manipulator showed jitters at certain movements. Especially the horizontal arm used to change the pitch angle of the light source performed movements that would make the accuracy of the sensing data vulnerable. In powering up the device, the addition of the external adapter proved to be essential in lengthy scans such as the complete scan since it provided adequate power. There were no power related issues observed in the device.

42

CHAPTER 5 DISCUSSION AND CONCLUSION This chapter will describe the overview of the research at the point of conclusion. During the process of the project there were variety of limitations and obstacles faced. Most of them were successfully resolved whilst some of them are discussed within this chapter with recommended solutions. In an overall perspective the objectives were achieved as expected. The prototype of 3DMLTB depicted the viability of the device described in this paper. The most strenuous section of this project was the designing of the mechanical components. All the mechanical components are manufactured with the aid of ‘box bars’ purchased locally. Luminaire holder being the most fundamental section of this device that exposes the light source to the sensor in different angles, it is recommended to use a technology like ‘3D printing’ to bring in precision in its mechanical movements. In the prototype, most basic components are used to model the functionality. With the use of high quality servo motors and sensors, it is expected that this device would increase its accuracy. The use of Arduino development platform over PIC microcontroller was justified with the simplicity that Arduino provided in interfacing devices. Moreover the reference material available for Arduino , aided in generating the expected outcome from the project. This simplicity of Arduino created room to be more focused on the other aspects of the project, especially the hardware and concept development sections. For the future implementation discussed in this section, it advisable to utilize the same Arduino platform due to the reasons mentioned above. As mentioned in a previous chapter this device utilizes only a single sensor. This in return increases the agility of the entire test bench, where that single sensor can be replaced with multiple types of sensors to obtain different spectral properties of a given luminaire. Furthermore the addition of an energy measurement is also recommended in order to test luminaires with respect to energy consumption. In this project, data interpretation process involves multiple number of software. The development of dedicated software with sophisticated UI to provide user controls and display test results would definitely increase the usability of the device. Having mentioned on dedicated software, the current version enables the user to use common software such as Microsoft Excel, which are readily available. In a more advance development step, the ability of making the 3DMLTB independent from the use of personal computer is foreseen. Inclusion of data exporting mechanism such as the addition of external memory card to the central processing unit, coupled with an inherent display unit for user inputs would uplift this device to be a comprehensive solution for luminaire testing.

43

REFERENCES [1] Michael Bass, (1995) Handbook of Optics - Devices, Measurements and Properties [2] Jane Brox, (2010), Brilliant: The Evolution of Artificial Light [3] Linda J. Vandergriff , (1997) ,Fundamentals of Photonics Module 1.1, Science Applications International Corporation McLean, Virginia [4] S.R.Ruocco,(1987) Robotics and Transducers, Chapter 3 – Light Transducers [5] James M. Palmer, Barbara G. Grant,(2010), The Art of Radiometry [6] Hans-Petter Halvorsen, (2013), Introduction to Arduino [7] Dogan Ibrahim , (2008) , PIC Microcontroller Projects in C, Second Edition: Basic to Advanced [8] http://electronics.stackexchange.com/ ,(2015) “How does the Arduino compare to PIC and AVR for serious learners” [9] http://forum.arduino.cc , (2014), Arduino vs. PIC [10] https://www.arduino.cc , Arduino programming and compatible peripherals

Figure References Figure 1.1 https://en.wikipedia.org/wiki/File:EM_spectrum.svg Figure 1.2 https://en.wikipedia.org/wiki/Incandescent_light_bulb#/media/File:Edison_Carbon_Bulb.jpg Figure 1.4 http://gamma-sci.com/wp-content/uploads/2014/10/Gamma-Scientific-Half-MeterIntegrating-Sphere-and-1290-Spectroradiometer-1500x1000-1024x682.jpg Figure 2.0 http://sensing.konicaminolta.asia/learning-center/light-measurement/luminance-meterscolorimeters/ Figure 2.5 http://www.electrical-knowhow.com/2012/05/classification-of-electric-motors.html Figure 2.8 http://www.handsonresearch.org/2012/PDF/IntroductionToArduino.pdf Figure 2.9 http://www.handsonresearch.org/2012/PDF/IntroductionToArduino.pdf Figure 2.10 http://www.electronics-tutorials.ws/io/io_4.html

44 Figure 3.2 http://www.electronics-tutorials.ws/io/io_4.html Figure 3.8 http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1750fvi-e.pdf Figure 3.9 http://www.protostack.com/microcontrollers/atmega328p-pu-atmel-8-bit-32k-avrmicrocontroller

I

APPENDICES Appendix A /* Complete program 3DMTBL Written by M M A Weerasinghe M.Sc/2012 AE/29 University of Colombo.*/

#include #include #include

BH1750 lightMeter; Servo yaw_servo ; // creating a servo object for the yaw control of the bulb Servo rol_servo ; // creating a servo object for the roll control of the bulb int yaw_pos ; // variable to store yaw servo position int rol_pos ; //variable to store role servo position int option; int sen_read = 2; // variable to store lux value and pin 2 assigned int lux;

void setup() { yaw_servo.attach(9) ; // attaching pin 9 to control the servo object rol_servo.attach(10) ;// attaching pin 10 to roll controlling servo pinMode(sen_read,INPUT); // defining the pin type Serial.begin (9600) ; // Setting up the serial library at 9600 bps lightMeter.begin(); yaw_servo.write(0); rol_servo.write(0); delay(1000);

II

Serial.print(" 3D Measurement Test Bench for Luminaires \n"); Serial.println(" ---------------------------------------- "); Serial.println(" 1)Press '1' for a COMPLETE scan "); Serial.println(" 2)Press '2' for a MODERATE scan "); Serial.println(" 3)Press '3' for a QUICK scan ");

} int displayOption(){ int serialData; //vaiable to store serial read data int select;// variable to store the ASCII real value if(Serial.available()>0) { serialData=Serial.read(); select=serialData-48; if(select>0 && select