Frequently Asked Question

WHIZBANG JR - Technical Information
Last Updated 6 years ago

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

Please Wait!

Please wait... it will take a second!