Sunteți pe pagina 1din 17

Supporting Information

Solar Glasses: A Case Study on Semitransparent Organic


Solar Cells for Self-Powered, Smart, Wearable Devices
Dominik Landerer,[a, b] Daniel Bahro,[a, b] Holger Rçhm,[a, b] Manuel Koppitz,[a, b]
Adrian Mertens,[a] Felix Manger,[a, b] Fabian Denk,[a] Michael Heidinger,[a]
Thomas Windmann,[c] and Alexander Colsmann*[a, b]

ente_201700226_sm_miscellaneous_information.pdf
1. Optoelectronic properties of the PEDOT:PSS top electrode

Figure S1. Sheet resistance and average visible transmission (400-700 nm) of PEDOT:PSS layers versus layer thickness.

2. Semi-transparent solar cells under different illumination intensities

Figure S2. (a) J-V curves and (b) electrical power of the semitransparent organic solar cells under different illumination
intensities (photoactive area: 0.24 cm2, illumination through the ITO electrode, 0.0003 – 1.0 suns).

2
Table S1. Key performance parameters of the semitransparent solar cells under different illumination intensities
(photoactive area: 0.24 cm2, illumination through the ITO electrode). Data collected under a solar simulator (ASTM AM
1.5G, Xenon lamp) using neutral density filters to adjust the illumination intensity.

Neutral Illumination JSC VOC FF PCE PMPP PMPP


density (W/m2) (mA/cm²) (mV) (%) (%) (µW) (µW/cm2)
0 1000 11.9 760 53 4.8 1000 4166.7
0.1 794.33 9.6 757 55 5.0 845 3520.8
0.2 630.96 7.7 750 58 5.3 709 2954.2
0.3 501.19 6.3 746 59 5.5 588 2450.0
0.4 398.11 5.1 739 61 5.8 479 1995.8
0.5 316.23 4.1 731 62 5.9 365 1520.8
0.6 251.18 3.3 723 62 5.9 297 1237.5
0.7 199.52 2.7 715 63 6.1 237 987.5
0.8 158.48 2.2 706 63 6.2 186 775.0
0.9 125.89 1.8 698 64 6.4 149 620.8
1.0 100 1.4 689 64 6.4 112 466.7
1.1 79.43 1.1 681 65 6.3 92.9 387.0
1.2 63.09 0.90 672 65 6.2 73.1 304.6
1.3 50.12 0.73 664 64 6.2 56.7 236.3
1.4 39.81 0.59 658 63 6.2 44.4 185.0
1.5 31.62 0.48 643 62 6.1 34.4 143.3
1.6 25.11 0.39 636 62 6.1 28.2 117.5
1.7 19.95 0.31 627 61 5.9 21.4 89.2
1.8 15.85 0.26 615 60 6.0 16.1 67.1
1.9 12.59 0.21 605 58 5.9 13.0 54.2
2.0 10 0.19 575 54 5.9 5.8 24.2
2.1 7.943 0.155 566 52 5.7 4.6 19.2
2.2 6.301 0.126 553 50 5.5 3.8 15.8
2.3 5.012 0.105 534 45 5.0 2.4 10.0
2.4 3.981 0.084 520 41 4.5 1.8 7.5
2.5 3.162 0.067 504 40 4.3 1.4 5.8
2.6 2.512 0.057 487 36 4.0 1.0 4.2
2.7 1.995 0.046 461 33 3.5 0.7 2.9
2.8 1.584 0.039 422 30 3.1 0.5 2.1
2.9 1.259 0.034 365 28 2.7 0.3 1.6
3.0 1 0.026 346 28 2.5 0.25 1.0
3.1 0.7943 0.022 305 27 2.3 0.19 0.8
3.2 0.6301 0.018 262 27 2.0 0.13 0.5
3.3 0.5012 0.014 208 26 1.5 0.07 0.3
3.4 0.3981 0.0114 175 25 1.2 0.05 0.2
3.5 0.3162 0.0085 140 25 0.9 0.03 0.1

3
3. Optoelectronic properties of the lens-fitted solar cells in different lighting scenarios

Figure S3. Light harvesting properties of the lens-fitted solar cells: (a) Spectral irradiance from the 26-channel LED solar
simulator at 1, 0.1 and 0.01 suns. The LEDs were adjusted to resemble the ASTM AM 1.5G spectral distribution. (b) The
corresponding J-V curves measured under the solar simulator demonstrate the lesser influence of series resistance of the
electrodes at lower illumination intensities. Dark curves are represented by dashed lines. (c) Power of the solar cells versus
voltage. (d) Towards lower illumination intensities, the PCE of the solar cells increases. (e) – (h) The same data set for a
lens-fitted solar cell illuminated by an artificial light source at 2000, 1000, 500, 200 and 100 lux. Therefore, a white-light LED
spectrum was loaded into the solar simulator.
4
Table S2. Key performance parameters of lens-fitted solar cells (photoactive area: 15.5 cm2, illumination through the ITO
electrode) under different illumination intensities using an ASTM AM 1.5G spectral light distribution.

Illumination JSC VOC FF PCE PMPP PMPP


(W/m2) (mA/cm²) (mV) (%) (%) (µW) (µW/cm2)
1000 0.40 630 24 0.06 939 60.6
100 0.35 605 25 0.5 790 51.0
10 0.11 555 39 2.4 377 21.7

Table S3 Key performance parameters of lens-fitted solar cells (photoactive area: 15.5 cm 2, illumination through the ITO
electrode) under different illumination intensities using a spectral distribution that matches the emission of a white-light
LED.

Illumination Illumination JSC VOC FF PCE PMPP PMPP


(Lux) (W/m2) (mA/cm²) (mV) (%) (%) (µW) (µW/cm2)
2000 7.187 0.174 571 31 4.3 479 30.9
1000 3.955 0.105 553 39 5.7 353 22.8
500 1.85 0.05 527 47 6.7 193 12.5
200 0.881 0.024 493 48 6.4 88 5.7
100 0.368 0.01 439 41 4.9 27 1.7

4. Methods: Color perception, CCT and CRI

To analyze the color perception of the lens-fitted semitransparent solar cells, we recorded their transmission spectra
(including glue and encapsulation) on a UV-Vis-NIR spectrophotometer (Cary 5000, Agilent Technologies) equipped with an
integrating sphere (ø = 150 mm). From the measured transmission spectra we calculated the chromaticity within the CIE
1931 and CIE 1960 UCS color space.
Following the CIE 13.3 standard, we determined the color rendering index (CRI) from the transmission spectrum.[S1] The CRI
describes the quality of color rendering for eight test color samples along the hue circle. Perfect color rendering is
represented by a CRI of 100. The human eye can distinguish CRI differences of more than 5. The correlated color
temperature (CCT) is defined as the temperature of the black body radiator with its chromaticity closest to the chromaticity
of the transmission spectrum.[S2]
Commonly, light sources with a CCT between 3300 K and 5000 K are considered pleasant.[S3] We note that this CIE standard
procedure is only valid if the displacement of the chromaticity of the investigated light source to the Planckian locus in the
CIE 1960 UCS color space does not exceed Δ = 5.4 · 10−3. In lack of better standards, we determined the CRI also for
chromaticities with larger Δ.

5
5. Full electrical circuit documentation

Core of the circuit (Figure S4) are two integrated circuits (ICs). BQ25504 from Texas Instruments Incorporation is a low-
power boost converter with energy storage management. MSP430F2013 is a 16-bit RISC mixed signal microcontroller. It
samples the current delivered by the solar cell using Rmeas as a shunt resistance and the voltage of an internal temperature
sensor. The gathered data is written to a SPI serial bus and read by the two displays. All other components are applied as
recommended by the datasheets of BQ25504 and MSP430F2013.[S4,S5]
The inductor L1 and the capacitor C1 are parts of the boost converter controlled by BQ25504 which provides a voltage VMPP
to operate the solar cell close to its maximum power point (MPP). For determining the MPP, the Voc of the solar cells is
measured every 16 s and stored on the capacitor C5. VMPP = 0.7·Voc is determined by the resistors R1, R2 and R10. The
current delivered by the solar cell is used to charge the large storage capacitor C3. When a level of 2.7 V (defined by the
resistors R7, R8 and R9) is reached, the transistor Q1 is switched to provide a current to the microcontroller and the
displays. To prevent damage to these components, an overvoltage level of 3.5 V is defined by the resistors R3 and R4, at
which the solar cells are driven to their Voc to stop charging of C3. Two analog ports of the microcontroller are connected
via low-pass filters (Rx1, Cx1, Rx2 and Cx2) to the shunt resistor R meas to record the current of the solar cells. The voltages at
Rmeas and at the voltage output of the internal temperature sensor are measured against a reference voltage stored on C52.
All components are mounted on a printed circuit board (PCB) that is incorporated into the right temple of the glasses. The
PCB that carries the electronic circuit has a display is attached to its bottom side, whereas the other display is attached to a
separate PCB in the left temple. The PCB layout and assembly is depicted in Figure S5. The wiring between the PCBs and the
connection to the display with a flexible printed circuit is shown in Figure S6. A full list of all employed components is
compiled in the bill of materials in Table S4.

Figure S4. Schematic of the entire electrical circuit including all components other than the displays. In addition to names
and values of the components, the digital signals at the display connector and the PC connector are given.

6
Figure S5. Schematic layout and assembly of the printed circuit boards (PCBs). The PCB in the right temple carries all
electronic components including the boost converter, the power management IC and the microcontroller. The left PCB
carries only the second display.

