Delta-T SPN1 Instruction Manual

SPN1 DNI Firmware- Use of the DNI function
1 of 8 5/4/2016
www.delta-t.co.uk
Use of the DNI Function
in SPN1
Version 2 Jul 2016
Contents
Introduction .............................................................................................................................................. 1
About DNI: What is it and why should I care?........................................................................................2
DNI: What is it?.................................................................................................................................... 2
DNI: Why needed? ...............................................................................................................................2
How do I calculate DNI if my SPN1 points directly at the sun? ..........................................................2
How do I calculate DNI if my SPN1 is horizontal?..............................................................................3
Location & Time ......................................................................................................................................3
Time Zone ............................................................................................................................................ 3
Location................................................................................................................................................3
GPS time and position .......................................................................................................................... 4
SPN1 electrical connections .....................................................................................................................5
RS232 pin connections ......................................................................................................................... 5
Electrical limits.....................................................................................................................................5
Baud rates ............................................................................................................................................. 5
Power supply ........................................................................................................................................5
RS232 Commands for obtaining DNI ......................................................................................................6
SPN1 DNI Command usage .....................................................................................................................7
General command flow ........................................................................................................................ 7
Strategies for use of these commands...................................................................................................7
Conversion of GPS sentences for use with SPN1..................................................................................... 8
Introduction
SPN1 Firmware version (1.09 and later), which runs on the microprocessor in the SPN1, is also able to
calculate DNI, the Direct Normal Irradiance.
This information is supplied via the RS232 serial port upon sending the SPN1 the necessary
information and the appropriate command. For the SPN1 to calculate DNI it needs to be supplied with
the Latitude, Longitude, and the correct date, the local time and the time zone offset from GMT.
The information is only available on the serial output and is obtained by sending RS232 commands to
the SPN1. So to get the DNI value you need a program able to send RS232 commands and receive
RS232 text strings in reply.
This feature is provided mainly for those with a programming background or for engineers who are
familiar with the use of PC programs such as HyperTerminal or building management software, or the
programming language of their chosen data logger.
To use this feature you need one of the following
Technical Note

SPN1 DNI Firmware- Use of the DNI function
2 of 8 5/4/2016
www.delta-t.co.uk
A HyperTerminal or similar terminal emulator program running on a PC
Note: The recent versions of MS Windows from Vista onwards do not provide the
HyperTerminal program but various terminal emulators are available on the internet;
A data logger which supports serial communications;
Your own utility or building management software.
Alternatively, if working directly with RS232 commands is not for
you, we provide an alternative method for retrospectively
calculating DNI from logged Global and Diffuse readings. This uses
an Excel spreadsheet. A working and reusable demonstration
spreadsheet and an application note are available for download at
www.delta-t.co.uk
Links: http://www.delta-t.co.uk/spn1-resources.asp
One benefit of using the SPN1 firmware DNI feature is you get the
result in real-time, whereas the spreadsheet option provides it some
time later.
The spreadsheet option is also useful as a teaching tool and for
checking you are setting the parameters correctly.
About DNI: What is it and why should I care?
DNI: What is it?
Direct-Normal Irradiance (DNI) also called Direct-Normal Solar Irradiance (DNSI) is the energy in the
solar spectrum incident in unit time at the Earth's surface on a unit area perpendicular to the direction to
the Sun.
DNI: Why needed?
This is an energy based method against which solar panels may be compared.
It is a common practice to compare solar panel efficiency to DNI. Maps of DNI are readily available
and are often used to make a quick estimate the suitability of a particular site for solar power. One
reason for this is that historical maps of DNI readings over several years are readily available in some
countries (e.g. USA). In addition DNI maps at ground level can be calculated from satellite data with a
suitable correction for travelling though the earth atmosphere.
The goal of accurately characterising the efficiency of a solar photovoltaic panel is of great interest to
the solar photovoltaic industry. It is quite a complex subject - Wikipedia is a good place to start.
Knowledge of the DNI at different sites is useful when making comparisons between field trials.
If a solar panel exactly tracks the sun (this requires two axes of movement) then it is common practice
to compare its efficiency relative to Direct Normal Irradiance (DNI).
Another use of DNI is its use as an intermediate value when calculating how much of the suns’
radiation is scattered or adsorbed by the atmosphere. The suitability of the SPN1 for this is being
investigated. For further details see “The SPN1 and Atmospheric Light Scattering” at http://www.delta-
t.co.uk/spn1-resources.asp.
How do I calculate DNI if my SPN1 points directly at the sun?
The Direct Normal Irradiance is given by the equation:
DNI = Direct = Total(Global) –Diffuse.
Figure 1 An alternative to using the SPN1
firmware to derive DNI is to download the
Excel spreadsheet and applications note at
www.delta-t.co.uk

