PCB Design with KiCAD

It is pretty incredible that you can find a written or1 video tutorial on virtually any topic to learn anything.  Today, I’m particularly thankful to Shawn Hymel, Sparkfun, and Digi-Key for putting together their Intro to KiCAD video series on printed circuit board design.

This series took me from knowing nothing at all about PCB layout and design to ordering my very first board through OSHPark.  My first design isn’t anything amazing – it was basically a breakout board for an ATTiny85 to make it easier to build small projects. 

My first ATTiny hacked tap light was a mess.  I soldered wires directly to the microcontroller making it a real pain to update. ((I ask you – is this the work of a sane man?)) I soon realized my mistake and soldered an 8-pin socket in its place so I could reprogram the chip easily.

This is the alternative to a custom PCB – a rat’s nest of wires soldered to a chip

Mercifully, Shawn’s tutorial series got me up and running very quickly.  This post is not meant to be a tutorial for KiCAD, but more like a “lab notebook” for the workflow to create a board.  If you haven’t built a board yet, go check out Shawn’s series and follow along in KiCAD.  If you are a novice like me, you might find these notes helpful:

Eeschema

  • If you launch Eeschema separately from KiCAD, you can save different versions of a schematic.  Keeping old versions of design files is hugely helpful to me and if you launch KiCAD directly, the option to save different file names and versions is not available!
  • The keyboard shortcuts in Eeschema are great.  With just a few, it’s possible to really get around quickly.
    • “Shift-A” and left click to place parts 
    • “M” to move parts
    • “R” to rotate parts
  • It is necessary to add “PWR_FLAG” to both the power and ground lines.
  • Double check your connections work by clicking on the bug icon. 
  • Assign the parts you intend to use to match up with the symbols using the “Assign PCB footprints” icon.
  • Save your work and “Generate netlist” to have something the Pcbnew will be able to work with.

Pcbnew

  • First configure the Design Rules by going to Setup -> Design Rules.  Shawn pulled these KiCAD Design Rules from the OSHPark.com website.  KiCAD has apparently changed a little since the version used on the OSHPark website, but the settings are easy enough to identify and change.
    • Net Classes Editor
      • Clearance: 0.01.  Track Width: 0.01.  Via Dia: 0.03.  Via Drill: 0.015.  uVia Dia: 0.03.  uVia Drill: 0.015.  Diff Pair Width: default.  Diff Pair Gap: default.
      Global Design Rules
      • Minimum track width: 0.006.  Minimum via diameter: 0.027.  Minimum via drill: 0.013Custom Track Widths: Track 1: 0.03
  • Read netlist” to bring your design over from Eeschema.
  • Placing parts and drawing lines gets a lot easier when you fine tune the Grid.  I started with 5.00 mils at first, then smaller figures to place smaller parts and features.
  • Once the parts are arranged in Pcbnew, connect the ground and power lines using 30 mil traces and everything else using 10 mil traces.
  • Create the outline for the board cutout by clicking on “Edge.Cuts” and drawing with the “Add graphic lines” tool.  Starting with my second board, I began cutting the corners off, so that they were a little nicer to hold and 
  • Label things on the “F.SilkS” and “B.SilkS” layers using the “Add text”‘ button.  Since my boards are so small, I wanted the text to be a fair bit smaller than the default settings.  I edited the text settings by going to Setup -> Text and Drawings.  
    • Copper text thickness:  0.007.  Text height:  0.035.  Text width:  0.035.
  • Create a copper pour with Place -> Zone, then choose “F.Cu”2 and “GND”.3 and draw a box around your board.  Then repeat for the “B.Cu” and “GND.”

Again, I’m a total newbie at circuit design.  If I got something wildly wrong, please let me know.  :)

  1. More frequently these days []
  2. Front copper []
  3. Ground, natch []

Rocklin Mini Maker Faire 2018

15 Second Drawings
15 Second Drawings

My daughter, TinkerGirl, and I are going to be demonstrating our 15 second drawings at the Rocklin Mini Maker Faire this Saturday.  We’re pretty stoked about this since it will be our first time as Makers at this Mini Maker Faire.  We’ll be the ones wandering around with a DIY dry erase board.

If you’re wondering what the heck “15 second drawings” even means… it’s just what it sounds like.  Both of us will each draw whatever you want in 15 seconds.  Whatever you want, no matter how complicated or absurd, drawing before your eyes in just 15 seconds.

Or, we can teach you how to draw anything in 15 seconds.  Or compete against us or perhaps challenge a friend (or enemy?!) to a 15 second drawing.

You want to learn more?!

Regex: Back reference and Self reference in Regular Expressions

This is going to be a very short and niche post.

Sometimes I have to use regular expression or “regex” searches to parse a bunch of text, but I can’t remember how to use the search function to find a particular sequence of character and then reuse those found characters in the text I’m trying to replace it with.  In Notepad++, this would be done as follows:

  • Search string:   (7//*[0-9]*[0-9])\r\n
    • This will find all entries with “7/3” or “7/14” or similar digits with a line return afterwards
  • Replace string:  \1/2018;
    • This will replace those entries with “7/3/2018;” and “7/14/2018;”, respectively

The trick here is that the first set of search information is collected together within a set of parenthesis, which are then referenced back by the “\1”.  If you forget the parenthesis, the “\1” term won’t “know” what it’s supposed to be repeating.

Like I said, very niche.

[SOLVED] Google Pixel stuck in a boot loop after update and full storage

If your Google Pixel is stuck displaying the “G” and forever looping through a boot screen, Google’s support will tell you there is no hope and you’ll either have to do a complete factory reset and data wipe of your phone or send it in so they can do it for you.  However, if you are adventurous or have nothing to lose, there may still be hope.

I’m not saying this will work for you, or that you should even try what worked for me.  But, if you’re as desperate as I was, you would try absolutely anything to get your photos back.1

While out of town on vacation, away from WiFi and cell carrier internet access, I took a lot of photos and a few short videos.  My phone, a lowly Google Pixel with just 32GB2 of storage ran out of space.  It claimed it was at “100%” usage of storage with only a few dozen megabytes of space left.  I leaped into action, right there on the beach, deleting some large documents and ZIP files I had downloaded and then asked the Google Photos app to “Free Up Space.”  Pats on the back!  Job well done!

Except the Pixel had other ideas.  I reached into my pocket later to pull out the phone and take a picture to discover that it was on the white boot screen with the colorful Google “G” logo and a light gray “progress” bar undulating underneath it.  I thought this might be due to the phone overheat and put the phone away.  When I pulled it out later, I found the phone was still showing the same white boot screen.  I don’t know what caused this problem.  I don’t know if it was the Android system update from a few days ago, the storage being mostly full, possibly being too warm from being in my pocket, or what.

I tried everything I could think of and everything I could find to no avail:

  • I was unable to boot the phone into anything resembling active status, not even the last measure of “Safe Mode.”
  • I could boot the phone into “Recovery Mode” which looks like the Google Android robot lying on its back with a front panel open and some text underneath.  However, attempts to “Start”, “Reboot”, and use “Recovery Mode” were all unsuccessful.
  • I tried following the recommendations of the mysterious “Techno Bill” on the Pixel Google Groups to install ADB and Fastboot and then apply a Rescue OTA to the Pixel.
    • If nothing else, this one possibility gave me hope that I could still interact with my phone, somewhat.  I was careful to try out the specific OTA3 for my phone.  As you navigate the various menus in the Recovery screens for Android, you’ll need to take note of the version of Android you’ve got – so you can place the same version over it.
    • As best as I understand this fix, you’re basically overwriting a possibly damaged or corrupted operating system with a shiny new factory fresh version – and that doing so leaves your data intact.
  • The thing that gave me the most hope was this post by Mac_DG on Reddit.  Basically, they said, “If you can get there [the Google recovery screen], and it’s a software problem everything is fixable.”
  • I even spent 43 minutes4 chatting5 with Google’s Pixel support team member, Marlene.  She was sympathetic, but assured me in no uncertain terms that my data was lost forever.  My options were to send my phone to Google or take it to a repair facility for a diagnostic.

Finally, after much searching, I found this thread on Google’s product forum where someone named Jintoku described an identical problem to mine – and someone named Kara Alexander described an identical problem … and a solution suggested by Samuel Cooksey!  If you think you’ve got the same problem – nearly full storage, frozen or looping “G” screen, and unable to enter Safe Mode, it is absolutely worth your time scrolling through this thread to see if this solution may work for you.  It is also worthwhile reading through Jintoku’s conversation with Google’s representatives to see how hard they tried not to do a factory reset on the phone – and just how certain the Google representative was that this was the only possible solution short of outright replacement of the phone.

I will not duplicate the efforts of Techno Bill, Jintoku, Kara Alexander, Samuel Cooksey, and Mac_DG by repeating everything they’ve already said.  Rather, you may use any of the above links from my search to follow along and, hopefully, set you on the correct path.  If you would prefer a condensed guide, with links, I hope this will help:

  1. Follow Techno Bill’s guide on installing ADB and Fastboot.
    1. If you’re on Windows, you either need to follow Techno Bill’s guide on updating your computer’s “Path” or, if you’re a little more comfortable doing so, you can skip steps 1-8 and instead open the command prompt and type
      1. “SET PATH=%PATH%;c:\adb”
      2. The benefit of doing it this way is that you don’t have to permanently add this path to your operating system, it’s a lot faster and easier than Techno Bill’s method, and you don’t have to restart your computer
  2. Download the Developer Beta Preview OTA for your phone6 .
    1. It almost goes without saying that with words like “Developer”, “Beta”, and “Preview” in the title, this version of the Android operating system isn’t for the faint of heart.  If you don’t know what you’re doing or, like me, don’t have anything to lose, you shouldn’t be trying this.
  3. Follow Techno Bill’s guide to “sideload” the Rescue OTA to the Pixel.

If this blog post, that I write as my phone is running the Photos application right now to back up my vacation photos, saves even one person’s data, I will be an incredibly happy person.

  1. After all, what’s the worst damage I could do?  In a worst case scenario, the phone would still be unresponsive or bricked permanently []
  2. !!! []
  3. I believe this refers to an “over the air” operating system update []
  4. I was emailed the chat logs after the session ended []
  5. Since I had no phone, natch []
  6. Pixel, Pixel XL, Pixel 2, Pixel 2 XL []

Loudest 3D Printed Whistle – now with 100% more science

Extremely loud and compact emergency whistle v1

Extremely loud and compact emergency whistle v1

I ordered a decibel meter from Amazon the other day so I could drop some science on the claims from various 3D printed whistles on Thingiverse.  There are several that claim to be the loudest.  Well, today, I began my quest to put these claims to rest.

The closer the decibel meter is to a sound source, the higher it registers.  To eliminate some of these variables, I placed the decibel meter on a counter in front of me and a chair 24 inches in front of that.  For each of the whistles I was testing I stood just behind the chair and gave the whistle three hearty puffs.  The decibel meter, which was set to record and display the “max” reading, would then tell me the loudest reading for that set of three whistle toots.

Without further ado, I declare the “Extremely loud and compact emergency whistle” by Whistleblower on Thingiverse the clear winner at 121.1 decibels.  Both whistles by this designer took the top two scientifically determined spots.

NameThingiverse IDMass (grams)PricePrint Time (minutes)DecibelsSubjective Rank
Extremely loud and compact emergency whistle [v1]29330213.9$0.1222121.11
Extremely loud and compact emergency whistle [v2]29330213.7$0.1118111.53
v29 (Over 118 db!)117916013.9$0.4290110.44
2 chamber whistle (LOUD) [w5]26165128.1$0.2449109.52
Emergency Whistle with Solidworks 2014 source4951721.2$0.047101.85
Whistle Ring Modified [v2]20271151.6$0.05990.86

Just how loud is 121.1 decibels? 1  Well, for starters, it’s just above the pain threshold of 120 decibels.  It’s louder than:

  • Your iPod headphones at maximum volume
  • A baby crying, next to your ear
  • A full symphony orchestra
  • The subway
  • A sporting event
  • A chainsaw
  • A jetski
  • A marching band

It’s on par with:

  • Thunder
  • A shotgun
  • An ambulance siren
  • A rock concert

And, if you didn’t have earplugs, you would exceed the daily safe exposure limit for 121 decibels in 7 seconds.

There may be louder whistle on Thingiverse2 and, if so, please let me know.  I’ll print the model and test against the others in my arsenal.

Default Series Title

  1. This page has several charts to help explain. []
  2. Or some other online 3D design repository []

Loudest Whistle on Thingiverse… The Answer Might Surprise You!

You'll need a pair of these earplugs

You’ll need a pair of these

Whistles have been a staple on Thingiverse for years, probably because they’re such a small, simple, and impactful way to demonstrate the usefulness of a 3D printer. 1 I don’t know how many there are, but there are a LOT of whistles on Thingiverse.  I’ve been curious about which whistles on Thingiverse are the loudest and conducted a semi-scientific experiment to figure this out.

Six whistles

Six whistles

I say “semi-scientific” because I don’t have a decibel meter.2 My methodology was to have my family at one end of the house while I went to the other side, closed the door, put in my earplugs, and wailed away on six whistles as hard as I could.  In any case, here’s my findings:

NameThingiverse IDMass (grams)PricePrint Time (minutes)RankDecibels
Extremely loud and compact emergency whistle [v1]29330213.9$0.12221TBD
2 chamber whistle (LOUD) [w5]26165128.1$0.24492TBD
Extremely loud and compact emergency whistle [v2]29330213.7$0.11183TBD
v29 (Over 118 db!)117916013.9$0.42904TBD
Emergency Whistle with Solidworks 2014 source4951721.2$0.0475TBD
Whistle Ring Modified [v2]20271151.6$0.0596TBD

I added a few columns that may (or may not) be of interest to you.  I indicated the weight of each whistle, because sometimes I want to know how many whistles I could produce off a single spool of plastic.3  Sometimes I want to produce the loudest whistle for the time I have to produce a whistle.4  I showed the cost per model5 , because it brings me so much joy to know I can make my daughter’s classroom louder than a jet engine for less than the cost of a pack of gum.

I know there are a number of important variables are are simply not addressed in this test.  Different frequencies sound louder or might be easier to hear through the door.  I tried to blow each whistle the same amount, but some whistles are louder with less forceful or more forceful blows.  Once that decibel meter shows up, I’ll be sure to post another update.

Default Series Title

  1. Photo by mosambers []
  2. Yet.  At <$20 on Amazon, you can be sure I’ll be adding actual readings soon []
  3. With careful design, approximately 2,500 whistles per kilogram of plastic []
  4. The v2 of this whistle is the clear winner []
  5. Assuming a spool costs about $30, shipped []

How to Back Up Files from Google Drive with a Supervised User

Google, why have you failed me?

Google, why have you failed me?

Google suddenly discontinued/crippled their Google Supervised User program in January of 2018.  This was a fantastic program which allowed parents to set up a Google account for a child on a Chromebook and monitor and control access to the internet.  Unfortunately, the “manage user page” redirects you a page “Supervised Users can’t be created or edited.”  Sure, there’s Google Family Link – but that only works for Android and mobile devices.

This means the Chromebook we bought for our daughter and which she’s been using for about a year now, is borderline useless.  How useless?

Imagine using a modern computer (or even a phone or tablet!) without the ability to copy, cut and paste.  No being able to visit any new sites, since I can’t edit her access to whitelist the website.  You can’t copy, move, or drag-and-drop the files from Google Drive to the internal microSD card or a flash drive.

And, as I discovered today, no being able to download files out of the Supervised User’s Google Drive account, since Google’s ability to zip the files is crippled.1  Since my daughter’s account had hundreds of files, it was beginning to look like my only option was to download each file individually, one after the other.

If you find yourself in a similar predicament, here’s how you can back up your Supervised User’s account out of Google Drive:

  1. Create a new empty folder with a catchy name like “20180528 Backup”
  2. Select all other files in their Google Drive
  3. Tap the trackpad with two fingers2 and select “Move”
  4. Move all the files into your newly created folder
  5. Select the newly created folder
  6. Tap the trackpad with two fingers3 and select “Share”
  7. Share that folder from the Supervised User with yourself (probably by typing in your email)4
  8. Open up Google Drive in your web browser on a completely different, non-Chromebook device
  9. Click on the icon that looks like two people and is labeled, “Shared with me”
  10. You should see the previously named folder under the documents recently shared with you
  11. Right click on the folder and click on “Download.”  It will take some time as Google zips the folder and all the documents in all the sub-folders into a file
  12. When prompted, save the file to your computer

I got through this with the usual trial and error.  I really hope it’s helpful to someone else some day.

  1. You can download a single file at a time – but not more than one at a time []
  2. This is the Chromebook version of a “right click” []
  3. Again, the Chromebook “right click” []
  4. You may get a warning that you won’t receive a confirmation email – don’t worry about it []

Maker Faire 2018 – 3D Printing for Home Improvement

If you’re here checking out my site after my presentation, you can check out all the slides from my presentation above. If you’d like more information about the individual things in the slides, I posted an update for most of them over on Hackaday. If you’ve still got some questions, feel free to leave a comment below, hit me up on twitter, email me directly.

Hacked Tap Light Enclosure

Just seeing a post and pile of code about a project isn’t always that interesting.  The nifty thing about this project is also one of the problems.  They’re cosmetically identical – so you can only tell which one you’ve got by activating it.  :)

