• Light Up Component Finder - Part One

    06/12/2023 at 08:40 0 comments

    [Part One]

    So I have a lot of components.

    It can take a long time to find a list of them for a prototype.

    This is just one cupboard:

    So I've come up with a solution: transferring everything into draws and putting lights behind the draws that flash and tell you which draws to search.

    I made a plan, involving an LED matrix with a thin controller board behind each draw:

    This was to be supported by a component database connected to a local server with an easy-to-use database that's quick to add a lot of parts to.

    I drew a UI mockup of it. I'll later put it together with Python and the ttkbootstrap library.

    One of the guys at my local hackerspace told me the matrix added a lot of complexity and proposed a new plan. Neopixels (WS2812B LEDs) can be arranged in a diamond formation such that the outputs and inputs are connected to one another, then power bus bars can be run along the length of the cabinet.

    I decided to give each unit its own daisy-chained connector so they can be disconnected and moved around.

  • Lighting Controller v4 Part 3

    06/12/2023 at 05:57 0 comments

    < Part Two  [Part Three]

    Following the previous part I've decided I need a case.

    I've done a bit of 3D design before in Blender and a few others.

    But I'd prefer to use OpenSCAD, because it turns the job from a design task to a programming task, which matches my skillset a bit better!

    So I used the same VSCode project to create a project box in OpenSCAD, thanks to Antyos's excellent VSCode plugin.

    I made it so all the port locations and sizes have variables that can be easily adjusted in case the first print puts them in the wrong place.

    You can take a look at my code on GitHub if you'd like.

    I also made a variable to show the case and lid so they can be viewed together when designing but separated later to export them as separate 3D objects.

    There's also space for a lithium rechargeable below the PCB. 

    Like this basically.

    So this is definitely something that's going to work first time right?


    There's some nasty warping on that corner.

    Is it because it printed directly on the bed?

    Maybe I can just rotate it and add some autosupp...

    You've got to be kidding me!

    The supports are all there but this thing I was trying to print is not!

    That's the last time I use the printer manufacturer's software to do auto-supports.

    I redid it with Lychee slicer.

    Well... the internal dimensions are good so that'll have to do for now.

    That corner is turning out to be a real problem. I'll have to give the tray a good clean later.

    Pretty tight, but the board fits!

    I also printed the lid in translucent green.

    Note that it has a cutaway so the sixteen light connectors are accessible from the top.

    Since I wasted so much time on 3d printing (and half a dozen other active projects) I haven't made much progress on the software so far, but stay tuned for more!

    In the meantime, the v3 light controller will have to continue their work.

    I don't think I've shown them before (I made them before my project documentation began) but here they are in all their perfboard glory:

    Stay tuned for more!

  • Lighting Controller v4 Part 2

    05/21/2023 at 08:04 0 comments

    < Part One [Part Two] Part Three >

    Continuing on from last time my boards have arrived from JLC PCB.

    Looks good!

    I did a quick inspection for issues and some basic electrical tests to make sure the thing's not going to turn into a pile of melted plastic as soon as I plug in the DC jack.

    No problems so far.

    I started loading the components.


    So far so good....

    Oh. Crap.

    So it turns out getting the version with the headers already installed was a pretty bad idea.

    They're all on the wrong side!

    Now I'll have to desolder 50+ pins per module.

    Or will I?

    After engaging my brain for I moment I realised that you can just flip the capacitor and terminals. then install the module upside down and all the pinout remains the same!

    Well, I'll have to connect the terminals the opposite way around and the pin numbers are now flipped such that channel sixteen becomes channel one and visa-versa. But that's something fixable in software.

    With this unorthodox modification, I finished the rest of the soldering:

    Well, almost. Most of the connectors are still stuck in the Australia Post system, and my workshop supplies were surprisingly empty after using most of them for the v3 boards at the beginning of the year.

    In the meantime, I connected up the board and built a little webserver in CircuitPython:

    Yep, that's all of it. Easy stuff.

    All it does is wait for a POST to /set, convert it to an int, and send it to the PWM controller.

    Fortunately,  Adafruit has a PCA9685 library for CircuitPython; because I'm not one to reinvent the wheel.

    I made a little LED attachment to test it.

    When the headers finally arrived I assembled the rest of it and started testing.

    I tested it out with a POST action from the Tasker app on my Android device:

    Seems to work okay and respond to changes in brightness.

    But I need a better API that can set the value of specific channels.

    So I jumped back to VSCode and wrote a simple JSON command system that lets you run on, off, and set commands with light number and brightness in the case of the light.

    This is just to test it out, it's not the language that the actual controllers are using.

    I sent a lot of requests to test it out:

    (You can send multiple at the same time using the JSON array.)

    Brightness seems to be adjusting okay and on/off is working. Very responsive.

    I tested the other ports to make sure there were no unexpected surprises.

    Join me next time as I put together a 3D-printed case and implement this archaic scripting code that I originally developed for the very memory-limited v1:

    Not exactly well documented!

    But all my light programs are already running it so I don't really want to change it.

    See you later!