Show Posts
Pages: [1]
1  Using Arduino / LEDs and Multiplexing / Re: Looking for an RGB LED addressable strip 1 LED per segment on: November 29, 2012, 02:19:32 am
I've now gotten to a working LED strip for my ambilight, now just need to get lightpack working...
2  Using Arduino / LEDs and Multiplexing / Re: Looking for an RGB LED addressable strip 1 LED per segment on: November 28, 2012, 09:25:39 pm
Honestly, I don't know what could be going wrong with your setup besides perhaps a lack of current.  If you are driving these only from USB power, that may be the issue, but I don't know.  It should still run at the very least the first sequence or a single pixel being lit, chasing from the beginning of the string to the end.  The others will start to draw more current.  90 pixels at 20mA is 1.8A - something your USB connection will *not* provide.  But the single chase should work because it's only drawing 20mA at a time.

So your next step is to try and run it with an external power supply like I do.  Run the UNO from your computer (so you can keep uploading sketches to it without having to reconnect/disconnect each time.)  But connect the string's power wires to an external power supply.  An old computer PSU works great.  Mine provides 30A on the 5V line which is plenty to drive a full 5 meter string at full power, 60mA each (9.6A total.)  Make sure you connect the PSU's ground to the UNO's ground.  Let it rip.  Report back.

Thanks a ton for the help KirAsh4!  I should have posted a video of my problem from the get go and you probably would have figured it out sooner.  

Below is the PS I've been using the whole time.  I have estimated that I would be using somewhere between 115 and 134 LED for this project.  And being that its an ambilight, I better not need a 30A PS.... smiley



Also attached the code I used in the video.
3  Using Arduino / LEDs and Multiplexing / Re: Looking for an RGB LED addressable strip 1 LED per segment on: November 26, 2012, 08:25:05 pm
Maybe post your sketch so I can see what you're doing ...


FastSPI: http://code.google.com/p/fastspi/
Adalight: https://github.com/adafruit/Adalight

I've found that the adalight package fails almost immediately.  However, with FastSPI, if I set the data rate to 7 (the slowest), and increase all of the delay times, it more or less works but eventually fails.
4  Using Arduino / LEDs and Multiplexing / Re: Looking for an RGB LED addressable strip 1 LED per segment on: November 26, 2012, 12:16:21 pm
Read the data sheet on the WS2801.  It tells you when/where you need to add the resistors.

However, I have run the FastSPI testled sketch on a full 5m reel straight out of the box with no problems what so ever.  The only change I made to the sketch was to add the proper dataRate line, which is missing from the sketch.  No resistors added, just hook up the four wires, make sure the 4 wires at the end aren't touching anything metal, and turn it on.  In fact, I just grabbed two reels, hooked them up in parallel to my Uno, using FastSPI.  I only ran one sequence, which is the single color down the whole strip, because it's not hooked up to a high amp power supply:

