Browsing posts in: Electronics

Backyard controller requirements…

We’re in the process of doing some new landscaping in our back yard, and that involves a small fountain and some landscape lighting. Which of course brings up the question obvious question:

How are you going to control the fountain and the lighting?

Here are some initial requirements:

  1. There are three separate circuits of control; one for the fountain, one for the landscape lighting in the main beds, and one for the new general purpose lighting that will be mounted under the second floor eaves (the current lighting is big floodlights that provide really harsh illumination.
  2. The fountain is 120VAC; the landscape lighting is going to be low voltage.
  3. We need an easy way to turn each of them on and off.
  4. We would like to be able to have them function automatically on some sort of schedule.
  5. It would be nice if the schedule is tied into our light dark cycle automatically; I am far too lazy to remember to adjust them by hand.

The main controller will be based on a – no surprises here – an ESP8266 NodeMCU controller running a hacked-up variant of my animation software. The landscape lighting is going to be LED, which gives the following control requirements:

  • Two AC circuits – one to control the fountain, and one to control the power supply for the landscape lights.
  • Two DC circuits to control the two landscape light circuits independently.

The AC control will be done with a couple of solid state relays that I salvaged out of earlier holiday light projects. The DC control will be done with some nice power mosfets. I should be able to drive both directly from the controller.

All of this needs to fit in one half of an outlet box. I’m not sure the form factor; I’m thinking that I’m going to 3D print a box for the electronics, but how it fits into the duplex box is tbd. I *might* put override switches on the box so that if you want to you can just press a button to turn the lights on for an hour.

And you can take the underground conduit for the pump outlet and the wire for the landscape beds as “already implemented”.

Here are the parts that have already shown up:

A 100 watt 12V DC power supply. It claims to be IP67 waterproof. The “6” means that it is “Dust Tight – No ingress of dust; complete protection against contact”. The “7” means “immersion up to 1m – ingress of water in harmful quantity shall not be possible when the enclosure is immersed in water under defined conditions of pressure and time (up to 1 m of submersion)”.

IP67 rating is impressively good. If it were true, I could drop this puppy into the fountain reservoir and it would keep running…

Alas, it is unlikely to be true; the ratings for much of the stuff out of China are hit and miss, with a bit more on the “miss” side of things. Which is why it’s going to be mounted up under the kitchen deck where water won’t be able to get to it.

I should call these “ubiquitous 10 watt low voltage LED lights”. I have a bunch of these at my cabin, and they are pretty well made; nice heavy aluminum housings to get rid of the heat, decent mounting options. This go about 18’ up in the eaves to project a nice smooth light down on the yard. I bought 4 of them.

Image result for leonlite pathway garden light

These are the pathway lights. I spent a lot of time trolling the chinese marketplace sites (aliexpress/alibaba etc.) looking for some decent lights that were cheap. What I found is that you can either buy high end lights that are $45 each, or you can buy part of an endless supply of really cheap and crappy solar lights, but nothing in between. So I settled for these from Amazon. The Amazon product is not linked because it has changed underneath to some other lights; suffice it to say that I bought 12 of these for about $13 each. These will be spaced out in the beds to make them look all pretty-like.

Astute readers will note that I’m using 36 watts for the pathway lights and 40 watts for the floods (or only 30 if I only put up three). That leaves me about 25 watts to spare. Some may go to accent lights on the north fence, and others might go for some lighting to help get to the hot tub. If I was smart, I would have gone bigger than 100 watts, but that can be replaced if necessary later on.

This is a nice little power MOSFET that will be switching the landscape light circuits. Why this MOSFET? Well, let’s look at the datasheet.

First off, MOSFETS are far nicer to use to switch loads than bipolar transistors. Bipolar transistors have significant downsides; you need quite a bit of current to switch big loads (the overhead lights will be about 3 amps) or you need darlington transistors, and because of the fixed collector/emitter voltage drop, you lose a lot of energy in the transistors, and they get hot.

This little MOSFET will happily switch 44 amps @ 10 volts and 100 degrees C, which is *way* more than it will ever see. It will switch 3 amps with 3 volts on the gate and 11 amps at 3.5 volts; the ESP runs at 3.3 volts so it will be enough to switch the current I need (if I needed big current, I’d need a bipolar driver in front to push the voltage higher). And – like most power MOSFETS – it has very low resistance between the drain and source (8.7 milliOhms with 10 volts on the gate). What that means is that it dissipates almost no energy as heat when on, and I can run it without a heat sink; it will at most get very slightly warm. And it also means I’ll send a full 12 volts out to the lights.

I guess I could also show the big 200’ roll of landscape cable. In the old world of incandescent lights, I would have needed to power these lights with a loop or maybe multiple wiring runs; in this world, the floods have their own power supplies so the voltage to them isn’t critical and the path lights don’t pull enough power to result in much voltage drop.

For the box connections, I’m thinking I will probably go with some molex connectors; that gives me a fairly safe way to hook up the AC to the power source and that way I can disconnect the whole module.

Easy PCB stencil creation and alignment

I have a product that I’ve just started selling; it’s a LED globe/Soldering challenge kit that looks like this:

It has a PCB that looks like this:


For my first run, I needed to make 10 kits, and each of them has 12 of these boards, so that’s 120 boards.

I’ve been hand-soldering the prototypes, but it takes quite a while and my eyes aren’t as good as they used to be. I just built a reflow oven based on the controleo3 kit so that I can reflow in cases like this.

Which means I need a stencil. I could easily just order one up, but that means I’m going to have to align this tiny stencil with the board 120 times. Doesn’t sound like fun…

What we need is a way to apply solder paste to a set of boards in one shop and make it repeatable. In the woodworking world, that would call for building a “jig”, or perhaps a “fixture”. Which is what this post is all about; we’re going to use a laser cutter to make all of this oh so much easier.

Teaser photo

Here’s a teaser photo of what we’re going to build:


Get your board outline and paste mask in SVG format

Since I’m doing my design in Kicad, this was really easy; just go into your design, click the plot button (like you would to create Gerbers), choose the F.Paste and Edge.Cuts layers, and set the plot format to SVG. That’s it.

Well, actually, you should probably modify your paste cutouts to be a bit smaller than they are by default; see this excellent reference for how to do it in Kicad.

If you are using a different package for your design, search online for how to make stencils from it; it will tell you how to export.

Create a combined image in Inkscape

The export give us two separate files; one has solder pads, and the other has the board outline. The first step is to combine them together.

Open both images in Inkscape. Change the color of the edges to blue and the color of the pads to red. We do this so we can control which ones get cut and which ones don’t in the laser cutter.

You do have access to a laser cutter, right? Because if you don’t you’re wasting your time.

Anyway, that gives us two instances of Inkskape:


We now need to combine those two together in another image.

Create a new document in Inkscape with File->New. Go to the pads Inkscape version, do a Select All, then a copy. Switch to the new document, choose edit->paste in place.

Repeat the operation with the edge cut Inkscape version.

If your are of true character and have a pure heart, you will get the following:


Edit->Select All, then Object->Group. That puts this all together into a single object.

Save the document away with a catchy name like “Combined”. We now have the image for a single board.


We now need to create an array of objects; in my case, it’s going to be an array of 4 wide and 3 high. We’ll start with the four:

  • Select the single object.
  • Paste it three time. Line them up approximately. It doesn’t matter like this.
  • Bring up the align and distribute menu. You will never find the icon to do this, so try CTRL-SHIFT-A. Hover around until you find a icon that says “align top edges”, and pick it.
  • Distribute the empty space using “make horizontal gaps between objects equal”.
  • Mine looked like this:


    Those are way too close together for me. Undo the distribute, move one of the edge ones out, and redo the distribution.


    That’s better. The actual spacing is up to you. Group them together and save.

    We’ll do the same thing for the rows; create two copies, align the left edges, and then distribute:


    Save. Looks like we’re done, right? Not quite, there’s one more thing to add:


    This will work fine, but we would have to hand-align the stencil with the boards, and that’s going to be a bit of a pain to do. What I want is a way to make it repeatable.

    The secret is pins. Pins, I say!

    A trip to my local hardware store yielded two 5mm shelf support pins. They are likely longer than I need and I might cut them in half for my usage. They look like this:


    We are going to use them for alignment, which means we’ll need some 5mm holes.

    Flip back to inkscape, and draw a circle. Pick the selection tool, and up under me menu bar, you’ll see the width and the height. Set both to 5mm:


    Set the fill color to full green, set the stroke color to black, flip over to the stroke style, and set the width to 0.1mm. It should look like this:


    Put this one to the upper left of your objects, copy it, and put the second object to the upper right. It should look something like this:


    Note that it doesn’t look that great. That’s okay, we will fix that now.

    Draw a rectangle from one corner of your objects to a point spaced away; this will be the pin location. Something like this:


    Then drag the circle so that it is at the corner:


    I call this “using a gauge block”. Move the rectangle to the other corner and use it to align the other pin as well, and then delete the rectangle. They don’t have to be symmetrical for the technique to work, but I like things to be regular.

    I ended up with this:


    Why so many items and so many colors? We will use them in the cutting process.

    The jig that we created will be a sandwich of different materials; from bottom to top they are:

  • On the bottom will be a piece with only the peg holes cut into it; we will use the black circle outline for those cuts.
  • Next up we will have a piece with the peg holes and the edge cuts, so we will cut both black and blue.
  • Finally, for the top, we will cut the actual stencil; it will have the circles cut for alignment and the solder pads.
  • There’s a bit more complexity than that; I’ll talk about it when I get to the actual cutting.


    The goal of making the fixture is to make laying down the solder paste easy, so the materials need to be chosen carefully.

    My PCB house says that they material they use is 1.6mm thick. I don’t trust material thicknesses, so let’s check:


    That’s pretty close, just a 0.04 mm thicker than I expected.

    For the main parts of the fixture, I needed something that was fairly rigid, fairly cheap, and the right thickness. I thought about hardboard but decided to go with what is called “chipboard”; I’m not sure why it is called chipboard because it’s just very compressed cardboard, the kind you find at the back of tablets of paper.

    After looking it locally in vain, I ended up heading to Amazon, where I came across this:

    Grafix Medium Weight Chipboard Sheets, 12-Inch by 12-Inch, Natural, 25-Pack

    Grafix Medium Weight Chipboard Sheets, 12-Inch by 12-Inch, Natural, 25-Pack

    25 sheets was more than I needed by about 24 sheets, but it laser cuts well and is decent for prototypes.

    The thickness isn’t listed in the specification, but that was one of the questions asked, so I looked at the answers and found that is was:

  • 1/16th of an inch at most
  • .057” (1.45mm) (from the manufacturer)
  • Almost exactly 1.5mm per board, determined by measuring a stack
  • 2 mm
  • It’s nice to have some many helpful answers. I could probably make most of those work, so I ordered it. It showed up, and what did I find?


    So, the correct answer was “none of the above”. It is notably a full 0.1mm thinner than what the manufacturer says. I’m not sure that just means there is more variance than the manufacturer says or they are just going thinner. Luckily, I can work with that thickness

    For the actual stencil, there were a few choices. You can cut them out of Kapton or out of Mylar. I went looking for Kapton in the common stencil thicknesses of 3 or 5 mil and didn’t find anything that looked good and cheap. So, looking at Mylar led me to Amazon, where I found 4 mil mylar, also in a package of 25.

    What is the mylar thickness?


    A quick bit of conversion shows me that the sheet is just over 3.8 mils thick, which is fine.

    Materials in hand, I headed out to my workroom where the glowforge lives to do some cutting.

    Some cutting remarks

    First up was cutting the mylar. The Glowforge has a significant bit of airflow to pull fumes out, and 4 mil mylar would blow right off the crumb tray, so I used ceramic magnets to hold it in place.

    One of the problems with mylar is that when you heat it up it tends to shrink. Since the holes I want to cut are rectangles, the laser head needs to stop at each corner, and at least on the Glowforge, it doesn’t do anything to the beam, so you will get a lot of power right at the corner. Maybe we could break the rectangles into two cuts and carefully manipulate the laser power, but I’m not that confident it would work. If you want to cut it normally, I would recommend trying low speed and very low power.

    Luckily, there’s another option. We can do a raster engrave of the squares and just ablate away all of the material in the middle. This avoids the “stuck in the corner” issue, and since the power level is fairly low and the start and stop is done by turning the laser on and off, there should be fewer issues.

    The right way to do this is to put a piece of paper under the mylar and figuring out what power and speed settings cut through the mylar cleanly but barely touches the paper. I grabbed some settings from the Glowforge Forums and used those.

    For the mylar, we are engraving the red paste mask part of the design and the green circles. The blue board outlines are disabled


    This is the first row being engraved. You can see that there is a little sloppiness in the outlines, but in general they are pretty much all the right size. Here’s the final sheet:


    The stencils look like what I expected and the 5mm holes look appropriate as well. Maybe this will work after all…

    Next up was cutting the top piece of chipboard with the board outlines. The board outlines are turned on in cut mode, the circles are switched to cut mode, and the paste mask is turned off.


    I previously did a proof of concept on this step, so I knew it was going to work. Nice clean cuts.

    And finally, the base cardboard piece. All it has is the circles, so it looks like the above picture with just the circles.


    Sandwich time!

    We start with the base.


    And then add in the 5mm pins. This posed a bit of a problem; the pins have a nice chamfer on the end so they didn’t stick into the cardboard very well. I solved this by cutting one of the pins in half with a dremel and an abrasive wheel. I should also note that at 4.96mm, they are just slightly undersized.


    So, it turns out that the 5mm holes aren’t quite 5mm in size; they are just a bit smaller so I need to force them in a bit. A friction fit is good, but a forced fit is less good. This is exactly the sort of stuff you learn if you do test cuts. Well, perhaps version #2…

    Adding in the board layer, which aligns quite well with the bottom layer. And the boards fit with just a little bit of movement, which is just about perfect. They are proud (above the surface) by about 0.3mm, which I determined by math. That will probably be okay, but if I want/need it to be closer, I can easily shim it out with some mylar, which at 4 mil is almost exactly 0.1mm thick.


    The moment of truth. Adding on the mylar layer. The mylar holes are also too small, perhaps more too small than the cardboard.


    What sort of result did we get? It mostly looks pretty good. There is a tiny bit of bowing in the mylar, which I think is due to the “too small holes” part, but it’s probably good enough right now. The alignment is offset a bit but it’s certainly usable:


    Revision #2

    The nice part about building a jig this way is that the materials are cheap and doing another set of cuts doesn’t take much time, so it’s easy to do another revision.

    My first goal was to fix the circles so that they better matched the pins. Since I set them to 5mm explicitly, I figured I’d need to make them a little bit bigger. So, I opened up the design in Inkscape, selected the circles, and what did I find?


    Huh? I honestly set them to 5mm, but now they are smaller.

    A bit of experimentation revealed what was going on. I am used to working in Visio where the dimensions are inherent properties of the object, so a circle that is 5mm in size is always 5mm in size.

    Inkscape is different. When you way that a circle is 5mm in size, you are setting the outside diameter, and that includes the line width. So, if you set the size of the circle and then change the line width to be thinner, your circle will no longer be 5mm in size. More like 4.95mm.

    Discovering this made me happy, as it meant that the bad fit was from something I understood, not something I did not understand.

    That was a really quick fix, and I cut the new pieces and put the sandwich together. This worked much better; everything went together much easier, and the alignment was better:


    Looking closely at the entire stencil, the errors look pretty random. It’s by no means as nice as the commercial stencils I’ve had cut, but it seems serviceable enough.

    I did want to deal with the spacing issue so I could get the board thickness a little closer to the fixture thickness. It turns out that 4 mil is almost exactly 0.1mm, so I cut a spacer as part of the previous revision. Here’s a crappy picture of my first attempt (the stencils are really hard to take pictures of):


    That is what happens when you try to cut mylar with high power; the beams stays on at the corners and totally blows it out. I *thought* this would still be usable, but all that melted mylar globs up and is way thicker than 4 mil.

    I cut a second version as part of the revision, using the lowest power that would work.


    That is definitely much better, but when I grabbed my micrometer and measured it, it turns out that the mylar melts a bit where it’s cut and the edges are about 0.2mm thick. Since I was hoping for something like 0.3mm total, just using this spacer should be sufficient.

    First pass with solder paste:


    And the resulting boards. It was mostly good enough; needed a bit of touch-up for a couple.


    LEDs and decoupling capacitor added:


    Into the oven:


    And all done:


    The reflow worked well; 11/12 were fine at the start, and I replace one LED to fix the others.


    Round 2

    Round 2 was more of a production run. I changed my technique so that after putting the paste on, I would peel the stencil up and then separate the layers to let the boards fall out the bottom. This worked pretty well. I did 9 rounds plus 4, or 112 boards total, which used up most of my LEDs. Two rounds in the oven, and I had 111 functional boards.

    I really need to build a new test rig; the current one only tests 3 at a time and it’s a pain to load them.


    I’m quite pleased with the way that the jib turned out; I pretty much works exactly the way I had hoped, and I can apply paste and populate a set of boards in about 10 minutes.

    DLE (Globes of Fire) Part 5 – First Board!

    When a new telescope is completed, one of the big milestones is known as “first light” – the first time that the telescope is used as it is intended.

    Now that I am the proud owner of a reflow oven – a modified Black & Decker toaster oven fitted with Whizoo’s Controleo3 reflow oven kit – and I have a new version of my boards back – it’s time to think about how to build these things in a reasonable way.

    The plan is obviously to switch from hand-soldering to reflow. To do that, the first thing that I need is a stencil that I can use to apply solder paste. Thankfully, kicad makes this really easy; you can modify the solder pad tolerances in the program, and the pcb editor can write out SVG files (thanks to Rheingold Heavy for this post). If I have the pads, I can easily cut a stencil, likely out of mylar because it’s a bit cheaper than Kapton is.

    That would give me a way to do a single board if I could hand-align it closely enough. But each of the globes needs 12 of these boards, and hand-aligning is a pain.

    So… what my real plan to do is to cut holes in a piece of hardboard (or cardboard) that will hold a number of the boards (12 or 24) and then a matching stencil. If I align the stencil one, then I can put solder paste on all of them.


    So, here’s the test. I took the pad svg and the board edge svg, joined them in inkscape and then cut them on the glowforge. As you can see, the boards fit perfectly into the cutouts, and the solder pads cut correctly. Next I will need to do a better version of this, with different colors for the pads and board edge so I can turn them off and off when laser cutting. I’m also probably going to cut holes for some posts that will give me registration between the board with cutouts and the stencil.

    You can also see the first two boards that ran through the reflow oven. I did the solder paste without a stencil and I also skipped baking the LEDs since they showed up in a factory-sealed pack and have been sealed since, and both boards came out fine. And a 10 minute reflow cycle is a lot quicker than hand soldering…

    Provisioning and using the ESP8266 controller

    The ESP8266 controller is preprogrammed with the ability to connect to your local wifi network and be remotely controlled.


    Initially, the controller does not know how to connect to your network, so it sets up its own network. Here is how to set it up:

  • Using your phone/laptop/tablet, connect to the network named something like “EDP_1002170403”. The password is the same as name of the node.
  • One you are connected, open up your browser and navigate to That should enter the provisioning page. Enter the SSID of your wireless network and the password, and click on connect.
  • If everything is working correctly, that will connect to your wireless network. You can find out the IP address by looking for the “EDP_…” name in your browser’s host table, or you can hook the esp board up to your computer and watch what it writes out the serial port when it boots.
  • Controlling via http

    You can control the LEDs via http by sending textual commands to controller. The format looks like this:

    http://[ip address]/message?content=[message]

    Controlling vs UDP

    If you want realtime control of the LEDs, http may have too much latency, which may result in unexpected pauses. The controller also supports communicating through UDP.

    To connect via UDP, use the same IP address and pass commands directly. The internal controller code runs at 100 Hz; if you drive with UDP messages at 60 Hz everything should just work great.

    Supported Messages

    All commands are three letters long, followed by another character (the examples use an underscore (“_”), followed by numeric parameters.

    The following commands are supported:


    Alternate between two colors.


    r1, g1, b1: the rgb values (0,255) for the first color (0-255)
    r2, b2, b2: the rgb values for the second color
    time: the time for each color

    Example: alt_0,100,000,000,000,000,250

    Blend to

    Blend from the current color to a specified color


    r, g, b: the rgb values (0,255) for the new color
    time: the time for the blend

    Example: rgb_255,255,255,1000

    Color rotate

    Rotate through a bunch of different colors.


    speed: the speed of the rotate
    brightness: The brightness of the colors

    Example: col_5000,200

    Flash decay


    decay: the speed of the decay
    min: the minimum pause before the next flash
    max: the maximum pause before the next flash

    Example: fdcx250,10,500

    Full control

    Full control is used to control the color of all the leds directly.


    chunk: the number of leds to apply each set of data to.
    data-bytes: colors express as two digit HEX values in the format RRGGBB

    Example: ind_011,000044440000004400

    Each color in data-bytes will apply to 11 LEDs. The data-bytes contain 3 color values:

    000044 – a blue value
    440000 – a red value
    000044 – a green value


    Save the current animation so that it will use that animation when rebooting.


    Set pixel count

    Set the number of pixels that the controller will use. This will result in a reboot of the controller.


    count: the number of pixels

    Example: n_13

    DLE (Globes of Fire) Part 4

    It’s been very long since my last update, and a fair bit has happened.


    I did a rev 1.2 of the board and sent them off to allpcb for a small run (10 IIRC, so 120 of the LED boards and 15 of the end boards).

    The boards showed up quickly, and didn’t work. Well, two of the LEDs worked sometimes, but the third would not.

    Clever me, I did some led moving and I managed to route the VCC line for LED #2 right across the data out pad when I did some moving. I could break the pad by hand and get them to work, which through trying to be quick led me creating a circuit that would work for all the colors except white because I didn’t break the trace completely. Which led me to think a new real of LEDs was bad and waste a couple of days trying to track down what was going on.

    I took the opportunity to do rev 1.3:


    I bumped the VCC and ground tracks up in size, redid the VCC routing, and just generally cleaned things up to be nicer. I also added (finally) a 100 nF decoupling capacitor to the right of the #1 LED, which should help eliminate glitches in the future.

    I spun a small verification order (3) through OSHPark because it was only $5, and those worked great. After that, I pulled out my little list of material costs, went back to reprice the PCBs, and found that JLCPCB would do my full first order for $83 delivered, which was about 30% less than the $120 I had written down. Given the temporary nature of PCB special deals, I put that order in, and today found this on my doorstep:


    Well, technically they were in a *box* on my front porch. That is 600 of the LED facets in the two bags at the top and 50 of the top facet in the small box. And the two pretty purple boards are the test ones from OSHPark.


    I’ve gotten pretty good at soldering the LEDs on the facets, but my plan all along was to reflow them. Towards that, I picked up a few things:

    That’s a nice little Black & Decker TO1313SBD toaster oven.


    That’s a Controleo3 toaster oven conversion kit. We’re going to hot-rod that oven, adding a full computer control to it (the blue board on the left), add an extra heating element, a lot of insulation, and even a servo to open the door.

    All of this will give me a reflow oven; you can put a board with solder paste and components on it, hit a button, and it will heat the board at a certain rate until the solder melts and then cool them down at an appropriate rate. It’s going to live under the garage near the laser cutter, and my guess is that I’m going to need a bit of ventilation for it.


    I am at what I think is the V1 firmware, for approximately the third time. This took a whole lot of time and effort, with the usual fun of running two different codebases on two microcontrollers connected over USB.


    The first time setup for IoT devices can be a bit of a pain, as they have to get your wireless ssid and password. In playing around, I found that iOS doesn’t let you enumerate wireless networks or change connections programmatically, which meant it might be a real pain to set up multiple nodes by hand.

    Then, I had a small bit of insight, and realized that I already had a device that could easily enumerate all the wireless networks; the ESP can do that an I already had the code because I needed it for testing. It was merely a matter of grafting it onto the existing code.If you connect to the network for any node and give it an SSID and password, it will verify that it works and then pass it off to all of the other nodes so that they can auto-configure. That code is all done, and it’s pretty cool to watch because the current firmware shows the state of the connection by flashing. Okay, maybe that’s only a little cool.


    I wrote a few of the simple animations that I want; some color rotations, a flash and decay animation, and a blend from the current color to a new one.

    I also wanted to be able to go fully to the metal and control every LED remotely and quickly. That led me to a better Http server for the ESP, a brief flirtation with TCP, and finally an implementation based on UDP. The server is fast enough that you could send the data for all 33 leds 500 times a second and it would work; it is currently constrained to 100 Hz because that is the speed the animation loop runs at, and I expect that for real applications sending data at 60 Hz would be fine.

    I am particularly happy with how the command processor worked out; the implementation is nice and clean.

    The wireless information is stored in permanent memory, and it is also possible to store the current animation so that it will resume on startup.

    Software (app)

    I want to have an app to control all of this. It needs to support both Android and iOS, which made Xamarin the logical choice; I can support both and I can write C# code which is a huge plus in my book.

    Like many open-sourcy software, it can be a real pain at times, but I’m able to build an app that deploys to my phone and debugs, and that’s a decent first step. I’m working on network discovery right now; once the provisioning is done, the app needs to enumerate all local ip addresses and see if one of my controllers is hiding there.

    And I’m using Xamarin Forms, which is built on top of XAML, which I guess is an advantage since I did XAML professional for a fair bit, but it’s a bit of a mind-bender as usual.

    I wanted to do something different for discovery, so I wrote a graphical pinger. Here’s a video.

    The app still needs a lot of work; it needs a way to do the initial provisioning, a way to list the different animations it can do, a color picker, etc.

    Givin’ the dog a bone–USB charging station part 2

    One of the realities of doing CAD work is that the real world sometimes intrudes…

    Your laser cutter – for example – is limited to cutting a given size of material, and only in one plane. And it isn’t a perfectly thin cut, there is a little width to the laser beam.

    For router-based machining, one of the problems is that the cutter is round, and often the cuts you would like to make are square. Here’s an example:

    Image result for cnc dog bones

    The part on the left is what you designed, and the part on the right is what you got when you cut it. There are a few approaches to deal with this; you can cut the corners out with a knife or saw, you can just pound the parts together and hope the material yields, or you can change your design so that the corners are cut out. It looks like this:

    Image result for cnc dog bone examples

    Hence the name “dog bone”. With the Shaper, there are a few ways to do this; you can either modify your design to include the dog bones, or you can do them on the tool, one at a time, kind of by hand. Since there are hundreds in this design, doing them on the tool did not seem very exciting.

    There is an add-in for Fusion 360 that does dog bones, so I installed it and tried it on a few designs. Like lots of freeware, it’s a bit challenging; you either have to pick every corner where you want the dog bone, or you can let it pick the corners that need to be modified but this only works if the corners are vertical.

    Oh, and it takes a long time. A *long* time. Like 5 minutes for a panel with just a few cuts if you mark them by hand, or 20+ minutes for one with lots of holes (19) where it figures out which corners to modify. This is made much more annoying because Fusion 360 does something that I thought wasn’t supposed to be allowed under Windows UI guidelines any more; the status bar that it shows brings the window to the foreground and selects it. Since this is happening about every second, you can’t do anything else on your computer while the dog-boneification process is underway. Which kindof gets in the way of making good progress, since you need to go and do something else.

    About this time I needed to get some wood for the shelf, and I needed to know how much and how I would arrange it the cut pieces on the board. I found this tutorial to be very useful in understanding how to do that, and ended up with a nice layout on a 24” x 48” sheet that used a bit more more than half of the space.

    Went to add the dogbones by selecting all 13 pieces in the and kicking off the add-in. An hour later it was still running. Two hours later is was still running, much more slowly. Left it overnight and came back to the autodesk crash dialog.

    About this time I was really thinking of just using the Glowforge and forgetting about dogbones, but the whole point was to use the shaper, so I pressed on.

    Went out for lunch, picked up some stock (birch plywood that was 4.7mm thick), rolled back to my 3-d layout, set the thickness of the stock, and went through and did each of the dogbones by hand-selecting each corner. After that was done, I ran the Fusion 360 plug-in for the Shaper Origin, which generated SVG files that I uploaded to their website (you can use a USB key if you’d rather). I was going to do the bottom part of the design; the last wide shelf and then the pieces that hang the hub underneath that, four pieces in total.


    At some point, Fusion lost the material selection for the one piece, and I was too lazy to fix it.


    Here is the setup. Sitting on the router table portion of my BT3000 table saw, I have an extra ikea shelf (melamine and very flat), a sacrificial piece of MDF on top of that (you need to cut just through the material), and then the birch plywood on top (that piece was about $8). Across the wood you can see the “shaper tape”; this is how the vision system on the router knows where it is. The basic process to cut is:

    1. Move the router around so that it locates all of the domino-shaped shapes on the shaper tape.
    2. Load a design (in this case, from the online pieces I uploaded)
    3. Set the cut parameters (the size of the cutter you have in the router (1/8” in this case), how deep you want to cut on this pass (I did two passes, one at 0.125” and one at 0.2”)
    4. Do a “z – touch” so that the router knows where the top of the material is and can therefore judge depth.
    5. Move the router so that the line you want to cut is inside the circle.
    6. Turn the router on (using the physical switch on the head)
    7. Press the cut button (green button on the right handle), and wait for the bit to plunge into the work.
    8. Navigate the router around the cut.
    9. Press the retract button (orange button on the left handle), and wait for it to retract.

    At that point, you can move to another cut that needs to be made or change parameters and recut the same line (deeper, for example).

    This worked really well, except for two issues. The first was that on my second cut, something went wrong, and on the cut, the router plunged the bit as deep as it could and then the software crashed (you can see the burned hole near the bottom of the workpiece). I had to turn off the router, pull it carefully out, and cycle the power on the shaper to get back. The second was my fault; I cut all the way through an outline before forgetting that the piece I cut had a cutout. Oh, and the software crashed again when it was just sitting there; the image on the display is a static one before I moved it to make the picture nicer.

    And the result is…



    What do we see? Well, the first thing you’ll notice is that there is a lot of fuzziness on some of the cuts. The shaper uses an upcut bit, so that’s pretty common. The fix is to do the first cut at a bit of an offset back from the line and then do the final cut without the offset. Overall, the lines look really straight, which is remarkable given that a human is moving the router around.

    What else do we see? Well, the joints don’t look very good, and there is a distinct lack of dogbones on them.

    It turns out that I outsmarted myself. One of the tricks with dogbones in wood is to set the cutter size slightly smaller than the actual size of the cutter; that makes the dogbone a bit smaller but it still works since the wood has a little give to it. But… the Shaper knows the size of the cut you are asking it to do and the size of the cutter, so it just avoids cutting the dogbone path. I cut them by hand with a utility knife, but I was short of time so this is the result I got.

    Finally, a couple of action shots with the hub in place:



    Up next is to redo the dogbones for the remaining pieces *again*, and the cut them using the offset to see if I can get nicer joints.

    WPC Driver board Upgrade

    I finished the upgrade of my WPC driver board today. It was fairly simple despite Williams using a crappy circuit design; instead of using vias to carry power from one side of the board to the other, they rely on component leads to do that, presumably to save cost.

    If you do this yourself, after you remove the component make sure to tin the ring on the component side with solder and overdo the amount of solder you use if you can’t see the component side; I had to redo several of the big capacitors because they had great solder joints on the bottom but not enough solder to grab onto the other side. So, on those components, jam more solder in there than you would normally do, and I also recommend grabbing the schematics, an ohmmeter, and checking for continuity through the hole.

    WCS Power Driver Board Voltages

    I measured the board voltage for future reference, both with only the input power connected to the board and the game in attract mode, using a quality Fluke voltmeter.

    AC is measured to look for poor filtering by the large capacitors on the board; as the capacitors degrade there will be more AC present on the voltages.

    Test point Input DC Input AC Attract DC Attract AC Description
    TP1 15.83 0.002 13.8 0.1 +12V filtered but not regulated
    TP2 5.02 0 5.01 0 +5V regulated Digital supply
    TP3 12.03 0 11.7 0 +12V regulated digital supply
    TP4 0.393 0.6 3.80 0.06 zero cross
    TP5 Board ground
    TP6 77 0 76.2 0 +50V for solenoids, flippers
    TP7 22.26 0.003 21.8 0.01 +20v flash lamps
    TP8 18.52 0 13.9 – 15.1 0 – 2 +18 to lamp columns

    WPC driver board issues

    My WCS 1994 is having some issues; the DMD display is showing static and now the game is behaving strangely.

    I’ve been using the guide here, but I’d like to share some other data I’ve gathered since I didn’t find it elsewhere.

    Test point Working DC Working AC Problem DC Problem AC Description
    TP1 14.7 0.63 13.5 0.08 +12V filtered but not regulated
    TP2 4.93 0.01 4.97 0.001 +5V regulated Digital supply
    TP3 11.92 0.008 0.758 0.122 +12V regulated digital supply
    TP4 0.37 0.63 3.62 0.06 +50V filtered
    TP5 0.03 Board ground
    TP6 73.2 0.2 – 0.8 75.1 0.01 +50V for solenoids, flippers
    TP7 21.7 0.09 21.6 0.04 +20v flash lamps
    TP8 15-17 0.2 (ish) 11-14 0.8 (ish) +18 to lamp columns

    “Working” values come from my Twilight Zone (working), while “Problem” ones come from my WCS (not working).

    What can we tell from this?

    Well, a few things. The obvious issue is TP3; it is less than 1 volt when it should be around 12 volts, and it’s letting a lot of AC through at all.

    Time to pull out the schematics.


    Sorry, that was the best image I could pull from a PDF; the paper version isn’t much better.

    Basically, we have power coming in from the left side, which should be a nice healthy 18volts (measured at TP8). It goes through two series diodes that will drop the input by a little over a volt, and then it goes to an absolutely-standard 78xx linear regulator circuit; a capacitor on the input, a 7812 (for 12volts) and a capacitor at the output. 78xx regulators are pretty robust, so let’s see if we’re using it correctly…

    Like most linear regulators, the 78xx series has some limitations around input voltage; it requires about 2 volts of headroom to be able to give us the output voltage, so we should be looking for 14 volts coming in. We have 11-14 volts – it fluctuates because the lights are flashing in attract mode. That 11-14 volts isn’t enough to consistently give us enough voltage for the 7812 to give us a nice 12 volts.

    So, we don’t have enough power coming in, so that is the problem, right? Well, not so fast. Based on what I know about the 78xx regulators, one would expect that if the voltage drops enough so that you don’t have a full 2 volts, you will see the output voltage slowly drop down.

    I pulled out a 7809 and hooked it up to my variable power supply, and found that this was mostly true; the dropout voltage was about 1.2 volts (two diode drops). That means I would expect that the 7812 would put out less voltage but something close to 12V.

    So, that suggests that we have two issues going on; we don’t have enough voltage coming in for the regulator to work and the regulator looks fried. That is supported by some data I had before this where the game was acting very weird and the voltage at TP3 was fluctuating all over the place. So, a new 7812, and it would be a good idea to replace the 1n4004 diodes and the electrolytic capacitors in this section at the same time, since this board is nearly 25 years old.

    Looking at the input voltages at T8, note that there is a decent AC component in the DC voltage – about 0.8 volts. Back to the schematics:


    This is also really simple; we have AC from the transformer coming in, going through a full-wave rectifier, and then there are two honking big 15,000 uF electrolytic capacitors. As these capacitors age, they are going to lose some capacity and have an increased internal resistance; both of those make them worse at filtering, so it’s time to replace those as well. It’s possible that the AC that they are putting out ended up hastening the end of the 7812.

    It’s typical to replace both the capacitors and the bridges when the board is reworked, just to make sure, so I will probably do that.

    I am a little concerned by some of the values I see on my TZ board; there are some indications that the caps there need replacement as well. I’ll do the WCS and then compare it to the TZ one.

    DLE (Globes of Fire) Part 3

     The new boards arrived from To recap, this, time I went with standard 0.1” (2.54mm”) header pins between the boards. I ordered some angled headers from the Amazon to use for the connections.


    After I populated 11 faces with LEDs, it was time for assembly. Here’s the first approach:


    The first concept was to wire the faces together with short pieces of header on the back. This worked poorly; it took a long time to hook them up and the angles were rarely right. The first half was technically done, but I was unhappy.

    For the second half – and keeping in mind that prettiness was not a requirement – I decided to go with another approach. I would use angled headers on the outside, and just solder the pins together where they overlapped.

    But first, I needed a better way to set the angle. The led to the following design in TinkerCAD:


    And then a long session of setup to migrate my 3D printer from an absolutely ancient laptop to one that was merely old. I printed up a whole set of these, and then used them to hold the faces at the right angle for soldering. That resulted in this upper ring:


    The alignment clips on the right worked very well; it only took about 30 minutes to do this whole ring. And yes, it’s very ugly.

    Time to hook them together, and then attach on the end face. These are attached with small pieces of header pin on the outside.


    Then it’s time to wire up the 5 volts, ground, and data, and take it out for a spin.

    The first attempt was not successful; one ring lit and the other didn’t. A quick check discovered that the ground connection between the two rings was not functioning, so I added an additional connection. Which led to this:


    The driver is running some simple rainbow code, so each LED is a slightly different color.

    Finally, adding on the requisite acrylic globe gives us the following:

    Globe of fire from Eric Gunnerson on Vimeo.

    Overall, I’m mostly happy. It would be nice if the header holes were a bit tighter on the pins, and I could clearly get by with 2mm or even 1.27mm pins. The 3d-printed alignment clips could use another iteration to make them easier to use.

    DLE (Globes of Fire) Pt 2

    A week or so goes by, and I get a package back from allpcb, so I started building one.

    Each half has a ring of 5 pentagons plus one the end, so I started hooking 5 boards together:


    The WS2812 LEDs are only 5mm on a side, so the whole board is roughly 15mm x 17mm. That’s tiny, and frankly working on it was a huge pain. I did this, put the boards into a box, and closed it.

    Then I came back the next day and decided to have another try. Rather than connect on the outside, I decided to use a much lighter wire and connect on the inside (back) of the boards. Here’s a set of 5 with VCC and GND hooked up:


    Yes, that’s some *ugly* soldering, but in my defense I’d like to note that the spacing on the holes is about 0.05”/1.3mm. This then gets folded into a ring. Eventually, we end up with the top and bottom:


    Next, those two are soldered together with wires to carry VCC and GND between halves, and you end up with this:


    Next was to wire through the data ports. Basically, it starts at one face at the open end, goes around that ring, goes around the lower ring, and finally travels to the bottom. Add in some hot glue to help hold things together, and put the LEDs on, and here’s the result:


    That is one ugly bit of construction, and it took a lot longer than I had hoped.


    After soldering a few hundred WS2812s, you learn how to do it without burning them up. On the left is one face from the 3-LED version that I tested to verify the layout.


    The first version was technically a success, but only because I so cussedly kept on. I was wondering if I could make something small enough to fit in an ornament ball, and the answer is “yes”, but you really don’t want to do it.

    So, it’s practically a failure.

    The biggest problem is the connection between the faces; the holes are too hard to solder, and using individually-cut wires is a pain…

    So, I’m going to abandon the single-LED version (kindof – more on that later) and work on the 3-LED version. I started by going with standard 0.1” (2.54mm) header spacing, and the plan is to use angled headers. The angled headers will stick out to the side, and two faces are connected by soldering the ends of the header pins together. It’s going to look a big weird, but should be a lot easier to construct.

    Here’s the old design and the new one:


    Obviously, the big different is the connectors; they are much larger, though the overall design is only a big bigger. I’ve used the extra space to pull the LEDs a bit farther apart because trying to hand-solder the LEDs in the first version was a difficult. And I added a little bypass jumper; if you solder a wire (or better, a 0805 zero-ohm resistor) across those pads, you can omit the bottom two LEDs and things will work fine.

    If you read backwards, you might see that it says “Dodecahedral Light Engine” on the back, which is the new name for the boards.

    A fully-populated DLE will features 33 LEDs, pull 2 amps @ 5V with everything on white, and put out quite a bit of light.

    I need one more design review pass before I send this one out to have boards made.