Saturday, November 7, 2009

the sbx 16x4x3 files

introduction to the 16x4x3





this post assumes that you have *some* very basic knowledge of electronics and programming. if not, google is your best friend, it is really easy to learn!


the 16x4x3 is a chase light step sequencer, capable of sequencing 12 voices. additionally it has 4 shift buttons which control different functions and 2 potentiometers. but first of all, its just a box with buttons and lights. the 16x4x3 is based on the
arduino, a great open source / open hardware micro controller.
the arduino is used to read button and potentiometer/mode-selector data thru its analog inputs and to control the led´s thru its digital outputs. the actual sequencing is happening inside a max/msp patch. the reason for this, is that it allows us to easily change the functionality of the box and not bounding it to one firmware.

as we want to connect 20 buttons, 2 potentiometers
and a 12 scale mode-selector, we need a total of 34 inputs. additionally, we want to control 20 led´s, so we need 20 digital outputs. the arduino has 6 analog inputs and 14 digital inputs/outputs, which is obviously not enough, so we are going to use five
4051 analog multiplexers to multiply our analog inputs and create a total of 40 inputs, and three 595 shift registers to multiply our digital outputs and create a total of 24 outputs.

data sheet, info and arduino tutorial of the 4051 multiplexer


data sheet, info and arduino tutorial of the 595 shift register

daisy-chaining five 4051´s for button input schematics(click for larger view):







daisy-chaining three 595´s for led control schematics(click for larger view):








the arduino code:

// credits and respect to Sebastian Tomczak (little scale)
// for all the useful information and help ive found in his blog
// during the 16x4x3 project. openskinnerbox 2009

int latchPin = 8;
int clockPin = 12;
int dataPin = 11;

byte data1;
byte data2;
byte data3;
byte data;

void setup() {

Serial.begin(57600);
DDRD = B00011110;
pinMode(latchPin, OUTPUT);
}

void loop() {
for(int i = 0; i < 40; i++) {

PORTD = (i % 8) << 2;

data = (analogRead(i / 8)) / 4;

Serial.print(data);
}
delay(5);
if(Serial.available() > 2) {

data1 = Serial.read();

data2 = Serial.read();

data3 = Serial.read();

digitalWrite(latchPin, 0);

shiftOut(dataPin, clockPin, data1);

shiftOut(dataPin, clockPin, data2);

shiftOut(dataPin, clockPin, data3);

digitalWrite(latchPin, 1);

}

}

void shiftOut(int myDataPin, int myClockPin, byte myDataOut) {

int i=0;

int pinState;

pinMode(myClockPin, OUTPUT);

pinMode(myDataPin, OUTPUT);

digitalWrite(myDataPin, 0);

digitalWrite(myClockPin, 0);

for (i=7; i>=0; i--) {

digitalWrite(myClockPin, 0);

if ( myDataOut & (1<<i) ) {

pinState= 1;

}

else {

pinState= 0;

}

digitalWrite(myDataPin, pinState);

digitalWrite(myClockPin, 1);

digitalWrite(myDataPin, 0);

}

digitalWrite(myClockPin, 0);

}



12 comments:

  1. Hi, Im interested in putting up together this sequencer but I noticed that in these two schematics none of the potentiometer's appear... so I was wondering if you could send me the rest of the schematics please?
    ivanefc@hotmail.com

    Thank You! :D

    ReplyDelete
  2. hi,i love good sequencers and this one is absolutely my favorite.I would make one for myself but in your schematic I do not see schematic for potentiometer/mode-selector.
    would you be kind to send me a rest of the schematic.
    my mail is tomislav.vision@gmail.com ,best regards Tomislav.

    ReplyDelete
  3. Very efficiently written information. It will be valuable to everyone who uses it, including myself. Thanks a lot. Real estate lawyer Vaughan The services provided by Gaur Law include the drafting of wills, creating financial trusts, administering trusts and estates, tax planning advice and the creation of power of attorney.

    ReplyDelete
  4. Excellent post. Have a look on our unbiased reviews on essay related help, using different sites to get reliable analysis of academic websites.


    Carpet Cleaning Machine

    ReplyDelete
  5. Thanks for sharing in detail. Your blog is an inspiration! Apart of really useful tips, it's just really ! This post will be effectively Just about everything looks good displayed. Anthony Mastrogiannis is an expert compensation lawyer in Sydney and surrounding areas.
    ------------------------
    Lawyer wollongong

    ReplyDelete
  6. Can you please send by e-mail me the code for this script or please tell me in detail concerning this script?
    Vila sol property for sale

    ReplyDelete
  7. Pleasant post and right to the point. I am not certain if this is really the best place to ask however do you parents have any ideea where to contract some expert scholars? Much obliged ahead of time.
    Real estate listings portugal

    ReplyDelete
  8. It’s my first pay a visit to this web site, and I am in fact surprised to see such a fastidious feature YouTube video posted at this point. Logistics and freight forwarding software in USA

    ReplyDelete
  9. Expected to form you an almost no word to thank you once more with respect to the decent proposals you've contributed here.
    Broken storage heater

    ReplyDelete
  10. your blog is great full and image is nice use,you use a different type content the topic is very much demand today and everyone wants to read about it thanks you so much.

    ----------------------
    Brother Embroidery Machines

    ReplyDelete
  11. It's generally so sweet furthermore loaded with a great deal of good times for me by and by and my office associates to look your online journal at least thrice in a week to see the new direction you have.
    2 bed Apartment Lagos

    ReplyDelete
  12. Good line and nice image this post. this post will be effectively Just about everything looks good displayed thanks for sharing.

    -----------------------
    Online form generator

    ReplyDelete