Show Posts
Pages: 1 [2] 3
16  Using Arduino / LEDs and Multiplexing / Re: LM1876 mute function on: January 11, 2013, 09:47:16 pm
@magician thanks! im using a split power supply, so that wont be a problem. 100kresistors it is then...
17  Using Arduino / LEDs and Multiplexing / LM1876 mute function on: January 11, 2013, 02:41:23 pm
hey guys

a very simple question;

i am waiting for my arduino MEGA to arrive in a few days.

i need to switch a bunch of LM1876's op amps on/off. they have mute pins that mute the signals passing through by receiving 5v!

so i figured i could use the arduino pins to switch the array of amps on/off.

however, my question is - do i need to put some kind of resistors inbetween or something to avoid drawing too much power/frying my arduino while muting 10+ LM1876's??

i should add, by default ALL AMPS WOULD BE MUTED AT THE SAME TIME - meaning id continuously be sending 5v through at least 10+ pins most of the time.

datasheet for the LM1876 can be found here ::

any thoughts would be greatly appreciated!

18  Using Arduino / General Electronics / Re: ebow HELP! on: August 02, 2012, 07:32:49 am
@ winner, that sounds like a great idea... could you show me a quick example schematic? 4 times the energy would suffice... it would help out a great deal for version 2 of the instrument!!!

@duane :: this is a prototype running on a piano -

here is a picture of the final instrument, and some sound as well...

acoustic recording -

live through 6 guitar amps, along with some processing, samples etc -
19  Using Arduino / General Electronics / ebow HELP! on: August 02, 2012, 06:33:45 am

last year i got a lot of help from you guys regarding an ebow circuit design. i ended up building a slightly modified 18v LM386-4 circuit like this ::

its an "electronic bow" for strings, basically a pickup and driver coil that feedback through a string, making it sustain a note for as long as the circuit is turned on. i made a micro-controlled electromagnetic harp that has 13 circuits like the above, switching strings on and off....

the project was great, but now i want to improve the circuit, and make it more powerful.

any thoughts on the TDA2030? i have it laying around, but don't really have the proper knowledge to implement it into a working design....

the LM386 distorted the signal a lot, and was only returning around 9v into the driver coil - resulting in very slow attacks on the tones of the string, or just no response at all.

the circuit needs to be compact to fit inside the new instrument, and not too expensive... powerful, for better response and less distortion.

any ideas? ANYTHING is helpful, my knowledge is limited, but im resilient as hell.

20  Using Arduino / Programming Questions / Re: capsense help on: January 20, 2012, 05:15:06 am
this really sounds like a great solution smokey!

what is cli and sei?

i am spending the afternoon trying this out, thanks so much!
21  Using Arduino / Programming Questions / Re: capsense help on: January 19, 2012, 04:10:08 pm
but i'm saying my hardware works fine if capsense is running as a separate sketch.

im trying to find out the conflict between my old patch and the capsense addition...
22  Using Arduino / Programming Questions / Re: capsense help on: January 19, 2012, 03:42:06 pm
any thoughts on how i could fix my code?

23  Using Arduino / Programming Questions / Re: capsense help on: January 18, 2012, 08:22:08 am
hey smoke

well, the code i implemented is copy/pasted from the tutorial you posted. when i run the tutorial by itself, the response is fine.

maybe the two libraries are having a conflict?

could anyone possibly point out some errors i've made?

24  Using Arduino / Programming Questions / capsense help on: January 17, 2012, 07:59:52 pm
hey guys

so im building an instrument with capacitive touch sensors for keys.
i have the amazing MPR121 capacitance breakout board and it works wonderfully.

