Show Posts
Pages: 1 2 [3] 4 5 ... 29
31  Using Arduino / General Electronics / Re: Building a 48 Cell Li-Ion Battery Pack?? on: October 18, 2011, 06:45:20 am
I have been doing some research on can't find a light 48v battery pack with enough amp hours at an inexpensive price  48v, 500-1000 watts and 10-20 amp hours is some serious battery power.  I can see why you would like to create a smaller one for the uni but dealing with the balancing issues of so many small batteries may be tricky and potentially dangerous.  I wonder if a charging system for a more expensive battery array used with smaller less expensive batteries would be an option - just thinking out loud here to spawn discussion / thought.

I too am very interested in creating a petal free electric unicycle and have been mulling it over for at least 10 years.  I even purchased an electric motor for this purpose but battery has been the big limiting factor for me as well.  If I come up with any power solution I'll post here, please do the same. 

If you need any programming assistance with the project - PM me. 

Best of luck.
32  Using Arduino / Programming Questions / Re: LED strip -> LED matrix on: October 14, 2011, 03:07:50 pm
That chip / library uses an unsigned int which is 2 bytes per color.  I suggest streaming the entire LED matrix frame with a start and stop indicator.  Even though you can send the data in 2 bytes you could send in three bytes to make your logic easier.  The color values are 0 to 31 with that chip / library.

On the Arduino ..
So the receive process could go like this ..

If the data value is 34 that means start frame - so set position to 0.
 else
if the data value is 35 then that means end frame - so use the buffered 150 bytes to set the values via the fast spi library.
 else
read in the data and set the value received in the buffer at the current position and add 1 to the current position

On the PC ..
The send process would send a start frame command then stream one byte per color, three bytes per led in order RGBRGBRGB until end of frame data - then send the stop command.

Summary:
That is my suggested approach if you want to stream a 50 LED matrix from a computer.

To make this happen I suggest you do this.

Create an arduino application with a 150 byte buffer, load the data using hard coded values and then create a function to refresh the LED based on that array of data.

Next I would create a simple serial program using the examples provided and assure you can send the data. 

Next combine the apps to have the data load the buffer array and then refresh the matrix.

Hope that helps.

33  Community / Exhibition / Gallery / Re: EQ Pixels: 8 Foot LED Pixel bar powered by Arduino & MSGEQ7 on: October 11, 2011, 02:27:33 pm
Good use of the technology, well done sir.
34  Using Arduino / LEDs and Multiplexing / Re: LED Effects Recommendations on: October 11, 2011, 12:50:42 pm
The LPD8806 (now that you fixed the typo) is way better than the very bad HL1606 chip.  You for sure want the LPD8806 version.
http://www.adafruit.com/products/306
 - Note is say individual control - 32 steps.  You don't get that with the HL1606 chip - in fact you don't get much with the HL1606 chip - hence the reason for the upgrade on that site smiley
35  Using Arduino / LEDs and Multiplexing / Re: using Uno to multiplex 200 common-cathode RGB LEDs, not sure about resistors on: October 07, 2011, 05:47:37 pm
200 LEDs is quite a bit to run on battery power.  I use one of these 12v batteries ..  http://www.sears.com/shc/s/p_10153_12605_00911221000P?sid=comm_sears_other
... and four 5v 12V car adapters 1.2 amps each and it only runs 70 LEDs for an hour. 

Providing more details on what your end goal is would help.  You say you want this to put on two helmet visors and needs to be see through. I would suggest you test the minimum size / separation to see through with a few LEDs and compute the maximum LED count from that.

I hope the battery details help. 

 
36  Using Arduino / Programming Questions / Re: 16x8 LED Matrix (MAX7219) on: September 30, 2011, 11:00:03 am
Post your code.  I a heading out on vacation but most likely your include is not pointing to LedControlFast.

That was also just a quick toss together to help get you started, if that does not work you may want to go back and read the other posts and start with the simplest example / working code and go from there.
37  Using Arduino / General Electronics / Re: My Uno is too hot for TV on: September 30, 2011, 09:37:37 am
Does it do this when nothing is connected?  If no - what is connected when it does do this?
38  Using Arduino / LEDs and Multiplexing / Re: using Uno to multiplex 200 common-cathode RGB LEDs, not sure about resistors on: September 30, 2011, 09:25:34 am
Quote
expect that 5v will probably be enough in the end
5v is the voltage and is not a limiting factor - in fact you will most likely want 5v.  What would not be enough would be current, such as in the case of trying to run too many LEDs from the regulator on your arduino board or worse through pins. 

If you want to wear the helmet then you will need to run on a battery.  You could use a good sized but fairly expensive lithium ion battery pack for an iPOD as long as it has 1.2amps (1200ma) or higher output.  The plus with this setup is it is small and can be used to charge your phone / ipod, etc - when not wearing the helmet.

