Arduino Drivers for Quad Power Management I2C Board Released

Arduino Drivers for Quad Power Management I2C Board IMG_5048Released

The Arduino C++ Class driver software for the new product from SwitchDoc Labs, the Quad Power Management Board, has been released.  This device just came out of a very successful (146% funded) Kickstarter campaign.

The Quad Power Management Board

The Quad Power Management Board (QPM) is a fabulous addition to our product line.  We have needed one of these for a long time.  Back when we were building Project Curacao, we were continually needing relays (mostly latching relays) to switch power on and off to computers and devices, to switch from solar to wind and a variety of other chores.  What a pain!  Now we have developed and designed a Quad Power Management board incorporating I2C controlled 4 Independent Solid State Relays each with LEDs to show what is going on with the board.  Each solid state relay is able to switch 20V and 2.3A.   You can switch DC signals and analog signals (with proper conditioning – you need to add a DC Offset for analog signals).
This board is magic  for building power systems. There are 4 Additional GPIOs provided on the board (thanks to the SX1502) that can be used as GPIOs, interrupts or a programmable logic gate as above.   Software drivers for Arduino and Raspberry Pi Included!
We are using this board extensively in our new  SunRover semi-autonomous robot design.   You will be seeing a series of articles on this robot in Raspberry Pi Geek magazine starting in the August issue.  The robot uses a total of 6 Quad Power Management boards to stack/unstack all the batteries and to switch the solar panels from one computer to another as well as switching other devices on and off, including the lasers.
And they are all controlled by an I2C bus!  No more massive use of GPIO pins for latching relays and other devices.

Here is the block diagram for the board:figure5

Features:

  • I2C controlled
  • 4 Independent Solid State Relays each with LEDs
  • Each is able to switch 20V and 2.3A
  • 4 Additional GPIOs
  • Software drivers for Arduino and Raspberry Pi Included!

 

10 Ohm 10W Load Resistor
Test Jig for QPM Board

Arduino Software Drivers are available here at https://github.com/switchdoclabs/SDL_Arduino_QPM

Here an example code for using the QPM board. It enables all four load switches (the solid state relays), and turns them on and off one at a time allowing you to track the LoadSwitch LEDs around the board.

// SDL_Arduino_QPM_Test
// Version 1.1 6/15/15

#include 
#include "SDL_Arduino_QPM.h"

SDL_Arduino_QuadPower QuadPower;

void setup() {
  

    Wire.begin();

    Serial.begin(9600);
    // put your setup code here, to run once:
  
  
    byte error, address;
    int nDevices;
  
    Serial.println("");
    Serial.println("--------------------------");
    Serial.println("SDL_Arduino_QPM_Test");
    Serial.println("Version 1.1");
    
    
    QuadPower.begin();

 
}

void loop() {
  
    byte value;
 
  // Enable Channels
  QuadPower.enablePowerChannel(QuadPower_POWER_CHANNEL_IO0, QuadPower_ENABLE);  
  QuadPower.enablePowerChannel(QuadPower_POWER_CHANNEL_IO1, QuadPower_ENABLE);
  QuadPower.enablePowerChannel(QuadPower_POWER_CHANNEL_IO2, QuadPower_ENABLE);
  QuadPower.enablePowerChannel(QuadPower_POWER_CHANNEL_IO3, QuadPower_ENABLE);
  
  QuadPower.setDirectionGPIOChannel(QuadPower_REG_IO7, QuadPower_OUTPUT);
  value = QuadPower.readGPIO();
  Serial.print("------>>>> Initial GPIO Value =");
  Serial.println(value, HEX);

    // turn on I07 too
    QuadPower.writeGPIO(0x80);
    
while (1)
  {
  

    
    Serial.println("----------------");
    // turn on I07 too
    QuadPower.writeGPIO(0x80);
    Serial.println("Turn on LSW0");
    QuadPower.setPowerChannel(QuadPower_POWER_CHANNEL_IO0, QuadPower_ON);
    delay(3000);
    QuadPower.setPowerChannel(QuadPower_POWER_CHANNEL_IO0, QuadPower_OFF);
        Serial.println("Turn on LSW1");
    QuadPower.setPowerChannel(QuadPower_POWER_CHANNEL_IO1, QuadPower_ON);
    delay(3000);
    QuadPower.setPowerChannel(QuadPower_POWER_CHANNEL_IO1, QuadPower_OFF);
        Serial.println("Turn on LSW2");
    QuadPower.setPowerChannel(QuadPower_POWER_CHANNEL_IO2, QuadPower_ON);
    delay(3000);
    
    // turn off I07 too
    QuadPower.writeGPIO(0x00);
    
    QuadPower.setPowerChannel(QuadPower_POWER_CHANNEL_IO2, QuadPower_OFF);
    Serial.println("Turn on LSW3");
    QuadPower.setPowerChannel(QuadPower_POWER_CHANNEL_IO3, QuadPower_ON);
    delay(3000);
    QuadPower.setPowerChannel(QuadPower_POWER_CHANNEL_IO3, QuadPower_OFF);

  }
  

}

The output of the code:

Test SDL_Pi_QPM Version 1.0 - SwitchDoc Labs
Sample uses 0x21 I2C Address
Cycles through all the four loadswitches Program Started at:2015-08-04 23:51:44
-----------------
('------>>>> Initial GPIO Value =', 0) ----------------
Turn on LSW0
Turn on LSW1
Turn on LSW2
Turn on LSW3
---------------- 
Turn on LSW0 
Turn on LSW1 
Turn on LSW2 
Turn on LSW3 
---------------- 
Turn on LSW0 
Turn on LSW1 
Turn on LSW2 
Turn on LSW3 
...