Monthly Archives: July 2009

The Pentametric has arrived

The Bogart Pentametric arrived in the mail yesterday and I connected it to a 12V power supply in my study. Connecting it was straight forward following the wiring diagram printed on the cover of the input unit. The connectors are of high quality. After applying power I hooked it to the serial port of my PC using a standard serial cable. Using the PMComm software from the Bogart Engineering web site configuring the unit was very easy. Below is a picture of the setup. In the middle in the bottom is the Pentametric input unit and serial interface connected to the Atmel Xplain board. The Xplain board is connected to an nRF24LE1 evaluation board (left) through SPI and this board sends a radio packet with the measured data every second. To the right is the nRF24LE1 receiver board showing the battery voltage, 13.8V. The battery in this setup is a laboratory type power supply.

Pentametric input unit and computer interface (lower middle)

Pentametric input unit and computer interface (lower middle)

Instructions for communicating with Pentametric via the serial interface can be found in this document: How to access data via the RS232 port from the PentaMetric battery monitor.

I will post the full source code here after it is finished but here is a preview of the “short read” command:

bool pentametric_short_read(unsigned char a, unsigned char n, unsigned char *msg)
{
unsigned char crc, i;
putchar(usart_data_, 0×81);
putchar(usart_data_, a);
putchar(usart_data_, n);
crc = 0×81 + a + n;
putchar(usart_data_, ~crc);
crc = 0;
for(i=0;i<n;i++)
{
msg[i] = getchar(usart_data_);
crc += msg[i];
}
crc += getchar(usart_data_);
if (crc != 0xff)
return false;
return true;
}
bool pentametric_short_read(uint8_t a, uint8_t n, uint8_t *msg)
{
    uint8_t crc, i;

    putchar(usart_data_, 0x81);
    putchar(usart_data_, a);
    putchar(usart_data_, n);
    crc = 0x81 + a + n;
    putchar(usart_data_, ~crc);
    crc = 0;
    for(i=0;i<n;i++)
    {
        msg[i] = getchar(usart_data_);
        crc += msg[i];
    }
    crc += getchar(usart_data_);
    if (crc != 0xff)
        return false;
    return true;
}

Atmel xmega and the Xplain evaluation and demonstration kit

As written in the previous post I am going to use the Pentametric Battery Monitor to measure the current in/out of the batteries. This means that I need to move the control of my monitor system from nRF24LE1 to a more powerful board with more than one serial port. I have thought about this and have made up my mind to use an xmega  micro controller from Atmel. Mainly because I have used the AVR micro controllers in several projects in the past and that the xmega have many serial ports (USARTs). The ATxmega128A1 found on the xplain evaluation and demonstration kit has eight (!) USARTs. Pictured here is the xplain board connected to an nRFgo board via SPI:

Xplain and nRFgo motherboards

Xplain and nRFgo boards

Below is a basic diagram of the new system. On the USART on xmega side I will use MAX3232 RS232 Transceivers and on the SunSaver (SS) MPPT side I will use the Morningstar PC Meterbus Adapter that converts the SS RS485 bus to RS232. The Pentametric use a similar converter, the Bogart PM-100-C.
Basic block diagram of new system

Basic block diagram of new system

Wireless transmitter prototype board

Here is a picture of the new prototype board mounted in my tool shed. The nRF24LE1 module is the same but I have moved it from the nRFgo motherboard to a prototyping board. I have also added a LM317 voltage regulator and an RS232 driver.

nRF24LE1 module

nRF24LE1 module

I have also made up my mind to order the Pentametric Battery Monitor from Bogart Engineering and use it for current measurement instead of the circuit described below. The Pentametric has a computer interface that can be used to read out all data captured. This means I also need a micro controller with more than one serial port. More on that later.