Posts Tagged ‘tutorial’
This is a little tutorial for a little trick that was figured out! It stemmed from the question that I posted on the EMSL forums.
Here’s a video of the tutorial as well! Double sweet!
Watch on YouTube
Basically, in gEDA it’s pretty fantastically easy to put pictures on the silk layer using pstoedit. However, for the pins/pads layer this can’t be done because there is no support for polygons in the footprint files.
You could draw the picture yourself using lines, but if there are a lot of curves that could take a long time. Since it’s gEDA and everything is open, it’s pretty straight forward that you can make whatever you want to do whatever you want.
There is a really great document to read the describes the structure of the footprint files: “Footprint creation for the open- source layout program “PCB”“. This is where you can see what the variables for element and pad correspond to.
For pad, this is basically what it looks like:
Pad [x1 y1 x2 y2 thickness clearance mask name pad_number flags]
With this info, we could make tiny ‘pixel pads’ for the black pixels that we see in the image!
I created a Processing sketch that reads in the image, looks for non-white pixels, then creates a square line segment pad with a given width and clearance. You can grab the sketch on Github here!
Here are some additional commentary on some parts in the code.
int x1 = 0;
int y1 = 0;
These are our coordinate variables that are used when looping through the image. Essentially, each pixel pad is just x1 x x1, or y1 x y1. The width is what gives it how wide it is, and then the coordinates are incremented based on that width. It’s odd, but was quick to write it this way.
int t = 200; // thickness of line segment (aka pixel) 100
int c = t/4; // 2000
These are two fun variables.
t is the thickness of the pixel pad. The smaller it is, then essentially the more “resolution” you would get in your output footprint picture. Larger, the more pixely and big it will look.
c is the clearance on the solder mask layer. I’m not sure if you can get away with this being 0, but I guess it would depend on your board house. If you have it as t/4, it works out pretty well as it is a very tiny outline.
More on the c now. If the value is large (eg, 2000), it might look a little goofy:
If it is a small value, or say t/4, then it looks decent:
output.println("\tPad["+x1+" "+y1+" "+x1+" "+y1+" "+t+" "+c+" 0 \"\" \"1\" \"square\"]");
This is what makes up each pixel pad. It’s the start point, end point, thickness, and clearance. This is added to the footprint file for every non-white pixel that the sketch sees. You can check out the document linked to above for more information on the Pad structure details.
output.flush(); // Write the remaining data
output.close(); // Finish the file
Well, that was pretty easy, wasn’t it?!
It only took about 20 mins to write the sketch, which was pretty cool. It was pretty exciting when it worked first try!
So hopefully this will help people make their boards with more creativity. I was inspired by the SpikenzieLabs boards where sometimes they have their logo on the pins/pads layer (but they use Eagle).
What do I plan to do with it? I want to make an Arduino derivative that has lots of stars on it. I dunno why, it just sounds cool! It would look really good as a black board with silver solder. … or just good purple and gold from OSH Park
SQUAWK! Happy boarding!
Send your robot into the cloud with a simple Processing sketch to upload its data to MyRobots or ThingSpeak!
Don’t forget to star/+1/tweet/comment the guide!
If you just want to jump to the code, here is the bare-bones Processing sketch: SimpleThingSpeak!
Be sure to give RoboBrrd some +1′s and friendship requests on MyRobots here!
This guide is a part of the adventure to answer the question “How many MAKE: Projects will it take to get to Maker Faire?”. If you really enjoyed this guide, you can donate towards my Maker Faire travel expenses
I’ll be putting up lots of tutorials on MAKE: Projects, and if you like them a lot, then you can donate on my Maker Faire page here. Since getting to Maker Faire Bay Area is almost impossibly expensive, I wanted something to show for my efforts anyway in case it doesn’t work out :p
The first tutorial in the series is Instant Nature: Quick & Peaceful! If you ever get annoyed at the whir of your computer fans… this one is for you. It combines Hotkeys for Arduino with the Adafruit Wave Shield (my 3rd fav shield)! You can check it out on MAKE: Projects.
Also Instant Nature was mentioned up in the New on MAKE: Projects post on the MAKE: blog! WOOHOO! Thanks!