Priming the panels for painting

After sanding, the panels were primed for painting.  Before the final paint job, I need to install all the fasters.

Notice the faux windows in the side panels are blacked out.  This is so they look mostly like the real ones when the YARDIS’s door is closed.

To attain the weathered/frosted glass look (from inexpensive acrylic plexi) for the window panes, I just took a hand sander to it loaded with 60 grit sand paper.  To avoid melting the plastic I wet the surface first.

This will give you an idea of what it will look like.

My wife is HOT!!

….Literally hot- as in radioactive!  For laughs, Katie let me measure her radioactivity immediately following her PET scan.

I was really surprised how easily we could get a reading.  I am currently looking into the feasibility of making my own PET scanner using PIN photodiodes, instead of LYSO crystal scintillators and PMTs.  Of course, it will be a while before I make my own cyclotron (to generate isotope tracer), but I could always test it out after one of her scans.  So many projects, so little time!

Test fitting the roof

Katie was kind enough to let me take over the kitchen island for the day while I assemble the rest of the YARDIS in preparation for test-fitting the roof.  This operation also served to figure out where I will put all the fasteners.  The goal is to make it assemble/disassemble like knock-down furniture.  Otherwise, it would be impossible to move to another room or even another house.  I made sure to put hinges on the door so she could practice going in and out of her new toy.  She’s had an ear to ear grin all week.

Making the Roof

Never one to go the easy route, I opted to give her YARDIS a sloped roof.  Lexi helped me coat the thing in primer.  This is the first thing I’ve ever built where aesthetics mattered, so I used wood putty to fill the gaps and sanded everything down first.

Making a TARDIS!

Katie has gotten into knitting and crocheting, amassing a formidable yarn collection in the process. We needed a lot of storage space, so I opted for a T.A.R.D.I.S. as it is bigger on the inside.  I borrowed heavily from WWMM, with a few modifications so it is actually structurally sound (instead of just a prop.)

Lexi loves learning and making things with me, so I brought her in on the project.  She’s doing a wonderful job!

 

Stay tuned!

 

The post-truth era

Here is a truth bomb about the post-truth era.  Decode this if you can.  As you straddle this problem, remember that sometimes people are playing chess when they really should be playing checkers.
85385 97713 47482 62190 34907 20718 28780 25474 90275 51999 08575 87906 82090 85090 54906 90803 12972 82832 75900 82694 90529 31907 00716 83109 03739 07907 90191 90825 71756 82729 07268 57754 19073 82679 07290 27509 07134 71080 29023 90086 80786 54908 57587 90383 82907 08265 41906 82090 13907 98371 75907 86827 40829 02756 49082 08183 58207 29073 38290 18382 84584 67890 64729 08208 08237 28371 25349 19075 09082 06134 07290 38382 90795 47219 07568 40900 84378 84072 90275 09067 05785 28790 23907 53129 07907 90192 90700 75684 53821 90382 90572 06190 27562 90716 49070 09071 38050 72907 38237 99080 08213 49023 90800 82134 91907 90790 19068 20901 83707 60712 90239 07964 87903 73902 75090 16790 90728 74679 57119 03739 07404 02571 90084 37883 25349 06472 90850 90756 84090 71397 08437 88407 29085 52759 02750 79919 03838 29082 07862 53417 55809 08552 75902 75079 90126 82207 29038 32907 98328 36787 88790 70040 73571 56789 29078 57709 02750 90177 57878 90373 90796 77547 49069 01800 68292 90382 90126 82254 74906 90735 82091 90902 75090 75312 90853 83787 29018 08206 72902 75090 79079 09023 90327 50829 07531 21929 06472 90275 09079 07909 07507 88007 29027 50907 53129 07378 38382 51759 19027 50907 93820 90790 79019 02750 90753 12907 13837 87290 12382 09290 27509 07938 20907 00407 35219 05290 71383 78729 08206 80902 75831 90780 67254 74902 39038 38290 84082 87907 86827 40907 08265 41919 03840 82902 57909 29027 55190 71397 08437 88325 34906 78783 85072 90831 90239 07007 13790 90275 09084 61278 87908 03850 82738 37892 90207 17543 78374 57167 89071 58457 85886 25349 08509 06820 90237 26879 19090 15471 09027 50907 20840 78380 79042 90373 90796 11907 90725 69064 72901 37156 78907 90725 69290 27508 20907 56190 70004 90690 73834 72679 04267 89017 55732 90549 02750 90706 78647 10903 73908 03850 82907 00285 00490 83190 64729 02750 90790 79019 19090 54906 49004 84582 34790 42908 57508 20907 90790 19071 64908 18357 17778 87901 80820 67292 90275 08209 05190 78011 90107 80712 58409 08082 01183 82090 23907 00907 00407 35715 67890 23902 75090 75312 90382 90084 04907 00902 82830 91909 05290 76831 29075 68409 01379 09013 82290 37390 68080 06789 02756 29067 87838 51905 29023 90180 82067 29073 82379 90753 12902 39075 31291 90901 54710 90275 51901 75573 29290 79079 01904 38590 83109 08319 07338 29027 50582 90700 40735 29067 83409 29071 37980 02547 49085 52759 03275 08290 79079 01907 33829 01806 71090 54903 83829 07082 65419 06472 90041 78684 54749 03838 29067 12534 19190 90275 83190 85090 68209 04385 90549 06908 03129 72828 32759 00826 92908 25730 90855 27590 72584 51534 90647 29071 34737 85712 91908 50906 82090 27509 01378 72508 21903 73902 75058 29085 68219 29070 09052 90275 82383 74759 03478 54090 28237 87854 74903 82907 85208 26787 88790 72875 47490 34902 75090 70622 78073 50787 29190 90084 04907 13828 03826 25341 92907 43840 82479 04219 06472 90820 78574 53419 06820 90690 73382 79903 73907 90790 92904 38590 73007 25474 90373 73903 73908 31919 02750 10905 41252 83253 41907 16490 70090 70040 73571 56789 29067 87890 85090 79831 29072 39051 90239 08347 20821 26472 90275 01090 79079 01906 47290 12008 29027 50799 02385 68272 19069 07938 20907 98328 36787 88790 70040 73571 56789 08207 86253 41755 80919 08562 71759 07264 90720 44022 93190 20729 02678 77907 26474 08238 31907 90790 191