7
Figure S6. (a) Wiring diagram of the assembly. A cable connects the PCBs attached to the left and right temple of the Solar Glasses. A single
8-core cable for all digital signals of the second display (SCLK, SI, SCS, VCOM, DISP) the power supply (VCC, GND) and the anode terminal of
one solar cells is mounted onto the frame. (b) The displays are connected using a flexible printed circuit (FPC) connector.

Table S4. Bill of Materials used on the printed circuit board depicted in Figures S5 and S6, including names and values of all
components. For some special components, additionally, the manufacturers and part numbers are listed.

Left PCB

Cnt Name Value Description Size Part Number Manufactur.


Capacitor, Ceramic, SMD, 50 V, ± GRM188R71H104
1 C1 100 nF 10%, X7R 0603 KA93D Murata
FPC connector, 0.5mm pitch, 59453- FCI /
1 CON_DISP2 - Bottom contact, 8 positions 5.5 x 3.2 mm 081110EDHLF Amphenol
1.2mm pitch crimp style
connector, shrouded header, 3 BM03B-ACHKS- ACH
1 CON_DISP2_A - circuits, black 5.4 x 4.3 mm GAN-ETF Connector
1.2mm pitch crimp style
connector, shrouded header, 4 BM04B-ACHKS-A- ACH
1 CON_DISP2_B - circuits, black 6.6 x 4.3 mm GAN-ETF Connector

8
Right PCB

Cnt Name Value Description Size Part Number Manufacturer


1 RMEAS 10 Ω Resistor, Chip, 1/5W, 1% 0402
Capacitor, Ceramic, SMD, 10V, ± GRM219R61A475
2 C1, C4 4.7 µF 10%, X5R 0805 ME19D Murata
1 R1 6.2 MΩ Resistor, Chip, 1/16W, 1% 0402
1 R2 3.9 MΩ Resistor, Chip, 1/16W, 1% 0402
1 R3 10 MΩ Resistor, Chip, 1/16W, 1% 0402
1 L1 22µH Inductor, SMT, 830mA, 360mΩ 4 x 4 mm LPS4018-223MRB Coilcraft

Capacitor, Ceramic, SMD, 50 V, ± GRM188R71H103


1 C2 10 nF 10%, X7R 0603 KA01D Murata
1 R4 2.4 MΩ Resistor, Chip, 1/16W, 1% 0402
1 R5 2.7 MΩ Resistor, Chip, 1/16W, 1% 0402
1 R6 4.3 MΩ Resistor, Chip, 1/16W, 1% 0402
1 R7 5.1 MΩ Resistor, Chip, 1/16W, 1% 0402
3 R8, R9, R10 1 MΩ Resistor, Chip, 1/16W, 1% 0402
Capacitor, Ceramic, SMD, 6.3 V, GRM21BR60J107
1 C3 100 µF ± 20%, X5R 0805 ME15L Murata
Capacitor, Ceramic, SMD, 50 V, ± GRM188R71H104
3 C5, C6, C9 100 nF 10%, X7R 0603 KA93D Murata
Capacitor, Ceramic, SMD, 50 V, ± GRM033R71H101
2 C7, C8 100 pF 10%, X7R 0603 KA12D Murata
1 R11 47 kΩ Resistor, Chip, 1/16W, 1% 0402
MOSFET, N-channel, 100V, Infineon
1 Q1 - 170mA SOT-23-3 BSS123N Technologies
Battery Management Ultra Low Texas
1 U1 - Power Boost Converter VQFN-16 BQ25504RGT Instruments
Microcontroller 16-Bit Ultra Low MSP430F2013IRSA Texas
1 U2 - Power 2kB Flash 128B RAM QFN-16 T Instruments
FPC connector, 0.5mm pitch, 59453- FCI /
1 CON_DISP1 - Bottom contact, 8 positions 5.5 x 3.2 mm 081110EDHLF Amphenol
1.2mm pitch crimp style
connector, shrouded header, 2 BM02B-ACHKS- ACH
1 CON_SZ - circuits, black 4.2 x 4.3 mm GAN-ETF Connector
1.2mm pitch crimp style
connector, shrouded header, 3 BM03B-ACHKS- ACH
1 CON_DISP2_A - circuits, black 5.4 x 4.3 mm GAN-ETF Connector
1.2mm pitch crimp style
CON_DISP2_B, connector, shrouded header, 4 BM04B-ACHKS-A- ACH
2 CON_PC - circuits, black 6.6 x 4.3 mm GAN-ETF Connector

9
6. Microcontroller Program Source Code

The microcontroller program is implemented in C and consists of a main program (Main.c) and a header file
(Display_Graphics.h), the latter containing the display graphics in hex-code (see text boxes below). The page references
commented in the code refer to the datasheet of the displays.[S6] For coding and compiling, the IAR Embedded Workbench
IDE Version 6.50.2 was used. For programing of the microcontroller MSP430F2013, we employed the EZ430-F2013 MSP430
USB-Stick Development Tool from Texas Instruments Inc.

Main.c:

/********************************************************
*
* Project: Solar Glasses
* Authors: D. Bahro, H. Roehm
*
* Affiliation: Karlsruhe Institute of Technology
* Material Research Center for Energy Systems (MZE)
* Strasse am Forum 7, Bldg. 30.48
* 76131 Karlsruhe, GERMANY
*
* Components: MCU: TI MSP430F2013
* Display: Sharp LS012B7DD01
*
********************************************************/

/* Include Microcontroller definitions */


#include "io430.h"

/* Include graphic data */


#include "display_graphics.h"

/* Pin connection definitions */


// P1.0: AD0+ (10 Ohms Resistor +)
// P1.1: AD0- (10 Ohms Resistor -)
#define DISP_ON 0x04 // P1.2: Display 1 & 2 - DISP (display on/off)
// P1.3: VREF, 100nF
// P1.4: not connected
// P1.5: Display 1 & 2 - SPI clock output
// P1.6: Display 1 & 2 - SPI data output
#define VCOM 0x80 // P1.7: Display 1 & 2 - VCOM (display toggle clock)
#define DISP1 0x40 // P2.6: Display 1 - SCS (SPI chip select)
#define DISP2 0x80 // P2.7: Display 2 - SCS (SPI chip select)

/* Display command definitions (LS012B7DD01 data sheet page 15) */


#define LCD_WR 0x80 // Write LCD command (MSB first)
#define LCD_CL 0x20 // Clear LCD command (MSB first)

/* AD converter definitions */
// Temp_value = 2^16 * 1.32mV/°C * (273K + Temp[°C]) / 600mV (MSP430F2013 datasheet, p. 47)
// Begin of status bar: Temp = 10°C, Temp_value = 40802, bar value: 0
// End of statuts bar: Temp = 32,4°C, Temp_value = 44034, bar value: 101
// -> Offset: 40802, Slope: 101 / (44034 - 40802) = 1/32 -> Bitshift by 5
#define TEMP_OFFSET 40802 // ADC Temperatre offset
#define TEMP_SLOPE 5 // ADC Temperature slope = 1 / 2^5
// I_value = 2^16 * 10Ohm * 400kOhm / (2*1MOhm + 400kOhm) * I_meas[mA] / 600mV
// Begin of status bar: I_meas = 0mA, I_value = 0, bar value: 0
// End of status bar: I_meas = 2.22mA, I_value = 404, bar value: 101
// -> Offset: 0, Slope: 101 / 404 = 1/4 -> Bitshift by 2
#define CURR_OFFSET 0 // ADC Voltage (Intens.) offset
#define CURR_SLOPE 2 // ADC Voltage (Intens.) slope = 1 / 2^3
// Threshold defines minimum valid measurement value, to prevent from noise
// Correspond to I = 0.20mA (or Temp = 0.3K), avoid display refresh during MPP measurement
#define ADC_THRESHOLD 36 // Minimum ADC value for a valid measurement

/* Program timing */
#define START_TIME 6000 // Delay to be introduced during initialization, 6000/12kHz = 0.5s
#define REFON_TIME 60 // Delay time to settle reference voltage for ADC, 60/12kHz = 5ms
#define CYCLE_TIME 1500 // Delay between two program cycles, 1500/12kHz = 125ms

10
/* Global variables */
unsigned char ADCycle = 0; // ADC cycle counter
unsigned int ADValue = 0; // ADC digital value (0..2^16)
unsigned char BarValue = 0; // Calculated length of status bar (0..101)
unsigned char activeDisplay = DISP1; // Active display for this ADC cycle
unsigned int activeOffset = TEMP_OFFSET; // Active ADC offset for this ADC cycle
unsigned int activeSlope = TEMP_SLOPE; // Active ADC slope for this ADC cycle
unsigned char LineBuffer[LINE_WIDTH] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF}; // Empty white line, Buffer for 23 pixels

/* Sub function definitions */


// Set bar on <display> to value <value>
void SPISetBar(unsigned char display, unsigned char value);
// Write graphic at address <*ptrGraphic> to display <display>
// additionally the first line on display and the number of lines to be written is specified
void SPIWriteLines(unsigned char display, const unsigned char *ptrGraphic, unsigned char FirstLine,
unsigned char NumberOfLines);
// Send a single Byte <value> via serial bus
void SPIWriteByte(unsigned char value);

/*****************
* main function *
*****************/

int main( void )