however, it only enables me to get input from 12 electrodes. i need 13 for a full octave (c to c').

i downloaded capsense, and tried to implement the code into my pre-existing MPR sketch, and well - i do get input from the capsense button on the arduino - but the latency is around 1 second!

if you could help me out, and tell me why my code slows down like that - i would be a very happy person.

here is my messy code - capsense is //commented. MPR121 code is taken from


//#include <CapSense.h>
#include "mpr121.h"
#include <Wire.h>
#include <SimpleMessageSystem.h>

//CapSense   cs_19_15 = CapSense(2,3);

int irqpin = 12;  // Digital 12
boolean touchStates[12]; //to keep track of the previous touch states

void setup(){
  pinMode(irqpin, INPUT);
  digitalWrite(irqpin, HIGH); //enable pullup resistor


void loop(){
//    long tot = cs_19_15.capSense(30);
//  Serial.print(tot);
//  Serial.println("\t");
//  if(tot < 5000){
//    digitalWrite(13, LOW);
//  }
//  if(tot > 5000){
//    digitalWrite(13, HIGH);
//  }
//  delay(10);

  if (messageBuild() > 0) { // Checks to see if the message is complete and erases any previous messages
    switch (messageGetChar()) { // Gets the first word as a character
    case 'r': // Read pins (analog or digital)
      readpins(); // Call the readpins function
      break; // Break from the switch
    case 'w': // Write pin
      writepin(); // Call the writepin function



void readTouchInputs(){
    //read the touch state from the MPR121
    byte LSB = Wire.receive();
    byte MSB = Wire.receive();
    uint16_t touched = ((MSB << 8) | LSB); //16bits that make up the touch states

    for (int i=0; i < 12; i++){  // Check what electrodes were pressed
      if(touched & (1<<i)){
        if(touchStates[i] == 0){
          //pin i was just touched
          Serial.print("pin ");
          Serial.println(" was just touched");
            digitalWrite(i+2, HIGH);
            digitalWrite(13, HIGH);
        }else if(touchStates[i] == 1){
          //pin i is still being touched
        touchStates[i] = 1;     
        if(touchStates[i] == 1){

          Serial.print("pin ");
          Serial.println(" is no longer being touched");
            digitalWrite(i+2, LOW);
            digitalWrite(13, LOW);
          //pin i is no longer being touched
        touchStates[i] = 0;

void mpr121_setup(void){
  // Section A - Controls filtering when data is > baseline.
  set_register(0x5A, MHD_R, 0x01);
  set_register(0x5A, NHD_R, 0x01);
  set_register(0x5A, NCL_R, 0x00);
  set_register(0x5A, FDL_R, 0x00);

  // Section B - Controls filtering when data is < baseline.
  set_register(0x5A, MHD_F, 0x01);
  set_register(0x5A, NHD_F, 0x01);
  set_register(0x5A, NCL_F, 0xFF);
  set_register(0x5A, FDL_F, 0x02);
  // Section C - Sets touch and release thresholds for each electrode
  set_register(0x5A, ELE0_T, TOU_THRESH);
  set_register(0x5A, ELE0_R, REL_THRESH);
  set_register(0x5A, ELE1_T, TOU_THRESH);
  set_register(0x5A, ELE1_R, REL_THRESH);
  set_register(0x5A, ELE2_T, TOU_THRESH);
  set_register(0x5A, ELE2_R, REL_THRESH);
  set_register(0x5A, ELE3_T, TOU_THRESH);
  set_register(0x5A, ELE3_R, REL_THRESH);
  set_register(0x5A, ELE4_T, TOU_THRESH);
  set_register(0x5A, ELE4_R, REL_THRESH);
  set_register(0x5A, ELE5_T, TOU_THRESH);
  set_register(0x5A, ELE5_R, REL_THRESH);
  set_register(0x5A, ELE6_T, TOU_THRESH);
  set_register(0x5A, ELE6_R, REL_THRESH);
  set_register(0x5A, ELE7_T, TOU_THRESH);
  set_register(0x5A, ELE7_R, REL_THRESH);
  set_register(0x5A, ELE8_T, TOU_THRESH);
  set_register(0x5A, ELE8_R, REL_THRESH);
  set_register(0x5A, ELE9_T, TOU_THRESH);
  set_register(0x5A, ELE9_R, REL_THRESH);
  set_register(0x5A, ELE10_T, TOU_THRESH);
  set_register(0x5A, ELE10_R, REL_THRESH);
  set_register(0x5A, ELE11_T, TOU_THRESH);
  set_register(0x5A, ELE11_R, REL_THRESH);
  // Section D
  // Set the Filter Configuration
  // Set ESI2
  set_register(0x5A, FIL_CFG, 0x04);
  // Section E
  // Electrode Configuration
  // Set ELE_CFG to 0x00 to return to standby mode
  set_register(0x5A, ELE_CFG, 0x0C);  // Enables all 12 Electrodes
  // Section F
  // Enable Auto Config and auto Reconfig
  /*set_register(0x5A, ATO_CFG0, 0x0B);
  set_register(0x5A, ATO_CFGU, 0xC9);  // USL = (Vdd-0.7)/vdd*256 = 0xC9 @3.3V   set_register(0x5A, ATO_CFGL, 0x82);  // LSL = 0.65*USL = 0x82 @3.3V
  set_register(0x5A, ATO_CFGT, 0xB5);*/  // Target = 0.9*USL = 0xB5 @3.3V

boolean checkInterrupt(void){
  return digitalRead(irqpin);

void set_register(int address, unsigned char r, unsigned char v){

//commence max communication!

void readpins(){ // Read pins (analog or digital)

  switch (messageGetChar()) { // Gets the next word as a character

    case 'd': // READ digital pins

    messageSendChar('d');  // Echo what is being read
    for (char i=2;i<14;i++) {
      messageSendInt(digitalRead(i)); // Read pins 2 to 13
    messageEnd(); // Terminate the message being sent
    break; // Break from the switch

  case 'a': // READ analog pins

    messageSendChar('a');  // Echo what is being read
    for (char i=0;i<6;i++) {
      messageSendInt(analogRead(i)); // Read pins 0 to 5
    messageEnd(); // Terminate the message being sent



void writepin() { // Write pin

  int pin;
  int state;

  switch (messageGetChar()) { // Gets the next word as a character

    case 'a' : // WRITE an analog pin

    pin = messageGetInt(); // Gets the next word as an integer
    state = messageGetInt(); // Gets the next word as an integer
    pinMode(pin, OUTPUT); //Sets the state of the pin to an output
    analogWrite(pin, state); //Sets the PWM of the pin
    break;  // Break from the switch

    // WRITE a digital pin
  case 'd' :

    pin = messageGetInt();  // Gets the next word as an integer
    state = messageGetInt();  // Gets the next word as an integer
    pinMode(pin,OUTPUT);  //Sets the state of the pin to an output
    digitalWrite(pin,state);  //Sets the state of the pin HIGH (1) or LOW (0)


25  Using Arduino / General Electronics / Re: help with optocouplers on: January 16, 2012, 01:38:56 pm
hey grumps

here is what my schematic looks like right now, resulting in the puny 5v output from the opto::

i have a TIP120, and wanted to ask you - would this possibly solve my problem?

thanks for hanging in there...
26  Using Arduino / General Electronics / Re: help with optocouplers on: January 16, 2012, 07:34:55 am
hey grumpy

i dont really know... but here is the LM schematic

is it drawing too much current?
27  Using Arduino / General Electronics / Re: help with optocouplers on: January 16, 2012, 07:14:14 am
i am trying to switch 12v LM386amps on and off. so i'm guessing the optocoupler transistor side can't handle 12volts?

28  Using Arduino / General Electronics / help with optocouplers on: January 15, 2012, 05:51:14 pm
i am trying to switch a 12v current on and off using a 4n25 optocoupler.

12v are hooked up to the collector - but when i turn on the diode - the emitter will only give me around 5 volts. i tried switching power supplies, even gave it 24v, which resulted in a 7v output from the emitter...

i have a digital pin connected to a 220ohm resistor to the anode, cathode goes to arduino ground.

i don't think the resistor between the arduino and the 4n25 is too big, the led should light up nicely... so where is all my current going?

any help would be greatly appreciated!!

29  Using Arduino / Sensors / Re: MPR121 simulated 13th pin on: January 07, 2012, 06:52:24 am
im talking about the pins on the MPR, not the arduino...
30  Using Arduino / Sensors / MPR121 simulated 13th pin on: January 06, 2012, 05:02:39 pm
hi guys

just started rocking out with my mpr121... it's great!

however, the twelve pins are not enaugh.i am making a one octave keyboard (c - c') so i need 13 touch sensors.

i wanted to know if you guys could give me some tips on how to make a "simulated 13th pin"? stuff to read etc...

any help would be greatly appreciated!
thank you

Pages: 1 [2] 3