I couldn’t be more pleased with the way this project came out.  I basically took my daughter’s setup based off an Adafruit Circuit Playground, built a more specialized (and louder!) version into a breadboard using an Adafruit Trinket, and then ported the entire design into an ATTiny85.  The only thing I would change about it would be to add a socket for the ATTiny to make it easier to modify down the line.

Default Series Title

Cheapest Easiest Easy Button Hack EVER

But... could it be even EASIER?!

But… could it be even EASIER?!

I’ve always liked the idea of the Staples Easy Button.  Not so much a button that says “That was easy,” but the idea of having an enormous button on my desktop that would do… anything at all.  Official “Staples Easy Buttons” used to sell for about $20 and are now only about $7.  But, this is still a lot to pay for a big button that I’d want to gut anyhow.  Recently I figured out a way to build a big useful button, very inexpensively.

This slideshow requires JavaScript.

The secret sauce is … a tap light!  You can buy a pack of 4 big (10cm diameter) tap lights for under $4 and they’ll ship free as a “Prime add-on.”  For less than $1 each, you get a three AA battery holder, toggle on/off switch, a bright LED, all neatly organized into a big plastic button.  This button also has another “feature” which is missing from many other pricier options.  The dome over the light is white – which means you can put any color LED or, as I did, an Adafruit Neopixel inside and the dome will change color accordingly!

