6803IC strip LED library [COMPLETED]

Hi,

I have an LED strip based on the 6803IC (it’s 5M addresseable dream colour thingy from Amazon) here’s the link:-

I’d like to try and get this working with the spark. I have found reference to a FastSPI library with people who are using an arduino, and a discussion about it here:-

http://forum.arduino.cc/index.php?PHPSESSID=idmuhk541c0cu3uu6ue6nk6hd5&topic=83073.0

Has anyone got a strip like this to work with the spark? Is there a working port of the FastSPI library? Any tips gratefully received.

Thanks.

The author of FastSPI should be providing support in future!

@peekay123 might be able to port this faster since a Timer is being used in the library i found:

1 Like

@jellifish, the library looks straight forward to port is SparkIntervalTimer is used. The timing of the ISR is the trick and what I need to look at. :smile:

1 Like

Thanks for all the responses so far, seems like it’s almost doable but I may have to rely on someone elses good will and technical skills to do porting.

I would hope that many others would benefit from this as the LED strips seem very good value and are impressive.

My hope is to integrate with the spark core to allow changes in weather conditions to change the lighting effects for example. With a library I’m confident I could hack something like that together :slight_smile:

@jellifish, I’ll port the library and post it on my github later tonight (I hope!) for you to test :slight_smile:

UPDATE: Looking at the product you have, I believe the 6803IC is built into the controller unit and not in the LED strip, which is just a plain 5050 RGB LED strip. So the library is not going to be of any use to you. If it is built into the strip, then you will need to control a transistor which will drive the strip since it uses 12V.

1 Like

Ah ha! I see, that’s a pity. Makes sense I suppose. Stupidly I thought that the spark might be able to control the LED strip directly somehow. I know very little about hardware, I kind of imagined that I’d power the strip on 12v and send signals to the strip using the other two pins on the strip connector. There are chips on the strip itself (every 3 leds) but not sure what those are or do.

Thanks anyway.

@jellifish, I’m reading more carefully the description for the product and it sounds like the 6803 chips are in the strip. If I am correct, there are three wires on the LED strip: GND, DI and +12V, correct? Or is there a 4th line?

My guess is that there are 4 lines: GND, +12V, DI and CLK (or something like that). You will need a 12V supply for the LED strips, a 5V supply (USB?) for the Core and a level translator (3.3v to 5v logic) to drive the DI and CLK lines from the Core.

1 Like

Hi,

Yes there are 4 lines, as you describe them (+ gnd, data and clk)

So this is starting to sound more hopefull again :slight_smile:

@jellifish, I posted the link to the library on my github here. Let me know how things go!

I also found an extended version of the original library here. It may be worth porting it as well if the original works for you. :smile:

1 Like

Great, I’ll give this as a go. I don’t have a level translator although googling does show me I can pick these up cheaply online. Is it worth my trying with 3.3v data and clock anyway so I can get going tonight? I do have a shield shield, does that incorporate a 5v data translator do you know? Sorry, I am a bit of a hardware newbie (but very interested in learning!)

@jellifish, you can try the shield shield but don’t give up if you have problems. The biggest issue is going to be making sure all your power supplies, the LEDs and the Core are correctly grounded together. Are you powering the shield shield and the LEDs from the same 12V supply?

Well this no doubt is the source of my “current” problems. (ha ha)