(the freezing that you're seeing, if any, is just the way YouTube processed the video - the chase is smooth with no hiccups.)


Thanks for posting this up. I looked in the spec sheet and it only states what's below.  I changed the pull up resistors from 10K to 50 with no positive effect.
Quote
The Connection and Driving of Cascading Operation
The transmit the data over long distance by cascading, the WS2801 integrates push-pull output stage with strong driving capability which enables the data and clock can be transmitted up to 6 meters at 2MHz clock frequency.
To prevent the reflection, it is necessary to connect a 50Ω resistor at the data input or output port for impedance match.


Any thoughts on what the problem could be?  A bad/faulty strip?  This wouldn't surprise me because the quality does not look top notch...
This afternoon I will try swapping out to a spare arduino to see if that changes anything.
5  Using Arduino / LEDs and Multiplexing / Help troubleshoot WS2801 LED Strip on: November 26, 2012, 02:09:41 am
I've got a 5m led digital strip,WS2801IC 32pcs IC+32pcs 5050 SMD RGB/meter with a total of 160 (32*5) LEDs.  I've paired this up with a duemillanove and a 5V 5A PS.  On the arduino, it's wired off of the ICSP header to Clock and Data pins on the strip and then pulled up by 5k resistors similarly to this.  I've ran the fastSPI test leds PDE and the adafruit WS2801 strand test PDE, with consistent errors after exceeding about 60 LEDs.  The failure that occurs are the first led pixel being off color and some leds toward the end of the string or all leds begin to behave erratically. If I set it to 50 pixels or less, it works flawlessly. 


Any thoughts? 
6  Using Arduino / LEDs and Multiplexing / Re: Looking for an RGB LED addressable strip 1 LED per segment on: November 25, 2012, 11:09:35 pm
The only issues with length is that at some point you need to add some pull-downs to the data and clock lines at the END of the string, to avoid reflection of the signal.  

Do you have any more info on this?

More specifically, I purchased a similar 5m led digital strip,WS2801IC 32pcs IC+32pcs 5050 SMD RGB/meter with a total of 160 (32*5) LEDs.  I've paired this up with a duemillanove and a 5V 5A PS.  On the arduino, I've ran the fastSPI test leds PDE and the adafruit WS2801 strand test PDE, with consistent errors after exceeding about 60 LEDs.  The failure that occurs are the first led pixel being off color and some leds toward the end of the string or all leds begin to behave erratically. Any thoughts?  Maybe throw in a pull down resistor after the 50th?
7  Using Arduino / Sensors / Re: Temperature controlled fan with One wire DS18B20 sensor with threshold on: February 29, 2012, 01:04:23 pm

Split your program up in several functions that do one task to simplify the loop() to something like this

Code:
void loop()
{
  float t = readTemperature();

  if (t > setpoint+threshold)
  {
    state = ON;
  }
  if (t < setpoint)
  {
    state = OFF;
  }

  setFan(state);
}


the part below makes no difference in state...
Quote
-----> if between setpoint and setpoint + threshold, check previous fan state,
----------> if was on, stay on
----------> if was off, stay off


Thanks for your help. 

But I have to disagree with you, that part does make a difference.  Or at least I want it to make a difference, I may just not be programming it correctly.  The threshold is designed to prevent excessive cycling of the fan.  I want the fan to only turn on when the temp > setpoint + threshold AND it needs to stay on until temp < setpoint. 

I could rewrite the program to be an if then based on output pin state, but based on the trouble with the pin beg read low when it should be high that I've been seeing, I'll hold off on this.
8  Using Arduino / Sensors / Re: Temperature controlled fan with One wire DS18B20 sensor with threshold on: February 29, 2012, 12:34:09 am
So I have messed around with this and have found out that if I put a load on pin 13, reading its state no longer returns the expected result.  I want it to tell me that it was previously on but it defaults to 0 state.  Connecting an NPN transistor to drive a relay as load.

Any advice appreciated.
9  Using Arduino / Sensors / Temperature controlled fan with One wire DS18B20 sensor with threshold on: February 28, 2012, 09:57:57 pm
Thought I'd share my code, I've messed with this over the past couple of days.  I wanted to have a threshold which would prevent the program from turning on the fan immediately.

Basic program: 
Check temp;
-----> if higher than setpoint + threshold, then turn fan on
-----> if between setpoint and setpoint + threshold, check previous fan state,
----------> if was on, stay on
----------> if was off, stay off
-----> if lower than setpoint, then turn fan off

Right now its setup to print a lot of info, but you can remove it as you see fit.

Code:
#include <OneWire.h>


OneWire  ds(10);                    // on pin 10

int PinLED = 13;                     //LED Pin
float temp_setpoint = 75.00;    //Temperature Set Point
float temp_thresh = 2.50;        //Temperature threshold
 
void setup(void) {
  Serial.begin(9600);
  pinMode(PinLED,OUTPUT);
}

void loop(void) {
  byte i;
  byte present = 0;
  byte type_s;
  byte data[12];
  byte addr[8];
  float celsius, fahrenheit;
 
  if ( !ds.search(addr)) {
    ds.reset_search();
    delay(250);
    return;
  }
 
  Serial.print("ROM =");
  for( i = 0; i < 8; i++) {
    Serial.write(' ');
    Serial.print(addr[i], HEX);
  }

  if (OneWire::crc8(addr, 7) != addr[7]) {
      Serial.println("CRC is not valid!");
      return;
  }

  ds.reset();
  ds.select(addr);
  ds.write(0x44,1);                          // start conversion, with parasite power on at the end
 
  delay(750);                               // maybe 750ms is enough, maybe not
                                             // we might do a ds.depower() here, but the reset will take care of it.
 
  present = ds.reset();
  ds.select(addr);   
  ds.write(0xBE);                            // Read Scratchpad

  for ( i = 0; i < 9; i++) {                 // we need 9 bytes
    data[i] = ds.read();
  }

                                             // convert the data to actual temperature
  unsigned int raw = (data[1] << 8) | data[0];
  if (type_s) {
    raw = raw << 3;                          // 9 bit resolution default
    if (data[7] == 0x10) {
                                             // count remain gives full 12 bit resolution
      raw = (raw & 0xFFF0) + 12 - data[6];
    }
  } else {
    byte cfg = (data[4] & 0x60);
    if (cfg == 0x00) raw = raw << 3;         // 9 bit resolution, 93.75 ms
    else if (cfg == 0x20) raw = raw << 2;    // 10 bit res, 187.5 ms
    else if (cfg == 0x40) raw = raw << 1;    // 11 bit res, 375 ms
  }

  fahrenheit = (float)raw / 16.0 * 1.8 + 32.0;
  float temp_current = fahrenheit;
  Serial.print(", Fan Relay: ");

  if (temp_current >= temp_setpoint + temp_thresh) {
   Serial.print("ON ");
   digitalWrite(PinLED, 1);
  }
else if (temp_current >= temp_setpoint && temp_current <= temp_setpoint + temp_thresh) {
    int fan1state = digitalRead(PinLED);
       if (fan1state == 1){
           Serial.print("ON ");
           digitalWrite(PinLED, 1);
       }
       else {
           Serial.print("OFF");
           digitalWrite(PinLED, 0);
       } 
  }
  else if (temp_current <= temp_setpoint) {
   Serial.print("OFF");
   digitalWrite(PinLED, LOW);
  }
 
  Serial.print(",  Current Temp / Threshold: ");
  Serial.print(fahrenheit);
  Serial.print(" / "); 
  Serial.print(temp_setpoint + temp_thresh); 
  Serial.print(" (");
  Serial.print(temp_current >= temp_setpoint + temp_thresh); 
  Serial.println(")"); 

}
                 
10  Using Arduino / Project Guidance / Re: PCF8574P or PCA9555 - Creating additional DO on: February 09, 2012, 01:22:25 pm
Quote
So does it matter which one I go with?
Well it will change the software you have to write to manipulate the output pins but both will work equally as well.

Is there a substantial difference in ease of use / capability of one programming over the other?  I imagine they are similar since they are both on the same bus, but have not have the time to research it.
11  Using Arduino / Project Guidance / Re: PCF8574P or PCA9555 - Creating additional DO on: February 09, 2012, 01:05:42 pm
Yes they look good to me.
Just connect the grounds of the two supplies together.

So does it matter which one I go with?  Is there any preference to one over the other?
12  Using Arduino / Project Guidance / PCF8574P or PCA9555 - Creating additional DO on: February 09, 2012, 03:14:06 am
Hey guys.  I'm trying to create additional DO for my arduino setup to control some AC relays. I have come up with two options for the circuit.  This is a remote relay board that is less than 10 feet away from main board.  Connected over RJ45 cable & port.  Relays will be driven with ULN2803 (acts as NPN) and a separate 24v power supply.  At this point I'm leaning toward the PCA9555 since its double the outputs in one chip.  Can anyone confirm that the circuit I have setup will work?  

Also, what do I have to do to tie the ground between the 24v supply and the 5v supply?

13  Using Arduino / Installation & Troubleshooting / Re: Automatically running the serial monitor on: February 07, 2012, 02:08:45 am
I dont know where but I've used something that had it.  Processing maybe........?
Pages: [1]