{

/* Timing settings */
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;

// System clock set to 1MHz (DCO based)


BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;

// Auxiliary clock set to 12kHz (VLO based)


BCSCTL3 |= LFXT1S_2; // ACLK = VLO: Use internal low power oscillator as ACLK source

/* Pin settings */
P1DIR = 0xFC; // Define pins P1.2..P1.7 as output
P1OUT = 0x00; // Pull outputs on first port to GND
P2DIR = 0xFF; // Define all pins on second port as output
P2OUT = 0x00; // Pull outputs on second port to GND
P2SEL = 0x00; // P2.6 and P2.7 as digital ports instead of XTAL input (default)

/* ADC initialization */
SD16CTL = SD16SSEL_1; // SMCLK (1MHz) as clock source for ADC
SD16CCTL0 = SD16SNGL + SD16UNI + SD16IE; // Single conv, unipolar, interrupt enabled

/* USI initialization (serial interface SPI) */


USICTL0 |= USIPE6 + USIPE5 + USIMST + USIOE + USISWRST; // SPI Master Mode (P1.5 CLK, P1.6 SI),
Output enabled, reset/stop USI
USICTL1 |= USICKPH; // Data is captured on the first SCLK edge and changed on the following
edge, USI Counter Intterupt enabled
USICKCTL |= USISSEL_2; // Source = SMCLK = 1MHz
USICTL0 &= ~USISWRST; // start USI

/* Timer settings */
CCTL0 = CCIE; // CCR0 interrupt enabled
CCR0 = START_TIME; // Timer counts up to CYCLE_TIME and releases interupt
TACTL = TASSEL_1 + MC_1; // ACLK (12kHz/CYCLE_TIME), cont.-mode

/* Turn displays on */
P1OUT |= DISP_ON; // DISP = high -> Displays turned on

// Delay of <START_TIME> to enable storage capacitance to be recharged and display voltage to be


settled
__bis_SR_register(LPM3_bits + GIE); // Enter low power mode 3 w/ interrupt

/* Display initialization */
for (unsigned char ii = 0; ii <= 2; ii++) // clear display twice (LS012B7DD01 data sheet page 13)
{
P2OUT |= DISP1 + DISP2; // DISP1 and DISP2 = high -> both displays read from SPI bus
SPIWriteByte(LCD_CL); // Display clear command

11
SPIWriteByte(0); // 8Bit Trailer
P2OUT &= ~(DISP1 + DISP2); // DISP1 and DISP2 = low -> data read finished
}

/* Write display graphic */


// Write Header (Temperature) and bar graphic to first display
SPIWriteLines(DISP1,&display_graphics_hex[BEGIN_HEAD_1][0],DISP_POS_HEAD_Y_1,LENGTH_HEAD_1);
SPIWriteLines(DISP1,&display_graphics_hex[BEGIN_BAR][0],DISP_POS_BAR_Y,LENGTH_BAR);
// Delay of <START_TIME> to enable storage capacitance to be recharged
__bis_SR_register(LPM3_bits + GIE); // Enter low power mode 3 w/ interrupt
// Write Header (Illuminations Intensity) and bar graphic to second display

SPIWriteLines(DISP2,&display_graphics_hex[BEGIN_HEAD_2][0],DISP_POS_HEAD_Y_2,LENGTH_HEAD_2+LENGTH_BAR);

// Delay of <START_TIME> to enable storage capacitance to be recharged


__bis_SR_register(LPM3_bits + GIE); // Enter low power mode 3 w/ interrupt

/* Main loop*/
while(1)
{

// Delay of one program cycle to enable storage capacitance to be recharged


CCR0 = CYCLE_TIME; // next timer interrupt in CYCLE_TIME
__bis_SR_register(LPM3_bits + GIE); // Enter low power mode 3 w/ interrupt

P1OUT ^= VCOM; // Toggle VCOM signal to maintain display contrast

// If minimum AD value ADC_THRESHOLD is surpassed


if (ADValue > ADC_THRESHOLD) {
// Calculate bar value from AD value: bar value = (AD value - AD offset) / 2^slope
BarValue = (ADValue - activeOffset) >> activeSlope;
// Write new bar value to active display
SPISetBar(activeDisplay,BarValue);
}

// Program runs through 15 AD cycles, first: Temperature, 2nd-15th: PV current = Ill. Intensity
measurement
ADCycle++;
switch(ADCycle) {
case 1: // Measure MCU temperature - 1x
SD16AE &= ~(SD16AE0 + SD16AE1); // Disable A0+ (P1.0) and A0- (P1.1) analog pins
SD16INCTL0 = SD16INCH_6; // A6+/- (Internal Temperature sensor)

activeDisplay = DISP1; // define display where to write AD result


activeOffset = TEMP_OFFSET; // define AD offset
activeSlope = TEMP_SLOPE; // define AD slope
break;

case 2: // Measure PV current at Rmeas - 14x


SD16INCTL0 = SD16INCH_0; // Enable channel A0+/-
SD16AE |= SD16AE0 + SD16AE1; // Enable external input on A0+ and A0- analog pins

activeDisplay = DISP2; // define display where to write AD result


activeOffset = CURR_OFFSET; // define AD offset
activeSlope = CURR_SLOPE; // define AD slope
break;

case 15: // Reset AD cycle counter to start again


ADCycle = 0;
break;
}

SD16CTL |= SD16REFON; // turn SD16 1.2V ref on

CCR0 = REFON_TIME;
__bis_SR_register(LPM3_bits + GIE); // Enter low power mode 3 w/ interrupt

SD16CCTL0 |= SD16SC; // Start SD16 conversion


__bis_SR_register(LPM0_bits + GIE); // Enter low power mode 0 w/ interrupt

SD16CTL &= ~SD16REFON; // turn SD16 1.2V ref off

12
/*****************
* Sub functions *
*****************/

// Set bar on <display> to value <value>


// Just refreshes the 9 lines necessary to change the length of the status bar
void SPISetBar(unsigned char display, unsigned char value)
{
// local variables
unsigned char barline, displayline; // Counter for current bar line and current line on display
unsigned char PixelByte; // Pixel counter, 1 PixelByte stores 8 Pixels
unsigned char NumWhiteBytesFirst, NumWhiteBytesLast; // Number of white bytes (8Pixels) left
and right from the bar circle graphic
unsigned char NumWhiteBitsFirst, NumWhiteBitsLast; // Number of white bits (1Pixel) left
and right from the bar circle grahic
unsigned char firstPixel, lastPixel; // Number of the first (leftmost) and last (rightmost)
Pixel of the bar graphic

// Write bar graphic line by line


for (barline = 0; barline < LENGTH_VAR_BAR; barline++) // repeat for each line
{
// read current display line number from FLASH stored coordinates
displayline = bar_coordinates[barline][0];

// Set grafic data left from bar, read from FLASH stored graphic data
for (PixelByte = 0; PixelByte < BAR_POS_X; PixelByte++)
{
LineBuffer[PixelByte] =
*(&display_graphics_hex[BEGIN_BAR][0]+PixelByte+(displayline*LINE_WIDTH));
}

// Calculated bar dimensions


firstPixel = bar_coordinates[barline][1]+value; // Rightmost bar Pixel read from FLASH data,
added by <value>
if (firstPixel == value) { // If central lines of the circle graphic are writte, the
graphic is extended to left end of the bar
firstPixel = 0;
}
lastPixel = bar_coordinates[barline][2]+value; // Leftmost bar Pixel read from FLASH data,
added by <value>

// Calculate bar Pixel graphic (Bitshift by 3 = Division by 8, remainder from bitwise &)
NumWhiteBytesFirst = firstPixel >> 3; // firstPixel / 8
NumWhiteBitsFirst = firstPixel & 0x07; // firstPixel % 8
NumWhiteBytesLast = lastPixel >> 3; // lastPixel / 8
NumWhiteBitsLast = lastPixel & 0x07; // lastPixel % 8

// Set bar graphic


for (PixelByte = BAR_POS_X+NumWhiteBytesFirst; PixelByte < BAR_POS_X+NumWhiteBytesLast+1;
PixelByte++)
{
LineBuffer[PixelByte] = 0x00; // full black line
}
LineBuffer[BAR_POS_X+NumWhiteBytesFirst] |= 0xFF << (8-NumWhiteBitsFirst); // add white
Pixels left from circle
LineBuffer[BAR_POS_X+NumWhiteBytesLast] |= ~(0xFF << (8-NumWhiteBitsLast)); // add white
Pixels right from circle

// Set grafic data right from bar, read from FLASH stored graphic data
for (PixelByte = BAR_POS_X+BAR_WIDTH; PixelByte < LINE_WIDTH; PixelByte++)
{
LineBuffer[PixelByte] =
*(&display_graphics_hex[BEGIN_BAR][0]+PixelByte+(displayline*LINE_WIDTH));
}

// Write complete line buffer to display


SPIWriteLines(display,&LineBuffer[0],DISP_POS_BAR_Y+displayline,1);

// Reset line buffer


for (PixelByte = 0; PixelByte < LINE_WIDTH; PixelByte++)
{
LineBuffer[PixelByte] = 0xFF;
}
}

13
}

// Write graphic at address <*ptrGraphic> to display <display>


// additionally the first line on display and the number of lines to be written is specified
// The lines and Pixels on DISP1 are written in the opposite order to rotate the grafic by 180 degree
void SPIWriteLines(unsigned char display, const unsigned char *ptrGraphic, unsigned char FirstLine,
unsigned char NumberOfLines)
{
// local variables
unsigned char line, PixelByte; // line and Pixel counter, 1 PixelByte stores 8 Pixels
unsigned char ByteOffset; // PixelByte offset to for calculating the current PixelByte address
unsigned char LineAddress; // Address of current line

// Start transmission by setting SCS line of the corresponding display


P2OUT |= display; // display pin high -> chosen display allowed to read from SPI bus

// Start data transmission


SPIWriteByte(LCD_WR); // Send display write command

// Send data
for (line = 0; line < NumberOfLines; line++) // Repeat for each line
{
// Send line address
USICTL0 |= USILSB; // change SPI transmission to least significant bit (LSB) first
if (display == DISP2) { // For display 2 line number is counted from top
LineAddress = line+FirstLine+1;
}else if (display == DISP1) { // For display 1 line number is counted from bottom
LineAddress = LINE_NUMBER-FirstLine-line;
}
SPIWriteByte(LineAddress); // write line address in LSB mode

// Send pixel data (23 Bytes per line)


for (PixelByte = 0; PixelByte < LINE_WIDTH; PixelByte++) // Repeat for each Pixel Byte
{
if (display == DISP2) { // For display 2 data is transmitted in the same order as stored in
FLASH
USICTL0 &= ~USILSB; // change SPI transmission back to most significant bit (MSB) first
ByteOffset = PixelByte; // PixelBytes are counted upwards
}else if (display == DISP1) { // For display 1 data is transmitted in opposite order to
rotate the whole graphic by 180 degree
ByteOffset = LINE_WIDTH-PixelByte-0x1; // PixelBytes are counted downwards from the end
}
SPIWriteByte(*(ptrGraphic+ByteOffset+(line*LINE_WIDTH))); // Send one Byte, read from data the
pointer defines
}
SPIWriteByte(0); // 8bit trailer
SPIWriteByte(0); // 8bit trailer
}
USICTL0 &= ~USILSB; // change SPI transmission back to most significant bit (MSB) first

// Send 8bit trailer


SPIWriteByte(0);

// Finish data transmission


P2OUT &= ~display; // display SCS pin low -> data read finished
}

// Send a single Byte <value> via serial bus


void SPIWriteByte(unsigned char value)
{
USISRL = value; // copy value into low part shift register
USICNT = 8; // start tranmission (8bit)
}

/******************************
* Interrupt service routines *
******************************/

// ADC16 interrupt service routine


#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=SD16_VECTOR
__interrupt void SD16ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(SD16_VECTOR))) SD16ISR (void)

14
#else
#error Compiler not supported!
#endif
{
ADValue = SD16MEM0; // Store AD value and clear ADC interrupt flag
__bic_SR_register_on_exit(LPM0_bits); // exit low power mode 0
}

// Timer A0 interrupt service routine


#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A (void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(TIMERA0_VECTOR))) Timer_A (void)
#else
#error Compiler not supported!
#endif
{
__bic_SR_register_on_exit(LPM3_bits); // exit low power mode 3
}

Display_Graphics.h:

/******************************************
* display_graphics.h
*
* - contains the hex code of the graphics written to both displays
* - on the first display the first header including the KIT logo
* and the temperature scale is written to the upper half, as well as the bar
* graphic is written to the lower half
* - on the second display the second header (ill. intensity) and the KIT logo
* is written
*******************************************/

#ifndef DISPLAY_GRAPHICS_H_
#define DISPLAY_GRAPHICS_H_

/* Definitions of graphics dimensions and positions */

// Display dimensions
#define LINE_WIDTH 23 // Number of data Bytes per display line ( width 184 pixels / 8 = 23
Bytes)
#define LINE_NUMBER 38 // Number of display lines (height 38 Pixels)

// Line numbers on display where to start writing the different parts of the graphics
#define DISP_POS_HEAD_Y_1 5 // First line of the first graphic header
#define DISP_POS_HEAD_Y_2 9 // First line of the second graphic header
#define DISP_POS_BAR_Y 21 // First line of the bar graphic