SPN1 DNI Firmware- Use of the DNI function
3 of 8 5/4/2016
www.delta-t.co.uk
How do I calculate DNI if my SPN1 is horizontal?
DNI = (SPN1 Direct)/Cos ϴ……………………………..(1)
Where:- ϴ= zenith angle
SPN1 Direct = SPN1 Total(Global) –SPN1 Diffuse.
Given the latitude, longitude and correct time relative to GMT the SPN1 firmware works out the sun’s
zenith angle and calculates DNI for a horizontally mounted SPN1 using equation 1.
Note: Delta-T also can provide an Excel spreadsheet add-in to do this - see www.delta-t.co.uk.
You may find this spreadsheet useful, for instance - to check you are sending the SPN1 the correct
parameters.
Location & Time
It is important to use the correct sign conventions to use when specifying Latitude, Longitude and also
the time zone offset from GMT.
Time Zone
You need to know the local time at the SPN1 and how many hours you are ahead or behind GMT
(Greenwich Mean Time) or UTC (Universal Time). For our purposes GMT and UTC are equivalent.
The time zone generally increases by 1 hour for every 15° East of Greenwich, with the international
date line separating GMT+12Hrs from GMT-12Hrs. There are however many exceptions, as the map
below demonstrates. The SPN1 time zone must be in the range -24:00 to +24:00 in hours and minutes.
Location
Your site location is another key input to many of the functions.
Latitude is entered in decimal degrees, with positive values for North, negative values for South.
Latitude must be in the range -90° to +90°.
Longitude is entered in decimal degrees, with positive values for East of the Greenwich meridian,
negative values for West. Longitude must be in the range -180° to +180°
Zenith
angle ϴ
SPN1 Sensor tilted directly towards
the sun measures the Direct Normal
Irradiance (DNI)
Horizontal SPN1
receives
DNI x Cos ϴ
ϴ
1kW/m2
1xCos(ϴ) kW/m2
1kW/m2

SPN1 DNI Firmware- Use of the DNI function
4 of 8 5/4/2016
www.delta-t.co.uk
Figure 2 Illustration indicating sign conventions used for entering Latitude, Longitude and time zone in the SPN1
DNI calculations
GPS time and position
For simplicity, we recommend that you take the latitude, longitude and GPS time from a GPS receiver,
and set the SPN1 time zone to 00:00. These will then be correct wherever in the world you are.
- LONGITUDE +
+165
+12 -12+11
180
+150
+10+9
+135
+8
+120
+7
+105
+6
+90
+5
+75
+4
+60
+3
+45
+2
+30
+1
+150
0-1
-15
-2
-3
-30-45
-4
-60
-5
-75
-6-7
-90-105-120-135-150-165
-8-9-10-11
- LATITUDE +
- Time Zone +

SPN1 DNI Firmware- Use of the DNI function
5 of 8 5/4/2016
www.delta-t.co.uk
SPN1 electrical connections
RS232 pin connections
This diagram shows the pin numbers used by the SPN1 serial data connector, and the standard RS232
cable.
Electrical limits
The RS232 signal is a ‘true’ RS232 signal, so voltage levels on the Tx & Rx lines are bipolar in the
range ±3V to ±15V. This is suitable for connection to a PC serial port. Only the Tx, Rx and Gnd wires
are used for communication.
Baud rates
The SPN1 communicates at a fixed baud rate of 9600 baud, 8 data bits, no parity, 1 stop bit. Your serial
port must be set to match this.
Power supply
If there is sufficient power available from the DTR signal (an output from the PC serial port), this will
power the SPN1 sufficiently to take readings. If there is insufficient power available from the DTR
signal, this wire can be detached from the serial port, and connected to a DC supply in the range 5V –
15V. Alternatively, the SPN1 can be powered through the heater power wires in the analogue
connector (see the SPN1 Quick Start Guide for cable description). If you want to use the SPN1 internal
clock, this power supply should be permanently enabled. If you need to minimise power consumption,
the power only needs to be applied for the duration of the communication session.

