Skip to content

Week name

Hero Shot

Summary

This week we had to play around with output devices, both measuring their power consumption and adding one to a lab made board.

Approach

This week I was all about them Neopixels! Since currently the idea is to only have light as an output device for my final project, this is quite an important one. Therefore my focus this week was to really understand the landscape of addressable RGB LED's, both in esthetics and their technical differences.

Assignment

group assignment: • measure the power consumption of an output device individual assignment: • add an output device to a microcontroller board you've designed, and program it to do something

Group assignment

  • explain neopixels vs rgb leds, explain data in data out, explain current requirements etc, explain WS2812

Assignment sub-part 1.a


Individual assignment

Since I'm trying to make a interactive bead curtain for my final project my only planned output is light, I've briefly thought about making my own strands out of RGB LEDs and a lot of Charlieplexing, but always figured some sort of led strings must be available. So after learning about Neopixels they definitely seemed the way to go and I didn't bother with other LEDs this week.

One strip

After we finished the group assignment I took home a strip of WS2812 Neopixels, which I then tried to hook up to both my Arduino and my RP2024 with a breadboard. In both cases I could not get them to turn on, they would briefly flash when I hooked them up to power. After a confused debugging session with code by ChatGPT, Fab instructor Quentin Bolsee and Adafruit I tried the same code on the Neopixel embedded on the RP2040 which ran just fine. Turns out I took home a bit of strip that cables connected only to the end of the strip, so I was pushing data into the data out line.

After a quick trip to the hardware store I am now the proud owner of a soldering iron. I sacrificed three jumper cables from my Arduino kit and finally got the strip to run smoothly when it was already dark out; they lit up the whole room, which was very satisfying.

Then I realized my board from last week has a pin socket with exactly the three lines needed to run the strip: power, ground and a GPIO output pin for the data signal. So I replaced the breadboard with my board from last week and ran the strip that way, which worked beautifully.

Five strips

Now it was time to come up with a new board for this week. On my final project I want to run several strings and since they have to be free flowing at the bottom of the curtain they can't be chained; this means each string needs a separate data pin. A Xiao RP2040 also won't be able to generate enough current to power multiple strips of about 2 meters, so I would need to use an external power supply. For these reasons I decide to design a board that can control 5 strips either 5 or 12V with 40 LEDs per strand (one every 5 cm). To get a better understanding of the power requirements when running a long or a lot of strips I read an article by SparkFun that explains it very well.

From this I learn that since I'll be powering the strip externally the power supply and my microcontroller need to share a ground. This is because otherwise the strip would compare the data to it's power ground and not the RP2040's ground. So next to a pin socket for 5 GPIO pins I also add a socket for ground and while I'm add it VCC, since this will make it easy to test an individual strip without an external power supply. I also learn that with such high currents running through the strip I have to add a resistor to protect each data pin.

Time to do some milling, I perform the same steps I've followed the last two weeks, only the Gerber2PNG tool is offline so I use the older Gerber2img. Here you have to be careful, cause you can't turn off the edge cut, but if you upload the traces gerber file without the edge cut its cropped to trace outer cut and will be smaller than intended. Luckily I caught this when comparing the downloaded png's and uploaded the gerber with both the traces and edge cut. This meant thought that my edge cut was now visible in the traces png and would also be milled with an offset, not sure how to prevent this, but it only added a few minutes to my milling process so I didn't care.

While designing my board I've used 5 pins for data because that's the minimum amount I would like to use for my final project. But while laying traces in KiCad I realize that with 4 pins I can make an even smaller footprint by not connecting one side of the Xiao. So as I'm waiting on the milling to finish I quickly whip up a design in KiCad. Could be a funny thing to try in a future week.

I still have some time left waiting for the edge cut to be done so I decide to prep 5 strips to hook up to my board latter. Two strips around the lab have cables on the input side, but three do not. I strip back a bit of the plastic covering and Henk shows me how to use flux and tin the coper pads to make soldering cables to them easier later. I do this for all three and attach cables to each pad.

The board comes out pretty well from the mill, the traces are pretty rough so sanding takes a long time. I solder on all the components and test them with the multimeter like I did in week 8 as I go.

When I'm done soldering I then try to hook up my led strip to my new board, but can at a maximum get only two leds to turn on. I double check my board and soldering with a multimeter like I did in week 8 but can't find any faults. Henk double checks my work and also can't find any issues. He asks me to show the setup, so I show him how the exact same code on the same pin on the exact same Xiao on a different board works fine. The only difference is, it doesn't have the resistors on the data lines. Henk takes a jumper cable and connects the pin and the data in line from the strip directly and the whole strip lights up. This suggest that with the external power source it may all be fine, unfortunately the day is over and we have to leave the testing for another day.

TODO: Hook up to external power and actually test the board!

Other strip types

THIS PART OF THE DOCUMENTATION ISN'T DONE

  • neopixel string on old board 5v

Left front, right back

  • explain difference ws2811,12,15

Assignment sub-part 2.a


What would i do differently

  • test things in the lab before you take em home

Files & resources

Done checklist

  • assignment checklist check off?
  • assignment learning outcomes learned?
  • assignment questions answered?
  • compressed assets?
  • everything self hosted?
  • pushed to main?
  • are all links relative and working on server?
  • removed this checklist?
  • added this page to nav?
  • added this page to index?

Leftovers previous week

  • nothing (give yourself a pat on the back)
  • fix link to changed xiao qpad repo code structure in previous weeks
  • which task from last week need finishing up?

Further exploration

  • out of scope nice to have