Yearly Archives: 2015

electronics

Jeep Computer Update

A year and a half ago, I wrote about a spanky little computer I built for my Jeep. It had been working like a boss for a little more than a year before it started to malfunction. Whereas it used to acquire a GPS fix almost instantly, it started to take several minutes to find the satellites. And the “trip timer” function (which measured trip time and average speed) no longer worked correctly. Every time the car was powered on, the clock was reset to 7:59pm or 6:59pm (depending on daylight savings status). After getting a GPS fix, the time would correct itself, but as far as the computer was concerned, the trip started at the pre-fix time, often adding several hours to the actual trip time.

My first suspicion was that the external antenna had gone bad. It’s encased in black plastic, and it sits on top of the dashboard. I imagined that the hot, summer sun baked it somehow, so the computer could only use its internal antenna, tucked (with the rest of the main processing unit) tightly under the dashboard. I ordered a new antenna, and started designing a small, protective case that I could print in white PLA, so the antenna would have some protection from direct sunlight. I decided that it would also make sense to replace the black enclosure that I had printed for the display with a white enclosure, and put a back on it for additional protection from the sun. When I pulled the display out of the car, I realized that the heat had taken a toll. The black enclosure had melted, and was drooping around the display.

Enclosure Before

Before: The enclosure was nice and square when it was first installed.

Enclosure After

After: A year and a half in the sun took its toll.

I literally had to cut away the enclosure to get the display out of it, as the PLA had so tightly molded itself around the back circuit board. Fortunately, I now have my own 3D printer, so I could use the same STL file to print a new copy of the enclosure, and design a cap to provide some shade for the back side of the display circuit board.

Finally, the main processing unit — the Arduino with the GPS shield, and all the assorted connections — was shoehorned into an awkwardly shaped, generic enclosure that I had purchased at Radio Shack [moment of silence, please]. So that was due for a new, custom enclosure. I made a pretty simple box, with some cutouts for the power and USB connectors, and holes where I could mount the GPS antenna connector and temperature sensor plug.

New Enclosure

After putting all of that together, the new antenna I had ordered arrived. I tried it out… And it made no difference. So on to the next step of troubleshooting. I remembered that the GPS shield had a built-in real time clock (RTC). That would have been the module responsible for maintaining the time when the device was powered off. I assumed also that keeping accurate time between power cycles would allow the GPS to establish a faster fix on the satellites. I pulled out the RTC battery (which was a CR1220 form factor). My multimeter happens to be dead now (due to a blown fuse) so I couldn’t test it. Fortunately, batteries are cheap. I got a new battery, and now the time is correct upon powering up, and the unit gets a fix within a few seconds. In the interim, I did make a minor tweak to the Arduino code. Previously, I depended on the unit maintaining the correct time between power cycles, so I started the trip calculation (time and average speed) immediately. Now, I wait until the GPS has a fix to start the calculations. In the normal case, the fix only takes a few seconds. However, the next time the battery dies, it will still affect the time it takes to find the satellites, but it will no longer cause the trip calculations to be totally erroneous.

 

programming

Sudoku, part 1

I know, I know. I’ve been MIA from this blog. And I feel just terrible about it. I haven’t abandoned it. I always have plenty of projects going on. Lately, I’ve just been wrapped up with a large project that has taken quite a bit of time. Lots of 3D printing and photography and working with new and interesting bits of software. I’m not ready to say much else about it right now.

Lately, though, I’ve had a bit of time to work on other projects. I decided to dig up a half-done Sudoku related project, to give it some polish. The crux of the project is a Sudoku solver (that I intend to write about at some point in the future). I decided that I needed an interface to the solver, so I put together this handy little web interface.

It allows the user to enter an initial puzzle, or to pull a random, pre-made puzzle. After the initial board is set, the user can allow for forbid impossible moves (that is, moves that would conflict with a number that is already set in the same row, column, or block). The user can also show pencil marks. Pencil marks are indications of playable numbers at each position.

Pencil Marks

I haven’t yet connected to solver to the interface. That’ll come later. The first priority was getting the board to respond to input correctly. Most of the work for managing the available moves on the board is done by my JavaScript class, Board. The Board class takes care of making sure that a move can be made, and updating all affected squares. The function to place a move in a square will only place the move if it is a legal move, or if the initial board has been set and the option to permit impossible moves is allowed. If the move can be placed, all related squares (squares in the same row, column, or block) are updated.

this.place = function(val, r, c) {
  var av = this.available[r][c];
  var placed = false;
  if ((this.setDone && getEl('impossibles_permit').checked) ||
      1 == av[val]) {
    this.placed[r][c] = val;
    this.updateAffectedLocations(r, c);
    placed = true;
  }
  return placed;
}

Higher level functions that interact with the front end operate outside of the class. The callback used when a move is played either tries to place the move if the keypress is between 1 and 9 (ASCII 49-57), or clear the square on backspace or delete (ASCII 8 or 127, respectively). If the move cannot be placed, blink the square that is blocking it.

function setSquare(e) {
  var k = (e == null ? event.keyCode : e.which);
  if (activesq) {
    var r = activesq.getAttribute('row');
    var c = activesq.getAttribute('col');
    var activepen = getPen(activesq);
    var activepencil = getPencil(activesq);

    if (48 < k && k < 58) {
      var val = String.fromCharCode(k);
      if (myBoard.place(val, r, c)) {
        activepencil.style.visibility = 'hidden';
        activepen.innerHTML = val;
      }
      else {
        var sq = myBoard.findBlocker(val, r, c);
        blinkSquare(sq, errcolor);
      }
    }
    else if (8 == k || 127 == k) {
      myBoard.unplace(r, c);
      activepen.innerHTML = '';
      if (getEl('pencil_show').checked) {
        activepencil.style.visibility = 'visible';
      }
    }
  }
  clearListener();
  return false;
}

