The Studio of Eric Valosin

Tuesday, April 22, 2014

Pushbutton Prayer Bead Progress - 3D Prints and Electronics for Dummies

The last couple weeks have presented a HUGE wealth of new knowledge and small victories I was totally not prepared for. I've made quite a bit more progress on my Pushbutton Prayer Bead project (follow the link to see how this all started), notably designing a prototype for the bead itself, expanding the circuitry to involve more than a single LED, and tackling the electrical practicalities that I wasn't even aware would be such a challenge.

My First 3D Print

Wary of the immense learning curve of designing in Blender, I decided to go with SketchUp to design my bead models, which I had much more experience with. Essentially the model needed 4 things:
  1. To be hollow so that the wiring and connections can be housed inside
  2. To have a "floor" that would support the pushbutton, with the button part accessible at the top surface and through-mounted so that the leads could be soldered to the wires inside the button
  3. Side holes where the wires can be fed from bead to bead
  4. Some way of assembling and, inevitably, of disassembling the bead once its ready to go.
And it had to be small. We're talking less than a 2 cm diameter. So I took to designing, with a big help from the Solid Inspector plugin and NetFabb software to make it manifest and watertight, ready for printing at Shapeways. (See here for a post that will save your life if you're attempting to 3D print from SketchUp)

my model on Shapeways, complete with latches to snap the model shut and 2 "oh crap, wait..." holes through which a paper clip can pop the latches open again when I inevitably realize I shouldn't have closed it yet!

Got my model back and it looked great! Needed some tweaking - through holes didn't quite punch through, and walls were a fraction of a millimeter too narrow for the button after printing.
Talk about a hack - Went at it old school style, with an exact-o and a push pin, and got something that will work! Still needs a thinner floor so the leads stick out a bit more.
I then went back in and made some adjustments to the original model for round 2, and I'm excited to send it off and see how it works!

Now just have to learn to solder... (ha!)


The next big task came with the arrival of this glorious bunch of 200 common anode RGB LEDs! 

I naively dove in and started hooking up some of the LEDs, only to learn that I had been prototyping with the common cathode type before, not common anode. When I started it up, first it did nothing at all. Then, after rewiring it was on when it was supposed to be off, and all the colors were the exact complement of what they were supposed to be! Lets just say I've spent a LOT of time surfing electronics forums this week. Luckily it was as simple as connecting the common pin to the power source rather than ground, and inverting all the Pulse Width Modulation (PWM) values that would tell it what color to be. No sweat.

Once I got my LED color fade working properly, I decided to start looking into what it was going to take to string up 200 of these things in parallel. Apparently all my extensive training in abstract conceptual theory has utterly destroyed my capacity for concrete thought, as my eyes glazed over at Ohm's Law (which I knew readily in High School), and I became someone I would have made fun of in physics class. The numbers and formulas all looked like Greek to me (to my credit, actually, some of it was in fact in Greek - ahem Ω) I totally got it in theory...

Tempted to just say "screw it" and fudge the numbers, I finally cleared my bleary eyes and buckled down to learn the very basic tenants of electrical engineering needed to see what I was up against. And its a good thing I did! After calculating resistances and amperages at different voltages, and poring through data sheet after data sheet (I'm talking 7 hours of research - I'm talking really starting from scratch here), it became clear to me that the setup shown above was one full-white pixel away from destroying my Arduino's digital output pin! The only reason it didn't was because the blend of colors was not drawing the full current it could potentially have if the LED were fully lit.

Not only that, but if I proceeded with more LEDs and my original plan, I would have blown out the +5V and Vin pins, melted my AC adaptor wall wart and fried every LED I had just purchased!
(I will post my most basic vital discoveries and disambiguations here)

I started seeking other options, and soon added to my shopping list a +5V 30A external power supply and 3 n-channel MOSFET transistors (to protect the Aduino input pins from that high current and drive the LEDs). The MOSFETs arrived in a matter of days, and I began cautiously proceeding with 4 LEDs, wired and protected the proper way.

My probably very unconventionally drawn schematic for the LED's wired in parallel and hooked up to the MOSFETs and pushbuttons

Oddly enough, the MOSFETs seem to invert the voltage coming through the gate, so that whole on-when-it-was-supposed-to-be-off LED problem ended up correcting itself (which still has me a bit puzzled, but I'm not going to argue with simpler code).

 And Here you have it...

The Remaining Challenges

The first of the remaining challenges is of course cost. The bigger this scales up to be, the more I need to seek funding of some sort. Besides that, I am beginning to consider installation layouts and locations.

Before I can get to that though, The code and the hardware still need quite a bit:
  1. It has to reset by itself when a user disengages with it so that a new user can start fresh rather than where the old user left off
  2. I've been using a placeholder image this whole time. I still need to to decide what image will be meditated upon, whether it be a static image, taken from a live video feed, or an array of images, etc
  3. As you can see in the video, for some reason the code is acting like it's executing functions out of order. Despite the sequence its written in, it fades the LEDs before highlighting the pixel in the image itself, and I want that to be the other way around. I'm sure I'm missing something very simple, but it's driving me nuts right now.
  4. I have to figure out the actual lighting fixtures (what they are made out of, how to most efficiently light the room, and where to place them so that all the necessary cords reach each other
  5. I have to learn to solder (duh) and actually put this stuff together off the breadboard
  6. I still haven't decided if the beads should be wireless, which will be a whole other can of worms
Definitely fun stuff!

No comments:

Post a Comment