• PCBs Arrive & Lasering an Enclosure

    Benjamin Broce10/07/2018 at 01:22 0 comments

    PCBs arrived from OSHPark a bit earlier than expected (past the challenge deadline, but that's my own doing)! Just a bit of cleanup, and they'll be ready for soldering (once the DigiKey order arrives).



    PCB dwarved by it's prototype :)

    I decided to learn a bit of Inkscape to design my SVGs for laser-cutting an enclosure. I used the tutorials by ATX Hackerspace and Eric Bredder. My idea was to stack 4 layers of 1/8" MDF with a top cover of 2mm Acrylic, which could then be engraved. I accomplished this by exporting an SVG board representation from KiCad, importing it into a layer in Inkscape, and designing each piece of the enclosure in a separate layer, to process and gather into each actual layer of material. The master file (all layers overlayed) ended up like this:

    I decided to do a negative raster on the top acrylic layer, such that everywhere my text and images weren't were engraved, to allow more diffuse area for the LEDs to shine through:

    The image is of the Angel Moroni (an important symbol of missionary work in my church), and the text is a translation of "God Be with You 'Til We Meet Again".


    The lasering turned out really well!

  • Prototype for Firmware Development

    Benjamin Broce10/07/2018 at 00:49 0 comments

    I plan on programming my boards using ArduinoISP from my Arduino UNO, so I thought I would get a jump-start on firmware development and testing an ISP setup by building a breadboard prototype of my circuit (as I've always programmed over UART in the past).

    I soldered together a little SIP ISP programming header, and set the fuses of a DIP ATmega328P with Optiboot I had laying around to run with the 8MHz internal oscillator (since I didn't have a 16MHz crystal on hand, Nick Gammon's wonderful Arduino tools helped me out with an alternate clock source). On the actual board, I plan on using the 8MHz oscillator for the CPU, and running a Timer2 RTC with an external 32KHz crystal. After laying things out (including a button to simulate the touch sensor), a simple test program (blinking one of the Charlieplexed LEDs) worked great:


    After some research into more easily controlling a Charlieplexed LED matrix, I went with Alexander Brevig's Charlieplex Library. This allowed me to run a more complex test with all of the LEDs, and had a great design for storing matrix pairs in an array of structs, but a bug quickly surfaced that could affect minimum refresh time on larger displays - If I didn't clear() the display before switching an LED on every time, then multiple LEDs were lit (which means that not all of the 6 control pins were truly driven into high-impendance "disconnect" upon writing a "low" using the library's charlieWrite() function). I modified the library to my liking, including the fix to this bug (writing both control pins for an LED to high-Z disconnect - input mode written LOW - upon writing the LED to "low" using the library).

    Next was to figure out sleep modes and pin-change interrupt wakes via the touch sensor. Nick Gammon's tutorials were again extremely useful, and got me up and running with a writing registers for interrupt setup. I can't test anything I write for the Timer2 timekeeping interrupts until I assemble a prototype board, because I don't have a 32KHz crystal on hand, but that and ultra-low sleep modes are the next steps. I also would like to allow shorting of some of the ISP pins to 3V3 to allow for setting the "time" in case of power failure or reset...

    Videos are taken, but not yet hosted anywhere - they'll come later.

  • PCB Layout Fail (And Fix)

    Benjamin Broce10/07/2018 at 00:27 0 comments

    Early on the PCB layout process, I used an "0603" footprint for most of my passives and my LEDs, and finished what I thought was a great component layout. Everything was fitting a little too well, with lots of extra room... Upon further inspection, I found that the footprints were really 0603 metric, or 0201 imperial, and I was further taught that almost all hobby PCB design and SMD parts are referenced in internet parlance in imperial. There goes my "bigger than a grain of rice" requirement...

    After reworking my component sizes up to 0603 imperial, I was finally able to get a good component layout, connected up traces, placed ground planes, and finished my first PCB design!

    In addition to the LEDs, regulator, ATmega, and cap sense chip, I added a jumper to a pad that could allow an external capacitive touch pad if the 6mm one under the OSHW logo isn't sensitive enough. I also made the footprint for CS1, the capacitive touch sensitivity adjustment cap, 1206, so I could get a few values to experiment with and hand-solder them. Time to whip up a BOM and design an enclosure!

  • Idea & Research

    Benjamin Broce09/15/2018 at 19:10 0 comments

    I've wanted to build something for the square inch project since the original challenge announcement, but most of my ideas have involved the ESP8266 or ESP32, and were a bit too grandiose for my first foray into PCB design. So with a few weeks left, I thought I'd build a blinky memento for my upcoming mission trip. The basic idea is a square inch flag-themed LED grid with 1 LED for each month I'll be gone.

    My wish list after that includes:

    • Lasting the full 2 years (preferably without recharging, and on a coin cell for assembly convenience)
    • General robustness, so that these can be carried/worn if desired - Leads me to think of a wooden/acrylic case and a capacitive touch sensor to trigger an MCU wake and the animation
    • Keeping track of time accurately enough for at least to-the-month granularity over the 2 year runtime (without resets or other functionality-breakers)
    • Relative ease of assembly and programming (time's running mighty thin!) - Arduino compatibility and parts bigger than grains of sand are preferable (though I'll likely be hot-plate reflowing)

    I considered several options for how to achieve the functionality I was going for, including consolidating processing and low-power capacitive touch interrupts with the ATmega328PB, but this didn't seem to be well-supported in the Arduino environment, and required a Windows-based proprietary tool to setup the touch sensing.

    Instead, I decided to use a plain-old ATmega328P and an AT42QT1010 momentary capacitive touch sensor - the board was starting to look a little tight! For 3.3V power from a 3V CR2032 coin cell, I decided to use an MCP1625 boost regulator. Things look to be coming together!