Charlieplexing

Note:  If you are seeing this note, then you are looking at an incomplete draft.  Keep checking back as I complete these series of blog posts over the next week or two.

You might be familiar with Charlieplexing with LEDS, but the same technique can be adapted for switches.   Let’s start by replacing LEDs and resistors with diodes and switches in the familiar Charlieplexing schematic layout.

For greater clarity, we are assuming the microprocessor has weak pullups enabled and can omit the external pullup resisors on the lines. This still looks insane and it gets even worse with more switches.   Let’s find a more systematic way to represent the connections.

All we’ve done here is swap the position of some diodes and switches, but the overall circuit is electrically identical.  Now we can begin to make the relation to a conventional scanning matrix more clear.

In this case, the common connection at the cathode for a group of switches would have been a column in a typical matrix configuration.  Let’s make the similarity even more clear by rearranging like this:

 

Basically, the columns are tied into the row lines.  Since we’re using a given row to select a “column”, we can’t use it to read that row at the same time. Thus, there is one less switch per row.  So with n lines, you can read n(n-1) switches.

When a “column” is selected, the other lines are tri-stated with pullups enabled to serve as inputs to read the rows.  For instance, when column 1 is selected, lines 2 & 3 function as input rows.  When column 2 is selected, lines 1 and 3 become input rows.

#define NUM_COLS (n)
#define NUM_ROWS (NUM_COLS - 1)

uint8_t keyMatrix[NUM_ROWS][NUM_COLS];

uint8_t buttonPressed(uint8_t row, uint8_t col)
{
    return keyMatrix[row][col];
}

void deselectCols(void)
{
    TRIS_GPIO0 = 1;
    TRIS_GPIO1 = 1;
    ...
    TRIS_GPIO(n-1) = 1;
}

void selectCol(uint8_t col)
{
    deselectCols();
    
    // Col LAT should already be set to LOW
    // so just enable the driver out of
    // tri-state mode so it can pull the
    // column low.
    switch (col)
    {
        case 0:
            TRIS_GPIO0 = 0;
            break;
            
        case 1:
            TRIS_GPIO1 = 0;
            break;
        ...    
        case (n):
            TRIS_GPIO(n-1) = 0;
            break;
    }
}

void readRows(uint8_t col)
{
    // Read Rows.  Switches will be active low,
    // so invert the reading.
    
    // Here is concrete example, using 3 GPIO
    // lines in a 3 x 2 matrix.  The key to
    // remember is there's n-1 rows and you
    // cannot read a row from selected col.     
    switch(col)
    {
        case 0:
            keyMatrix[0][col].input = !GPIO1;
            keyMatrix[1][col].input = !GPIO2;
            break;
        case 1:
            keyMatrix[0][col].input = !GPIO0;
            keyMatrix[1][col].input = !GPIO2;
            break;

        case 2:
            keyMatrix[0][col].input = !GPIO0;
            keyMatrix[1][col].input = !GPIO1;
            break;
    }
}

//call every millisecond
void scanMatrix(void)
{
    for (uint8_t i =0; i< NUM_COLS; i++)
    {
        selectCol(i);
        // Give time for voltage levels to stabilize
        __delay_us(50); 
        readRows(i);
        deselectCols();
    
    }
}

void initMatrixIO(void)
{
    //configure GPIO pins
    
    // All digital mode
    ANSEL_GPIO(0..n-1) = 0; 

    // Set all latches low. The latches needs to
    // remain low for the rest of the code
    //  to work. This way they can pull columns
    // low when no longer in tri-state.
    LAT_GPIO1(0..n-1) = 0;

    deselectCols();

    // Enable all pullups.  This is necessary
    // when pin is serving as input.
    // Should do no harm when it's an output.
    WPU_GPIO(0..n-1) = 1;

}

void initKeyMatrix(void)
{
    initMatrixIO();
    
    for (uint8_t i = 0; i < NUM_ROWS; i++)
        for (uint8_t j = 0; j < NUM_COLS; j++)
            keyMatrix[i][j] = 0;
}

The main drawback to Charlieplexing is that it’s no longer possible to resolve the ghosting problem when multiple keys are pressed at once.  The other is that you can’t use a keypad wired in a standard matrix.

I know you’ll stop being my friend if I leave you without a working example, so I hacked together a 5 x 4 Charlieplexed key array from five 1 x 4 key matrix strips.

<USB HID Keyboard example firmware using 5 x 4 matrix>