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 []

OpenSCAD Intermediates: How to Make Complex Organic Shapes

Cyborg Beast OpenSCAD prototype

Cyborg Beast OpenSCAD prototype

OpenSCAD tutorials for the MakerBot blog.  In that OpenSCAD tutorial series I covered the basics of the OpenSCAD interface, how to make 2D forms, how to make some basic 3D forms, how to position those forms in 3D space, the different ways to combine forms, how to create mashups of one or more existing STL’s and OpenSCAD forms, how to use modules to reuse your code to make your life easier, how to extrude flat 2D forms into 3D forms, and how to fix design problems.  One of the last tutorials was on how to make organic looking shapes using OpenSCAD.1  However, I have a few design tricks left to share.  A little over 18 months ago I left off the series suggesting as new topics.2 There’s one particular “trick” I am using a lot as I work on designing a printable parametric prosthetic. This trick is somewhat easier to explain using pictures.  Suppose you wanted to make a shape that looked something like a “jack,” but you wanted it to have curved surfaces at the center.  Let’s see what happens when we try to use the “hull()” command.  Do do this, we’ll make a sphere at the center and put eight more spheres around it.  The code for this example is basically irrelevant, but I’ll provide it anyhow.

sphere(r=10);
rotate([0,0,0]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10);
rotate([0,0,90]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10);
rotate([0,0,180]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10);
rotate([0,0,270]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10);
rotate([0,180,0]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10);
rotate([0,180,90]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10);
rotate([0,180,180]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10);
rotate([0,180,270]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10);

There’s a much easier way to create the 8 “orbiting” spheres, but that’s another post unto itself.  :)  Here’s what the above code will create:

Nine little spheres (I named one of them Pluto!)

Nine little spheres (I named one of them Pluto!)

Now, let’s use the “hull()” command to wrap around these spheres.

hull()
{
sphere(r=10);
rotate([0,0,0]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10);
rotate([0,0,90]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10);
rotate([0,0,180]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10);
rotate([0,0,270]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10);
rotate([0,180,0]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10);
rotate([0,180,90]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10);
rotate([0,180,180]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10);
rotate([0,180,270]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10);
)

That code will make this:

Nine spheres to... a box?

Nine spheres to… a box?

The result looks nothing like a jack! It looks more like a box with rounded edges. The limitation with the “hull()” command3 is that it connects all the outside points from the various shapes.  The result is more like what the objects would look like if you covered them in plastic wrap – but not what they would look like if you tried to use shrink wrap.4 However, our goal is to get a jack.  How should we go about this?  The same way we eat an elephant.56 We need to use “hull()” multiple times7 to connect the central sphere to the eight surrounding spheres.

hull() { sphere(r=10);
rotate([0,0,0]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10); }
hull() { sphere(r=10);
rotate([0,0,90]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10); }
hull() { sphere(r=10);
rotate([0,0,180]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10); }
hull() { sphere(r=10);
rotate([0,0,270]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10); }
hull() { sphere(r=10);
rotate([0,180,0]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10); }
hull() { sphere(r=10);
rotate([0,180,90]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10); }
hull() { sphere(r=10);
rotate([0,180,180]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10); }
hull() { sphere(r=10);
rotate([0,180,270]) translate([100,100,100*pow(2,0.5)/1.5]) sphere(r=10); }

The result would look like:

Much better!

Much better!

By breaking the overall design into pieces, you can use the “hull()” command to connect pieces of the design to one another in a seemingly organic fashion.  Here’s a set of pictures of my most recent work that uses these design tricks.

This slideshow requires JavaScript.

  1. Full list here:

    1. OpenSCAD Basics: The Setup
    2. OpenSCAD Basics: 2D Forms
    3. OpenSCAD Basics: 3D Forms
    4. OpenSCAD Basics: Manipulating Forms
    5. OpenSCAD Intermediates: Combining Forms
    6. OpenSCAD Intermediates: Mashups
    7. OpenSCAD Intermediates: Modularity
    8. OpenSCAD Intermediates: Extruding 2D Objects
    9. OpenSCAD Intermediates: Fixing Design Problems
    10. OpenSCAD Intermediates: How to Make Organic Shapes
    11. OpenSCAD Design Tips
    12. OpenSCAD Design Tips: How to Make a Customizable Thing

    []

  2. These are, in no particular order:

    • How to sketch an object with OpenSCAD
    • How to easily make regular solids – other than cubes and cylinders, like hexagons, pentagons, octagons, etc
    • How to easily make symmetrical solids
    • How to easily make irregular, but symmetrical solids

    []

  3. I almost typed “problem,” but in this case it probably is just a feature []
  4. That’s the best analogy I can come up with []
  5. One bite at a time. []
  6. It’s such a damn shame when a cool domain name is taken – and there’s nothing there.  Such as eatanelephant.com []
  7. 8 times []

How to Make Awesome Cardboard Paper Mache Anything

Awesome Paper Mache Hats

Awesome Paper Mache Hats

A few weeks ago a friend of mine had a “bad movie night” where he was showing the film1Sharknado.”  Inspired by the theme for the party, I decided I had to wear a shark hat for the event.  After making my hat, my daughter requested a monkey hat.  This was not a request I could refuse.

I took pictures of the process to show you how you can make your own.  I haven’t ever tried to make paper mache hats before, so this was not only a lot of fun – but a great learning experience.  While I own the really great paper mache monster books by Dan Reeder, I only used them for inspiration and tried out a few new things on my own.

Even though I used this process to make hats, the directions here could easily be adapted to making anything out of paper mache.

1. Step 1: Gather Materials and Tools

All the things you need to make your own awesome paper mache anything

All the things you need to make your own awesome paper mache anything

Here’s what you need to get started:

  1. Cardboard Boxes.  Cardboard forms the “skeleton” of the structure.  It’s cheap, ubiquitous, sturdy, and easy to cut and form.
  2. Masking Tape.  Once the cardboard has been cut, liberal use of masking tape will keep your creation together until it can be covered with paper mache.
  3. Scissors and Utility Knife.  Scissors can be very helpful in cutting cardboard or paper.  While scissors can be helpful, and appropriate for kids, I find a utility knife gets the job done faster.
  4. Measuring Tape.  If you’re not making a hat (or other apparel or armor) you won’t need this.  But it is helpful when making measurements.  ((In a pinch, you could just use a piece of yarn or string to mark lengths, and then put the yarn on the cardboard for reference.))
  5. Plastic Wrap.  Whether you’re working with gluey paper or paint, the process is messy.  I would recommend covering the work surface with plastic wrap.  I happened to have a really large plastic bag, which I taped directly to the table.
  6. Glue.  I just used a big bottle of Elmer’s white glue from the hardware store, but I’m pretty sure wood glue would have worked as well, if not better.  It’s also more versatile and sturdy.
  7. Plastic Tray.  The next time you get take-out or have a plastic liner from inside some packaging, save it.  It makes a great wide tray for mixing water and glue or when your project is dry, it is also great for mixing paints.
  8. Paper Grocery Bags.  The “twist” with this process is that I used torn up grocery bags, rather than the traditional newspaper.  It turned out this was a really good idea for a number of reasons.  Paper bags are a cheap and plentiful material.  When thoroughly wet strips of paper bags are easy to place, mold and shape. However, the most important features of paper bags is that they hold glue and water really well and then dry quickly into a sturdy hard shell.  In fact, they form such a sturdy surface that I only had to do a single layer of paper mache around the entire hat.  This means that you can quickly put down a single layer of paper bag strips all over your cardboard form, wait a few hours for it to dry, and then get to work finishing the project.
  9. Paper or Newspaper.  While grocery bags work really well to cover your cardboard form, they can leave some small gaps where they overlap.  When I found gaps in the project, I simply used a few thin strips of the newsprint style paper to cover the holes and smooth out spots on the rough paper bag layer.
  10. Cup of Water and Paintbrushes.  An old mug is best and pile of cheap dollar store brushes is probably fine.
  11. Paints.  I prefer acrylic paints.  They are cheap, can be diluted with water, easy to mix, they stay wet long enough for you to blend, but not so long that you have to wait days for it to dry.  They also clean up well with water.

2. Step 2: Create Cardboard Form

Process for creating awesome hat

Process for creating awesome hat

The process I used to create the cardboard forms for the hats was pretty quick and easy.  I measured the circumference of my daughter’s head and then the distance from her ears to the top of her head.  Using these measurements, I cut out a strip of cardboard as tall as the distance from her ears to the top of her head and as wide as the circumference of her head – with a little extra to allow for overlap.

This slideshow requires JavaScript.

In the pictures above you can see the strip of cardboard cut out and then taped into a cylinder with the masking tape.

This slideshow requires JavaScript.

Cut strips into the cardboard cylinder, fold them down, and add enough masking tape to mold it into a hat-shape.

3. Step 3: Add Embellishments

This slideshow requires JavaScript.

A paper mache hat is way more interesting with some kind of embellishment, like ears, shark fins, wings, or whatever else.  Here I cut ear shapes out of cardboard, curved them slightly, taped them to hold the curve, and then taped them to the hat.  When I made the shark hat, I cut a long slit into the hat through the tape and inserted the shark fin through the underside of the hat.  Don’t be afraid to use a lot of tape.

4. Step 4: Prepare the Work Surface, Paper Strips, and Glue Mixture

This slideshow requires JavaScript.

Cover the work surface with plastic sheeting.  I used a big plastic bag from a helium balloon order from my daughter’s birthday.  However, a big garbage bag or plastic wrap would also work well.  Paper bags from the grocery store work really well – but there are too thick in places.  Tear off the handles and pull the paper bag apart at the seams.  You’ll probably need to discard some of the sections where the the paper bag is too thick to use.

Add some glue (I used about a tablespoon) and warm water (about a half cup or so) to the plastic pan.  It should look like milk or heavy cream once you’ve mixed it up.

This slideshow requires JavaScript.

Completely soak the strips of paper bag in the glue mixture.  They should be completely soaked all the way through until they’re nearly translucent.  Unlike paper mache with thin pieces of newspaper, you won’t need to put layers and layers of paper on the form – just one layer where the pieces overlap a little should work fine.  The excess glue from the strips of paper will soak into the cardboard and help make the entire structure sturdy.

5. Step 5: Set Model to Dry, Patch Holes with Paper

This slideshow requires JavaScript.

Since the cardboard helps soak up the water, the entire structure should dry relatively quickly.  I put the shark hat outside in the sun for a few hours and it was ready for painting.  Once the hat is dry (or dry enough), you’ll probably notice some holes and gaps from the paper bag strips.  Tear up some newsprint paper, soak those in the gluey mixture, and cover and smooth out any defects.  Once these pieces dry, the project will be ready to paint!

6. Step 6: Paint to Suit

This slideshow requires JavaScript.

The great thing about acrylic paints is that they are so easy to work with.  They dry really quickly, so you can paint one side of the model, work on the other side, and then come back to the first side to add details.  In any case, just paint the project to suit and you’re done!

Each hat went together really quickly.  I put the cardboard form together in about 15 minutes, covered it with the gluey paper bag strips over maybe 30 minutes, let it dry for several hours, and then paint it over the course of maybe an hour.

If you make your own paper mache hat (or other sculpture), let me know in the comments!

  1. And I use the word “film” loosely here []

Arduino Adventure Series – The Adventure Begins!

Arduinos, Arduinos, Arduinos... where to start?!

Arduinos, Arduinos, Arduinos… where to start?!

A few weeks ago I started fiddling with an Arduino in earnest.1 I’ve built things using Arduinos before, but each time all I did was slavishly follow a tutorial as it took me step by step through a process.

Just as a child memorizes the Pledge of Allegiance, committing to memory the right sounds in the right order, I had a grasp of the assembly – but not the underlying meaning.  Sure, I built a MakerBot Cupcake CNC (“Bender”), a MakerBot Thing-O-Matic (“Flexo”), an Egg-Bot, a Polargraph/PlotterBot, and an IoT Printer.  ((FYI, my MakerBot Replicator 1 is named “HedonismBot“))  However, I have only the dimmest understanding of how the things I did actually created the things I ended up building.

However, I want more – there are several ideas I would like to create using electronics.  One is a sonic screwdriver flashlight.  Another is device for … shall we say…2  interfering with television infrared codes.3

My goal for this series of posts4 is to document my triumphs and failures playing with an Arduino.  I think it’s time to get started on that next post now…

Default Series Title

  1. Photo courtesy of Arkadiusz Sikorski []
  2. Mu-ah-ha-ha!!! []
  3. Nope, not a TV-B-Gone []
  4. I know it’s ambitious to call a post the “first” post – but dammit, a man’s got to dream []

OpenSCAD tutorial outline

They’ll continue, but I think the next one will come out on Friday.  So far I’ve covered the interface of OpenSCAD, 2D forms, and 3D forms.

My goal is to show people how to use OpenSCAD in a way that is intuitive and builds quickly on what was taught earlier, with a secondary goal of getting the reader to be able to make something useful as quickly as possible.  Here’s the rough outline/idea of where I’m going:

  1. OpenSCAD interface
  2. 2D forms
  3. 3D forms
  4. Union/difference/intersection
  5. Rotate/mirror/translate/scale
  6. Variables/module
  7. Linear and rotational extrusion
  8. Using other programs to make using OpenSCAD easier (Sketchup, Inkscape, Notepad++)
  9. Include/libraries
  10. Conditional and Iterator Functions

I know I’m leaving a lot out of that outline.  What would you like to see?