SPN1 DNI Firmware- Use of the DNI function
6 of 8 5/4/2016
www.delta-t.co.uk
RS232 Commands for obtaining DNI
These commands added to the SPN1 firmware in version 1.09 to enable the calculation of DNI are part
of a larger set. For a description of the other RS232 commands and their use please see the SPN1
Technical Manual.
You type
Typical reply
Notes
Z<CR>
Format:
YYYY/MM/DD hh:mm:ss
Example:
2006/01/10
00:09:52<CR>
Report the date and time (reset at power up)
Time is LOCAL time, with an offset from
GMT specified by ‘L’ command
(See the SPN1 technical manual for the
complete set of commands).
ZYYYY/MM/DD
hh:mm:ss<CR>
2006/01/10
00:09:52<CR>
Set and then report SPN1 internal clock as
above
L<CR>
Format:
dd.d,ddd.d,hh:mm<CR>
Example:
39.9,-098.96,-08:00
Report current Latitude, Longitude & time
zone. Latitude & Longitude in decimal
degrees, time zone in hours and minutes.
Ldd.d,ddd.d,hh:m
m<CR>
dd.d,ddd.d,hh:mm<CR>
Set and then report SPN1 Latitude,
Longitude & time zone. Latitude & longitude
stored to 1 decimal place.
A<CR>
GMT,2014/01/10
13:09:52,148.1,33.0<
CR>
Calculate the solar Azimuth and Zenith
angles using the previously stored Latitude,
Longitude, time zone and SPN1 local clock
time.
Report the date, GMT, Azimuth and Zenith
angle (in degrees, reported to 1 decimal
place).
Calculation takes 700ms approx.
AYYYY/MM/DD
hh:mm:ss<CR>
GMT,2014/01/10
13:09:52,148.1,33.0<
CR>
Calculate the solar Azimuth and Zenith
angle using the previously stored Latitude,
Longitude, time zone and the supplied Local
Time.
Report the Date and GMT time, Azimuth
and Zenith angle.
Calculation takes 700ms approx.
D<CR>
GMT,2014/01/10
13:09:52,
tttt.t,dddd.d,s
,DDDD.D<CR>
Calculate DNI from SPN1 readings, using
the stored Latitude, Longitude, time zone and
SPN1 local time. Values reported to 1 decimal
place.
Display GMT, Total, Diffuse, Sun Status &
DNI (in W.m-2)
Calculation takes 700ms approx.
DYYYY/MM/DD
hh:mm:ss<CR>
GMT,2014/01/10
13:09:52,
tttt.t,dddd.d,s
,DDDD.D<CR>
Calculate DNI from SPN1 readings, using
the stored Latitude, Longitude, time zone and
the supplied local time.
Display GMT, Total, Diffuse, Sun Status &
DNI (in W.m-2)
Calculation takes 700ms approx.

SPN1 DNI Firmware- Use of the DNI function
7 of 8 5/4/2016
www.delta-t.co.uk
The SPN1 clock and any input times to these commands are assumed to be in the local time represented
by the time zone set using the ‘L’ command. The SPN1 then converts this local time into universal time
(UTC or GMT) for use in the solar position calculations. The results reported from the ‘A’ and ‘D’
commands show the universal time (GMT) used in the calculation. This also gives you the opportunity
to check that you have the correct time zone settings for your particular local clock time.
SPN1 DNI Command usage
General command flow
Strategies for use of these commands
The latitude, longitude and time zone are stored in persistent memory in the SPN1, so only need to be
set once on installation. They will then be correct unless the SPN1 is moved, or the time offset changes
(e.g. daylight savings time?).
Send R
Check for »
(ASCII 175)
Send the required command
Check
command has
been echoed
fully
Check for
response,
including final
<CR>
Analyse response
The Rcommand wakes the SPN1
and puts it into a known state. If
necessary the internal oscillator is
calibrated to ensure accurate
RS232 character recognition.
The SPN1 responds with the ‘»’
prompt (ASCII 175) to confirm
this.
This command normally returns
immediately, but you should wait
up to 1s to be sure of this.
The command you send is always
echoed back in full before any
response is sent.
Any response will always end with
a <CR> (ASCII 13).
A few commands (Iand ? - see the
technical manual for the full
command set) return several lines
of information, so you will need to
wait for several <CR> to be
received to be sure the command
has completed.
The commands will normally
complete in less than 1s, plus any
additional communication delay if
you are accessing the SPN1
remotely

