- Published: Saturday, 17 July 2010
- Written by Jon Chandler
- Hits: 17264
A friend of mine is evaluating solar panel technology for a large-scale home project. An irradiance meter is a handy tool to help evaluate various options. This irradiance meter is a fusion of pieces that came together to make a simple solution possible.
A Handspring Visor PDA provides a slick user interface and logging capability.
The SensorThe heart of this project is the TSL230R Light-to-Frequency converter, which may still be available at some Radio Shack locations. This chip features an "electronic iris" to facilitate measurements over a wide range of intensities. The photo sensor may be enabled in 3 stages to measure from near darkness (the glow of a computer monitor) to full-intensity sunlight. The output of the sensor is a pulse stream whose frequency is proportional to irradiance.
Amicus CompilerThe Amicus compiler's PULSEIN command makes it easy to read the pulse frequency so it seemed like the ideal choice. The 18F25K20 requires 1.8 - 3.6 volts for operation; the sensor is rated for 2.7 - 5.5 volts, so this is a nice match.
TAP-28 BoardThe TAP-28 board can use the 18F25K20 required by Amicus, so it's an excellent low-cost means of implementing the circuit. The sensor requires 3 port pins for full operation - one for the pulse output and 2 to control the electronic iris. Two additional port pins could be used to control the frequency divider stage, but this isn't needed to achieve full range of the sensor and it may be fixed. The I2C/SPI connector on the TAP-28 board has 4 port pins, power and ground, so it's a perfect place to interface the sensor to the TAP-28.
Microchip 8-Pin SOIC/MSOP/TSSOP/DIP Evaluation Board
The temperature sensor is in an 8-pin DIP package with little support circuitry required so many construction methods are suitable. The SOIC8EV prototype board from Microchip proved to be an ideal solution. It features SMT pads for pull-up, pull-down and series resistors and bypass caps for each pin, a large pad for each pin where a clip lead can be easily attached and a location for a 6 pin header to mate with the I2C/SPI connector on the TAP-28 board. At a cost of $10/5 boards from Microchip, there's little cost penalty for this easy implementation.
Opportunity knocked in the form of a newly new Handspring Visor PDA at the local thrift store. A terminal-emulator operating on the PDA provides a great user interface and logging capability.
Ptelnet is a terminal emulator for use with the Palm operating system which the Handspring Visor uses. It works quite nicely for I/O to the PIC18F25K20, and includes logging features.
Building A System
The TSL230R Circuit
The TSL230R takes almost no support circuitry, so it's ideal for construction on the Microchip prototyping board. The circuit requires a couple pull-up resistors to set the frequency scaling - I used resistors rather than a direct connection so that alternate settings could be tried just by shorting the pins to ground with a clip lead. The only other component needed is a bypass capacitor of 0.1 μF.
The circuit is arranged to connect to the I2C/SPI connector (with 4 port pins available) on the TAP-28 board. The "electronic iris" controls how much of the sensor is active, so the sensitivity may be set by the micro controller. The scaling is fixed at divide by 100 to bring the signal down to a range that's easy to measure.
I built the circuit on the Microchip 8 pin prototype board. This board has a 6 pin header location, with connections to the power and ground plane. The signals to S0 and S1 required trace cuts and jumps. Connections between the TSL230R pins and power and ground were made with 0-ohm resistors.
There are a couple extra jumpers on the above board...use care to identify the traces to cut!
The irradiance meter is mounted in a cheap plastic box. The TAP-28 board will be dedicated to this task, so the implementation is somewhat different than usual. Two switches are used for the meter, a toggle switch to select the mode and a push button switch to trigger readings. Instead of switches on the board, the remote switches are connected to the pads on the board.
The LEDs, which indicate the iris setting, are visible through the plastic enclosure. I also including a DS18B20 temperature probe (from Sure Electronics). The pinout of this sensor is different than the 3 pin connectors on the TAP-28 board, so a short adapter cable is used to sort them out. The One-Wire protocol used by the DS18B20 requires a pullup resistor to V+. This was installed at the daughterboard pads and can be seen to the left of the crystal in the photo below.
The sensor board uses 3 port pins on the I2C/SPI connector. A header connector with long pins was used so that the sensor extends through a hole in the box cover. The photo below shows the sensor supported by a couple of neoprene blocks to give it rigidity.
The schematic of the assembly is shown below. The TAP-28 is shown as an module - the circuit on the board is pretty standard and is described elsewhere. It uses an 18F25K20 as required by the Amicus compiler and uses a 12 MHz crystal - the micro is operating at 48 MHz with the 4x PLL. LEDs 1, 2 & 3 indicate which iris setting has been selected.
A pair of AA batteries power the system. The 18F25K20, the TSL230R and the DS18B20 all operate well over the range of battery voltage. The biggest current draw is an LED indicating the iris setting. Rather than leaving an LED on all the time, I could flash it, or turn it on briefly when it changes but until the system is proven, I like having the iris setting always visible.
Handspring Visor PDA
While I was developing the irradiance meter, I used a UART-USB bridge to monitor the output. If the meter is to be used with a laptop computer, this would work well.
I could have used an LCD 16x2 character display, but this didn't seem like an ideal solution. The ability to see more measurements and the ability to see the display in full sunlight were desirable.
I came across a Handspring Visor at the local thrift store. Some quick research revealed that a nice terminal emulator is available, and that the Handspring has a serial interface. The Handspring was still available when I returned to the thrift store, so I had a potentially nice output device. The Handspring supports wired serial as well as the IrDa (infrared data transmission) protocol. Turns out that this protocol is quite complex and is usually implemented using a specialized encoder/decoder chip. A wired connection appeared to be the best option.
A Google search found the pinout of the Handspring. The Handspring has a 3.3 volt serial interface - perfect for the 18F25K20 chip! The cradle supplied with the Handspring was a USB cradle. Since I didn't have a connector to fit the Handspring, adapting the cradle was the best bet.
Disassembling the cradle, I noticed the circuit board has a number of test point pads. Beeping them out against the needed connections showed that all of the pins were available. Thank you some design engineer someplace! Note that this is a USB cradle. Serial cradles are available, but they will convert the desirable 3.3v levels to RS-232 levels which is exactly what we don't want. I don't know if there are different versions of cradles, so check connections carefully if you use this idea.
* Connects to card bay only. Not used in this case.
** Pad at lower right corner of the board.
Note: ptelnet operates on most Palm PDAs, including Palm Tungsten units which feature an awesome color screen, SD-card support and even more features. The downside of the Tungsten models is that the conversion from low-voltage serial to RS-232 levels is internal to the unit. Using one of these with a micro-controller requires converting RS-232 levels back to low voltage. The battery life is also significantly shorter. The USB docking cradle for the Palm Tungsten T or Tungsten T3 is similar to that of the Handspring and has test pads for the needed signals.
The Handspring can transfer data to a PC for analysis, plotting and so on. Support for the Handspring has been discontinued in Windows Vista, but the Palm Desktop software works great on XP machines. There are some reported work-arounds for Vista but I have not investigated them.
The software for the irradiance monitor was written using the Amicus compiler. The PulseIn command to calculate the frequency of the TLS230R pulse stream made it easy calculate the light level. Floats were used to calculate the light level but the number of operations in a single line is limited, so it was necessary to break the equation down into several steps.
The data sheet shows a log-log graph of light level vs. frequency but unfortunately does not provide a simple equation for the relationship. I believe I have correctly figured it out but I don't have any way to calibrate it. It's order-of-magnitude correct based on solar irradiance reports.
Ee = frequency / 1000 * 0.77 * (output scaling) * (sensitivity/100) where
Ee = irradiance in µW/cm²
The DS18B20 section was lifted straight out of Graham's Amicus example.
Ptelnet supports the ISO Latin1 character set and VT-100 terminal emulation so formatting commands and special characters are included to get a nice display on the Handspring screen. These commands will probably be correct for most terminal emulators but may need to be changed for a particular output device.
Solar panels are relatively expensive even today. The question to be determined is how much solar panel efficiency can be improved using either fixed or adjustable reflectors. Even with the expense of additional support structures and control mechanisms, reflectors may boost panel efficiency enough to make the system practical.
This photo shows one of two panels (of what could be a 40 panel system!) installed for evaluating reflector options. The other panel is used as the control with no reflectors to judge the benefit of adding them. Plywood with white reflective roofing paint is being used for the initial tests but several other high tech (and costly) options are being considered. The irradiance meter will aid in testing and in adjusting reflectors for maximum effect.
Using the irradiance meter is simple. It has two modes of operation, continuous readings at a specified interval or readings only when a button is pressed. In either case, the readings are displayed on the Handspring screen and may be logged for later analysis. The Handspring screen displays irradiance, temperature and elapsed time. If the readings are logged, data is broken into 4 kbyte chunks and stored with a time stamp so the actual time of each reading can be determined.
When in continuous mode, pressing the trigger button prompts for the desired interval on the Handspring screen. This is entered using Grafitti on the touch screen. Grafitti isn't too difficult to use, especially just for numbers.
The ten-year-old technology of the Handspring really made this application practical and it's a great option to have for projects needing I/O. The irradiance sensor is easy to use with the Amicus compiler, although it wouldn't be much more difficult to write Swordfish code to support it.
The PIC18F25K20 is a nice part to use where battery operation is needed. A couple AA cells will supply power for a long period (even longer if I didn't insist on leaving an LED on!). For this prototype system, I didn't include any battery monitoring but the two sensors and the PIC will operate over most of the useful range of the batteries.
Finally, the Microchip dev boards are a great find. A reliable circuit for the TLS230R was built in short order.
Time will tell if the irradiance meter is helpful in the solar panel evaluation. It is interesting that my desk lamp is about 300 µW/cm² while bright sun is over 100,000!
Rob, in the photo below, doesn't seem too impressed by any of this....