So, right now I have my shield shield powered from USB and my strip powered from a different 12V source. I’m not 100% certain about the pin mappings on the shield shield (looking at http://docs.spark.io/shields/ ) I am not certain if D3 and D4 on the spark are marked as D3 and D4 on the shield or if I should use what is marked as D4 & D7). I tried both however and all I get is a pretty random looking flickering of mostly white and a bit of green bobbing about. It looks pretty much like random noise (particularly since I get the same effect using either pin combination)

Now that you are saying there needs to be a common ground (which is something that not suprisingly confuses me) I need to work out what to do next. I have some breadboard and even a power breakout board. The shield shield can be powered up to 15V so I guess I need to plug in my 12V supply to the bread board and split the power between my LED strip and my shield shield? Is this the reason for my lack of success so far?

The other thing is I presume the number of LEDs defined in the demo app is not critical at this point? I’m not certain if I have 150 or 50 since the chips are spaced every 3 LEDs. I’ve set to 50 LEDs and am assuming that at worst this would just light up a third of the strip in the demo and not cause the effect I see here.

Appreciate your patience and help :smile:

Just as an aside, I got this to compile and flash to my core locally via USB, but when I paste it into the cloud compiler on spark.io and try to verify it I get error messages (see http://pastebin.com/4cvCZ53X )

What is different about the cloud dev interface?

(EDIT: I got this to work using the pre-existing SparkIntervalTimer library and changing the includes to:-
#include “SparkIntervalTimer/SparkIntervalTimer.h” )

As for whether the code works, I’m still thinking about fiddling with breadboard to power everything from one source and hoping not to blow up my spark in my ignorance…Just not sure if I might need resistors or diodes along the way. Any chance of confirming the best way to wire this physically for a test?

@jellifish, adding library references within libraries is tricky on the IDE and I suspect that may be part of the problem. This is why I strongly recommend members use the Spark CLI and (evolving) Spark DEV to do their development.

Power wise, you may want to start with separate supplies for your LEDs and Spark, as long as their GND is connected together. Once you have that working, you can look into a single power supply. I have not looked at the shield shield schematics in a while but I think powering the core via USB also powers the onboard level shifters (TBC). If you don’t use the shield shield then you could use USB power for the Spark and the level shifter (both 3.3v and 5v). In the long run, if every works, you could use the single 12v supply and a dc-to-dc down converter to power the core.

BTW, when you have multiple power supplies in a system, they usually must share a common ground since GND is the reference “zero”. Otherwise, that reference may be slightly different for each supply which will create problems.

As for the shield shield pins, Spark pins D3 & D4 are marked 4 & 7 on the shield, as per the documentation.

The LED count is the number of LEDs, not the number of 6803IC chips. Keep me posted on your progress :smile:

@peekay123 Unfortunately I can’t seem to get anywhere with it! All I seem to get is white flickering and flashes of green up and down. I tried commenting out all the example code in an attempt to get it to just start with switched off LEDs but even with all the subroutines commented out in the main loop, I get the same effect.

Does the fact that the arduino uses a PWM port but the spark ports userd here aren’t PWM make any difference?, (I presume for this library PWM doesn’t come into it so the answer is no)

I’ve retested the strip with the original supplied controller and it is still capable of functioning normally so the strip is fine.

I’m not certain what the cpu settings in the code do (if anything, as they don’t seem to be defined) and also, as for the 50 LEDs, I had read on a different amazon page for what looked like to be the same product, a review that said the LEDs were only addressable in groups of 3. I’m still guessing that doesn’t matter in this instance though since I should still expect some of the LEDs to start in the off state if set to 0,0,0.

One final question, if I use the cloud version of pre-existing SparkIntervalTimer library rather than the one on your Git repository, does that make a difference? Is your library the same or somehow modified? I only ask because now that I have it compiling and flashing from the cloud, I do find it easier to make changes to the code and re-flash that way when I am not powered from USB.

Really do appreciate all the time you are giving this :smile:

@jellifish, I’ll take a detailed looked at the library and example to see if I spot anything weird. My concern is the data out of the shield shield and into the LED string not being at the right voltage or timing. I have a shield shield and a logic analyzer so I can mock up at least the unloaded output to measure it.

I HIGHLY recommend looking at installing Spark CLI or Spark DEV to do your development as they allow way more flexibility than the IDE. Both of these can be used with or without a USB connection. When you use these, you put all the files in a single directory and compile the directory… easy peasy.

I agree that the number of LEDs per 6803IC is not important at this stage. What is important is the timing and voltage of the control signal. I also have an Arduino to use as a reference. Stay tuned :smile:

@jellifish, just a thought… Do you have an arduino board you could test the original code with?

@peekay123 Yeah I think I have an Uno lying around somewhere…I’ll give it a go.

I forgot I can use the Spark CLI without USB, will do that next time. I use Ubuntu so I don’t have the Spark DEV IDE which sounds interesting. Did try and get it running anyway but didn’t want to get too side tracked on that.

1 Like

@peekay123 Well I suppose the “good” news is that it also doesn’t work on the Arduino Uno!

Getting similar issues. Again I tried just one part of the demo (setting all to one colour) but I continued to get all the LEDs flashing around like mad, with the outcome of mostly white and spiralling colours. (I say spiralling because I still have the LED strip wound on its spool!). It doesn’t seem to matter whether I comment out everything in the main loop or not, or just try to set one colour, it still just flashes manically. If I pull out the leads from the pins it then does set to all white, so plugging the leads in does have an effect (as it did on the spark) just not the effect anyone would want or expect.

Could be getting ready to give up :frowning:

@jellifish, don’t give up!!! The areas to focus on are:

  1. Power to devices and signal quality to LED string
  2. Timing and structure commands to the LEDs

We assumed that the library worked so the first thing to do is to assert that by looking at the 6803 datasheet. Then we go from there. Another approach altogether is to drop this LED string in favor of a neopixel/WS2812 type LED string for which we have many working libraries and examples. :smile: