Show Posts
Pages: 1 2 [3] 4 5 ... 42
31  Using Arduino / LEDs and Multiplexing / Re: Super Bright Red Led - BC547B Transistor, but which Resistors? on: September 05, 2012, 03:28:12 pm
It doesn't matter, I can do both, just wondering on what I could do with the stuff I already have that will get my ultra brightness.  smiley-mr-green
32  Using Arduino / LEDs and Multiplexing / Re: Super Bright Red Led - BC547B Transistor, but which Resistors? on: September 05, 2012, 03:18:31 pm
Can't I just use 2 x ULN2803 chips and 8 pins on the Arduino? (I don't need many free pins, only 4 for a multiplexer, and 2 for UART)
33  Using Arduino / LEDs and Multiplexing / Re: Super Bright Red Led - BC547B Transistor, but which Resistors? on: September 05, 2012, 03:11:36 pm
Sounds interesting, but how can I do that? Do you mind teaching me, pretty please? ;-) ;-)
34  Using Arduino / LEDs and Multiplexing / Re: Super Bright Red Led - BC547B Transistor, but which Resistors? on: September 05, 2012, 03:01:41 pm
:-p

Too bad I don't have those. But I will see if the local shop carries it... (doubt it)
35  Using Arduino / LEDs and Multiplexing / Re: Super Bright Red Led - BC547B Transistor, but which Resistors? on: September 05, 2012, 02:51:50 pm
I need it to be as bright as possible, since a plexy will go on top of the LEDs. ;-)
36  Using Arduino / LEDs and Multiplexing / Re: Super Bright Red Led - BC547B Transistor, but which Resistors? on: September 05, 2012, 11:39:02 am
But I guess using a 4x4 matrix will present less light brightness compared to the other solution, right?
37  Using Arduino / LEDs and Multiplexing / Re: Super Bright Red Led - BC547B Transistor, but which Resistors? on: September 05, 2012, 11:34:22 am
Oh, thanxs!

I got some ULN2803A here, would those work too?
38  Using Arduino / LEDs and Multiplexing / Re: Super Bright Red Led - BC547B Transistor, but which Resistors? on: September 05, 2012, 11:16:30 am
One thing I'm wondering is to just do a matrix of leds instead of using the shift c595 ic. Any ideas on that?

For 16 leds using the C595, I would need two x C595, a resistor + transistor + resistor for each led.

Now, for a 4 x 4 Led Matrix (total of 16 leds) connecting directly to each pin on the arduino, I would have 4 pins for the row and 4 pins for the column. Now, wouldn't I use less ICs? I know that I will need to use a timer to handle the leds, just like SparkFun did on the 4x4 Button SPI product.

Anyway, just brainstorming out loud ... ;-)
39  Using Arduino / LEDs and Multiplexing / Re: Super Bright Red Led - BC547B Transistor, but which Resistors? on: September 05, 2012, 10:09:53 am
Oops, actually they were called "5mm Red Ultra Bright" (I copied this from the purchase I made)

So they are like this:

http://www.ebay.com/itm/100pcs-OF-RED-5mm-ROUND-HEAD-ULTRA-BRIGHT-8000-mcd-/271047071506?pt=LH_DefaultDomain_0&hash=item3f1baa1712

FORWARD VOLTAGE: 2.3 VOLT
FORWARD CURRENT: 20 MA
40  Using Arduino / LEDs and Multiplexing / Re: Super Bright Red Led - BC547B Transistor, but which Resistors? on: September 05, 2012, 10:08:47 am
Perfect! I'm learning, thanks!  smiley-cool

One thing, how can I know the details of a LED? I bought in bulk, all I know is that they are super bright red leds. (I think they are 5mm, I could measure)

They look just like this one:

http://www.ebay.com/itm/100-Pcs-5mm-Red-Superbright-diffused-LED-Light-lamp-2-Pins-5000-6000-Mcd-/180967282597?pt=LH_DefaultDomain_0&hash=item2a227d97a5
41  Using Arduino / LEDs and Multiplexing / Re: Super Bright Red Led - BC547B Transistor, but which Resistors? on: September 05, 2012, 09:54:08 am
Thanks bud, and yes, its 5V, sorry I forgot to mention. ;-)

I also wonder if I could use 2 of those LEDs in series with the 5V supply?
42  Using Arduino / LEDs and Multiplexing / Super Bright Red Led - BC547B Transistor, but which Resistors? on: September 05, 2012, 08:57:24 am
Guys, hope someone could help me with the math, as I can't figure this out just yet.  smiley-red

I plan on using a BC547B NPN transistor to switch On/Off a Super Bright Red Led. But I need to know the resistor for the LED and the resistor for the Transistor. I plan on using a Shift Register (74HC595) to drive 16 Leds from the Arduino.