When you are running on non-battery power - you will still need an external power source.  If you are running 60 leds then that need 20ma each will be 1.2 amps.  This is more than you want to run from either your arduino regulator or the USB provided power so you will need external power - a DLink 5v power supply is a commonly used item for external power. 

As for how you do this electronically - I stopped soldering chips or using 595/TLC chips a while back so I'll leave the chip selection / wiring assistance for people that more into that aspect of your project.  I assume you don't want to "cheat" and use a pre-soldered solution with chips built in .. because that would be no challenge at all and you won't learn much in the way of electronics.

Best of luck.
39  Using Arduino / Programming Questions / Re: 16x8 LED Matrix (MAX7219) on: September 28, 2011, 06:51:27 am
The untested code should have compiled - make sure you have the library in the correct location.

@CrossRoads - I agree that bit banging this stuff out is not the best route and I don't see why the library uses bit bang in the first place.  The initial link provided shows how to use SPI as well and as noted a couple of times is the best route.
40  Using Arduino / LEDs and Multiplexing / Re: using Uno to multiplex 200 common-cathode RGB LEDs, not sure about resistors on: September 27, 2011, 07:54:40 am
It is important to know if you only need 7 colors from the RGB or do you need to mix colors to create a wider array of colors.  If you only need 7 colors then you only need on/off for each "frame".  If you want to mix color, you have to create a software PWM mechanism where you manually turn the LEDs on and off real fast and POV mixes the colors.  I implemented PWM for 44 LEDs multiplexed x2 but I don't think that would scale up to 200 LEDs.  You may be able to run 200 LEDs with 595 chips but know your limits.  Don't assume what you build with 10 LEDs will scale up to 200 .. work up slow.  If what you really want in the end is lots of colors (i.e. cycle through the hue smooth) then you may want to consider another chips like the TLC5940/41 chips.   

Understand power needs - 200 RGB LED will need a 60watt power supply at 5v. 

When you look at the price of 200 LEDs on e-bay, it is easy to say - oh I want 1000.  When you add up what is really takes in time and money - most people end up scaling back by an order of magnitude.  So if you have to scale back your project - know your in good company smiley

41  Using Arduino / Programming Questions / Re: 16x8 LED Matrix (MAX7219) on: September 27, 2011, 07:32:54 am
Understand about being busy.  When you get back into it .. this may help you get to end of goal quicker.

1) Create copy of existing project to modify and save it
2) Unzip and install LEDControlFast into your libraries folder (and restart Arduino if open)
http://www.hookedup.com/joe/hookedup.nsf/LEDControlFast
3) Open the new copy of your project, find LEDControl and replace with LEDControlFast
4) Cross your fingers, compile and upload smiley

Hope that helps clear up the tons of code and technical details.

Best of luck with exams and projects smiley
42  Using Arduino / Programming Questions / Re: 16x8 LED Matrix (MAX7219) on: September 27, 2011, 06:54:59 am
Just for giggles I attempted to create a quick and dirty combination of the two libraries.  
Here is a link to the two library files combined and updated to use shiftOutFast.  

http://www.hookedup.com/joe/hookedup.nsf/LEDControlFast

Note: I do not have the hardware you have so this is untested but it does compile.  Normally you should NOT combine both libraries like this, it was combined due to wanting a simple proof of concept that using shift out fast will indeed make your display run faster.
43  Using Arduino / Programming Questions / Re: 16x8 LED Matrix (MAX7219) on: September 27, 2011, 06:02:29 am
Just noticed there is a direct port manipulation library.  Using that may work well and would be an easier way to implement shiftOutFast.
http://code.google.com/p/digitalwritefast/downloads/list

Not as fast as SPI but may be plenty fast enough.  Download and install the above library and include it in your code before the LEDControl library.  Then update the LEDControl library as shown below.  If you can an error about
Untested code ...
Code:
void shiftOutFast(int myDataPin, int myClockPin, byte myDataOut) {
  //--- clear data pin
  digitalWriteFast(myDataPin,LOW);

  //Send each bit of the myDataOut byte MSBFIRST
  for (int i=7; i>=0; i--)  {
    digitalWriteFast(myClockPin,LOW);
    //--- Turn data on or off based on value of bit
    if ( bitRead(myDataOut,i) == 1) {
      digitalWriteFast(myDataPin,HIGH);
    }
    else {      
      digitalWriteFast(myDataPin,LOW);
    }
    //register shifts bits on upstroke of clock pin  
    digitalWriteFast(myClockPin,HIGH);
    //zero the data pin after shift to prevent bleed through
    digitalWriteFast(myDataPin,LOW);
  }
  //stop shifting
  digitalWriteFast(myClockPin, 0);
}


