Professional Documents
Culture Documents
compared to standard lighting fixtures, there effects can quickly become uninteresting and
repetitive. With no commercially available mood lighting system offering anything but preset animations or static colour the idea and motivation for this project was born. The project
entails the design and build of a mood lighting system which can react and reflect its
environment
offering
automated
operation
yet
maintaining
interest
through
unpredictability. This report is a review of the project to date, outlining the system design,
work covered and development. Also provided is an insight into possible system
improvements noted during the course of the project.
Department of
Electronic Engineering
I confirm that the submitted coursework is my own work and that all material
attributed to others (whether published or unpublished) has been clearly
identified and fully acknowledged and referred to original sources. I agree that
the University has the right to submit my work to the plagiarism detection service
TurnitinUK for originality checks.
URN: xxxxxxx
Assignment/Lab Title:
Final Report
Signature: xxxxxxxxx
Date: 15/05/2011
CONTENTS
1
Aim ........................................................................................................................................................ 1
1.2
1.3
Documentation ..................................................................................................................................... 1
1.4
1.5
1.6
2.1.1
2.1.2
2.1.3
2.1.4
2.1.5
2.2
2.2.1
2.2.2
2.2.3
2.3
2.3.1
2.3.2
2.3.3
2.3.4
2.3.5
2.3.6
2.3.7
2.4
2.4.1
2.4.2
Research ......................................................................................................................................... 24
2.4.3
2.4.4
2.4.5
2.5
2.5.1
2.5.2
2.5.3
2.5.4
Software.......................................................................................................................................... 28
2.5.5
2.5.6
Software .............................................................................................................................................. 32
3.1.1
3.1.2
3.1.3
3.2
Hardware............................................................................................................................................. 35
3.2.1
3.2.2
3.2.3
3.2.4
3.2.5
3.2.6
4.2
4.3
Costs ............................................................................................................................................................. 46
Conclusions ................................................................................................................................................... 47
Bibliography .......................................................................................................................................................... 49
Appendix ............................................................................................................................................................... 51
1 PROJECT INTRODUCTION
1.1 AIM
The project being undertaken is the design and creation of a reactive lighting system whose output is
influenced by elements of its surrounding environment. The systems light output will be on par with what is
considered 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 a
method 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 should
incentivize users to interact with the system, other configurations will allow the system to disappear into the
background and have a more subconscious effect on mood. The system must also offer a standard protocol
rd
whereby 3 party applications can interface with the system via a computer.
1.3 DOCUMENTATION
As the project has a heavy focus on coding it was felt that a hand written log book would not be a logical
solution. In the same light a folder full of files was also not sensible as it has limited points of access. An
internet based solution was decided upon; wordpress a highly flexible blog based content management
system. The blog is easily accessible from any internet enabled device to allow for additions to be made
anywhere. The URL is http://louisc.co.uk/FYP/, and the domain and hosting is owned by myself. There are
many advantages offered over a paper based logbook. Dates and times of posts are automatically added for
reference as well as indexing whole posts allowing for searches on any keyword. Multimedia such as pictures
and video can be added. Code can be pasted and commented easily and neatly.
Page | 1
URN: 6025977
ID
Task Name
Start
Finish
Nov 2010
Dec 2010
24/10 31/10 7/11 14/11 21/11 28/11 5/12 12/12 19/12 26/12
1
2
3
4
5
21/10/2010
31/10/2010
1w 4d
08/11/2010
14/11/2010
1w
08/11/2010
14/11/2010
1w
15/11/2010
21/11/2010
1w
22/11/2010
01/01/2011
5w 6d
22/11/2010
05/12/2010
2w
04/12/2010
01/01/2011
4w 1d
05/12/2010
18/12/2010
2w
Driver Unit
18/12/2010
26/12/2010
1w 2d
10
27/12/2010
31/01/2011
5w 1d
11
Master Unit
02/02/2011
19/04/2011
11w
12
02/02/2011
15/02/2011
2w
13
15/02/2011
17/04/2011
8w 6d
14
06/04/2011
19/04/2011
2w
20/02/2011
15/04/2011
7w 6d
20/02/2011
05/03/2011
2w
28/02/2011
13/03/2011
2w
13/03/2011
26/03/2011
2w
26/03/2011
15/04/2011
3w
15
16
17
18
19
Sensor Units
Design, build and code prototype
movement sensor
Design, build and code prototype
Temperature Sensor
Design, build and code manual
remote controller for the system
Design, make and populate PCBs for
Sensors and Remote Controller.
Jan 2011
Feb 2011
Mar 2011
Apr 2011
May 2011
Duration
20
11/04/2011
19/04/2011
1w 2d
21
16/04/2011
22/04/2011
1w
22
05/04/2011
16/05/2011
6w
2/1
9/1
16/1
23/1
30/1
6/2
13/2
20/2
27/2
6/3
13/3
20/3
27/3
3/4
10/4
17/4
24/4
1/5
Page | 2
URN: 6025977
8/5
Page | 3
URN: 6025977
The widely available Phillips mood lamp is a good example of a recent consumer mood lighting product. Figure
1-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 colours
last set and allow definitions for a favourite. Their second generation lamp allows for basic automated colour
scrolling but each lamp is independent so if syncing is required they must all be in range of the remote at the
same time. The first generation uses four LEDs, two Red a green and a blue. The newer lamp uses seven LEDs.
[1]
The only product found during research to be closest in design to that being suggested was a solution by
ChromoFlex. Given the difficulty in track this product down it is nowhere near as widely available as the
Phillips mood lamp. The product requires some knowledge in electronics to set up, in contrast to the Phillips
mood lamp which works out of the box. With no wires needing to be run through walls or floors the wireless
abilities of the system seem to be the biggest factor in setting it apart from requiring professional installation.
Figures 2-2 2-4 show the complete wireless ChromoFlex range. The System can be driven either by a remote
control (FIGURE 1-3) or by software via a USB dongle (FIGURE 1-4). The software is simple and allows for setting
colours or animations. The system requires constant input from the computer in order to run animations.
Although many of these more reasonably priced domestic solutions shared some features with the system
proposed, there were none found which offered it in its entirety.
Page | 4
URN: 6025977
FIGURE 2-1 - LIGHTIVE SYSTEM, TYPICAL SETUP SHOWING MULTIPLE DRIVER AND SENSOR
UNITS COMMUNICATING WITH A SINGLE MASTER
Page | 5
URN: 6025977
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 using
the microcontroller, it is installed on a board which presents and clearly marks each input and output pin.
Figure 2-2 shows the Arduino Duemilanove with an ATMEGA328P microcontroller installed. These chips are
capable of self-programming. The Arduino team have developed a clever boot-loader which sits on the chip
and allows it to be programmed via its hardware serial connection. Most demo boards offer a USB to serial
interface meaning they can be programmed using a single USB connection. This is done via Arduinos own
integrated development environment (IDE) with the language based on C++. Included libraries make common
input operations easier. This removes the need for expensive chip programmers and software [2]. With the
hardware design being open source, schematics are easily available and can be modified and integrated into a
custom PCB for the project.
The Arduino environment and boot-loader are only compatible with a limited number of Atmel Chip models.
This limits the processors which can be used in the project. Fortunately the processors selected are very
capable and if purchased without the boot-loader preinstalled, competitive in price. The decision was made to
use the Atmel ATMEGA328P as it offers the greatest power versus price ratio of the Arduino enabled line.
Page | 6
URN: 6025977
Page | 7
URN: 6025977
Page | 8
URN: 6025977
T HE R ANGE E XPERIMENT
The aim of the experiment was to set up two wireless modules and, using the Demo application provided with
the library, test reliability and robustness of the signal at range. A secondary aim is to gain an understanding
into 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 is
assumed to be in ideal conditions with no obstacles and minimal interference [4]. The testing conditions for
the experiment were far from this. The testing will be carried out in University of Surrey undergraduate
laboratories. 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 to
work out the optimum antenna length for the transceivers. Each antenna was made from a single strand, 22
gauge 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 (Listed
in APPENDIX FIG 1 ). Two identical Arduino units with wireless modules were setup. One unit was left at a
workstation powered by a bench power supply. The other was USB powered via a laptop for mobility. This unit
was 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. Each
time the mobile unit was moved, 10 full sized (66 byte) packets were sent, one every second and each with an
acknowledgement request. As the unit is set up in a corner of the room the signal will be checked at distances
in two directions.
The results were impressive and exceeded personal expectations for the testing environment. The link showed
no real signal loss till over 25 meters away in the worst case. At this point the signal was travelling through an
office and across a second lab filled with computers. In both directions the only observable deterioration was
only once several walls had been passed. The results can be seen on a graph in Figure 2-6, this has been
plotted from the table of results which can be found in APPENDIX FIG 2. There was a case where a single
packet was dropped at 6 meters in direction 1. This was likely caused by interference. Direction 1 allowed
further distance to be travelled without going through any walls.
Page | 9
URN: 6025977
Direction 1
Direction 2
7
6
5
4
3
2
1
0
0
10
15
20
25
Approximate Distance (Meters)
30
35
40
C ONCLUSIONS
These wireless modules have performed above and beyond the specification required. The library found, once
implemented abstracts much of interface complexity during use. This allows more concentration on coding
functionality for the system as opposed to low level interaction with hardware. Although this abstraction is
helpful, for complete comfort in using the library some time was spent understanding how its functions have
been implemented.
A potential issue could arise if a repeat example of a dropped packet due to interference should be
encountered. This could result in an LED bar remaining the wrong colour. It is therefore important to
implement some kind of automatic repeat request (ARQ) system to handle dropped packets due to
interference spikes.
All in all no reason could be found not to continue with this as a solution to wireless communication.
CTL - control flag which, when set, is used to denote packet is an ack response
DST If set denotes the Node ID field contains the packets desired destination node. If clear
denotes the packet is a broadcast and Node ID contains the ID of the broadcasting node.
ACK set if an ack reply is required
Page | 10
URN: 6025977
The functionality of these flags will become clearer in the following examples.
The table in Figure 2-8 shows how these flags and the Node ID field are used in any given scenario.
To demonstrate the libraries ack mechanism a packet requiring an ack will be transmitted and the sequence of
radio events which follow documented. Figure 2-9 displays the headers exchanged between two nodes. First, a
packet containing some information is sent from node 1 to node 2 and requires an ack. The header will have
the ACK flag set, denoting an ack response is required. The DST flag will also be set along with the value in the
node ID field being set to the address of the receiving node, in this case, node 2.
Once Node 2 receives this packet the ACK flag in the header is examined. If the flag is set an ack packet with
the appropriate header is created. This header will differ slightly depending on the kind of initial transmission
being responded to. In our example Node 1 is transmitting directly to Node 2, in this case the header will have
nothing but the CTL flag set. Should Node 2 have been responding to a broadcast, the response would have
simply included its own Node ID.
FIGURE 2-9 JEELABS UNMODIFIED RADIO TRANSACTIONS FOLLOWING A SENT PACKET WITH ACK REQUEST
Page | 11
URN: 6025977
The first noticeable issue with the header byte is there is only space for a single node ID. If we are transmitting
to a particular node, this will have to be the ID of the destination. If an ack is requested, the receiving node
does not have a return address for the ack packet. This is combated by simply broadcasting the ack packet to
all. This could be problematic if multiple systems are run alongside each other.
The Lightive system was also given an ACK command which can be transmitted when replying to an ack
request. Although the original ack system can still be used all Lightive units will be checking for the ACK
command and not the header flag. This ACK commands is also no longer broadcast as in Figure 2-9 but
transmitted back to the requesting unit using the address provided in the received packet. The receiving unit
also verifies the ID on the incoming ACK command to ensure its from the unit it was requested.
Page | 12
URN: 6025977
Alpha-TRX433S
433 Mhz Wireless
FM Transceiver
MOSFETs
r
Output
To LED
BAR 1
g
b
SPI
r
Atmel
ATMEGA328
Microprocessor
SPI
TLC5940
16-channel
PWM LED
Driver
.
.
.
r
g
Output
To LED
BAR 2
Output
To LED
BAR 5
Initialization
Routine
Register with
Master
Received
Yes
Command
Processing Finished
?
Pass (CRC = 0)
Display
Error on
LCD
No
No
Master Ack ?
Return Ack to
master
Ambilight projects a glow of light from the back of a TV onto the wall, matching and enlarging the picture on
the screen for a truly immersive experience [25]
Page | 13
URN: 6025977
A little research on the Arduino website surfaced a library written for control of the TLC5940 via an Arduino. It
was written by Alex Leone and is available under the GNU General Public Licence [9]. This allows for
modifications of the software along with redistribution of the modified software [10]. The library offers control
over all of the core features of the chip which are likely to be used as well as supporting daisy chaining and
retrieval of currently set channel brightness. On receipt of a TLC5940 sample from Texas Instruments it was
connected using the default pins found in the Basic Use example. The unit worked perfectly with the library
and supports everything required for the application in hand.
With the IC chosen the next step was to decide how the LED bars will be driven. The specifications state that
an LED supply voltage up to 17 volts can be used, well within the 12 volts required for the strips. When the ICs
supply voltage is greater than 3.6 volts each channel can support a maximum of 60mA. Each channel on a
meter of RGB LED strip may require up to 200mA. It was clear to see that a driving method which will support
this higher current would need to be developed. A likely solution will use MOSFETs, this solution is explored
below in section 2.3.4 Using MOSFETs.
There are some key properties of MOSFETs which must be properly configured to use them efficiently and
ensure they are only handling power they are rated for. A circuit diagram showing how the MOSFETS will be
connected is shown in Figure 2-14. It can be seen in this figure that the TLC5940 is a pull down device which
effectively discharges the gate of the MOSFET turning it off. The resistor R1 then acts to pull up the gate and
recharge it enabling the MOSFET to turn on. The gate can be thought of much like a capacitor. When the gate
is discharged and a positive potential is first applied it will begin to charge, drawing the most current when the
voltage is applied and tailing off as it becomes charged. This is identical to the discharge scenario except now
the gate will source the current. This means that it takes time to charge as well as discharge the gate. The
reason 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 its
absolute maximum ratings, could cause permanent damage to the device. We can deduce from this that the
amount of current allowed to flow into the gate at the time it is charged or discharged will determine how
quickly the MOSFET turns on or off. On the discharging side the TLC5940 has built in current limiting circuitry
which can be set using a resistor from ground to its Iref pin. This built in current limiting also means there is no
resistor required between the TLC5940s output and the gate of the MOSFET. The charging side will have its
current limited by the pull up resistor in place.
+12V
LED Strip
PULL UP RESTISTOR
The TLC5940 is a current sink
device only so this turns the
transistor back on at the end of
blue channels.
a pulse.
TLC5940
OUT X
MOSFET
N-channel
TLC5940 OUTPUT
Any one of 15 driver output pins
from TLC chip
Although initially some MOSFETs (IRF610s) were supplied by the undergraduate labs for prototyping and
testing it quickly became clear they were incorrect for this application. After some research MOSFETs of model
number ZXMN2A01FTA by manufacturer DiodesZetex were decided upon. They offered a specification
exceeding the requirements for the project and were only 10 pence each. They were also surface mount which
meant a considerable space saving when 15 are required per driver. The datasheet explains these MOSFETs
Combine the benefits of low on-resistance with fast switching speed. This makes them ideal for high
efficiency, low voltage, power management applications [11]. To allow the ability to test and prototype they
were mounted to some proto board, this, along with a size comparison is shown in Figure 2-15.
Page | 15
URN: 6025977
Some calculations were performed to establish safe values for gate charge and discharge values. An
experiment was then performed picking components around the calculated values which showed the best
response in the experimentation. A 10K pull up resistor was decided upon as a safe pull up value. The CRO
traces in Figure 2-16 clearly show effects introduced by the gate capacitance of the MOSFET. The complete
charging time can be deduced from Figure 2-16 as 30 micro seconds although the transistor is fully on for the
required current draw of 200mA by the time the gate voltage has exceeded 1.5 Volt. This was determined
from the MOSFET data sheet, the graph used can be seen in APPENDIX FIG 3.
FIGURE 2-16 - CRO TRACES SHOWING OUTPUT OF TLC5940 WITH AND WITHOUT MOSFET LOADING DIFFERENCE SHOWN IS GATE CHARGING
Page | 16
URN: 6025977
running the lower power signal through lengths of wire. Thirdly it could also permit the use of devices other
than LED strips on driver outputs making for interesting future expansion.
The decision was also made during design development to use surface mount technology (SMT) anywhere
possible to reduce both size and cost. This would bring challenges to soldering and PCB design and
manufacture 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 module
and a larger 100uF across the entire rail to absorb slightly larger fluctuations.
PCB D ESIGNS
Once the breadboard prototype was tested with the design developments and deemed to be working
correctly, 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 process
of creating a component was wizard driven and the information required could be found in the devices data
sheet under the package specifications. Figure 2-18 shows, to the left, a screen grab of the wizard used to
create the components. Values are simply entered defining pin pitch, pad width and height among other
defining dimensions. The wizard also requests naming of the pins as well as mapping from the schematic to the
PCB symbol. On the right of Figure 2-18 is a photograph taken whilst checking the newly created component
for size with the actual device. This photo shows perfect alignment of the pins with, what will become the
solder pads on the PCB.
FIGURE 2-18 - LEFT - PARTS WIZARD CREATING TLC5940 COMPONENT RIGHT - TESTING AN SMD PACKAGED TLC5940 ON PRINTOUT OF CREATED PART
Once all the components required were added to the library the final driver schematic design was created, this
is shown in APPENDIX FIG 4 - Driver PCB Schematic. This schematic was then used to create the PCB layout.
The auto-route functionality of the PCB design software was unable to successfully route the design so it was
completed manually. As the designs were to be produced in house by the University of Surrey EE technical
Page | 18
URN: 6025977
services certain limitations were in place. This included the inability to add vias to the PCB. Larger holes and
pads were created for vias which will require manual soldering during the build phase. The final PCB design is
shown 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 as
both the ATMEGA Microcontroller and TLC5940 are in large 28pin P-DIP packages.
FIGURE 2-19 - FINAL LIGHTIVE DRIVER PCB DESIGN - KEY FEATURES AND COMPONENTS ANNOTATED
The design features a front panel header situated at the top of the board which will be compatible with a
Lightive Front Panel. This front panel will contain a 16x2 alphanumeric LCD display as well as 4 control
buttons. For the more advanced unit this front panel will be mounted allowing extra features to be accessed
from the driver unit itself. Also included is an Output Extension Header situated in the bottom right of the
board. The TLC5940 allows itself to be daisy chained whereby the serial out of one device can be connected
through to the serial in of the next. This header includes all the various enable and clock lines which need to be
extended across the chain. This once again allows for simple expansion of the driver unit with only a software
update and small driver board. Furthermore, this opens up possibilities of higher end and more advanced
models.
In order to allow LED strips to be connected and disconnected easily and without tools a second board would
be required which could be mounted on the enclosure providing externally accessible ports. This solution was
also implemented with HARWIN connectors which were offered free under their free connectors for
students promotion. This breakout board simply provides somewhere to mount the female side of the
connectors which have a nonstandard 2mm pitch. The PCB design is shown in Figure 2-20.
Via - A plated through hole (PTH) in a Printed Circuit Board that is used to provide electrical connection
between a trace on one layer of the Printed Circuit Board to a trace on another layer. Since it is not used to
mount component leads, it is generally a small hole and pad diameter. [28]
Page | 19
URN: 6025977
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
custom PCBs which would solder directly to the end of the strips were designed. These included the 3
MOSFETs, pull up resistors and a small capacitor to reduce noise created down the power line. The PCB
schematic is shown in APPENDIX FIG 5. Figure 2-21 below shows the completed PCB design along with an
illustration of how the cable and LED strip will connect. Key design features and components have been
annotated. The PCB is slightly wider than the LED strip but still compact at only 16.5mm wide by 42.2mm long.
FIGURE 2-21 - LIGHTIVE LED BAR DRIVER PCB DESIGN WITH CABLE AND LED STRIP CONNECTION ILLUSTRATIONS
- KEY FEATURES AND COMPONENTS ANNOTATED
The final PCB required for the driver is a step down voltage regulator to take the 12 volt supply for the LED
strips down to the required 5v for the driver PCB. A switching regulator was decided upon over the more
Page | 20
URN: 6025977
standard three pin linear regulators. The LM2575T is such a regulator with an input voltage ranging from 8-40v
and current handling of up to 1A, far beyond the requirement of the Driver PCB. The biggest advantage of such
a regulator is the lack of requirement for a bulky heat sink due to its greater efficiency. Other features offered
are thermal shutdown and current limit protection which are handy safety nets to have included in the event
of a fault condition presenting it self. The regulator requires only 4 external components, an inductor, 2
capacitors and a schottky barrier rectifier [13]. The power supply PCB design is shown in Figure 2-22 and its
schematic can be observed in APPENDIX FIG 6. The schematic is based on the "typical application schematic
in the LM2575Ts datasheet [13].
E NCLOSURE D ESIGNS
After an initial brainstorm of design ideas and sketches on paper, a design for both the advanced countertop
model and more discreet installation model were established.
The discreet model, for more permanent installation, will be designed to fit into a white 2 gang pattress box
with corresponding blanking plate. This is a standard electrical installation box and will unlikely look out of
place on a skirting board or wall.
Page | 21
URN: 6025977
The countertop model design drew inspiration from many of the modern DAB radio designs which incorporate
a mix of modern electronics, brushed aluminium and wood or wood effect. Figure 2-25 below shows a fully
dimensioned orthographic projection of the design.
The front and back will constructed of 3mm ply or MDF with the outward facing side of the wood veneered
with, most likely, a light coloured Birch or Ash veneer depending on availability. The top arc is to be formed of
brushed aluminium with two arcs cut in the flat ends to allow cables in and out when the back is against a flat
surface. All connectors will be presented underneath the unit. To gain better idea of what the finished product
may look like a 3D render has been created. This is shown in Figure 2-26 below.
Page | 22
URN: 6025977
Ambient Light
Sensor
Or
PIR Motion Sensor
Atmel
ATMEGA328
Microprocessor
Or
Sound Level Sensor
Or
Temperature Sensor
Page | 23
URN: 6025977
2.4.2 RESEARCH
Research was required into how each sensor type was to be built and what relevant components were
required.
T EMPERATURE S ENSOR
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 digital
temperature sensing component seemed unnecessary so the analogue path was chosen. A very popular range
seems 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 in
Celsius to a quarter of a degree at room temperature; this is accuracy beyond anything required for this
application [14]. The output voltage, in millivolts, is simply proportional to the current temperature, for
example, at 250mV the temperature is 25C.
Realistically, only temperatures in the range of 0-100C require measurement. This, on the output of the
LM35DT will equate to a range of 0 to 1 volt. The way the ATMEGA328 calculates values on its analogue pins is
by dividing the resolution of its 10-bit ADC between ground and a reference voltage. The reference voltage can
be externally defined via a pin on the microcontroller, or, its own internal reference of 1.1V can be used. This
internal range works out almost perfectly for the predefined range of 0-100C as 91% of the ADCs (Analogueto-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.
FIGURE 2-29 - ONLY A SINGLE DIRECT CONNECTION REQUIRED FOR CONNECTION OF LM35DT TO MICROCONTROLLER
Every time a reading is required the sensor will be polled around 20 times and an average taken. This will
drastically reduce the chance of any anomalies from noise or other interference affecting the output of the
system.
Page | 24
URN: 6025977
PIR sensor modules are available with all of the control electronics already built in. These detect movement
and nearly all activate an output for a set time period. Due to this set time period the final PIR sensor unit will
need to take an average over a fairly large timespan, most probably in the range of around 20 seconds before
an initial value is produced.
Page | 25
URN: 6025977
Start
Initialization
Routine
Update Attached
Sensor Values
Nothing
Finished
Enter Registration
Mode
Yes
Register
Request ?
Yes
Value
Request ?
CRC Fail
Pass (CRC = 0)
Return Ack to
master
The sensor will continually keep its sensor data up to date and will provide the last read and calculated sensor
values 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 or
other devices which present only an on and off
state the easiest way to average activity over a
timeframe is by switching single bits in a variable
then take an average of on bits to off. This is better
explained in Figure 2-34 which shows how the
process would work with a 2 Byte or 16 bit variable.
Once the 16th bit of the variable is reached
sampling goes to the beginning and continues. This
is a first in first out system meaning the result is
always based on the last 16 readings in time. The
1s are then counted and mapped to a 12 bit
lighting value from 0-4095.
CurrentBit = 0
(Set CurrentBit counter equal to 0)
Set CurrentBit
to 1
Yes
Is PIR
Triggered ?
Set CurrentBit
to 0
No
no
CurrentBit == 16 ?
Yes
CurrentBit + 1
(Go to next bit)
Page | 26
URN: 6025977
FIGURE 2-35 LIGHTIVE SENSOR PCB DESIGN KEY DESIGN FEATURES AND COMPOENENTS ANNOTATED
2.5.4 SOFTWARE
This section describes the software after the design developments mentioned previously. The masters units
ultimate aim is to route the required data from sensor to driver. Under the new design the first task is polling
registered and connected sensors and storing their values. The master will then sequentially update the
drivers by sending them the data of the sensor which is mapped to their bars. This is better explained by the
flowchart in Figure 2-37.
The new design requires communication via an SD card. Using the SD card as a raw data store is fairly straight
forward and only requires sending a few commands down the SPI line. The problem is that the SD card then
cannot be easily read by a computer as it has no file system. Ideally the system should be able to read a file
system on an SD card and open or write files to it. Writing code for this from scratch would be extensive as the
file system which requires interfacing with would have to be heavily studied for an in depth understanding.
Whilst looking for others wanting the same a library was discovered for SD card communications and the
Page | 28
URN: 6025977
Arduino. It turns out this library already used the widely supported FAT file system and was written by William
Greiman [17] and is available under the GNU General Public Licence.
Start
Initialization
Routine
Update Connected
Drivers
Button Pressed ?
Menu
Item Selected ?
Poll Connected
Sensors
Triggered
Poll Timer ?
No
Page | 29
URN: 6025977
User Interface
Buttons
SD Card
Atmel
ATMEGA328
Microprocessor
Alpha-TRX433S
433 Mhz Wireless
FM Transceiver
3v
3V3 Voltage
Regulator
SPI
Line Level
Translator
3v
The above design along with help from the breadboard prototype was used to create the master schematic
which is shown in APPENDIX FIG 7. Much like in the previous PCB designs the components and their solder
footprints 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 of
the front panel board was established. This board must also be compatible with the front panel header on the
Lightive Driver PCB described in section 2.3.7 (page 18). The buttons and LCD display to be used were
modelled in Autodesk Inventor accurate to within one half of a millimetre. These were then laid out onto a
PCB within the application and measurements taken to help establish size and positioning. The results of the
modelling are shown below. Figure 2-40 shows an orthographic projection of the proposed layout to clearly
establish its size. Figure 2-41 is an isometric view which helps establish an idea as to what the interface will
look like.
Page | 30
URN: 6025977
Once a physical layout was confirmed the PCB design work for the front panel was completed. The schematic
for 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 to
complete the Masters PCB layout. Figure 2-43 below shows the final PCB design. The footprint of the board
exceeds that of the actual circuitry because it must mount to the front panel board. The four holes which will
mount the master PCB are the same four which also go through the display. Once put together these holes
going straight though should provide plenty of support for the 3 PCBs.
FIGURE 2-43 - FINAL LIGHTIVE MASTER PCB DESIGN - KEY FEATURES AND COMPONENTS ANNOTATED
Page | 31
URN: 6025977
3.1 SOFTWARE
The coding and developing of the Lightive software for each unit was running continually throughout the
entire project. As this report is written the current total line count stands at more than 1500. This does not
include any content from third party libraries. The code written to date forms a usable foundation to which
functionality can easily be added. This section aims to summarise the functionality of this code above and
beyond what was explained in the design section to allow an insight into how the system is processing data.
This is how the settings for drivers and sensors are stored to files on the SD card. As the bytes of data are not
necessarily visible characters in the ASCII standard a normal text editor cannot be used to read or write the
files. Instead a raw editor which shows the
actual contents of each byte is used. Figure 3-2
shows the driver settings file currently used by
the master unit. If the first three settings are
taken, these are DRVR_REG, DRVR_ADD,
DRVR_BARS we can see the corresponding FIGURE 3-2 - THIS IS THE DRIVER SETTINGS FILE CURRENTLY BEING USED BY
THE SYSTEM THERE IS A SINGLE DRIVER REGISTERED, DRIVER 0
Page | 32
URN: 6025977
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 system
setup 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 code
behind the entire library in this report. The code has instead been appropriately commented. One function
was chosen for explanation as it has many elements which others share. This was the readline() function and
its while loop, which gives it most of its functionality, is shown in Figure 3-3.
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 a
character 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
string array is passed in as a pointer its size must not be exceeded so the count variable is also checked against
size in every loop iteration.
maximum of 5 bits (0-31) to the 5 Least Significant Bits (LSB) of the header byte, sets the dest flag to 1 and
then 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 transmission
can 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 not
become ready within a time window. This is simply done here by creating a retry counter. Every time the radio
is 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 finished
and returns a success. If an ack was requested the function the calls another Lightive radio library function
called 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 the
transmit() function. Should an ack fail to be received the packet will be re-transmitted and the checks
performed 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 of
the transmit() function.
The original aim of the project specified the system must have an ability to allow 3 party, computer based
software to be written which can interface with the system. An example given was the ability to use the
system as an Ambilight ( section 2.3.2, page 13 ) where low latency was essential. This is where the Direct
output functionality comes into play. It reads data, in a defined protocol via the serial line on the master then
transmits this, with minimal delay to a driver unit where the output change is instantaneously effected.
The serial line is read in on the master once it has been put into the direct output mode. Upon placing the
master in direct output mode the drivers are also wirelessly placed into this mode. This then simply waits for a
preamble of 0xAA which was chosen because of its uncommon binary sequence. After this preamble it will
read a specified number of bytes and load these into a payload. These bytes correspond to each output
channel on the other end. Figure 3-5 shows this functionality. This payload is then transmitted to the specified
driver which instantly works to effect the changes required.
Wireless Link
Page | 34
URN: 6025977
3.2 HARDWARE
3.2.1 MANUFACTURING THE PCBS
As the PCBs were being made in house the process was followed for a better understanding. The process used
here at the University of Surrey Electronic Engineering department is a Photo etching method onto photo PCB
which has a photo-resist layer on one side. To speed up the completion of the PCBs hole drilling and trimming
were completed whilst the technical staff were extremely busy. This section aims to briefly show and describe
the process used as is not intended as a guide.
S TEP 2 E XPOSURE
This step involves exposing the photo sensitive PCB layers to strong UV light. The
transparency will mask the areas of copper to be kept. The areas exposed to UV
will react with the PCB developer in the next stage and be removed. Figure 3-7
shows the UV exposure box, the yellow tinge on all the photos is the safelight.
FIGURE 3-7 - BOARD BEING EXPOSED
TO UV THROUGH TRASPARENCIES
S TEP 3 D EVELOP
This stage will remove the photoresist that has been exposed to
the UV light. The PCB is simply soaked in the developer for a few
minutes then brushed to help remove the remaining photo resist.
This is shown in Figure 3-8.
FIGURE 3-8 - BRUSHING OFF REMAINING
PHOTORESIST
S TEP 5 - E TCHING
The board is placed into a machine which sprays an etchant, in our case ferric
chloride at it continually. This etchant attacks the areas of copper which are
not protected by the photoresist and eats away at the copper. The etchant is
also warmed up which makes it more effective and shortens the time required.
Once all the exposed copper has been removed the board is once again rinsed.
Figure 3-10 shows the tank etching the PCB in action.
FIGURE 3-10 - ETCHING THE
PCB
Page | 35
URN: 6025977
V IAS
Although not unique to surface
mount boards vias were found to
be one of the most time
consuming and fiddly tasks when
soldering. One technique developped was to coil a strip of wire as to
make a kind of torsion spring then
use the tension between the ends
to hold it in place whilst it is
soldered. This technique is
pictured in Figure 3-14. The tricky
part was stopping the wire falling
through whilst soldering the
opposing side.
FIGURE 3-14 - TECHNIQUE DEVELOPED FOR KEEPING WIRE IN PLACE WHILST SOLDERING VIAS
Page | 36
URN: 6025977
S URFACE M OUNT IC S
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 was
aligned then pushed down where the tackiness of the flux would help to hold it in place. Two opposing pins
were then tack soldered to hold the IC in place. Please observe Figure 3-15 which shows an ATMEL
microcontroller tagged to a driver board using this method. Now each side of the IC remaining were heated
and solder was applied across the whole side. By pulling the soldering iron away from the IC down the tracks
most solder bridges could be avoided. Any bridges which do occur had excess solder soaked up with some
solder wick which was heated over the bride and also dragged away from the IC down the tracks before lifting.
FIGURE 3-15 - ATMEL ATMEGA328P WITH OPPOSING PINS TAGGED TO DRIVER BOARD - SURFACE MOUNT IC SOLDERING TECHNIQUE
FIGURE 3-16 - FEMALE SIL HEADER WITH PLASTIC CASING REMOVED TO EXPOSE PINS
Page | 37
URN: 6025977
FIGURE 3-18 - ASSEMBLED LIGHTIVE DRIVER PROTOTYPE INSTALLATION MODEL TOP RIGHT SHOWS VIEW WITH LID ON
FIGURE 3-19 - LED BAR DRIVER PCB SOLDERED AND READY TO BE ATTACHED TO STRIP. VISABLE ARE 3 MOSFETS AND THEIR PULL UP
RESISTORS
Figure 3-22 shows the 10 driver PCBs which have been completed and had 1 meter of LED strip attached. The
next task was to mount the strips into trunking, solder on the wires and their connectors. The connectors used
to connect the bars to the driver were Harwins L-Tek range and are friction latched to avoid them just falling
out. The cables were soldered to the connector and then heat shrink wrapped for protection. How the
connectors look before and after the heat shrink is applied can be seen in Figure 3-21.
The mini trunking used was purchased from Rapid electronics and is manufactured in the
UK by MITA [19]. The size chosen had a channel width of 25MM and height of 16MM. It
was only available in 3 meter lengths which unfortunately meant, since each bar would be
just over a meter with the driver, there would be some waste with only 2 bars being
produced per strip. After pieces of trunking were cut to length the RGB LED strip was stuck
directly down the middle of the trunking using the 3M adhesive tape the strips were
supplied with. The driver board was secured using a tie-wrap (Figure 3-20) then some hot
glue in each corner to stop any movements or impacts fracturing its connection with the
FIGURE 3-20 - LED
DRIVER ABOUT TO BE
TIE-WRAPPED
Page | 39
URN: 6025977
LED strip. Finally the wire was also tie wrapped down for security and the end of the trunking was capped with
some hot glue. The finished assembly, shown in Figure 3-23 formed a solid and durable feeling LED light bar.
The amount of wastage left over for each 3 meter strip prompted an idea to use of the remaining trunking as a
stand for the bars as shown in Figure 3-24. These stands tilt the bars which allow them to be placed facing flat
surfaces such as walls to create a wash of light.
The final part of the driver is the PCB which translates the 12V required for the LED bars to the 5V required by
the control circuitry. This is a high efficiency switching regulator so requires some external components. There
was a small issue with this board where the gaps between the pads for the regulator legs were too tight to
have been reproduced correctly on the PCB. This was solved by running a craft knife between the edges of the
pads. This seemed to work flawlessly. The completed driver board is shown in Figure 3-25.
Page | 40
URN: 6025977
FIGURE 3-26 TWO COMPLETE LIGHTIVE SENSORS. THE BOARD ON THE RIGHT IS SHOWN CONNECTED TO A
BATTERY PACK FOR POWER AND WITH A PIR, TEMPERATURE AND LIGHT SENSOR ATTACHED
As the PIR is an aftermarket standalone unit it is connected separately. It requires a 5V, ground and signal line.
The heat sensor and light dependant resistor have been soldered to a piece of proto board which has power
and a signal line for each sensor. The sensors are shown in Figure 3-27.
FIGURE 3-27 - PIR, TEMPERATURE AND LIGHT SENSORS WITH CABLE HARNESSES FRONT, TOP AND RIGHT VIEW
Although there has not been enough time to complete the last two sensor boards before the writing of this
report the sensors have not suffered from any issues.
Page | 41
URN: 6025977
The next PCB to be built was the SD card board. This simply allowed the SD card holder to be mounted on a
corner of the master unit enclosure for access externally. The capacitor seen attached across the back of the
board allows it to be mounted either way around.
The second from last PCB required was the front panel board. This mounts the front panel LCD display and
interface buttons as well as containing all of the components for them. There is a small resistive pot on the
board which controls the contrast on the LCD display. This is set prior to board installation as it becomes
inaccessible once the board is mounted to the enclosure. Spacers cut to length are compressed between the
LCD and front panel board by nylon screws and nuts keeping it at the correct height. PCB pillars are then
attached to the bottom of these nylon screws and the Master PCB is mounted through them. A complete front
panel board is shown in Figure 3-30.
Page | 42
URN: 6025977
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 square
hole 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 is
shown in Figure 3-33. For standard system operation this driver unit will only require power so has minimal
cables. Due to late delivery the FTDI USB to serial converter for this unit has yet to be fitted.
Page | 43
URN: 6025977
lightive
"com1"
9
momo
20000
AA
57600
The Device is what the system is outputting to and so contains the connection
information required. Figure 4-1 shows the device section in the configuration file.
The type field has been set to momo. Although there is limited information
available on this it seems to be very similar to the proposed protocol in that it
sends a prefix followed by lighting values. This was discovered by using a device
called a bus pirate which can sniff data down a serial line. Both the prefix and the
order of values can be customized and were changed to suite the Lightive system.
The colour section allows the user to specify colours the system would require. The
colour section from the Lightive configuration can be seen in Figure 4-3. The
minimum required information is a name and RGB value. The RGB value was formatted as RRGGBB and
required values presented in HEX. When boblight scans the screen it is these colours it then makes a
comparison with. If it scans a section of the screen and sees red, it will add value to the red colour. The
Page | 44
URN: 6025977
[color]
name red
rgb
FF0000
[color]
name green
rgb
00FF00
adjust 0.8
adjust values seen in the configuration were added to calibrate the system and
produce 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 LEDs
are also perceivably weaker than the blue. These values were obtained through a
progression of logical trial and error.
[light]
The light section brings the other two sections
name left
together. This is where the actual physical bars are
color
red
lightive 1
defined. The configuration for one of the three
[color]
color
green lightive 2
lights is shown in Figure 4-2. After the name, in the
name blue
color
blue lightive 3
case of Figure 4-2 this is the left bar, there is three
rgb
0000FF
hscan 0 33
lines which begin with colour. These lines map a
adjust 0.5
vscan 0 100
colour to a devices output. If we take the red
colour in Figure 4-2 we are mapping any red
FIGURE 4-2 - ONE OF THREE LIGHT
FIGURE 4-3 - COLOUR
SECTIONS IN CONFIG FILE
colours,
as
define
in
the
colour
section,
to
the
SECTION IN CONFIG FILE
Lightive 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.
Computer
screen
(With Boblight Software running)
33
100
66
Right
Left
100
[Lights]
Left
Top
33
[Device]
Serial
Lightive
System
Top
Right
FIGURE 4-4 - DIAGRAM RELATING DIFFERENT SECTIONS AND FIELDS IN THE BOBLIGHT CONFIG (PLEASE VIEW IN COLOUR SUPPLEMENT)
To help bringing these fields together we can take an extreme example to demonstrate how they would work.
Looking at Figure 4-4 we can see that the complete right hand side of the screen is red. Boblight will scan the
area inside what is defined as the right light which, as the diagram shows is anything from 66-100% in the
horizontal axis and 0-100% in the vertical. As it scans the area it will compare it to the colours which have been
defined and create an average for each. In the case of the example it will see that, as the field is pure red the
averages for green and blue will be 0 and red will have a value of 255. As the red colour, within the right bar is
th
assigned to the lightive device as value 7, it will be the 7 value down the serial line.
Although no official survey was performed, individuals who had a chance to experience the system in action,
within a few minutes agreed it faded into the background creating the illusion of watching a far larger display.
They did not find it a distraction which implies data is travelling smoothly through the system at a fast enough
pace. A video of the system in action can be found on YouTube at http://www.youtube.com/user/louisc123.
Page | 45
URN: 6025977
time period. Whilst on the sensor unit was moved to other areas of the house and the lighting system was
observed 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 heat
conductance from the LED strips themselves as they felt warm to the tip of the meter length. The only reason
the system was turned off at 32hours was because it has to be moved to the undergraduate laboratories. Here
the system had been plugged in and ran for the rest of the day. It has, on several occasions, run for times
exceeding 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 system
coped 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 COSTS
This section summarises the average actual cost per prototype unit. These are the prices that items were
purchased 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 built
in manufacture.
Items with no price were acquired as samples. Components such as resistors and capacitors have not been
included and are available from the undergraduate labs and are of very low value.
Driver Unit
Part Number
Item Description
Supplier
ZXMN2A01FTA
MOSFET N-CH
RS
N/A
M30-4010346
Quantity
Unit Cost
Line Cost
16
0.10
1.60
Rapid
0.29
0.29
Harwin Connectors
Harwin
0.00
0.00
TLC5940
Texas Instruments
0.00
0.00
TRX433S
Alpha RF Transceiver
RS
3.51
3.51
ATMEGA328P-AU
Atmel Microprocessor
Farnell
2.22
2.22
N/A
Univ of Surrey
1.16
1.16
N/A
Univ of Surrey
0.21
1.05
T4483ST
Rapid
13.09
13.09
N/A
eBay
19.00
19.00
Total:
41.92
Sensor Unit
Part Number
Item Description
Supplier
N/A
Rapid
TRX433S
Alpha RF Transceiver
RS
ATMEGA328P-AU
Atmel Microprocessor
N/A
Quantity
Unit Cost
Line Cost
0.29
0.29
3.51
3.51
Farnell
2.22
2.22
Univ of Surrey
0.81
0.81
N/A
PIR Sensor
eBay
2.93
2.93
LM35DT
Temperature Sensor
Rapid
0.93
0.93
N/A
LDR - Photoresistor
Rapid
0.18
0.18
Total:
10.86
Page | 46
URN: 6025977
Master Unit
Part Number
Item Description
Supplier
N/A
Rapid
TRX433S
Alpha RF Transceiver
ATMEGA328P-AU
Atmel Microprocessor
N/A
Quantity
Unit Cost
Line Cost
0.29
0.29
RS
3.51
3.51
Farnell
2.22
2.22
Univ of Surrey
1.99
1.99
N/A
Univ of Surrey
1.24
1.24
PB61302BL
RJS Electronics
1.58
6.32
85-3736
Rapid
5.04
5.04
DM1AA-SF-PEJ(72)
SD card holder
RS
1.64
1.64
UA78M33CDCY
RS
0.24
0.24
TXB0104DG4
RS
1.16
1.16
PC1602ARS
Rapid
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 actually
because the prediction did not include the cost of the power supply which was 13. In theory the unit itself has
actually come in under the predicted cost. The sensor unit was estimated to cost 8.81 but this was with no
sensors. The total cost with sensors was a reasonable 10.86. The master unit sees the biggest cost difference
with predicted costs being at 13.07 and actual costs coming in at 29.81. This was down to the purchase of
some Laser Etched Buttons at sample prices which added 6.32 and the inclusion of a power supply adding
5.04.
For a system with a two sensors, a master and a driver with 5M of LED strip the total price is 93.45.
Considering a single Phillips mood lamp costs 92.99 online and offers nowhere near the functionality and light
output of the proposed Lightive setup above, its fantastic value for money. If these could be produced to even
a small scale the cost saving benefits would fall meaning they could probably retail at around that price range
and hypothetically return a profit.
6 CONCLUSIONS
The primary aim for this project has been achieved. Even in its unfinished state the system is reacting to
environmental changes from wirelessly connected sensors. With the system just sitting on a bench in a fully lit
lab it was wonderful to see people gravitate towards it and watch it change colour. Several students and
academics were seen trying to work out what was invoking the colour changes. Once they had discovered it
was based on movement they were observed standing still then exaggeratedly moving to prompt colour shifts.
The ideas of subtle interactivity laid out in the aim feel to have been fulfilled although no structured user
questionnaire was carried out due to a shortage of time.
The specification laid out in the aim also stated the desire for the ability to use the system with applications
developed on a computer. The Ambilight software test was a perfect demonstration of this concept and why it
was an important addition. As far as research suggests this is the first wireless Ambilight capable system to
date. It can easily be adapted to run with visualization software as well as have plugins developed for popular
music players such as iTunes. An example of where this flexibility could be invaluable is in a hotel venue where
perhaps some of the dining suites or halls serve multiple functions. Whilst gusts are dining the lighting system
can provide ambiance, perhaps even reacting with customized colours to fit with a weddings colour scheme.
Page | 47
URN: 6025977
Then when the disco rig kicks in the system can become part of the disco rig controlled by software. The
possibilities with this level of flexibility are unparalleled for a system at this price point.
The problems experienced were few but they were crippling with regards to time. Ultimately due to delays in
designing the PCBs there was a shortage of equipment to prototype on. No prior experience in many of the
fields, namely PCB design and Microcontroller development mean any real estimation of time was always
going to be limited in accuracy. It is now evident the project was extremely ambitious from the start with such
a limited time frame.
There are several improvements that could be made to Lightive v2.0. The first is a rethink of the driver design.
The idea of having one driver running multiple bars remains valid with regards to cost reduction. Expensive
items such as wireless modules and capable microprocessors cannot be justified on single bars. Instead it
would be great to have a single receiving unit which could process the data and present a serial or two-wire
bus onto which the LED bars could sit. Each bar in turn would have a much cheaper low power microcontroller
capable of PWM to read this bus and create the desired output. This would mean bars could be daisy chained
along with small, 4 core cable. This would reduce the need to run individual cables back through to a single
point. Another smaller improvement would be the addition of bar detection. This would essentially allow the
driver to know if a bar is connected. This way only the bars which are connected to a driver will be presented
as available at the master.
A personal note; when I embarked on this project I began with a small interest in lighting systems and a desire
to step into the ever more powerful world of microcontroller electronics. I feel I have ended up with so much
more. From technical skills such as PCB design and manufacture, surface mount soldering, object oriented
programming, microcontroller development, system design and wireless communications through to soft skills
such as time management and dealing with suppliers, this project has equipped me with an array of priceless
real world skills. To see the Lightive system go from its inception, as a series of sketches on paper, to a working
almost breathing system reminds me why I decided on the engineering pathway. This project, although
stressful and frustrating at times has been a joy to complete.
Page | 48
URN: 6025977
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://docseurope.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://students.washington.edu/acleone/codes/tlc5940arduino/html_r012/group__CoreFunctions.html.
10 GNU.org. Licenses - GNU Project. [Internet]. [cited 2010 Dec]. Available from:
http://www.gnu.org/licenses/.
11 ZETEX Semiconductors. N-CHANNEL ENHANCEMENT MODE MOSFET Datasheet [Internet].
12 RS. DesignSpark PCB. [Internet]. [cited 2011 Apr]. Available from: http://www.designspark.com/pcb.
13 National Semiconductor. LM1575/LM2575/LM2575HV SIMPLE SWITCHER 1A Step-Down Voltage
Regulator Datasheet [Internet]. 2011 Mar.
14 National Semiconductor. LM35 Precision Centigrade Termperature Sensor Datasheet [Internet].
15 Glolab Corporation. How Infrared motion detector components work. [Internet]. [cited 2011 Apr]. Available
from: http://www.glolab.com/pirparts/infrared.html.
16 e-qstore. eBay My World: e-qstore. [Internet]. [cited 2011 Mar]. Available from:
http://myworld.ebay.co.uk/e-qstore/.
17 Greiman W. sdfatlib - A FAT16/FAT32 Arduino Library for SD/SDHC cards. [Internet]. [cited 2011 Feb].
Available from: http://code.google.com/p/sdfatlib/.
18 Arduino. References - SD. [Internet]. [cited 2011 Apr]. Available from: http://arduino.cc/en/Reference/SD.
Page | 49
URN: 6025977
19 Rapid Electronics. Cables & Connectors. [Internet]. [cited 2011 Apr]. Available from:
http://www.rapidonline.com/Cables-Connectors/Cables/Conduit-And-Trunking/Miniaturetrunking/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.rsonline.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.rsonline.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.
27 Wippler JC. About - The JeeLabs Shop. [Internet]. [cited 2010 Dec]. Available from:
http://jeelabs.com/pages/about.
28 speedyPCB.com. PCB Terminology. [Internet]. [cited 2011 Apr]. Available from:
http://www.speedypcb.com/pcb-knowledgeBase/pcb-terminology.htm.
Page | 50
URN: 6025977
APPENDIX
// 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
APPENDIX FIG 1 - DEFAULT PINOUTS - EXTRACT FROM JEELABS RFM12 LIBRARY
0
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
8
10
10
10
10
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
no
no
no
no
no
no
no
no
0
0
0
0
0
0
0
0
0
0
0
0
0
6
5
10
8
10
10
10
10
Line of Sight
Direction 2
Packets Lost / 10
Line of Sight
Packets Lost / 10
Distance (m)
Direction 1
yes
yes
yes
yes
yes
yes
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
Page | 51
URN: 6025977
Page | 52
URN: 6025977
Page | 53
URN: 6025977
Page | 54
URN: 6025977
URN: 6025977