So, the 74HC595, each output pin goes to one BC547B Transistor base via a Resistor, and so on ... I can draw this if required, but you could also check this page out instead.

http://www.sqlskills.com/blogs/paulselec/post/Arduino-figuring-out-transistors-and-associated-resistors.aspx

I see he did reply about such question, but the transistor and led I'm using may be a bit different from what I see...

Thanks for any help.

Best Regards, WilliamK
43  Using Arduino / Project Guidance / 16 Touch Sensors - its working [code] but I wonder ... on: September 04, 2012, 02:34:42 pm
So, I wanted to push this tutorial to its limits, making 16 touch sensors (I'm using screws for that)

http://www.arduino.cc/playground/Code/CapacitiveSensor

And using a 16 channel analog multiplexer (this is the one I actually tested with)

https://www.sparkfun.com/products/299

So far so good, it works. But I just want to double check things out, to be sure it won't burn something after hours of usage. ;-)

Here's the test code I created, I'm just using an Arduino UNO + the multiplexer, nothing else. Thanks for any advice!  smiley-cool

Code:
#include "pins_arduino.h" // Arduino pre-1.0 needs this
volatile uint8_t* port;
volatile uint8_t* ddr;
volatile uint8_t* pin;
byte bitmask;
#define pinToMeasure 8
uint8_t values[16] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
uint8_t buttons[16] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
uint8_t buttonEvent[16] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; // 1 == normal push, 2 == hold push //
char printOut[16*2];
uint8_t counterIdle = 0;
#define oversample 8
#define sensitivity (4*oversample)

void setup()
{
  for (char x=2; x<12; x++) pinMode(x, OUTPUT);
  for (char x=2; x<12; x++) digitalWrite(x, LOW);
  Serial.begin(9600);
 
  port = portOutputRegister(digitalPinToPort(pinToMeasure));
  ddr = portModeRegister(digitalPinToPort(pinToMeasure));
  bitmask = digitalPinToBitMask(pinToMeasure);
  pin = portInputRegister(digitalPinToPort(pinToMeasure));
}

void loop()
{
  memset(values, 0, sizeof(values));
  for (uint8_t y=0; y<oversample; y++)
  {
    for (uint8_t x=0; x<16; x++)
    {
      digitalWrite(2, bitRead(x,0)); digitalWrite(3, bitRead(x,1));
      digitalWrite(4, bitRead(x,2)); digitalWrite(5, bitRead(x,3));
     
      values[x] += readCapacitivePin();
    }
  }

  uint8_t buttonchanged = 0;
  for (uint8_t x=0; x<16; x++)
  {   
    if (values[x] <= (sensitivity/2) && buttons[x] > 0)
    {
      if (buttons[x] < 99) { buttonEvent[x] = 1; buttonchanged = 1;  }
      buttons[x] = 0;
    }
    else if (values[x] > sensitivity && buttons[x] < 120)
    {
      buttons[x]++;
      if (buttons[x] == 99) { buttonEvent[x] = 2; buttonchanged = 1; }
    }
  }
 
  if (buttonchanged)
  {
    Serial.print(":");
    for (uint8_t x=0; x<16; x++)
    {
      if (buttonEvent[x] == 1) Serial.print("#:");
        else if (buttonEvent[x] == 2) Serial.print("@:");
        else Serial.print("_:");

        buttonEvent[x] = 0;
    }
    Serial.println("");
    counterIdle = 0;
  }
 
  counterIdle++;
  if (counterIdle > 100)
  {
    Serial.println("");
    counterIdle = 0;
  }
}


uint8_t readCapacitivePin()
{
  *ddr &= ~(bitmask); // Make the pin an input with the internal pull-up on
  *port |= bitmask;
  uint8_t cycles = 6;
  for(uint8_t i = 0; i < 6  ; i++)  // Now see how long the pin to get pulled up
  {
    if (*pin & bitmask){ cycles = i; break; }
  }
   
  *port &= ~(bitmask); // Discharge the pin again by setting it low and output
  *ddr  |= bitmask;

  return cycles;
}
44  Using Arduino / Audio / Re: Sampler - writing to the internal Flash and other crazy things. on: August 16, 2012, 02:06:02 pm
Indeed, I have to research more about external RAM, if its usable or not for sample-reading.
45  Using Arduino / Audio / Re: Sampler - writing to the internal Flash and other crazy things. on: August 16, 2012, 01:04:34 pm
Ahhh, is that so? Now I see why no lib has been done yet.  smiley-red  smiley-sad

Well, its was a nut idea anyway. ;-)

Maybe its just easier to interface with some small RAM chip instead? Reading from flash takes 2 cycles, so, if somehow we could read from an external RAM chip without much fuzz...
Pages: 1 2 [3] 4 5 ... 42