Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

  • Upload
    louisc

  • View
    219

  • Download
    0

Embed Size (px)

Citation preview

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    1/60

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    2/60

    Although many of the currently available mood lighting products are distinctive when

    compared to standard lighting fixtures, there effects can quickly become uninteresting and

    titi With i ll il bl d li hti t ff i thi b t

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    3/60

    Facu l ty of Engin eer ing & Phy sicalSciences

    Department ofElectronic Engineering

    I confirm that the submitted coursework is my own work and that all materialattributed to others (whether published or unpublished) has been clearlyidentified and fully acknowledged and referred to original sources. I agree thatthe University has the right to submit my work to the plagiarism detection serviceTurnitinUK for originality checks.

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    4/60

    CONTENTS

    1 Project Introduction ....................................................................................................................................... 1

    1.1 Aim ........................................................................................................................................................ 1

    1.2 The Idea A Personal Note ............................................................ ....................................................... 1

    1.3 Documentation ..................................................................................................................................... 1

    1.4 Project Gantt Chart ............................................................................................................................... 2

    1.5 What is Mood LIGHTING? ..................................................................................................................... 3 1.6 Notable Current Products ..................................................................................................................... 3

    2 Project Design Phase ...................................................................................................................................... 5

    2.1 The Lightive System Overview ......................................................................................................... 5

    2.1.1 System Design and Functionality ......................................................... ............................................. 5

    2.1.2 Ambient Awareness ........................................................ ................................................................. . 5

    2.1.3 Modular Platform ............................................................................................................................. 5

    2.1.4 The Arduino Microcontroller platform ............................................................................................. 6

    2.1.5 Wireless Communication ................................................................................................... ............... 6

    2.2 Establishing Lightive s Wireless Communications System .................................................................. 7

    2.2.1 Initial Research ................................................................................................................................. 7

    2 2 2 T ti th TRX433S Wi l M d l 8

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    5/60

    2.5 The Lightive Master Design .......................................................................................... ..................... 27 2.5.1 Initial Design ................................................................................................................................... 27

    2.5.2 Design Development ................................................................. ...................................................... 27

    2.5.3 Data Storage ................................................................................................................................... 28

    2.5.4 Software ............................................................... ................................................................. .......... 28

    2.5.5 Breadboard Prototype .................................................................................................................... 29

    2.5.6 Final Design .......................................................... ................................................................. .......... 30

    3 Project Build Phase ............................................................................................ ........................................... 32

    3.1 Software ........................................................ ................................................................. ..................... 32

    3.1.1 The Lightive SD Card library ................................................................. ........................................... 32

    3.1.2 The Lightive Radio Library .......................................................... ..................................................... 33

    3.1.3 Direct Output Functionality ............................................................................................................ 34 3.2 Hardware............................................................................................................................................. 35

    3.2.1 Manufacturing the PCBs ................................................................................................................. 35

    3.2.2 Soldering Techniques ...................................................................................................................... 36

    3.2.3 The Driver ....................................................................................................................................... 38

    3.2.4 Led Strips ........................................................................................................................................ 39

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    6/60

    1 PROJECTINTRODUCTION

    1.1 AIM The project being undertaken is the design and creation of a reactive lighting system whose output isinfluenced by elements of its surrounding environment. The systems light output will be on par with what isconsidered mood lighting. This will also, by the nature of the specification, make this an interactive system.The completed system should create a distinct ambient feel in a room through the use of lighting. This is amethod not unknown to interior design. The area in which this system differs from others is the ability to read

    its environment via sensors and produce a coordinated output as a result. Certain configurations shouldincentivize users to interact with the system, other configurations will allow the system to disappear into thebackground and have a more subconscious effect on mood. The system must also offer a standard protocolwhereby 3 rd party applications can interface with the system via a computer.

    1.2 THE IDEA A PERSONALNOTE The idea behind the project came through a desire to better understand physical computing and previousattempts at simple lighting systems as a hobbyist. I have, for a long while wanted to own such a system andthere are no reasonably priced yet capable mood lighting systems available to date. Interior design, especiallywith regard to lighting is something I have always paid attention to. I have wanted to enhance lighting in myown living spaces, allowing it to offer more to its observers. Out of the ordinary lighting installations are oftencostly because they have to be designed for purpose, the hope here is to create a flexible system to combatthis. I feel as if my avid interest in photography also allows real appreciation of how the quantity, quality andcolour of light can change the mood of a scene. The reason for wanting to build this project from the ground

    d bi i i i h l i f lfil l h f d di f

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    7/60

    Page | 2URN: 6025977

    1.4 PROJECTGANTTCHART

    ID Task Name Start Finish DurationOct 2010 Nov 2010 Dec 2010 Jan 2011 Feb 2011 Mar 2011 Apr 2011 May 2011

    2 4/ 10 3 1/ 10 7 / 11 1 4/ 11 2 1/ 11 2 8/ 11 5 / 1 2 1 2/ 12 1 9/ 12 2 6/ 12 2 /1 9 /1 1 6/ 1 2 3/ 1 3 0/ 1 6 /2 1 3/ 2 2 0/ 2 2 7/ 2 6 /3 1 3/ 3 2 0/ 3 2 7/ 3 3 /4 1 0/ 4 1 7/ 4 2 4/ 4 1 /5 8 /5

    1 1w 4d31/10/201021/10/2010System Design & Relevant research

    2 1w14/11/201008/11/2010Decide on a microcontroller platform andbecome comfortable with basics

    3 1w14/11/201008/11/2010Decide on a wireless communicationsplatform

    4 1w21/11/201015/11/2010Establish wireless communications linkbetween two microcontrollers

    6 2w05/12/201022/11/2010Design and build a prototype driverunit

    8 2w18/12/201005/12/2010Design PCB for driver unit

    17

    10

    16

    12

    5w 1d31/01/201127/12/2010Exam Period and Mid Project report write

    up (Likely Slowed work Rate)

    1w 2d26/12/201018/12/2010Etch and populate Driver board PCB

    2w15/02/201102/02/2011Design and build prototype formaster unit

    2w05/03/201120/02/2011Design, build and code prototypemovement sensor

    2w13/03/201128/02/2011Design, build and code prototypeTemperature Sensor

    7 4w 1d01/01/201104/12/2010Coding for driver unit

    13 8w 6d17/04/201115/02/2011Coding for Master Unit

    18

    19

    21

    22

    2w26/03/201113/03/2011Design, build and code manualremote controller for the system

    3w15/04/201126/03/2011Design, make and populate PCBs forSensors and Remote Controller.

    1w22/04/201116/04/2011Testing of system / getting 3rd partyopinions

    6w16/05/201105/04/2011Final Report write up

    20 1w 2d19/04/201111/04/2011Minor Tweaks / Issue resolution

    5 5w 6d01/01/201122/11/2010Driver Unit

    9

    11 11w19/04/201102/02/2011Master Unit

    15 7w 6d15/04/201120/02/2011Sensor Units

    14 2w19/04/201106/04/2011Design, make and populate PCBs forMaster Unit

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    8/60

    1.5 WHAT IS MOOD LIGHTING?Lighting is a key design consideration in architecture and interior design. It can often dictate how many of theother physical design features are perceived. Mood lighting is the term given to the technique of using lightingto manipulate or influence the feeling of a space whilst also adding to the immediately visible aesthetics. Theselights are usually distinguishable from the general lighting of a room.

    An example of the use of mood lighting we have all likely experienced is in a restaurant. Often ceiling lights aredimmed and candles or smaller light sources are placed on tables. Another example can be observed in

    practically any film; the primary aim of lighting any scene it to subliminally convey the feeling or atmosphere ofthe scene to the observer.

    When implementing mood lighting, direction, brightness and colour are all qualities of light usually varied tocreate the desired feeling and atmosphere. The first quality, direction, has the biggest influence on theperception of objects. A bare, bright ceiling lamp will create harsh shadows in every direction away from it.This is often not very aesthetically pleasing. A bright ceiling light through a lampshade will create a soft diffuselight in a room. Because most objects will receive light evenly reflected off walls shadows are largely

    eliminated meaning things look more 2 Dimensional. The size of the light source will often dictate how soft orharsh shadows are. Bigger light sources can be created by bouncing light off walls or ceilings. Often a nice,potentially moody combination is directional yet dim and diffuse light.

    Brightness is a more obvious quality which is widely used to influence the feeling of a space. Brighter roomstend to bring about an alert and awake feeling whereas dimly lit rooms, a more relaxed ambient feeling. Theuse of dimmers on general light fittings as well as lamps and candles are common ways of taking down thebrightness of the ambient light to set a mood.

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    9/60

    The widely available Phillips mood lamp is a good example of a recent consumer mood lighting product. Figure1-1 shows the first generation of Phillips mood lamp which provides a wire free remote for setting colour.Automated colour cycling is enabled only in an included demo mode. The lamp will also remember the colourslast set and allow definitions for a favourite. Their second generation lamp allows for basic automated colourscrolling but each lamp is independent so if syncing is required they must all be in range of the remote at thesame time. The first generation uses four LEDs, two Red a green and a blue. The newer lamp uses seven LEDs.

    [1]

    FIGURE 1-1 - PHILLIPS MOOD LAMP (1ST GEN)PHOTO: WWW.AMAZON.CO.UK

    The only product found during research to be closest in design to that being suggested was a solution byChromoFlex. Given the difficulty in track this product down it is nowhere near as widely available as thePhillips mood lamp. The product requires some knowledge in electronics to set up, in contrast to the Phillipsmood lamp which works out of the box. With no wires needing to be run through walls or floors the wireless

    bili i f h b h bi f i i i f i i f i l i ll i

    http://www.amazon.co.uk/http://www.amazon.co.uk/http://www.amazon.co.uk/http://www.amazon.co.uk/
  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    10/60

    2 PROJECTDESIGNPHASE

    2.1 THE LIGHTIVE SYSTEM OVERVIEW 2.1.1 SYSTEMDESIGN ANDFUNCTIONALITYIt was decided the system needed a name, after some brain storming Lightive was decided upon. It is a play

    on the words reactive and lighting. The Lightive system will collect information from an array of wirelesssensor units placed around a given space. The system will then react to these inputs using predefined settings

    by the user. This reaction is displayed visually via the systems wireless LED driver units. The centrepiece,running the show, will be the master unit. This will provide a central point for system setup and management.All driver and sensor units will require an initial registration with the master and declaration of their presencethereafter. Figure 2-1 shows an overview of a typical system setup. This example setup has 4 sensor units anda single driver unit. These three individual units and their functionality will be further explained in thefollowing sections.

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    11/60

    2.1.4 THE ARDUINO MICROCONTROLLER PLATFORM

    The Arduino was chosen after research into many of the leading microcontroller platforms and their respectiveofferings. The platform is completely open source and the ethic of its growing online community is basedaround sharing solutions and libraries to interface it with hardware. This means there is a vast collection oflibraries and support materials freely available. This project is almost completely reliant on a microcontrollerand associated programming. With no prior experience in any microcontroller platform it was important toselect one which would allow for the completion of the project within the allocated time and with the desiredlevel of functionality.

    FIGURE 2-2 - ADRUINO DUEMILANOVE WITH ATMEGA 328P MICROCONTROLLER (IMAGE: WWW.ARDUINO.CC)

    The Arduino platform is based on the Atmel AVR processor. To simplify the process of programming and usingthe microcontroller, it is installed on a board which presents and clearly marks each input and output pin.

    Fi 2 2 h h A d i D il i h ATMEGA328P i ll i ll d Th hi

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    12/60

    2.2 ESTABLISHINGLIGHTIVES WIRELESSCOMMUNICATIONS SYSTEM The wireless communications are at the base of the whole system. For this reason the protocol must bedescribed before the individual units which lay on top can be.

    2.2.1 INITIALRESEARCH

    PICKING THE RADIO HARDWARE AND STANDARD Initially a variety of wireless options were explored. The first were the popular Bluetooth and well established

    ZIGBEE protocols and hardware. Both standards, due to their popularity, have an abundance of support onany of the microcontroller platforms. Bluetooth was quickly dismissed due to its limited range. The ZIGBEEunits offered lots of relatively easy to use features and also a proven and tested platform. With cost being aconsidering factor, despite easy access to functionality the ZIGBEE modules were still not enough of a cleanand obvious choice to stop further research.

    Whilst searching through UK electronic component suppliers radio modules the Alpha RF Transceiver fromRS stood out. It offered a far superior specification than anything else in its price range. At 3.90 per module

    compared to a ZIGBEE compatible 21.46 per module this was a very affordable and capable unit. This costsaving did come at a price; the support for the Alpha unit seemed limited. After purchasing and receiving themodule subsequent research discovered that the Alpha module is in fact a rebranded RFM12B module. Furtherresearch uncovered an Arduino library by JeeLabs [3] supporting the RFM12B. After successfully testing thelibrary, work on creating an interface for the module from scratch was abandoned and the library was insteadadopted.

    These modules have a small, square footprint of only 16mm. The package is classed as surface mount; this is

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    13/60

    FIGURE 2-3 - PACKET STRUCTURE

    2.2.2 TESTING THETRX433S WIRELESSMODULES On successful completion of this test it was felt the next step should be a test of range. This would quicklyidentify any major issues early on. In order to carry out this wireless range test one unit had to be powered viaits DC input jack as it would not be within proximity of a computer for USB power.

    PROTOTYPING WITH THEALPHA RF TRANSCEIVERS The first requirement was the ability to prototype with the TRX433S modules. Their restrictive 2mm pitchmeant no way of mounting them to a breadboard. An intermediary adaptor board was required which wouldpresent the modules pins at a standard pitch. Using strip board and some male SIL headers an adaptor wasbuilt and the module soldered on. This adapter is shown in Figure 2-4. A total of two adaptor boards weremade. Using the default connections found in the library they were each connected to an Arduino which wasprogrammed with the Demo Application included in the library. The demo application included a test option

    which sent a full sized packet and requested an acknowledgement. The test packets were transmitted andreceived between both units along with the acknowledgements.

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    14/60

    THE RANGE EXPERIMENT The aim of the experiment was to set up two wireless modules and, using the Demo application provided withthe library, test reliability and robustness of the signal at range. A secondary aim is to gain an understandinginto how the library is driving the modules to aid in decisions on how to implement them.

    The specification states the modules are capable of transmission over a maximum distance of 300m, this isassumed to be in ideal conditions with no obstacles and minimal interference [4]. The testing conditions forthe experiment were far from this. The testing will be carried out in University of Surrey undergraduatelaboratories. These are densely filled with electronic equipment and cables. Performance in these conditions

    will define the lower boundary of what to expect from these modules. Some calculations were performed towork out the optimum antenna length for the transceivers. Each antenna was made from a single strand, 22gauge wire at a length of 165mm, 6mm shorter than a quarter of the signal wavelength.

    The experiment setup used the default pin connections between the Arduino and the wireless module (Listedin APPENDIX FIG 1 ). Two identical Arduino units with wireless modules were setup. One unit was left at aworkstation powered by a bench power supply. The other was USB powered via a laptop for mobility. This unitwas sending the test packets and waiting for an acknowledgement of their receipt. For a diagram of the setup

    please see Figure 2-5.

    The methodology used was simple. The mobile unit was moved away at set lengths from the fixed units. Eachtime the mobile unit was moved, 10 full sized (66 byte) packets were sent, one every second and each with anacknowledgement request. As the unit is set up in a corner of the room the signal will be checked at distancesin two directions.

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    15/60

    FIGURE 2-6 - PLOTTED RESULTS - LINK RELIABILITY OVER DISTANCE

    CONCLUSIONS These wireless modules have performed above and beyond the specification required. The library found, onceimplemented abstracts much of interface complexity during use. This allows more concentration on coding

    0

    1

    2

    3

    45

    6

    7

    8

    9

    10

    0 5 10 15 20 25 30 35 40

    P a c k e t E r r o r s

    ( 1 0 t r a n s m i t t e

    d )

    Approximate Distance (Meters)

    Link Reliability over Distance

    Direction 1

    Direction 2

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    16/60

    The functionality of these flags will become clearer in the following examples.

    FIGURE 2-7 - INSIDE THE HEADER BYTE

    The table in Figure 2-8 shows how these flags and the Node ID field are used in any given scenario.

    FIGURE 2-8 - HEADER CONFIGURATION FOR DIFFERENT SCENARIOS

    To demonstrate the libraries ack mechanism a packet requiring an ack will be transmitted and the sequence ofradio events which follow documented. Figure 2-9 displays the headers exchanged between two nodes. First, apacket containing some information is sent from node 1 to node 2 and requires an ack. The header will havethe ACK flag set, denoting an ack response is required. The DST flag will also be set along with the value in thenode ID field being set to the address of the receiving node, in this case, node 2 .

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    17/60

    The first noticeable issue with the header byte is there is only space for a single node ID. If we are transmittingto a particular node, this will have to be the ID of the destination. If an ack is requested, the receiving nodedoes not have a return address for the ack packet. This is combated by simply broadcasting the ack packet toall. This could be problematic if multiple systems are run alongside each other.

    REDESIGNEDLIGHTIVEACKNOWLEDGEMENT SYSTEM The ack mechanism was improved to ensure that the transmitter and receiver send their own addresses butwithin the payload not the header. This way both ends know which nodes they are receiving communicationsfrom. Initially the first byte of the payload was always going to be the Lightive command , this has now been

    shifted along a byte to accommodate the devices own ID first. This is shown in Figure 2-10.

    FIGURE 2-10 - PACKET PAYLOAD LAYOUT WITH IMPROVED ACK SUPPORT

    The Lightive system was also given an ACK command which can be transmitted when replying to an ackrequest. Although the original ack system can still be used all Lightive units will be checking for the ACKcommand and not the header flag. This ACK commands is also no longer broadcast as in Figure 2-9 buttransmitted back to the requesting unit using the address provided in the received packet. The receiving unitalso verifies the ID on the incoming ACK command to ensure its from the unit it was requested.

    2.3 THE LIGHTIVE DRIVERDESIGN

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    18/60

    LCD Display (HD44780)

    Alpha-TRX433S433 Mhz Wireless

    FM Transceiver

    TLC594016-channelPWM LED

    Driver

    SPI

    Atmel ATMEGA328Microprocessor

    SPI

    r

    g

    b

    r

    g

    b

    r

    g

    b

    .

    .

    .

    MOSFETs

    OutputTo LEDBAR 1

    OutputTo LEDBAR 2

    OutputTo LEDBAR 5

    FIGURE 2-11 - INITIAL DRIVER DESIGN BLOCK DIAGRAM

    2.3.2 SOFTWARE DESIGN The driver will be designed to accept and process basic fading commands for each bar. A flowchart for theproposed behaviour of a driver is shown in Figure 2-12. Each command will be identified by a number andconsist of an ID of the bar to be faded, the end value for red green and blue and time duration to reach thatvalue. The driver will then calculate, based on the current value, what it needs to do to get to the requestedresult within the requested time period. Once a fade command is successfully received it will not actually beacted upon until a shift command is sent from the master. This will allow the master controller to pass

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    19/60

    2.3.3 EXPANDINGPWM USING THETLC5940

    The chosen microcontroller has only 6 hardware enabled PWM ports. Unfortunately 3 of these ports are lostto the hardware SPI interface being used by the wireless module. With only 3 ports remaining only a single LEDbar can be driven, this is not a cost effective use of the hardware. A solution to this is to increase the PWMports using a dedicated IC. The TLC5940 by Texas Instruments is such an IC. With support for 16 channels it willallow for control of 5 bars independently. This is a purpose built LED driver IC with an array of features, one ofthe most prevalent being 12 bit (4096 Step) PWM control. This very high resolution permits very precisecontrol of each colour channels duty cycle, giving a more comprehensive range of colours on output. The chipsalso support daisy chaining which allows for drivers to support even more outputs should the need arise. Thechip communicates via a serial interface loosely adhering to the SPI standard. The use of the TLC5940 will alsoalleviate stress placed on the microcontroller whilst performing PWM duties.

    The TLC5940 also has some neat built in features by design. One of these is the way it handles the PWMsignals. In many PWM controlled systems LED s are triggered simultaneously on all channels as the data isusually just shifted out in parallel. The TLC5940 uses delays to sequence its outputs; this is shown in Figure2-13. Each of these delays is fixed at 20ns where OUT0 has no delay, OUT1 has 20ns, OUT2 40ns etc. There is amaximum delay time from OUT0 to OUT15 of 300ns [8]. This delay helps to avoid large current pulses. This inturn reduces noise down rails and helps keep current flow continuous.

    FIGURE 2-13 TLC OUTPUT DELAY FEATURE

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    20/60

    There are some key properties of MOSFETs which must be properly configured to use them efficiently andensure they are only handling power they are rated for. A circuit diagram showing how the MOSFETS will beconnected is shown in Figure 2-14. It can be seen in this figure that the TLC5940 is a pull down device whicheffectively discharges the gate of the MOSFET turning it off. The resistor R1 then acts to pull up the gate andrecharge it enabling the MOSFET to turn on. The gate can be thought of much like a capacitor. When the gateis discharged and a positive potential is first applied it will begin to charge, drawing the most current when thevoltage is applied and tailing off as it becomes charged. This is identical to the discharge scenario except nowthe gate will source the current. This means that it takes time to charge as well as discharge the gate. Thereason this is a concern is because whilst the gate is neither fully charged nor discharged the MOSFET will not

    be fully on or off. This can result in a resistance and hence power dissipation across it which, if outside of itsabsolute maximum ratings, could cause permanent damage to the device. We can deduce from this that theamount of current allowed to flow into the gate at the time it is charged or discharged will determine howquickly the MOSFET turns on or off. On the discharging side the TLC5940 has built in current limiting circuitrywhich can be set using a resistor from ground to its Iref pin. This built in current limiting also means there is noresistor required between the TLC5940s output and the gate of the MOSFET. The charging side will have itscurrent limited by the pull up resistor in place.

    R1

    +12V

    LED StripSimplified View, this wouldbe one of the red, green or

    blue channels.

    PULL UP RESTISTORThe TLC5940 is a current sink

    device only so this turns thetransistor back on at the end of

    a pulse.

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    21/60

    FIGURE 2-15 - SMD (SURFACE MOUNTED DEVICE) MOSFETS,LEFT - A UK 20 PENCE COIN BESIDE SMD MOSFET, RIGHT - 3 SMD MOSFETS READY FOR TESTING

    Some calculations were performed to establish safe values for gate charge and discharge values. Anexperiment was then performed picking components around the calculated values which showed the bestresponse in the experimentation. A 10K pull up resistor was decided upon as a safe pull up value. The CROtraces in Figure 2-16 clearly show effects introduced by the gate capacitance of the MOSFET. The completecharging time can be deduced from Figure 2-16 as 30 micro seconds although the transistor is fully on for therequired current draw of 200mA by the time the gate voltage has exceeded 1.5 Volt. This was determinedfrom the MOSFET data sheet, the graph used can be seen in APPENDIX FIG 3.

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    22/60

    2.3.5 BREADBOARDPROTOTYPE

    In order to test the driver design theory before beginning the PCB design the system was prototyped on abreadboard. The completed breadboard can be seen in Figure 2-17. For this prototype the ATMELmicrocontroller is mounted on a purpose built aftermarket breakout board which includes all the timingcomponents and relevant connections for base processor operation. All of the input and output lines arepresented on headers which push into the breadboard. Although only one of the five output channels havebeen constructed with the MOSFETs everything else in the block diagram shown in Figure 2-11 has beenconnected. This should be sufficient for testing.

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    23/60

    running the lower power signal through lengths of wire. Thirdly it could also permit the use of devices otherthan LED strips on driver outputs making for interesting future expansion.

    The decision was also made during design development to use surface mount technology (SMT) anywherepossible to reduce both size and cost. This would bring challenges to soldering and PCB design andmanufacture but it was felt this could be achieved.

    The decoupling added was as initially suggested with a small capacitor of 0.1uF for each IC and radio moduleand a larger 100uF across the entire rail to absorb slightly larger fluctuations.

    2.3.7 FINALDESIGNS Some final designs were realised before entering the build phase where they would likely see furthermodification and improvement. The design for the more complex of the potential drivers was established first.

    PCB DESIGNS Once the breadboard prototype was tested with the design developments and deemed to be workingcorrectly, work started on a PCB design. The software package used to complete these designs was

    DesignSpark PCB which is offered completely free of charge by RS [12] .

    Many of the components required were not in DesignSpark PCBs libraries and had to be created. The processof creating a component was wizard driven and the information required could be found in the devices datasheet under the package specifications. Figure 2-18 shows, to the left, a screen grab of the wizard used tocreate the components. Values are simply entered defining pin pitch, pad width and height among otherdefining dimensions. The wizard also requests naming of the pins as well as mapping from the schematic to thePCB symbol. On the right of Figure 2-18 is a photograph taken whilst checking the newly created component

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    24/60

    services certain limitations were in place. This included the inability to add vias 2 to the PCB. Larger holes andpads were created for vias which will require manual soldering during the build phase. The final PCB design isshown in Figure 2-19 along with annotations of key components and features. The entire board is 80x44mm,this would have been considerable larger without the use of surface mount components and connectors asboth the ATMEGA Microcontroller and TLC5940 are in large 28pin P-DIP packages.

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    25/60

    FIGURE 2-20 - LIGHTIVE LED BAR CONNECTOR BOARD WITH KEY COMPONENTS ANNOTATED

    To allow for greater flexibility the earlier decision to move the MOSFETs to the strips themselves was kept and

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    26/60

    standard three pin linear regulators. The LM2575T is such a regulator with an input voltage ranging from 8-40vand current handling of up to 1A, far beyond the requirement of the Driver PCB. The biggest advantage of sucha regulator is the lack of requirement for a bulky heat sink due to its greater efficiency. Other features offeredare thermal shutdown and current limit protection which are handy safety nets to have included in the eventof a fault condition presenting it self . The regulator requires only 4 external components, an inductor, 2capacitors and a schottky barrier rectifier [13] . The power supply PCB design is shown in Figure 2-22 and itsschematic can be observed in APPENDIX FIG 6. The schematic is based on the "typical applicati on schematicin the LM2575Ts datasheet [13] .

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    27/60

    The countertop model design drew inspiration from many of the modern DAB radio designs which incorporatea mix of modern electronics, brushed aluminium and wood or wood effect. Figure 2-25 below shows a fullydimensioned orthographic projection of the design.

    FIGURE 2-25 - ORTHOGRAPHIC PROJECTION OF FINAL COUNTERTOP DRIVER MODEL

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    28/60

    FIGURE 2-27 ILLUSTRATION OF HOW THE LED STRIPS WILL BE HOUSED.

    The LED strips will be housed, with theirdriver in strips of Mini Trunking whichis widely available and used in electricalinstallations in buildings. It has aremovable pop on cover which will bekept on the end housing the driver tohide it. A small piece of cover will alsobe kept on the opposing end to sustainrigidity. The final assembly is shown

    illustrated in Figure 2-27.

    2.4 THE LIGHTIVE SENSOR DESIGN

    2.4.1 INITIALDESIGN There will be a variety of sensors available for the Lightive system. Sensors can be added depending on the enduser requirement or desire for system functionality. Initial sensors to be integrated will be movement, sound,temperature and light although the system must be designed to accept further sensors, easily, in futuredevelopment.

    Each sensor will run on the same microcontroller used in the Driver units, an ATMEGA 328P. Much like thedrivers this will be connected to an Alpha FM transceiver for wireless communications. The sensor type for the

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    29/60

    2.4.2 RESEARCH Research was required into how each sensor type was to be built and what relevant components wererequired.

    TEMPERATURE SENSOR There are many different kinds of temperature sensor components with an array of interfaces and packages.Having many free analogue ports available on the microcontroller, the use of a more expensive digitaltemperature sensing component seemed unnecessary so the analogue path was chosen. A very popular rangeseems to be the LM35, namely the LM35DT. This is a Precision Centigrade Temperature Sensor ; it has three

    pins, supply voltage pin, ground pin and an output pin. Its output is linearly proportional to the temperature inCelsius to a quarter of a degree at room temperature; this is accuracy beyond anything required for thisapplication [14] . The output voltage, in millivolts, is simply proportional to the current temperature, forexample, at 250mV the temperature is 25C.

    Realistically, only temperatures in the range of 0-100C require measurement. This, on the output of theLM35DT will equate to a range of 0 to 1 volt. The way the ATMEGA328 calculates values on its analogue pins isby dividing the resolution of its 10-bit ADC between ground and a reference voltage. The reference voltage canbe externally defined via a pin on the microcontroller, or, its own internal reference of 1.1V can be used. Thisinternal range works out almost perfectly for the predefined range of 0- 100C as 91% of the ADCs (Analogue-to-Digital Converter) range is being used giving the highest resolution with no extra external components.Figure 2-29 shows how simple connecting one up should be.

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    30/60

    PIR sensor modules are available with all of the control electronics already built in. These detect movementand nearly all activate an output for a set time period. Due to this set time period the final PIR sensor unit willneed to take an average over a fairly large timespan, most probably in the range of around 20 seconds beforean initial value is produced.

    AMBIENT LIGHT SENSOR Ambient light detection will simply be performed using anLDR or Light Dependant resistor within a potential divider.The output will be sampled by an analogue pin on the

    microcontroller and an average light intensity valuecalculated.

    SOUND LEVELSENSOR Although initially a sound level sensor was to be built, researchuncovered a pre-built sound sensor module for only 5USD oraround 3. It was simply impractical to build one when theyare available at this price. The units found were being sold byan eBay seller called e -qstore and although the English usedto write the advert is poor, there are some code snippetswhich show what output to expect from the device [16] . They

    FIGURE 2-31 - A LIGHT DEPENDANT RESISTORIMAGE: HTTP://WWW.THECOLLEGEROAD.COM/

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    31/60

    Start

    InitializationRoutine

    Check Radio forpacket

    Check CRC value

    Received

    Return Ack tomaster

    Pass (CRC = 0)

    CRC Fail

    Place packet data intorecCmd array

    Process Command

    RegisterRequest ?

    Update AttachedSensor Values

    Nothing

    Finished

    Enter RegistrationMode

    Yes

    ValueRequest ?

    Send current Values Yes

    FIGURE 2-33 - LIGHTIVE SENSOR SOFTWARE SYSTEM DESIGN FLOWCHART

    The sensor will continually keep its sensor data up to date and will provide the last read and calculated sensorvalues when requested. The sensor must not be occupied for too long without checking the Radio for a packet.

    Where an average value is required for the PIR orother devices which present only an on and offstate the easiest way to average activity over atimeframe is by switching single bits in a variable Is PIR

    Triggered ?Set CurrentBit

    to 1 YesSet CurrentBit

    to 0No

    CurrentBit = 0(Set CurrentBit counter equal to 0)

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    32/60

    2.5 THE LIGHTIVE MASTERDESIGN 2.5.1 INITIALDESIGN

    FIGURE 2-35 LIGHTIVE SENSOR PCB DESIGN KEY DESIGN FEATURES AND COMPOENENTS ANNOTATED

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    33/60

    2.5.3 DATA STORAGE From early on in the conception stages of the project it was decided to make the system as independentlyrunning as possible. The system should be capable of running and producing an output without the need for acomputer at any stage. Realistically this does impose limits to how customizable the system can be made usingonly a single 2x16 digit alphanumeric display and 3 buttons. Different methods of setting up the system via acomputer were brainstormed. The minimum criteria for any ideas were not requiring this computer

    connection be maintained for running. Ideas included concepts ofan Ethernet or WIFI based web interfaces or a USB connection witha serial converter chip for direct microcontroller communication.

    Strangely the answer to this issue came whilst troubleshootingwhere data was to be stored for the menu system.

    Initially EEPROM was to be used for the menu text which wouldrarely change. This did not solve the issue of settings storage duringunit power down. EEPROM was technically capable of having thesesettings values written but its designed with a write few times

    read many times approach and not ideal for the longevity of the

    system. Whilst looking at external components for non-volatilememory the idea for removable media such as an SD card (Figure2-36) came to mind. This thought quickly developed into an almostideal solution. Removable flash media, due to its popularity, offeredthe greatest value in price per unit storage of any other reasonablesolution. With the ability to remove it from the Master unit and

    read it on very readily available hardware on a computer suddenly also solved the earlier issues faced with

    FIGURE 2-36 - A FLASH MEMORY BASED SD CARD

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    34/60

    Arduino. It turns out this library already used the widely supported FAT file system and was written by WilliamGreiman [17] and is available under the GNU General Public Licence.

    Start

    InitializationRoutine

    Button Pressed ?

    Run Items function

    Item Selected ?

    Load Settings fromSD

    Poll ConnectedSensors

    Update ConnectedDrivers

    Poll Timer ?Triggered

    Button != Menu Button

    Load Main Menu

    No

    Menu

    Item

    Timeout

    FIGURE 2-37 MASTER UNIT SOFTWARE DESIGN FLOWCHART

    2.5.5 BREADBOARDPROTOTYPE In order to test the systems design theory before PCB design began a prototype was created on a breadboard,

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    35/60

    2.5.6 FINALDESIGN After successful testing with the breadboard prototype the PCB designs were realised. A final block diagram,including all system developments, is shown in Figure 2-39.

    Alpha-TRX433S433 Mhz Wireless

    FM Transceiver

    AtmelATMEGA328

    Microprocessor

    User InterfaceButtons

    Line LevelTranslator

    SD Card

    SPI

    3V3 VoltageRegulator

    3v

    3v

    16x2 Alphanumeric LCDDisplay

    Front Panel Header

    FIGURE 2-39 - BLOCK DIAGRAM OF FINAL MASTER DESIGN

    The above design along with help from the breadboard prototype was used to create the master schematicwhich is shown in APPENDIX FIG 7. Much like in the previous PCB designs the components and their solderfootprints had to be created using the datasheets.

    Before the design of the PCB can begin an idea of how the front panel board will look is required. A design ofthe front panel board was established. This board must also be compatible with the front panel header on the

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    36/60

    Once a physical layout was confirmed the PCB design work for the front panel was completed. The schematicfor the front panel can be found in APPENDIX FIG 8. Figure 2-42 shows the final PCB design for the front panel.

    This is a single sided board with no surface mount components so should be simple to create and put together.

    FIGURE 2-42 - LIGHTIVE FRONT PANEL PCB KEY DESIGN FEATURES AND COMPOENENTS ANNOTATED

    The circuit schematic for the Master unit PCB could now be used along with the front panel designs above tocomplete the Masters PCB layout. Figure 2-43 below shows the final PCB design. The footprint of the boardexceeds that of the actual circuitry because it must mount to the front panel board. The four holes which willmount the master PCB are the same four which also go through the display. Once put together these holesgoing straight though should provide plenty of support for the 3 PCBs.

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    37/60

    3 PROJECTBUILDPHASEThe build of the project did overlap heavily with the design phase. They have been separated to allow moreclear presentation of the progress throughout the year. As unit PCBs were designed they were beingsubmitted to the department for manufacture. This was because only two prototyping microcontroller chipsand boards were available. This lack of available units to prototype on did begin causing issues as the firstPCBs took a while to create. The time taken to design PCBs drastically reduced as the software was learned

    and components were created and could therefore be reused.

    With the very broad band of areas covered by this project there is not enough scope in this report to cover allaspects in detail. For this reason the software has been well commented and the software section focuses onsnippets of each library to give an idea of the kind of functionality being used and how they are managing data.Far more attention has been paid to the build where, unlike code, the process cannot be commented andexplained as easily afterwards.

    3.1 SOFTWARE

    The coding and developing of the Lightive software for each unit was running continually throughout theentire project. As this report is written the current total line count stands at more than 1500. This does notinclude any content from third party libraries. The code written to date forms a usable foundation to whichfunctionality can easily be added. This section aims to summarise the functionality of this code above andbeyond what was explained in the design section to allow an insight into how the system is processing data.

    3.1.1 THE LIGHTIVESD CARD LIBRARY The Lightive SD card librarys core functionality is wrapped around the Arduino SD card library. This has been

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    38/60

    values after 0* are 01, meaning the driver has been registered, 01 which is the drivers address and 05 which

    is how many bars are available on the driver. The beauty behind this system is that a relatively simple piece of

    software can be written to run on a computer which writes these files with selected settings making systemsetup extremely quick and efficient without any need to have access to the system.

    Unfortunately due to the large scope of content which must be covered it is not possible to explain the codebehind the entire library in this report. The code has instead been appropriately commented. One functionwas chosen for explanation as it has many elements which others share. This was the readline() function andits while loop, which gives it most of its functionality, is shown in Figure 3-3.

    FIGURE 3-3 - WHILE LOOP FROM READLINE() FUNCTION

    This loop uses peek() to check what the next character is without actually reading it. If the value it is peeking

    at is not the end of line character it then jumps into the loop and reads that character into a string. Once acharacter is read the position in the file is incremented by one so the loop will then peek at the next value.Other conditions for the loop include open_file.available() which ensures that the open file is still accessible

    and we have not reached the end. There is also a counter who variable is named count which increments

    with every loop. This moves along the array which the read characters are being placed into. Because this

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    39/60

    maximum of 5 bits (0- 31) to the 5 Least Significant Bits (LSB) of the header byte, sets the dest flag to 1 andthen ORs this with the original header byte to carry along any flags which have been set so far.

    Once the header byte has been setup the payload is essentially ready to be transmitted. Before transmissioncan begin the radio module must confirm it is ready. The JeeLabs library function called rf12_canSend()

    returns whether the module is ready or not. Some code must be setup to allow a timeout if the radio does notbecome ready within a time window. This is simply done here by creating a retry counter. Every time the radiois checked the counter is incremented, if it exceeds a certain amount of attempts the entire function returns 0,specifying the packet transmission failed. If the rf12_canSend() function returns 1 then the packet may be

    transmitted.

    One the packet has been transmitted there are two options, if no ack was requested the function is finishedand returns a success. If an ack was requested the function the calls another Lightive radio library functioncalled delayforack(), this checked the radio for a given window and runs check on incoming packets. If a

    packet is deemed to be the correct ack then this function returns true and consequently do does thetransmit() function. Should an ack fail to be received the packet will be re -transmitted and the checksperformed once again. This process also has a timeout in the form of number of attempts. Should the

    maximum number of attempts is exceeded the function returns a failure. This concludes the functionality ofthe transmit() function.

    3.1.3 DIRECTOUTPUT FUNCTIONALITY The original aim of the project specified the system must have an ability to allow 3 rd party, computer basedsoftware to be written which can interface with the system. An example given was the ability to use thesystem as an Ambilight ( section 2.3.2, page 13 ) where low latency was essential. This is where the Directoutput functionality comes into play. It reads data, in a defined protocol via the serial line on the master then

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    40/60

    FIGURE 3-7 - BOARD BEING EXPOSED

    3.2 HARDWARE 3.2.1 MANUFACTURING THEPCBS As the PCBs were being made in house the process was followed for a better understanding. The process usedhere at the University of Surrey Electronic Engineering department is a Photo etching method onto photo PCBwhich has a photo-resist layer on one side. To speed up the completion of the PCBs hole drilling and trimmingwere completed whilst the technical staff were extremely busy. This section aims to briefly show and describethe process used as is not intended as a guide.

    STEP 1 PRINT THEPCB DESIGN TO A TRANSPARENCY.Double sided boards require one printed for both sides. By tapingthem together in alignment a pocket can be formed allowing thePCB to be slipped in, this is shown in Figure 3-6. This also keeps thetop and bottom in alignment as holes must obviously meet the padson both sides. It is best to print the transparencies at the highestresolution available on the printer, this should deepen the blacks

    STEP 2 EXPOSURE This step involves exposing the photo sensitive PCB layers to strong UV light. Thetransparency will mask the areas of copper to be kept. The areas exposed to UVwill react with the PCB developer in the next stage and be removed. Figure 3-7shows the UV exposure box, the yellow tinge on all the photos is the safelight.

    FIGURE 3-6 - DRIVER UNIT PCBTRANSPARENCIES TAPED TOGETHER

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    41/60

    FIGURE 3-11 SK10 FLUXBASED LACQUER

    STEP 6 REMOVE REMAINING PHOTORESIST The remaining photoresist can now be removed. This was done simply using someacetone and a cloth. The board was once again rinsed one final time.

    STEP 7 LACQUER THE BOARD For this step some SK10 flux solution was sprayed on to form a protective layer abovethe board. This not only stops corrosion on the board but also acts as a flux which helpsbind the solder when soldering. A heat gun was used to reduce the drying timerequired by the sk10. Figure 3-11 shows the SK10 spray can.

    STEP 8 DRILL THE HOLES The department had a foot operated drill press which projects andmagnifies the PCB and places a cross hair directly over the drill piece. Thismakes drilling holes accurately a fast and easy process. Figure 3-13 showsthe drill press used. Over 1000 holes have been drilled for the entireproject.

    STEP 9 CUTTING TO SIZE The P CBs can now be trimmed to size.This is simply done using a guillotine.The PCB manufacture is now completeand the board is ready for soldering.

    FIGURE 3-13 -FOOT OPERATEDPCB DRILL PRESS FIGURE 3-12 CUTTING PCB TO SIZE WITH

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    42/60

    SURFACEM OUNT ICS Several techniques were tried when soldering surface mount ICs but one was found to be fastest and the most

    precise. The first step was to ensure a generous helping of flux was on the board. Using tweezers the IC wasaligned then pushed down where the tackiness of the flux would help to hold it in place. Two opposing pinswere then tack soldered to hold the IC in place. Please observe Figure 3-15 which shows an ATMELmicrocontroller tagged to a driver board using this method. Now each side of the IC remaining were heatedand solder was applied across the whole side. By pulling the soldering iron away from the IC down the tracksmost solder bridges could be avoided. Any bridges which do occur had excess solder soaked up with somesolder wick which was heated over the bride and also dragged away from the IC down the tracks before lifting.

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    43/60

    3.2.3 THE DRIVER The Driver was the first board to be created and soldered. It has a total of 42 vias which, due to limitations inavailable equipment, had to be soldered manually using the aforementioned technique. A total of two driverboards were created and apart from an issue where a via on the reset line was missed, all boards workedflawlessly first time. One of the driver boards was mounted in a two gang pattress as described in the designstage (See section 2.3.7) . A photo of the complete prototype is shown in Figure 3-18. This is to demonstratethe concept works in reality and can create a neat and fairly inconspicuous unit.

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    44/60

    3.2.4 LED STRIPS The LED strips, as described in the design (section 2.3.7 ), consist of a driver board with the LED strip soldereddirectly onto it. The driver board requires a 12V power line, 0V line and three PWM signals for red, green andblue channels. There were no large issues with these boards; the only modification which had to be made wasdue to a printing error where the PCB boarder remained on the board. As this risked shorting the tracks on theLED strip it was removed with a craft knife.

    FIGURE 3-19 - LED BAR DRIVER PCB SOLDERED AND READY TO BE ATTACHED TO STRIP. VISABLE ARE 3 MOSFETS AND THEIR PULL UPRESISTORS

    Figure 3-22 shows the 10 driver PCBs which have been completed and had 1 meter of LED strip attached. The

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    45/60

    LED strip. Finally the wire was also tie wrapped down for security and the end of the trunking was capped withsome hot glue. The finished assembly, shown in Figure 3-23 formed a solid and durable feeling LED light bar.

    FIGURE 3-23 - ASSEMBLY AT DRIVER END OF A LIGHTIVE LED BAR

    The amount of wastage left over for each 3 meter strip prompted an idea to use of the remaining trunking as astand for the bars as shown in Figure 3-24. These stands tilt the bars which allow them to be placed facing flatsurfaces such as walls to create a wash of light.

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    46/60

    3.2.5 THE SENSOR The sensor module was by far the easiest module to solder. It was the smallest and least complex. Due to itsmodular format it had to have many connectors and some external boards made up for it. All of the sensorsare individually detachable. So far two sensors boards have been built and tested although a total of 4 PCBshave been manufactured. The two completed sensors are shown in Figure 3-26.

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    47/60

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    48/60

    The final board is the power supply. This is the same board pictured in Figure 3-25 in the Driver section above.This has been mounted to the enclosure (Figure 3-32) and the DC socket for the power supply has been

    mounted for external access (Figure 3-31) .

    An acrylic mount for the project box the Master unit is in was made. The acrylic was cut to size and a squarehole was made. The acrylic was then heated with an electric heat gun and slowly formed to the right shape.This creates a comfortably viewed and easily accessed control interface for the system. The complete master isshown in Figure 3-33. For standard system operation this driver unit will only require power so has minimalcables. Due to late delivery the FTDI USB to serial converter for this unit has yet to be fitted.

    FIGURE 3-31 - EXTERNALLY ACCESSABLE DC PLUG WILLACCEPT ANYTHING FROM 8V TO 40V DC

    FIGURE 3-32 - POWER SUPPLY MOUNTED TO MASTERENCLOSURE

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    49/60

    4 THE SYSTEM INPRACTICE/ IMPLEMENTATION With the issues faced throughout the project a complete setup of the system as to get social feedback couldnot be completed before the writing of this report. For this reason this section will focus primarily on thetechnical aspects of the system to date.

    Unless explicitly stated all testing was performed with one fully loaded driver (all 5 bars attached) using thepower supply purchased for the unit. The final master controller, assembled and in its enclosure. A singlesensor board, battery powered with only the PIR movement sensor attached.

    4.1 KEY FUNCTIONALITY ANDUSER INTERFACE The user interface is simple and intuitive requiring only 3 buttons to operate. During testing settings werebeing saved to the SD card but were not being loaded. This meant the system was setup via the menu manytimes and the system never behaved unexpectedly.

    Once registered the changes from the sensor and attached PIR were seen to be accurately resulting in thespecified colour changes in the bars. The designated colours were changed on the SD card via a computer.These changes were seen to be working flawlessly in system which confirms sensors are receiving their valueswirelessly from the SD card in the master.

    Tests were performed to see how the system would react to powering down the sensor or driver, both instandard operation and whilst registering them. In every case the system dealt with these scenarios wellalthough it was noticed the driver may not respond to an open menu request on the first attempt. This isbelieved to be because retry values in the wireless library are too large resulting in the wireless module gettinghung up retrying transmissions to an unavailable device

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    50/60

    adjust values seen in the configuration were added to calibrate the system andproduce a more accurate colour output. This is because the red LEDs on the strips

    seem to have a weaker output than the blue or green. Subsequently the green LEDsare also perceivably weaker than the blue. These values were obtained through aprogression of logical trial and error.

    The light section brings the other two sectionstogether. This is where the actual physical bars aredefined. The configuration for one of the threelights is shown in Figure 4-2. After the name, in thecase of Figure 4-2 this is the left bar, there is threelines which begin with colour. These lines map acolour to a devices output. If we take the red

    colour in Figure 4-2 we are mapping any redcolours, as define in the colour section, to theLightive device. The 1 on the end denotes its the first value to leave the serial port.

    The hscan and vscan fields define how much of the screen this light will scan and represent. Figure 4-4 more

    clearly describes how these horizontal and vertical allocations work.

    Left

    Top

    [Lights]

    Lightive

    [Device]0 100Top

    L ef i

    g h t

    33 66

    Serial33

    Computer screen(With Boblight Software running)

    [color]name redrgb FF0000

    [color]name greenrgb 00FF00adjust 0.8

    [color]

    name bluergb 0000FFadjust 0.5

    FIGURE 4-3 - COLOURSECTION IN CONFIG FILE

    [light]name leftcolor red lightive 1color green lightive 2

    color blue lightive 3hscan 0 33vscan 0 100

    FIGURE 4-2 - ONE OF THREE LIGHTSECTIONS IN CONFIG FILE

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    51/60

    time period. Whilst on the sensor unit was moved to other areas of the house and the lighting system wasobserved changed when activity occurred in the given areas. By the end of the 32 hour test the TLC could have

    been barely been described as moderately warm. The driver units were warm but this seemed to be heatconductance from the LED strips themselves as they felt warm to the tip of the meter length. The only reasonthe system was turned off at 32hours was because it has to be moved to the undergraduate laboratories. Herethe system had been plugged in and ran for the rest of the day. It has, on several occasions, run for timesexceeding 5-6 hours in the undergraduate laboratories and shown no issues.

    Two feature length films have also been watched using the Direct Output mode and Boblight and the systemcoped with the drastic light changes and flashes with no issues at all.

    There have been no stability issues presented by the system to warrant further testing in this field.

    5 COSTSThis section summarises the average actual cost per prototype unit. These are the prices that items werepurchased at for this project and are therefore at the retail end of the price range. Many of these can be

    heavily reduced by buying in bulk and are in no way representative of the final prices which things can be builtin manufacture.

    Items with no price were acquired as samples. Components such as resistors and capacitors have not beenincluded and are available from the undergraduate labs and are of very low value.

    Driver Unit Part Number Item Description Supplier Quantity Unit Cost Line Cost

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    52/60

    Master Unit

    Part Number Item Description Supplier Quantity Unit Cost Line CostN/A 16MHZ SMD CRYSTAL (RC) Rapid 1 0.29 0.29

    TRX433S Alpha RF Transceiver RS 1 3.51 3.51

    ATMEGA328P-AU Atmel Microprocessor Farnell 1 2.22 2.22

    N/A Master PCB (In House) Univ of Surrey 1 1.99 1.99

    N/A Front Panel PCB (In House) Univ of Surrey 1 1.24 1.24

    PB61302BL Laser Etched buttons RJS Electronics 4 1.58 6.32

    85-3736 9vdc 15watt UK psu Rapid 1 5.04 5.04DM1AA-SF-PEJ(72) SD card holder RS 1 1.64 1.64

    UA78M33CDCY Lin Regulator 3.3V 0.5A RS 1 0.24 0.24

    TXB0104DG4 Voltage Level Translator RS 1 1.16 1.16

    PC1602ARS Alphanumeric LCD 16x2 Rapid 1 6.17 6.17

    Total: 29.81

    The predicted costs in the midterm report were not too far out considering how much the project has evolved.The cost of a driver unit was predicted at 37.17 where as it came in at 41.92. The reason for this is actuallybecause the prediction did not include the cost of the power supply which was 13. In theory the unit itself hasactually come in under the predicted cost. The sensor unit was estimated to cost 8.81 but this was with nosensors. The total cost with sensors was a reasonable 10.86. The master unit sees the biggest cost differencewith predicted costs being at 13.07 and actual costs coming in at 29.81. This was down to the purchase ofsome Laser Etched Buttons at sample prices which added 6.32 and the inclusion of a power supply adding

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    53/60

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    54/60

    BIBLIOGRAPHY 1 PHILIPS. Philips. [Internet]. [cited 2010 Dec]. Available from:

    http://www.philips.co.uk/c/livingambiance/livingcolors-anthracite-6914367pu/prd/?t=specifications .

    2 Arduino. [Internet]. [cited 2010 Dec]. Available from: http://www.arduino.cc/ .

    3 Wippler JC. JeeLabs. [Internet]. [cited 2011 Apr]. Available from: http://jeelabs.org/ .

    4 QUASAR UK. ALPHA RF Transceiver Datasheet. [Internet]. [cited 2010 Dec]. Available from: http://docs-europe.electrocomponents.com/webdocs/0d06/0900766b80d0644d.pdf .

    5 Wippler JC. RF12 library. [Internet]. [cited 2011 Apr]. Available from:http://jeelabs.net/projects/cafe/wiki/RF12 .

    6 Open Source Initiative. OSI - The MIT Licence. [Internet]. [cited 2011 Apr]. Available from:http://www.opensource.org/licenses/mit-license.php .

    7 Cook M. De-Coupling. [Internet]. [cited 2011 Jan]. Available from:http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html .

    8 Texas Instruments. DATASHEET - TLC5940. [Internet]. [cited 2011 Apr]. Available from:http://focus.ti.com/lit/ds/symlink/tlc5940.pdf .

    9 Leone A. TLC5940 - Arduino TLC5940 Library. [Internet]. 2009 [cited 2010 Dec]. Available from:

    http://www.philips.co.uk/c/livingambiance/livingcolors-anthracite-6914367pu/prd/?t=specificationshttp://www.philips.co.uk/c/livingambiance/livingcolors-anthracite-6914367pu/prd/?t=specificationshttp://www.arduino.cc/http://www.arduino.cc/http://www.arduino.cc/http://jeelabs.org/http://jeelabs.org/http://jeelabs.org/http://docs-europe.electrocomponents.com/webdocs/0d06/0900766b80d0644d.pdfhttp://docs-europe.electrocomponents.com/webdocs/0d06/0900766b80d0644d.pdfhttp://docs-europe.electrocomponents.com/webdocs/0d06/0900766b80d0644d.pdfhttp://docs-europe.electrocomponents.com/webdocs/0d06/0900766b80d0644d.pdfhttp://jeelabs.net/projects/cafe/wiki/RF12http://jeelabs.net/projects/cafe/wiki/RF12http://www.opensource.org/licenses/mit-license.phphttp://www.opensource.org/licenses/mit-license.phphttp://www.thebox.myzen.co.uk/Tutorial/De-coupling.htmlhttp://www.thebox.myzen.co.uk/Tutorial/De-coupling.htmlhttp://focus.ti.com/lit/ds/symlink/tlc5940.pdfhttp://focus.ti.com/lit/ds/symlink/tlc5940.pdfhttp://focus.ti.com/lit/ds/symlink/tlc5940.pdfhttp://www.thebox.myzen.co.uk/Tutorial/De-coupling.htmlhttp://www.opensource.org/licenses/mit-license.phphttp://jeelabs.net/projects/cafe/wiki/RF12http://docs-europe.electrocomponents.com/webdocs/0d06/0900766b80d0644d.pdfhttp://docs-europe.electrocomponents.com/webdocs/0d06/0900766b80d0644d.pdfhttp://jeelabs.org/http://www.arduino.cc/http://www.philips.co.uk/c/livingambiance/livingcolors-anthracite-6914367pu/prd/?t=specifications
  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    55/60

    19 Rapid Electronics. Cables & Connectors. [Internet]. [cited 2011 Apr]. Available from:http://www.rapidonline.com/Cables-Connectors/Cables/Conduit-And-Trunking/Miniature-

    trunking/74246/kw/04-5571 .

    20 boblight. Boblight - google code. [Internet]. [cited 2011 Mar]. Available from:http://code.google.com/p/boblight/ .

    21 topbrightledstore. [Internet]. [cited 2010 Dec]. Available from: http://stores.ebay.com/topbrightledstore .

    22 AP15N03H datasheet. [Internet]. [cited 2010 Dec]. Available from:http://www.alldatasheet.com/datasheet-pdf/pdf/134269/A-POWER/AP15N03H.html .

    23 RS Components. RF-Solutions - ALPHA RF Transceiver Module 433MHz. [Internet]. [cited 2010 Dec].Available from: http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=6666757 .

    24 RS Components. Wireless Solutions - XBee RF Module with Whip Antenna. [Internet]. [cited 2010 Dec].

    Available from: http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=0102721 .

    25 Philips. [Internet]. [cited 2010 Dec]. Available from:http://www.philips.co.uk/c/televisions/33092/cat/#/difference/ambilight .

    26 Philips. [Internet]. [cited 2010 December]. Available from:http://www.philips.co.uk/c/televisions/33092/cat/#/difference/ambilight .

    http://www.rapidonline.com/Cables-Connectors/Cables/Conduit-And-Trunking/Miniature-trunking/74246/kw/04-5571http://www.rapidonline.com/Cables-Connectors/Cables/Conduit-And-Trunking/Miniature-trunking/74246/kw/04-5571http://www.rapidonline.com/Cables-Connectors/Cables/Conduit-And-Trunking/Miniature-trunking/74246/kw/04-5571http://code.google.com/p/boblight/http://code.google.com/p/boblight/http://stores.ebay.com/topbrightledstorehttp://stores.ebay.com/topbrightledstorehttp://stores.ebay.com/topbrightledstorehttp://www.alldatasheet.com/datasheet-pdf/pdf/134269/A-POWER/AP15N03H.htmlhttp://www.alldatasheet.com/datasheet-pdf/pdf/134269/A-POWER/AP15N03H.htmlhttp://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=6666757http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=6666757http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=6666757http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=6666757http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=0102721http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=0102721http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=0102721http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=0102721http://www.philips.co.uk/c/televisions/33092/cat/#/difference/ambilighthttp://www.philips.co.uk/c/televisions/33092/cat/#/difference/ambilighthttp://www.philips.co.uk/c/televisions/33092/cat/#/difference/ambilighthttp://www.philips.co.uk/c/televisions/33092/cat/#/difference/ambilighthttp://www.philips.co.uk/c/televisions/33092/cat/#/difference/ambilighthttp://www.philips.co.uk/c/televisions/33092/cat/#/difference/ambilighthttp://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=0102721http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=0102721http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=6666757http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=6666757http://www.alldatasheet.com/datasheet-pdf/pdf/134269/A-POWER/AP15N03H.htmlhttp://stores.ebay.com/topbrightledstorehttp://code.google.com/p/boblight/http://www.rapidonline.com/Cables-Connectors/Cables/Conduit-And-Trunking/Miniature-trunking/74246/kw/04-5571http://www.rapidonline.com/Cables-Connectors/Cables/Conduit-And-Trunking/Miniature-trunking/74246/kw/04-5571
  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    56/60

    APPENDIX

    APPENDIX FIG 1 - DEFAULT PINOUTS - EXTRACT FROM JEELABS RFM12 LIBRARY

    Direction 1 Direction 2

    D i s t a n c e

    ( m )

    P a c

    k e t s L o s t

    / 1 0

    L i n e o

    f S i g h t

    P a c

    k e t s L o s t

    / 1 0

    L i n e o

    f S i g h t

    0 0 yes 0 yes2 0 yes 0 yes4 0 yes 0 yes6 1 yes 0 yes8 0 yes 0 yes

    // ATmega328, etc.#define RFM_IRQ 2#define SS_PORT PORTB#define SPI_SS 5#define SPI_MOSI 11#define SPI_MISO 12#define SPI_SCK 13

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    57/60

    APPENDIX FIG 3 - MOSFET TRANSFER CHARACTERISTSICS GRAPH[11]

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    58/60

    APPENDIX FIG 5- LED BAR POWER BOARD PCB SCHEMATIC

    APPENDIX FIG 6 STEP DOWN VOLTAGE REGULATOR PCB SCHEMATIC

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    59/60

  • 8/10/2019 Lightive - Eviroment Aware Lighting System - Project Report Louis Christodoulou

    60/60

    THE PHOTOGRAPHYRIG Here is a photo of the rig setup to take shots of the finished products:

    I thought it may be of interest.