SPN1 DNI Firmware- Use of the DNI function
8 of 8 5/4/2016
www.delta-t.co.uk
The SPN1 clock will keep good time for many weeks or months, but the SPN1 has no internal power
source, so it will reset on a loss of power. We recommend that you check and set the SPN1 clock on
power up, and thereafter once a day, if you are using it to provide your local time. Otherwise, you can
provide the current time from your system clock for every DNI reading you make.
We recommend that you use a GPS receiver to provide accurate location and time information
wherever possible. This will give you accurate location and time information, but the GPS signal can
easily be lost through interference, so may not always be available. In this situation, you would need
two separate events:
1. Daily, or on power up. Check for valid GPS position & time, set SPN1 latitude & longitude, with
00:00 time zone. Set SPN1 clock to GPS time.
2. Whenever a reading is required. Use ‘D’ command to ask the SPN1 for DNI data. Use the ‘S’ or
‘F’ commands if you also need Global, Diffuse, or individual detector values.
Conversion of GPS sentences for use with SPN1
Most GPS receivers by default will send out time and location information using the NMEA standard –
this is a 4800baud RS232-based output. Data is usually sent out every second, though the data rate can
be adjusted as desired. They will normally send a small number of data ‘sentences’, though there is a
much larger number that can be sent if desired. Most GPS receivers also have a manufacturer’s
proprietary data format which will provide more information, and at a higher speed. Use the
manufacturer’s data sheet to be sure what is happening.
In general, the default NMEA setting is sufficient. Because the data is sent out as a continuous stream,
your system will need some way of buffering this data, so that you can search for the right sentence in
amongst the range of different sentences that are sent.
The NMEA sentences from a GPS receiver will start with $GP, and end with <CR><LF>. All receivers
will send the recommended minimum data sentence, or RMC. This will look similar to:
$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6ACRLF
Where:
RMC Recommended Minimum sentence C
123519 Fix taken at 12:35:19 UTC
A Status A=active or V=Void.
4807.038,N Latitude 48 deg 07.038' N
01131.000,E Longitude 11 deg 31.000' E
022.4 Speed over the ground in knots
084.4 Track angle in degrees True
230394 Date - 23rd of March 1994
003.1,W Magnetic Variation
*6A The checksum data, always begins with *
If possible, check the checksum is correct. Calculating the checksum is very easy. It is the ASCII
representation of two hexadecimal characters of an XOR of all characters in the sentence between –but
not including –the $ and the * character. If the checksum is incorrect, don’t use the data.
Only use this data if the Status is given as ‘A’ (or sometimes ‘A0’, ‘A1’). If it is shown as ‘V’, the data
will be inaccurate or incorrect.
The date and time are given as 6 digit numbers. These need to be reordered and reformatted with the
correct delimiter characters for the SPN1, and the correct century added. So from a GPS time format of
hhmmss and date format of DDMMYY, you need to construct and SPN1 date & time format of
YYYY/MM/DD hh:mm:ss.
The latitude and longitude are a little more awkward, because they are given in degrees and decimal
minutes, e.g. ddmm.mmm for latitude, or dddmm.mmm for longitude. The sign then follows, as either
a N or S, E or W. The number of decimal places can be variable.
You therefore need to calculate the decimal degrees as dd + mm.mmm/60. Multiply by -1 if the sign
character is S (or W for longitude). Then either round to 0.1°, or truncate to 2 or 3 decimal places. The
SPN1 will round to 0.1° and store this rounded value internally.
Other manuals for SPN1
1
Table of contents
Other Delta-T Measuring Instrument manuals