News:

To visit MidNite Solar click this link www.midnitesolar.com

Main Menu

tech info

Started by dgd, July 20, 2015, 06:23:16 PM

Previous topic - Next topic

dgd

Midnite,

Is there any interfacing and tech info available for the WBjr?
I'm considering the idea of connecting it directly to a computer such as RPi or Arduino.
If this can be done I'd rather spend the $ on it rather than design and build a suitable A to D converter for a shunt.

dgd
Classic 250, 150,  20 140w, 6 250w PVs, 2Kw turbine, MN ac Clipper, Epanel/MNdc, Trace SW3024E (1997), Century 1050Ah 24V FLA (1999). Arduino power monitoring and web server.  Off grid since 4/2000
West Auckland, New Zealand

zoneblue

#1
You might be able to find a current shunt amplifier breakout, something like this:
http://www.adafruit.com/products/904 (you remove the built in shunt resister and wire it to the external shunt).

Thats high side, but you will need low side, and bi directional as well. The birectional current amplifiers have two  amps configured in opposite parallel. 

Such a chip is in these sort of things too: http://www.ebay.com/itm/181149100016  .Should be pretty easy to hack one of those to do the job.

If you do decide to build something (should be pretty simple), this app note is a good place to start.
http://www.linear.com/docs/12479

6x300W CSUN, ground mount, CL150Lite, 2V/400AhToyo AGM,  Outback VFX3024E, Steca Solarix PL1100
http://www.zoneblue.org/cms/page.php?view=off-grid-solar

dgd

Thanks for that ZB. I have a few of the INA219 devices from Ebay and they interface easy to Arduino.
I am interested in the WBjr because I bought several of them last year but when Classics arrived they already had Wbjr included
so now they are spare. Also recovered some Deltec 100A shunts from Cisco router power units so the though was to use these
with a WBjr for multi channel current monitoring

dgd
Classic 250, 150,  20 140w, 6 250w PVs, 2Kw turbine, MN ac Clipper, Epanel/MNdc, Trace SW3024E (1997), Century 1050Ah 24V FLA (1999). Arduino power monitoring and web server.  Off grid since 4/2000
West Auckland, New Zealand

brad.midnite

You would need to breadboard a circuit or design a PCB to talk to the Wb Jr. If you're comfortable doing that, it's not too hard to plug in an oscilloscope and take a look at the signals.

Your main problem to work with is the communication is non-standard and at higher voltages than Rpi/Arduino will tolerate. The second problem you have is that the WbJr is a single-wire interface. There is half-duplex communication and power transfer from the Classic/Kid to the WbJr.

So it will be a bit of work to interface them. It may not be worth your time.

-Brad

dgd

Thanks Brad..
the interface level shifting to 3.3v logic for the Arduino does not concern me, neither does the single wire interface that does power supply and signalling. They are easy to deal with.
I was looking for the format/content of the repeating digital data packet that the WBjr sends and any timing/data rate info

dgd
Classic 250, 150,  20 140w, 6 250w PVs, 2Kw turbine, MN ac Clipper, Epanel/MNdc, Trace SW3024E (1997), Century 1050Ah 24V FLA (1999). Arduino power monitoring and web server.  Off grid since 4/2000
West Auckland, New Zealand

brad.midnite

The WbJr works based on a one-wire interface. To speak to it, you'll need to level-shift from your arduino/Pi voltages to approximately 0/15 Volts, though it can run at a slightly lower voltage.

It's more tricky than that because your output must be three-state, it must be active-high, active-low, and passive (high impedance). This is so that the Whizbang Jr can seize the line and respond to your device. Beyond the level-shifting, the Whizbang Jr uses typical asynchronous serial to pass data between the host/client. It is however at a non-standard 2500 baud (convenient to use with a 2Mhz clock).

The basic idea is for the host to put the line in an active-high state for a period of time, say 50-70ms. This charges up the electrolytic capacitor on the WbJr. Then you must send a valid single-byte command, and immediately afterwards put the line in a passive, high-impedance state. Again, so the WbJr may seize the line.

The Whizbang Jr then responds by pulling the line up to its capacitor voltage or letting it drop to ground. The packet lengths are small, just a few bytes. The host must then bring the line back into an active-high state to recharge the WbJr's capacitor. You can do this about 10 times/second, limited mostly by the ADC's maximum sample rate.

The command bytes are all of the form 0x?5 where ? is a variable hex nibble.

0x05
   Request Current/Temperature information, ADC Gain = 1
0x15
   Request Current/Temperature information, ADC Gain = 2
0x25
   Request Current/Temperature information, ADC Gain = 4
0x35 and 0x55
   Request Current/Temperature information, ADC Gain = 8

This returns the following:
   ADC High Byte
   ADC Low Byte
   Temperature + 50 (unsigned, in Celsius units).
   CRC Checksum

Note: A gain of 8 is what's used normally with a normal 50mV shunt. This provides resolution of approximately 79mA.

0x45:
   Request raw (non-translated) NTC sensor reading (temperature).
   Returns high adc byte, low adc byte, and crc value.

0x65:
   Resets malfunction status (if error no-longer exists, device animation and operation will return to normal).
   Returns 1 followed by CRC

0x75:
   Returns clock trim byte and nibble. The WbJr trims its clock-speed to increase the asynchronous serial reliability.
   Returns trim value and CRC byte.

0x85:
   Enable Rick Mode (disables the normal 5 second blink, does not disable error LED animations).
   Returns 1 followed by CRC

0x95:
   Disable Rick Mode (back to normal behavior)
   Returns 1 followed by CRC

0xA5
   Returns 0x000000 plus CRC. This was going to be a unique identifier but we decided not to implement it.

0xB5
    Returns the upper 24-bits of a unix time stamp and a crc byte. This will report the time-stamp of device programming and test within    about 5 minutes.

0xC5
    Returns software version number (byte), hardware version number (byte), and crc

0xD5
    Returns status byte (0 for normal) and crc byte

0xE5
    Returns 0x55, 0x55, 0x55 and a crc byte. Intended for debugging during development.

0xF5
     Similar to the main current-measurement commands but the third byte, instead of temperature in celcius, is an unsigned up-counter  which overflows. This was meant for debugging dropped packets.

The CRC Byte is a standard 8-bit CRC. Its polynomial is: x^8 + x^2 + x + 1. The byte sent from the host and all responding bytes (minus the CRC byte itself) are included in this calculation.

-Brad









dgd

Thanks Brad, just what I needed

Dgd
Classic 250, 150,  20 140w, 6 250w PVs, 2Kw turbine, MN ac Clipper, Epanel/MNdc, Trace SW3024E (1997), Century 1050Ah 24V FLA (1999). Arduino power monitoring and web server.  Off grid since 4/2000
West Auckland, New Zealand