A little JavaScript, and a little nice styling… That’s about all that’s involved. I’ll get around to hooking up the solver in the next few weeks.

knitting

Quadruple Cross Mitts

Download the pattern: Quadruple Cross Mitts

I made the first pair of these mitts in 2009. I came up with a rough sketch, then took notes on the design as I went along. I intended to write up the pattern immediately afterward. A year later, when I still hadn’t written up the pattern, I decided I needed to make another pair to make sure that my notes were correct. I did that, and again, failed to formally write up the pattern. My notes sat in a binder for lo these many years, until I finally decided that I would, once again, knit the mitts as a refresher, then write up the pattern. This time it stuck.

Quadruple Cross Mitts

Skills

  • Knit and Purl
  • K2Tog and SSK
  • Circular cast on
  • Circular bind off – Since you’ll be binding off individual fingers a “jog” will be quite noticeable. If you are not confident in this skill, I recommend reviewing the TECHKnitting review of circular bind offs.
  • Cable 1 left and Cable 1 right – If you don’t know how to cable without an extra needle, this would be a good project for learning. There are many tutorials about cabling without an extra needle, such as this or this.
  • M1 with reverse loop
  • Picking up stitches

Joining Fingers

Quad Cross MittsThe trick with gloves is not to leave holes between the fingers. I’ve tried several strategies to avoid the inter-digital void; the strategy described in this pattern is the one that I find works best. It is repeated several times in the pattern, and in fact, is a significant contributor to the complexity of the description. If you get your head around the finger joins before beginning the pattern, you’ll find that the whole thing becomes much less complex.

The primary point to recognize is that the finger join involves turning one “tube” into two. We’ll call them Tube A and Tube B. Upon separating Tube A from Tube B, you’ll continue knitting Tube A, and set aside Tube B for later. And that brings us to the second point to recognize: that Tube A and Tube B will not be symmetrical. You’ll be adding a few extra stitches between the tubes, but those stitches will be added differently to Tube A than to Tube B (and most of those stitches will disappear shortly after the base of the join).

So here we go… Get your knitting visualization caps on. You’re knitting the main tube of the work, and you are ready to start a finger. You have arranged the stitches so that the stitches for the finger are on three needles, and the remainder of the stitches are on waste yarn. On the third needle of the finger, you’ll cast on two new stitches with reverse loops, and join it to the first needle. This is the beginning of Tube A. On the next round, you’ll knit the two new stitches through the back loop (to tighten them up). On the round after that, at the stitch before the two new stitches you’ll SSK then K2Tog, effectively removing the two new stitches.

Tube B will come from the remaining stitches. Put those stitches on three needles. On one of those needles, you’ll pick up four stitches from the base of Tube A. As with Tube A, you’ll knit one round keeping all stitches. Then on the following round, you’ll SSK the first of the new stitches with the stitch before it, and you’ll K2Tog the last of the new stitches with the stitch after it. Now you have the base of Tube B.

Gauge

Hand MeasurementThese mitts are meant to be knit at a gauge that would, for most garments, be wrong for the yarn. I’d recommend starting with a yarn that recommends size 8 needles for 4 or 5 stitches per inch, and knit a swatch on size 6 needles. You should end up with a gauge around 5.5 stitches per inch (or 22 stitches per four inches). With the 40 stitches in the main part of the pattern, this gauge results in a tube of approximately 7.25 inches in circumference. That fits well — gives the right amount of negative ease — on a hand that is approximately 7.5 inches around (measured at the knuckles, around the base of the fingers).

 

Download the pattern: Quadruple Cross Mitts

snippets

Sheetz

insideShe raised her eyebrows toward the middle of her forehead. This, he knew, was to express an emotion that was composed of 40% concern and 60% skepticism. It seemed to him that she was unable to experience simple feelings. Not that she was unable to experience feelings—rather, her feelings always seemed to be some unnamed composite of named emotions. Until he met her, had he thought about it, he would have believed himself to be a sort of emotional genius, being able to distinguish between even subtle variations of happiness and joy, or sadness, sorrow and despair. But she… She lived her life like a master chef seasoning each moment with a unique blend emotional herbs and spices. His emotional palate had expanded in the months they had been together. And in this dish, he could distinguish concern and skepticism.

Had she been with her girlfriends, the look would have been enough. They would have known what she meant. But in her brain, in her overly-developed frontal lobe, a signal emerged to notify other areas of her mind that there was a non-negligible chance that he had missed the entire meaning of the look she threw his way, and this issue was far too important for her to risk failing to convey her passionately held view. Her language center was first to respond, producing the words in just such a tone that he would have been unable to miss their deeper meaning. “You mean, at that gas station where you can get food?”

“No,” he said, perhaps a shade too pointedly. He was aiming at 65% flippant, 25% sincere and 10% firmly resolved. He suddenly feared that he lacked the fine vocal control to accomplish such a technical maneuver, and that he had overshot the “firmly resolved”. He pulled back for the briefest moment to regroup before continuing. “I mean, at that eating establishment where you can refuel your car.”

Mmmm.