Then change ..
shiftOut(SPI_MOSI,SPI_CLK,MSBFIRST,spidata[i-1]);
to
shiftOutFast(SPI_MOSI,SPI_CLK,spidata[i-1]);

In the library file (after backing it up of course).

44  Using Arduino / Programming Questions / Re: 16x8 LED Matrix (MAX7219) on: September 27, 2011, 06:00:58 am
In the LEControl.CPP file you will see it is using shiftOut, which is very slow.  You should be able to change that to use either direct port manipulation or better yet - SPI.

Here is the place in code that looks like it would need to be updated.

Code:
void LedControl::spiTransfer(int addr, volatile byte opcode, volatile byte data) {
    //Create an array with the data to shift out
    int offset=addr*2;
    int maxbytes=maxDevices*2;

    for(int i=0;i<maxbytes;i++)
spidata[i]=(byte)0;
    //put our device data into the array
    spidata[offset+1]=opcode;
    spidata[offset]=data;
    //enable the line
    digitalWrite(SPI_CS,LOW);
    //Now shift out the data
    for(int i=maxbytes;i>0;i--)
  shiftOut(SPI_MOSI,SPI_CLK,MSBFIRST,spidata[i-1]);
    //latch the data onto the display
    digitalWrite(SPI_CS,HIGH);
}   

If the one line in the above code is changed from ..
shiftOut(SPI_MOSI,SPI_CLK,MSBFIRST,spidata[i-1]);

to  use either shiftOutFast or spi_transfer in the below post you may find speed improvements.  This post was me learning the same thing and providing the results.  If you hit issues or have questions attempting to implement this I'll jump in an help.
 http://arduino.cc/forum/index.php/topic,37304.0.html


To use this code you may need to update your pins to 10 - latch - 13 clock and data 11.

Since there is a tone of code in that post - here are the important parts (may have missed something but this is a good start).

Code:
//--- vars
//--- Pin connected to ST_CP of 74HC595
int latchPin = 10;
//--- Pin connected to SH_CP of 74HC595
int clockPin = 13;
//--- Pin connected to DS of 74HC595
int dataPin = 11;

//--- Used for faster latching
int latchPinPORTB = latchPin - 8;


//----- Setup()

 //set pins to output because they are addressed in the main loop
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);

  digitalWrite(latchPin,LOW);
  digitalWrite(dataPin,LOW);
  digitalWrite(clockPin,LOW);

  //--CMD SerialCommander.initialize(runCommands);
  setupSPI();

//----- Other routines

void latchOn(){
 bitSet(PORTB,latchPinPORTB);
}

void latchOff(){
 bitClear(PORTB,latchPinPORTB);
}

void setupSPI(){
  byte clr;
  SPCR |= ( (1<<SPE) | (1<<MSTR) ); // enable SPI as master
  //SPCR |= ( (1<<SPR1) | (1<<SPR0) ); // set prescaler bits
  SPCR &= ~( (1<<SPR1) | (1<<SPR0) ); // clear prescaler bits
  clr=SPSR; // clear SPI status reg
  clr=SPDR; // clear SPI data reg
  SPSR |= (1<<SPI2X); // set prescaler bits
  //SPSR &= ~(1<<SPI2X); // clear prescaler bits

  delay(10);
}
byte spi_transfer(byte data)
{
  SPDR = data;                    // Start the transmission
  loop_until_bit_is_set(SPSR, SPIF);
  return SPDR;                    // return the received byte, we don't need that
}

If you implement the above code - then use the spi_transfer method in place of the line detailed above .. so ...
 
shiftOut(SPI_MOSI,SPI_CLK,MSBFIRST,spidata[i-1]);

is changed to

spi_transfer(spidata[i-1]);

That may do it, best of luck - let us know please.  Here to help if you hit snags.
45  Using Arduino / LEDs and Multiplexing / Re: Controlling/Strobing 60 LED'S on: September 24, 2011, 06:54:28 pm
I am using the 5v concept.  The link you showed only provides 650mA of power.  I would suggest going to e-bay and getting ones that have 1amp at least.  I found some 1.2amp ones on e-bay and got the last few. You should be able to find something similar.
http://www.ebay.com/itm/250838285454?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

I pulled the socket part off the adapter and connected the exposed black and red wires to the 12v lithium icon battery by adding a small metal adapter that fits snug into the battery slot.  Then I plug a USB cable into the 5v adapter slot and splice the USB cable.  In the cable, locate the black and red wires.  IMPORTANT: Check with a tester to assure +/- (do not assume color is correct).  

I use 4 of these to run 70 RGBs.
Pages: 1 2 [3] 4 5 ... 29