This slideshow requires JavaScript.

Here are some pictures of the disassembled tap light so you can see if it would work for you.  I had originally bought these so that I could put a light right next to my newest 3D printer.123

This slideshow requires JavaScript.

There’s actually quite a bit of room inside the tap light for a small project.  I was able to pack a Neopixel, a small buzzer, an ATTiny85, and a rat’s nest of wires.  I expect this project to take a lot of abuse at Maker Faire, so I applied a liberal amount of hot glue inside to hold the wires down and out of the path of the springs, switch, case, and the likely path of the button dome.

Once reassembled, there really isn’t any way to tell the button was hacked.  It looks identical to three other tap lights.  I just love that I was able to make use of the battery holder and existing switch inside the project.  The 4.5V supplied by the batteries is perfect for powering my ATTiny85 and lone Neopixel.  If you’ve got a junk drawer, you could probably build something very similar for about $2-3.4 As it is, I “splurged” by using $1 worth of Neopixel because I was being lazy and didn’t want to either wire up three sets of LED’s or track down three resistors to go with an RGB LED.  Even so, this is an incredibly cost-effective project enclosure.

15 Second Timer-Buzzer

15 Second Timer-Buzzer

In case it’s of interest to you, this project is the newest iteration of our 15 Second Timer-Buzzer from my daughter’s 15 Second Drawings project for Maker Faire Bay Area 2017.  The prior version used an Adafruit Circuit Playground, a 100mm Red Button, and a LiPo battery and probably cost around $40 or so. 5

All of the code is on Github. Basically, the buzzer flashes amber three times with a very short tone in between flashes, then turns green for 14 seconds, amber for one more second, and then turns red and buzzes angrily to let you know time is up.  I had written most of the code to work on an ATTiny45… until the code ballooned to a whopping 4560 bytes and I had to switch to an ATTiny85.6 If I had to build this over again, I’d solder in an 8-pin DIP socket for the ATTiny rather than mutilating the chip and hot gluing it directly to the inside.  ;)

Default Series Title

  1. I have a power strip next to it, but it’s fully utilized, I only need a little bit of light sometimes, and I was getting tired of holding a flashlight on it at night []
  2. In my tradition of naming my 3D printers after characters from Futurama, my Monoprice Mini Delta is named “Roberto.” []
  3. My prior 3D printers are Bender the MakerBot Cupcake CNC, Flexo the MakerBot Thing-O-Matic, and HedonismBot the Replicator 1 Dual []
  4. I figure about $1 for an ATTiny85 and $1 for the button.  Most people can find a way to scrounge an RGB LED or a few different LED’s, an old buzzer or piezoelectric disc, and some bits of wire []
  5. Not counting the gelato we ate, of course []
  6. What a waste!!! []