// Coordinates of the different parts of the two graphics in display_graphics_hex in FLASH storage
#define BEGIN_HEAD_1 0 // Position of the first Byte of the first graphic header
#define BEGIN_HEAD_2 16 // Position of the first Byte of the second graphic header
#define LENGTH_HEAD_1 16 // Number of lines of the first graphic header
#define LENGTH_HEAD_2 12 // Number of lines of the second graphic header
#define BEGIN_BAR 28 // Position of the first Byte of the bar graphic
#define LENGTH_BAR 13 // Number of lines of the bar graphic

// Coordinates of the varying part of the bar graphic


#define LENGTH_VAR_BAR 9 // Number of variable lines
#define BAR_POS_X 8 // Horizontal position of the first pixel of the status bar
#define BAR_WIDTH 14 // Number of Bytes per line of the display bar

/* Graphic data stored as global constant in FLASH memory */

// Coordinates that define the shape of the circle at the end of the status bar [line number, first
Pixel, last Pixel]
const unsigned char bar_coordinates[LENGTH_VAR_BAR][3] = {2,3,8,
4,1,10,
5,0,11,
6,0,11,
7,0,11,

15
8,0,11,
9,0,11,
10,1,10,
12,3,8};

// Static display graphic data in hex code


const unsigned char display_graphics_hex[41][23]={

// begin of display

// 4 empty rows

// begin of 1st graphic header [0..15][..]


// graphic data written to the upper part of the first (temperature) display
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBF,0xFB,0xF
F,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x87,0x1B,0xF
F,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBF,0xFF,0xFF,0xFF,0xFF,0xDF,0xFF,0xFF,0x56,0x6D,0xF
F,0xFF,0xFF,
0xFF,0xFF,0x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0x80,0x7E,0x07,0xC0,0xFF,0x63,0xFF,0xFF,0xB1,0xFF,0xFF,0xC4,0x7F,0xFF,0xE2,0x3F,0xFF,0xF
1,0x1F,0xFF,
0xFC,0x3C,0x18,0x80,0xFE,0x07,0xC0,0xFF,0x6B,0xFF,0xFF,0xB3,0xFF,0xFF,0xF5,0x7F,0xFF,0xFA,0x7F,0xFF,0xF
B,0x5F,0xFF,
0xFC,0x1E,0x18,0x81,0xFE,0x07,0xC0,0xFF,0x6B,0xFF,0xFF,0xBD,0xFF,0xFF,0xED,0x7F,0xFF,0xF7,0xBF,0xFF,0xF
D,0x5F,0xFF,
0xF8,0x07,0x08,0x80,0xFE,0x07,0xC0,0xFF,0x63,0xFF,0xFF,0xB3,0xFF,0xFF,0xC4,0x7F,0xFF,0xE2,0x7F,0xFF,0xF
1,0x1F,0xFF,
// end of 1st graphic header

// begin of 2nd header [16..27][..]


// graphic data written to the upper part of the second (illumination intensity) display
0xFF,0xFF,0xF8,0xFF,0x02,0x04,0x00,0x0F,0xFB,0x6F,0xFF,0xFB,0xFF,0xFF,0x7F,0xFF,0xBF,0xFF,0xFF,0xFE,0xF
F,0xFF,0xFF,
0xFF,0xFF,0xE0,0xFE,0x02,0x04,0x00,0x0F,0xFB,0x6F,0xFF,0xFF,0xFF,0xF7,0xFF,0xFF,0xBF,0xDF,0xFF,0xFF,0xD
F,0xFF,0xFF,
0xFF,0xFE,0xE0,0xFC,0x02,0x04,0x00,0x0F,0xFB,0x6D,0xB0,0x1B,0x0C,0x23,0x61,0x87,0xB0,0x8E,0x70,0x8E,0x8
B,0xBF,0xFF,
0xFF,0xF8,0xE0,0xF8,0x06,0x04,0x00,0x0F,0xFB,0x6D,0xB6,0xDB,0x6F,0xB7,0x6D,0xB7,0xB6,0xDD,0xB6,0xBE,0xD
B,0x7F,0xFF,
0xFF,0xE0,0x60,0xF0,0x0E,0x04,0x00,0x0F,0xFB,0x6D,0xB6,0xDB,0x6C,0x37,0x6D,0xB7,0xB6,0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xFF,0x3F,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0
0,0x00,0x7F,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x83,0xFF,0xFF,0xFF,0xFF,0xFF,0xF
F,0xFF,0xFF
// end of bar graphic

// 5 empty rows

// end of display
};

#endif /* DISPLAY_GRAPHICS_H_ */

7. References

[S1] Commission Internationale de l’Éclairage International, CIE 13.3.

[S2] N. Lynn, L. Mohanty, S. Wittkopf, Building and Environment 2012, 54, 148–158.

[S3] E. Theiß, Gebäudetechnik, Vol. 1: Beleuchtungstechnik: neue Technologien der Innen- und Außenbeleuchtung,
Oldenbourg-Industrieverl 2000, München.

[S4] “bq25504 Ultra Low-Power Boost Converter With Battery Management for Energy Harvester Applications”, Texas
Instruments Inc. 2012, http://www.ti.com/lit/ds/symlink/bq25504.pdf, (accessed January 27th, 2017).

[S5] “Mixed signal microcontroller”, Texas Instruments Inc. 2012, http://www.ti.com/lit/ds/symlink/msp430f2013.pdf,


(accessed January 27th, 2017).

[S6] “Technical Literature For TFT-LCD Module, Model No. LS012B7DD01”, SHARP Corporation 2013,
http://www.mouser.com/ds/2/365/MitsubishiElectric_LS012B7DD01%20LCP-1113013B-364546.pdf, (accessed
January 27th, 2017).

17

S-ar putea să vă placă și