Centipede Shield - also a contest!

great! this will make it easy for me to build a (hardly original nowadays) stepsequencer for drums. sort of like monome but 4 rows with 16 steps (using something like the sparkfun 4x4 button pads (not allowed to post that here)). there will be 16 rotary encoders, how to use them is something i'll still have to figure out for myself, but i guess it should even be possible using two of these shields!

This shield could be ideal for a fancy wall mounted analog clock: 60 outputs which drive 60 leds (for example, high brightness, white leds). One led for each minute (6 degrees), closing the circle. Leds are soldered in order to project each light beam almost parallel to the wall surface (it's preferable to use very narrow beam leds).
The project is very, very simple, since the software must basically drive in a very clever manner 60 different outputs (2 pushbutton inputs for time setting and/or IR input to do the same job).
The hardware part is also quite simple: if we don't want to rely on Arduino clock settings, we only need to add an RTC to the Arduino in order to keep the time as stable as possible. For the code, it's up to our fantasy to find a way to display the time. Some ideas:

  1. All leds are powered off except led (or group of 2, 3, 4 or more) to show the hour; slow blinking led (or group) to show the minutes and optionally fast blinking led (leds) to show seconds;
  2. All leds are powered on (pay attention to maximum sink/source current from IC) and 2 different blinking rates to show hours and minutes: this way the clock could be used also as a very original wall mounted lamp/clock!
  3. More ideas, please! (consider that you can find other purposes for this gadget, not only a clock, but: countdown timer, analog thermometer, vu-meter, whichever-physic-environmental-variable-meter...)

Hi!

I find this perfect for application in driving all the indicators and switches on the overhead panel of a home-built flight simulator for a B373-700 airplane.

Usually you need to run a rats nest (hundreds) of cables to the IO board located elsewhere in the electronics bay.

Using this, with a local power supply, a simple two or three wire cable is all that is needed

All the best
Tom

I have an old electric-air-blower-powered organ, with several octaves and a chord section, which works by opening/closing holes in a large box (picture a saxophone's key mechanisms).

I'd like to retrofit it with lots of solenoids for pushing the buttons, and interface it to MIDI via an Arduino.

Your Centipede Shield should provide enough outputs to do it right, with a few pins left over for control buttons and an LCD display!

I am going to be building a custom EEG/EMG monitor. I need multiple channels so I can monitor the electrical activity of various areas of the brain and muscles I'm studying.

This many I/O inputs would allow me to increase my ability to monitor and interpret the electrical impulses from a variety of sources at the same time.

I had an idea for a "distributed production" alphanumeric electronic demonstration sign. the idea is demonstrators get a kit in the mail containing precut led strips and wire, and construct a 2X4 foot 14-segment alphanumeric 1-character sign. the wires all go out to a plug at the bottom. Now - one guy comes out with the same sign, but he also has the control board - arduino+centipede, to control all 5 signs (incl. power supply and switching with uln2003) , and end up with a 5-letter, 10X4 foot electronic sign! I know this does not make use of the input and only uses the centipede as an output expansion, and I know that for the same price I can almost get an arduino mega (which is good for 4 1-letter signs) , but I still want it!
I also discussed this with some guys from graffiti research lab (google it) and they were cautiously interested.

diagram will be up soon. thanks for reading!

Tomas: This won't help you in the contest, but you may want to suggest it to the GRL gang....

Instead of LED signs and lots of wires, put the 14-segment displays on the backs of jackets, using EL wire, powered by batteries, uniquely labeled with a QR code patch on the front (where it's harder to see mid-demo), and control it though an iPhone app. Once enough of these are floating around, you could do impromptu flash-mob signage.

Lots of good ideas so far, glad so many of you think this might work for your projects.

Based on the entries so far, I want to clarify a few things.

PWM may be possible, but probably not too accurate over I2C. I would say that if you're controlling LEDs, you should plan to just have them either on or off. The same goes for LED matrix driving...it could work, but there are probably better and more reliable ways.

Since these are general purpose I/O, I'd like to see at least some mixing of functions. Input-only and output-only are valid uses for this board, but don't exploit any advantages this would have over some shift registers.

I am also paying a lot of attention to how the entries are written, and really appreciate the ones with full details and examples of what you've already done to work on the project. From these posts, it's pretty easy to tell when someone knows what they're doing, and has the ability and motivation to follow through. I would really like to get feedback on these and not have them sit on a shelf until the Arduino is obsolete. If any of you want to expand on your project a little more, that's fine. Feel free to post more details, as long as you get them in by Friday the 13th they'll be included in the overall decision.

Thanks to everyone so far....

Consider mine withdrawn.

I needed more I/O which the Centipede could give me

But i also need more room for my program so i am upgrading to the Maple (http://leaflabs.com/Maple)

and that will give me the I/O needed also. But if i need more i can add your board on later.

i'm intending to make a hologram generator using the pesistence of vision concept.

its going to consist of two 256x256 RGB matrices (think big, might get at least a small part of it right :wink: ) mounted on a axel (1800rpm+) as shown in a rough top down sketch.....(gimp is not a friendly alternative to MSpaint, but i not complaining :-/ )

i intend it to show 3D renders at 30fps min when complete.... so i guess the shift register nature of the centipede wil be useful...

[edit] sketch after break...

To make it easier to understand what's going on, I created a simple library for the Centipede Shield. It could also be used as-is to control any MCP23017 chip. Right now it makes the Centipede I/O work like the normal Arduino I/O. More specialized functions are not implemented yet.

Download zipped library here

Example code using the Centipede library:

// Example code for Centipede Library
// Works with Centipede Shield or MCP23017 on Arduino I2C port

#include <Wire.h>
#include <Centipede.h>

/* Available commands
  .digitalWrite([0...63], [LOW...HIGH]) - Acts like normal digitalWrite
  .digitalRead([0...63]) - Acts like normal digitalRead
  .pinMode([0...63], [INPUT...OUTPUT]) - Acts like normal pinMode
  .portWrite([0...3], [0...65535]) - Writes 16-bit value to one port (device)
  .portRead([0...3]) - Reads 16-bit value from one port (device)
  .portMode([0...3], [0...65535]) - Write I/O mask to one port (device)
  .init() - Sets all register to initial values

  Examples
  CS.init();
  CS.pinMode(0,OUTPUT);
  CS.digitalWrite(0, HIGH);
  int recpin = CS.digitalRead(0);
  CS.portMode(0, 0b0111111001111110);
  CS.portWrite(0, 0b1000000110000001);
  int recport = CS.portRead(0);
*/

Centipede CS; // create Centipede object

void setup()
{
  Wire.begin(); // start I2C

  CS.initialize(); // set all register to default

  CS.portMode(0, 0b0000000000000000); // set all pins on port 0 to output

}


void loop()
{
  
  CS.digitalWrite(0, HIGH); // write A0 high
  CS.digitalWrite(15, LOW); // write B7 low
  delay(150);
  
  CS.digitalWrite(0, LOW); // write A0 low
  CS.digitalWrite(15, HIGH); // write B7 high
  delay(150);
  
}

Centipede.h:

// Centipede Shield Library
// Controls MCP23017 16-bit digital I/O chips

#ifndef Centipede_h
#define Centipede_h

#include "WProgram.h"

extern uint8_t CSDataArray[2];

class Centipede
{
      public:
                  Centipede();
            void pinMode(int pin, int mode);
            void digitalWrite(int pin, int level);
            int digitalRead(int pin);
            void portMode(int port, int value);
            void portWrite(int port, int value);
            int portRead(int port);
            void initialize();
      private:
            void WriteRegisters(int port, int startregister, int quantity);
            void ReadRegisters(int port, int startregister, int quantity);
            void WriteRegisterPin(int port, int regpin, int subregister, int level);
};

#endif

Centipede.cpp:

// Centipede Shield Library
// Controls MCP23017 16-bit digital I/O chips

#include "WProgram.h"
#include "Centipede.h"
#include <Wire.h>

uint8_t CSDataArray[2] = {0};

#define CSAddress 0b0100000


Centipede::Centipede()
{
  // no constructor tasks yet
}

// Set device to default values
void Centipede::initialize()
{

  for (int j = 0; j < 4; j++) {

    CSDataArray[0] = 255;
    CSDataArray[1] = 255;

    WriteRegisters(0, 0x00, 2);

    CSDataArray[0] = 0;
    CSDataArray[1] = 0;

    for (int k = 2; k < 0x15; k+=2) {
      WriteRegisters(j, k, 2);
    }

  }

}


void Centipede::WriteRegisters(int port, int startregister, int quantity) {

  Wire.beginTransmission(CSAddress + port);
    Wire.send(startregister);
    for (int i = 0; i < quantity; i++) {
      Wire.send(CSDataArray[i]);
    }
  Wire.endTransmission();

}

void Centipede::ReadRegisters(int port, int startregister, int quantity) {

  Wire.beginTransmission(CSAddress + port);
    Wire.send(startregister);
  Wire.endTransmission();
  Wire.requestFrom(CSAddress + port, quantity);
  for (int i = 0; i < quantity; i++) {
    CSDataArray[i] = Wire.receive();
  }

}


void Centipede::WriteRegisterPin(int port, int regpin, int subregister, int level) {

  ReadRegisters(port, subregister, 1); 
  
  if (level == 0) {
    CSDataArray[0] &= ~(1 << regpin);
  }
  else {
    CSDataArray[0] |= (1 << regpin);
  }
  
  WriteRegisters(port, subregister, 1);
  
}

void Centipede::pinMode(int pin, int mode) {
  
  int port = pin >> 4;
  int subregister = (pin & 8) >> 3;

  int regpin = pin - ((port << 1) + subregister)*8;

  WriteRegisterPin(port, regpin, subregister, mode ^ 1);
  
}

void Centipede::digitalWrite(int pin, int level) {
  
  int port = pin >> 4;
  int subregister = (pin & 8) >> 3;

  int regpin = pin - ((port << 1) + subregister)*8;

  WriteRegisterPin(port, regpin, 0x12 + subregister, level);
  
}

int Centipede::digitalRead(int pin) {

  int port = pin >> 4;
  int subregister = (pin & 8) >> 3;

  ReadRegisters(port, 0x12 + subregister, 1);

  int returnval = (CSDataArray[0] >> (pin - ((port << 1) + subregister)*8)) & 1;

  return returnval;

}

void Centipede::portMode(int port, int value) {
  
  CSDataArray[0] = value;
  CSDataArray[1] = value>>8;
  
  WriteRegisters(port, 0x00, 2);
  
}

void Centipede::portWrite(int port, int value) {
  
  CSDataArray[0] = value;
  CSDataArray[1] = value>>8;
  
  WriteRegisters(port, 0x12, 2);
  
}

int Centipede::portRead(int port) {

  ReadRegisters(port, 0x12, 2);

  int receivedval = CSDataArray[0];
  receivedval |= CSDataArray[1] << 8;

  return receivedval;  

}

It does look very simple to control things with.

Now my project.

I am doing a visualiser with the lasers I recently bought off ebay and a load of solenoids.

The lasers are pointed in a line and hinged at one end so that they can move the laser point up and down. They are all sprung so they move back into a line if moved. When audio is inputted, it is analysed and causes solenoids to strike under the lasers, bouncing the laser up, creating an upwards series of lines on the wall/surface.

This will also be implemented with a number of pots (into arduino analog pins) and a load of push buttons for creating your own midi music and altering sounds, settings etc. and of course a load of LEDs for good measure. :smiley:

And another project:

I am looking to sync a load of led bargraph modules (the ones with loads of led bars) for a number of projects, I would like to use some for a visualiser, displays for monitoring my pc (CPU usage, temp, hard drive usage, net download speed etc).

A giant led matrix is something everyone wants to do so I am looking to do one of those as well. Would I need transistors on each line? What is the max current on each pin?

I basically think it would be an infinitely useful board for a whole load of projects.

Mowcius

Liking a lot of the entries so far, but it's still anybody's game...you've got all day tomorrow to post your idea and possibly get a free Centipede Shield!

I now have another project I would like to use it for:

I am currently in the process of making an iron man suit for children in need (next friday). Due to not thinking of it sooner I am only currently doing the arc reactor and one arm with repulsor/fight stabiliser (lack of time to do more). Afterwards, I would like to make more of it, a second arm, the boots... (all of the internals, not the main body shell) but will run out of i/o pins of the arduino for solenoids/servos/leds etc.

I will be posting up pictures of the arm and arc reactor on the forums in the next week so keep a look out for them! :smiley:

Mowcius

well just to elaborate on mine.

I plan to build a midi controller keyboard with more than one octave, probably a full set, and have controls on it like pitch and such on an analogue stick.

the main thing will be the inputs for all the keys, but also led playback on the keys from the pc.

Cheat ! ;D

The contest has finished now...

Who has won? :smiley:

Mowcius

ok macegr,

i want to make a self balancing robotics platform. something where i have two legs, sensors for input of gravity/force/tilt/intertia/IR/Vision/Encoder positioning and output motor control for servos or linear actuators. With the arduino, it would be simple to load different libraries for 2 legs or 4 or hexapod walkers, but we would be able to add enough sensor IO for the system to co-ordinate and 'evolve' a better balance then could be programmed. Same for walking gates. routines could be loaded and tuned from live sensor data. Once this is done, it can become a small standarized system for robotics rollouts whether it be with wheels or legs or a virtual body. they key is plenty of IO channels and some efficient slick coding. I hope this expansion of details explains a little better what i want to do.

Just an update: checking through all the entries and will be announcing the winners soon!

Sounds good :smiley:

Mowcius