Raspberry Juice

From BitWizard Wiki
Revision as of 14:59, 2 June 2015 by Rew (talk | contribs) (→‎Use)
Jump to navigation Jump to search
The Raspberry Juice board


Overview

The Raspberry Juice serves as a power switch for the Raspberry Pi. This expansion board can turn the power on or off at a scheduled time. shop link

Specifications

The Juice always uses about 2mA/10mW. The board is rated for a maximum current of 1A.

Use

The Raspberry Juice can be found using I2C or SPI at address 0xA4, and has the following read ports: All times are in ms, and are 32 bits in size.

Port Returned value (in milliseconds)
0x20 Time until power off
0x21 Time until power on
0x30 button active 0: don't react to button press. 1: react to button press (default), others: undefined.
0x31 external input active 0: inactive (default), 1: active, others: undefined.
0x32 external input polarity 0: active low (default), 1: active high, others: undefined.
0x33 power set on/off state 0: off, 1: on, others: undefined.
0x38 button active powerupstate 0: don't react to button press. 1: react to button press (default), others: undefined.
0x39 external input active powerupstate 0: inactive (default), 1: active, others: undefined.
0x3a external input polarity powerupstate 0: active low (default), 1: active high, others: undefined.
0x3b power set on/off state powerupstate 0: off, 1: on, others: undefined.

Additionally, the following can be written to the Juice:

Port Effect
0x20 Set the time in milliseconds until power off
0x21 Set the time in milliseconds until power on
0x30 button active 0: don't react to button press. 1: react to button press (default), others: undefined.
0x31 external input active 0: inactive (default), 1: active, others: undefined.
0x32 external input polarity 0: active low (default), 1: active high, others: undefined.
0x33 power set on/off state 0: off, 1: on, others: undefined.
0x38 button active powerupstate 0: don't react to button press. 1: react to button press (default), others: undefined.
0x39 external input active powerupstate 0: inactive (default), 1: active, others: undefined.
0x3a external input polarity powerupstate 0: active low (default), 1: active high, others: undefined.
0x3b power set on/off state powerupstate 0: off, 1: on, others: undefined.

examples

So, for instance, writing 10000 to port 0x21 and 1000 to 0x20 will cut the power in 1 second, and then turn on the power 9 seconds later.

 bw_tool -I -D /dev/i2c-1 -a a4 -W 21:2710:i 20:3e8:i 

Note that bw_tool works with hexadecimal numbers. So 2710(hex) is 10000 decimal, and 3e8 is 1000 decimal.