Close

updates

A project log for Cypress PSOC 4 + ESP8266 WS2812 RGB XMAS Lights

802.11 WIFI enabled RGB LED Strips, using the ESP8266 and $4 Psoc 4 dev board.

charliexcharliex 12/01/2014 at 19:566 Comments

Well lights up day was meant to be Sunday, but we decided to start finishing the drywall on the garage which is my home shop, so that took three days of the holiday, krs had to do her sisters bridal shower event as well, so all in all a very busy thanksgiving. but i got some time to work on them.

went from this


to this


We just finished as the rain started, so had to get all of gear back in at like 10PM, in the rain... so yeah fun time, and didn't get a chance to clean and seal the floor, or at least prime the drywall Oh well, its getting there. I also left a bunch of wood outside, so thats gonna take 6-12 months to dry out.

Also finished (mostly) the table for krs, that had to be done before we started the drywalling because of the dust.


New Things.

Ordered another 20 of the ESP8266's from alibaba, they arrived and i programmed them all for my AP and 460800 baud rate , and so far so good, i built a small usb uart to 8 pin header for the programming and just used that to rinse/repeat. Though this prolific adapter doesn't work as well and you have to reconnect every time, and every 10-20 reconnects you lose the port. Luckily these ones came with the same firmware I've used.

I also got 4 of the external antenna versions to test, have no hooked them up.


The PCB's arrived from itead and kris put a couple together, they worked off the bat but i hadn't noticed i'd used the debug lines for one of the GPIO's, it didn't matter since i wasn't going to be debugging these anyway, flashed the firmware in and i dropped 20 psocs on the boards and left the rest for her, i of course forgot to order the parts on reels/strips in time so we could use our pick and place. which would have breezed through this. ah well. i did find a full reel of 10K 0805 resistors in the first box i looked in, considering (a) how many we have and (b) how much of the house was a mess since it was moved out the garage into the house during drywalling, i'm amazed how lucky i was to find them when needed.

The top right board is one of the "free 2 boards" from itead, it looks like some sort of bluetooth/wifi power control switch the other one was a reprap motor controller, and the first board i've gotten from itead in that jumble that i could figure out what project it was for.

The esp8266's cost me about $3.20 each.

The new node designs have the programming pins broken out.. so super easy to program, all you do is solder the chip to the board and use the cypress programmer, no other components needed for flashing, which was great for batching. I'm a tad worried the little smd switch has the make contacts on the wrong side of the pcb schematic, but its not really needed since it was a shortcut for bootloader mode anyway.

The control software is now able to control up to 255 nodes, and for pretty much any song length, i've got it set to 250ms steps at the moment, i'm adding in the various patterns and figuring out how i want it to work. I've been thinking about how to split up the rows of the table to match the song being played, maybe with a bpm/tempo match, but a lot of music is at things like 148BPM which doesn't easily match up to a nice uniform number. 60,000/ 148 = 405.40540540540540540540540540541 etc but we'll see as i go along, variable control over the range of the song would be great, so instead of just doing row*n, you give a list of times to fire the pattern, and no dead data, which might make a lot more sense, I'm mulling it over. Then insert/delete rows as you go along with new times..

Currently I'm just putting in numbers, so 1-15 are various preset patterns, 100-164 means switch to color 0-64 immediately, 200-264 means fade to colour 0-64 etc, there's a preset CLUT for those too. 0 means no change.

Had to stop about 10:20PM last night, since were just worn out. It's one of those times where you're too tired even to take pictures and document, so i'm at least adding what i recall here. krs managed to get about 70% of the itead boards completed.

Today i'm thinking about changing the numeric values in the grid to a ComboBox with a text+color representation of what will happen at that time spot, then adding a display control that shows what each strip is set too, that'll be interesting since they're 150 leds long and up to 256. i might just make it a bitmap, we'll see.

I also started a rev of the board that runs the PSOC at 3.3V this should need less parts since instead of level shifting everything between the ESP8266 and the psoc, its just the LED control signal that needs to be level shifted to 5V. I really should have sent in a build of that too, since its a few less components to build, well really i should have had the parts ordered in time and used the pick and place! But time sneaks up on you, I can't believe it's already December, it was just summer.

Now that this rev i know works i'll post up the eagle files. Though i also flipped the 8266 so it points away from the board, and moved that GPIO.

The 3rd gen board will be 3.3V primarily.

Maybe tonight the rest will get finished and we can start to waterproof and install them this week, definitely by the end of the week..

cheers

Discussions

Ben Delarre wrote 12/02/2014 at 23:31 point
Ah the novelty of rain in LA. :-)

I'm going to have to come down and take a look at this when you get it up Charlie. I also might have to buy a board off you if you have any spares as I'm rebuilding our FLED array (http://hackaday.io/project/3-fled) and am going to have to go for something more powerful than a raspberry pi so it won't fit inside our nice acrylic case.

How long a strip can a single PSOC drive and maintain 30fps? I'm looking at just under 2k leds.

  Are you sure? yes | no

charliex wrote 12/02/2014 at 23:54 point
yeah the novelty has worn off already ;) everyone here is saying, isn't the rain great ?

one PSOC board can do 900 RGB LED's, probably considerably faster than 30 fps.

  Are you sure? yes | no

Ben Delarre wrote 12/03/2014 at 00:36 point
Hmm, so I would need at least 2, I've got 1728 LEDs to run.

How are you finding latency hiccups and other wifi related failures now that you're up to larger numbers?

  Are you sure? yes | no

charliex wrote 12/03/2014 at 21:21 point
can you use a CLUT instead of individual RGB values, 1728 might be ok at 30FPS on one PSOC, its RAM at that point.

So far so good, as long as you don't use broadcast i've yet to hit major issues, some machines/network cards seem to stutter after 24+ hours of streaming. Laptops particularly.

I'm not sending data if i don't need too, and i could always cut it down considerably by using fixed patterns and just sending the ID instead of sending the whole buffer out per node.

I'm pushing on a 1Gbps wired , barely hitting 0.02%, on the wifi side i'm pushing out about 210kbps per node when it's worst case (changing all data every frame) so for 20 nodes , 4200kbps (worst case constant streaming to all nodes at once)

  Are you sure? yes | no

Ben Delarre wrote 12/03/2014 at 21:35 point
Hah, that's hilarious, its not the hardware that's failing its the PCs . Typical.

Two wouldn't be the worst thing in the world, as long as they are reasonably synchronized. I'll have to see, I might just try using the ESP8266 with another microcontroller and see if I can get something with enough ram to buffer a couple of frames to avoid any network hiccups spoiling the animation.

Not so much of a concern for your use case but for a large LED matrix any hiccups will be really visible.

  Are you sure? yes | no

charliex wrote 12/07/2014 at 22:07 point
yeah with wifi you're pretty much always gonna get hiccups unless you're caching read ahead with a timed event sync on the output. doing the pattern gen on the nodes means less data to send so that is still worth looking into.

tuning for latency on wifi though is hard, i have the bits for a wired node too, just haven't written up the code yet.

the psoc5 should handle way more, once i'm done setting up the lights, putting the shop back together and work stuff i'll see how many i can drive. i've got about 10 strips running on broadcast at the moment.

krs is doing her crafternoon next week too.

  Are you sure? yes | no