Show Posts
Pages: 1 2 [3] 4 5 ... 10
31  Using Arduino / Networking, Protocols, and Devices / Re: TLC5940 and Ethernet Shield using SPI on: March 06, 2013, 12:26:02 pm
so is it out of the question to choose a different pin than D10 for the ethernet slave select?
32  Using Arduino / Networking, Protocols, and Devices / Re: TLC5940 and Ethernet Shield using SPI on: March 06, 2013, 12:17:44 pm
so i just looked through all of the library files and i cant seem to find where to change the BLANK pin number, unless i'm missing somewhere simple...
33  Using Arduino / Networking, Protocols, and Devices / Re: TLC5940 and Ethernet Shield using SPI on: March 06, 2013, 11:48:07 am
yeah it is used by the tlc5940.  it is connected to the blank pin on the tlc although im not sure what that does exactly.
if i move it over to another pin for the tlc5940, wont i have to edit the library or something like that to accommodate for a change like that?
34  Using Arduino / Networking, Protocols, and Devices / Re: TLC5940 and Ethernet Shield using SPI on: March 06, 2013, 11:39:05 am
its connected exactly as described in the tlc5940 libary demo "BasicUse".  ie:
Code:
/*
    Basic Pin setup:
    ------------                                  ---u----
    ARDUINO   13|-> SCLK (pin 25)           OUT1 |1     28| OUT channel 0
              12|                           OUT2 |2     27|-> GND (VPRG)
              11|-> SIN (pin 26)            OUT3 |3     26|-> SIN (pin 11)
              10|-> BLANK (pin 23)          OUT4 |4     25|-> SCLK (pin 13)
               9|-> XLAT (pin 24)             .  |5     24|-> XLAT (pin 9)
               8|                             .  |6     23|-> BLANK (pin 10)
               7|                             .  |7     22|-> GND
               6|                             .  |8     21|-> VCC (+5V)
               5|                             .  |9     20|-> 2K Resistor -> GND
               4|                             .  |10    19|-> +5V (DCPRG)
               3|-> GSCLK (pin 18)            .  |11    18|-> GSCLK (pin 3)
               2|                             .  |12    17|-> SOUT
               1|                             .  |13    16|-> XERR
               0|                           OUT14|14    15| OUT channel 15
    ------------                                  --------

    -  Put the longer leg (anode) of the LEDs in the +5V and the shorter leg
         (cathode) in OUT(0-15).
    -  +5V from Arduino -> TLC pin 21 and 19     (VCC and DCPRG)
    -  GND from Arduino -> TLC pin 22 and 27     (GND and VPRG)
    -  digital 3        -> TLC pin 18            (GSCLK)
    -  digital 9        -> TLC pin 24            (XLAT)
    -  digital 10       -> TLC pin 23            (BLANK)
    -  digital 11       -> TLC pin 26            (SIN)
    -  digital 13       -> TLC pin 25            (SCLK)
    -  The 2K resistor between TLC pin 20 and GND will let ~20mA through each
       LED.  To be precise, it's I = 39.06 / R (in ohms).  This doesn't depend
       on the LED driving voltage.
    - (Optional): put a pull-up resistor (~10k) between +5V and BLANK so that
                  all the LEDs will turn off when the Arduino is reset.

    If you are daisy-chaining more than one TLC, connect the SOUT of the first
    TLC to the SIN of the next.  All the other pins should just be connected
    together:
        BLANK on Arduino -> BLANK of TLC1 -> BLANK of TLC2 -> ...
        XLAT on Arduino  -> XLAT of TLC1  -> XLAT of TLC2  -> ...
    The one exception is that each TLC needs it's own resistor between pin 20
    and GND.

    This library uses the PWM output ability of digital pins 3, 9, 10, and 11.
    Do not use analogWrite(...) on these pins.

    This sketch does the Knight Rider strobe across a line of LEDs.

    Alex Leone <acleone ~AT~ gmail.com>, 2009-02-03 */
35  Using Arduino / Motors, Mechanics, and Power / Re: Computer PSU and Arduino on: March 06, 2013, 11:25:55 am
nobody??
36  Using Arduino / Networking, Protocols, and Devices / Re: TLC5940 and Ethernet Shield using SPI on: March 06, 2013, 11:24:54 am
haha good point! i was wondering why nobody was responding.  I was unsure if the two devices would be able to work together because they both use SPI.  Posted below now is my code:
Code:
#include <Tlc5940.h>
#include <tlc_animations.h>
#include <tlc_config.h>
#include <tlc_fades.h>
#include <tlc_progmem_utils.h>
#include <tlc_servos.h>
#include <tlc_shifts.h>
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>

byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192, 168, 1, 200);
unsigned int localPort = 8888;  // local port to listen on
char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,
EthernetUDP Udp;
int packetSize;

char Buffer[9];

char handshake;
char command_type;
char command_pin0;
char command_pin1;
char terminator;
int digit1;
int digit2;
int digit3;
int digit4;
int in_value;
int pin;
int val;

void setup()
{
  Serial.begin(9600);
  Ethernet.begin(mac,ip);
  Udp.begin(localPort);
  Tlc.init();
  for (int i = 0; i<16; i = i+1)
  {
    Tlc.set(i,0);
    Tlc.update();
    delay(5);
  }
}

void loop()
{
  if (Serial.available()==9)
  {
    for (int m = 0; m<=8; m = m+1)
    {
      Buffer[m] = Serial.read();
    }
    command_serial();
  }
  else if(Serial.available()<9 || Serial.available()>9)
  {
    Serial.flush();
  }
  packetSize = Udp.parsePacket();
  if(packetSize)
  {
    IPAddress remote = Udp.remoteIP();
    Udp.read(packetBuffer,UDP_TX_PACKET_MAX_SIZE);
    command_udp();
  }
}

void command_udp()
{
  handshake = packetBuffer[0];
  command_type = packetBuffer[1];
  command_pin0 = packetBuffer[2];
  command_pin1 = packetBuffer[3];
  digit1 = packetBuffer[4];
  digit2 = packetBuffer[5];
  digit3 = packetBuffer[6];
  digit4 = packetBuffer[7];
  terminator = packetBuffer[8];
}

void command_serial()
{
  handshake = Buffer[0];
  command_type = Buffer[1];
  command_pin0 = Buffer[2];
  command_pin1 = Buffer[3];
  digit1 = Buffer[4];
  digit2 = Buffer[5];
  digit3 = Buffer[6];
  digit4 = Buffer[7];
  terminator = Buffer[8];
  parsing();
}

void parsing()
{
  digit1 = digit1-48;
  digit1 = digit1*1000;
  digit2 = digit2-48;
  digit2 = digit2*100;
  digit3 = digit3-48;
  digit3 = digit3*10;
  digit4 = digit4-48;
  in_value = digit1+digit2+digit3+digit4;
  command_pin0 = command_pin0 - 48;
  command_pin1 = command_pin1 - 48;
  command_pin0 = command_pin0 * 10;
  pin = command_pin0+command_pin1;
  if (handshake == '!' && terminator == '@' && in_value <= 4095)
  {
    switch (command_type)
    {
      case 'A':
        Tlc.set(pin,in_value);
        Tlc.update();
        Serial.print("1");
        delay(5);
        break;
      case 'a':
        val = analogRead(pin);
        Serial.print("1");
        break;
      case 'D':
        if (in_value == 4095) { digitalWrite(pin, HIGH);}
        if (in_value ==0)    { digitalWrite(pin, LOW);}
        Serial.print("1");
        break;
      case 'd':
        val = digitalRead(pin);
        Serial.print("1");
        break;
      case 'P':
        pinMode(pin,OUTPUT);
        Serial.print("1");
        break;
      case 'p':
        pinMode(pin,INPUT);
        Serial.print("1");
        break;
      default:
        break;
    }
  }
}
37  Using Arduino / Motors, Mechanics, and Power / Computer PSU and Arduino on: March 04, 2013, 03:30:56 pm
Hello! For a project of mine I would like to incorporate an arduino controlling somewhat large loads (many 1A loads 12VDC mainly LEDs) from my arduino with the power coming from my computer PSU.   My psu is this one (http://www.newegg.com/Product/Product.aspx?Item=N82E16817121040).  It is a 1.2kW supply with 100A available on the 12V rail.  Are there any things I should know about using large amounts of power from a computer PSU?  things like power protection or any intricacies of a psu that Im not aware of?
Thank you very much for any help, I would really not like to hurt my beast of a psu and computer to boot!!
38  Using Arduino / Networking, Protocols, and Devices / TLC5940 and Ethernet Shield using SPI on: March 04, 2013, 02:59:12 pm
Hi, for a project of mine, I would like functionality of the Ethernet Shield and a TLC5940 chip.  However, both of these devices use the SPI functionality on the atmega.  Is it possible to use both, because as it stands now with my code, they don't seem to be playing nicely together.
39  Using Arduino / Project Guidance / Re: LED Lightbulb and Arduino Control on: February 17, 2013, 06:08:20 pm
thanks for that

from what i understand, they are first rectifying the HV AC lines and then running it through a simple zener diode to drop the voltage down to 30VDC for the LEDs?  If so then this is good news since this can easily be controlled via a mosfet and optocoupler connected to an arduino with digital write
40  Using Arduino / Project Guidance / Re: LED Lightbulb and Arduino Control on: February 17, 2013, 02:45:21 pm
im a little consused what the led driver accomplishes and its composition.
what i originally imagined doing was something like the led fader demo in arduino but on a larger scale, why shouldn't this be achievable?
41  Using Arduino / Project Guidance / Re: LED Lightbulb and Arduino Control on: February 17, 2013, 02:25:58 pm
im not too worried about working with 120vac as we work with this stuff and much much higher in the lab all the time.  my actual short coming is with the lower voltage supplies.  what i was sort of hoping to hear was that you could simply rectify the ac to dc, filter it, then run it through a buck converter for the (120/sqrt(2))-->5vdc conversion.

but maybe this would be just too simple and thats not allowed :/
42  Using Arduino / Project Guidance / LED Lightbulb and Arduino Control on: February 17, 2013, 11:43:03 am
Hi,
I'm interested in making my own LED light bulb fixtures to replace incandescent bulbs. however i cant seem to find any documentation that explains the internal of the bulbs. theoretically it should be very simple, just a small switching regulator for the 120vac to the 12vdc for the led array but i can find anywhere that confirms this. So my questions are these:
1) does it actually use a switching supply or just rectify the AC signal and use that?
2) if i connect the 12v rail to the transistor and optoisolator to an arduino should I be able to control them with a simple analogwrite command?
3) should a couple of simple 3000k super bright leds work?

Thank you very much for any replies!!
43  Using Arduino / Motors, Mechanics, and Power / Re: arduino controlled computer fan controller on: February 15, 2013, 09:13:35 am
thank you for that, at first glance, that should be very helpful.  unfortunately the pcb has already been made so there isn't much hardware tweaking i can do
44  Using Arduino / Motors, Mechanics, and Power / Re: arduino controlled computer fan controller on: February 12, 2013, 10:43:16 pm
i will have to check out the bit banging method, but since the mega will be doing many other things this seems like a difficult option, but at least an option, thanks!

also, i connected a 220uF cap in between the motor leads and that seems to work pretty well.  is this not a good thing to do long term or at all?
45  Using Arduino / Motors, Mechanics, and Power / arduino controlled computer fan controller on: February 12, 2013, 09:13:57 pm
hi, i have designed a fan controller using a bjt and an opto-isolator connected to a pwm pin on an arduino.  the circuit seems to work when i put varying duty cycles through it (0-255).  however, anything less than 255 gives a really annoying whine in the fan and the fan refuses to spin.  does anybody have any reasons for this, or solutions?  I have designed this so that i can make my fans quieter when there is less load on the computer.  Posted below is the picture of the schematic being used.

Thank you very much
Pages: 1 2 [3] 4 5 ... 10