Posts | Comments

Planet Arduino

Archive for the ‘kicad’ Category

Musicians have an array of electronic tools at their disposal to help make music these days. Some of these are instruments in and of themselves, and [Wai Lun] — inspired by the likes of Choke and Shawn Wasabi — built himself a midi fighter

Midi fighters are programmable instruments where each button can be either a note, sound byte, effect, or anything else which can be triggered by a button. [Lun]’s is controlled by an ATmega32u4 running Arduino libraries — flashed to be recognized as a Leonardo — and is compatible with a number of music production programs. He opted for anodized aluminum PCBs to eliminate flex when plugging away and give the device a more refined look. Check it out in action after the break!

[Lun] designed the project in Fusion 360 and KiCad with plenty of room to spare for some electronic art — gotta love Daft Punk. He’s using Sanwa OBSC 24mm arcade buttons for their premium quality and two SK6812 mini LEDs apiece for a slick lighting effect when they’re pressed.

After receiving the manufactured boards and parts, a quick test fit flowed right into final assembly. With the ATmega32u4 flashed and programmed, he was ready to rock. Down the line, [Lun] wants to have a GUI to configure the notes each button plays without tinkering around in the code, but it works great for now.

For an astounding acoustic to electronic instrument conversion, check out this MIDI accordion!


Filed under: Arduino Hacks, musical hacks
Gen
03

A Low Cost Dual Discriminator Module for the Easy-phi Project

arduino hacks, ARM, discriminator, Easy-phi, Hardware, kicad, limpkin, open source, universal input Commenti disabilitati su A Low Cost Dual Discriminator Module for the Easy-phi Project 

A few months ago I presented you the Easy-phi project, which aims at building a simple, cheap but intelligent rack-based open hardware/software platform for hobbyists. With easy-phi, you simply have a rack to which you add cards (like the one shown above) that perform the functions you want.

Recently my team finished testing our FPGA-based discriminator or “universal input” if you prefer. As easy-phi cards use a well-defined electrical signal to communicate with each other, we needed to make a card that would translate the different kinds of electrical signals from the outside, as well as perform plenty of other functions. It was therefore designed to have a 100MHz input bandwidth with an AC/DC coupled 50 ohm/high impedance input stage (x2) and 4 easy-phi outputs. For this module, we picked the (old) spartan3-an FPGA to perform the different logic functions that may be needed by the final users (high speed counter, OR/XOR/AND, pulse creation,…). Using the cortex-m3 microcontroller present on the board, it may be easily reconfigured at will. All design resources may be found on our Github, and you can always have a look at our official website.


Filed under: Arduino Hacks, ARM, hardware
Ott
22

Easy-phi: an Open Source Platform for Experimenters

arduino, arduino hacks, ARM, Cubieboard, Easy-phi, Hardware, kicad, open source Commenti disabilitati su Easy-phi: an Open Source Platform for Experimenters 

As a few of Hackaday readers may already know, my day job involves working with high speed electronics. For the last few months, my team at [Université de Genève] in Switzerland has been working on an open source platform (mostly) targeted for experimenters: the easy-phi project. The main idea is to build a simple, cheap but intelligent open hardware/software platform consisting of a 19″ frame (or smaller), which can house a big variety of electronic modules. Hobbyist would therefore only make/buy the modules that would suit their needs and control them through a web page / standalone application / Labview module.

I detailed in more depth on my website the technical aspects of the project. To give you a quick and simple overview, the rack is essentially a USB hub that connects all the modules to a Cubieboard. It also integrates a few synchronization signals, a clock and a monitoring system for voltages, temperatures, power consumption. The modules are made of template + module specific electronics. The template electronics are part of the ‘easy-phi standard’, they consist of the Arduino compatible SAM3X8E microcontroller and of a few other power related components. This ensures electrical and firmware compatibility between the rack and modules that you guys may develop. It is important to note that the modules are enumerated on the USB bus as composite CDC (communication device) and MSC (mass storage). The CDC is used to configure the module while the MSC allows you to grab its documentation, resources, and standalone application in case you use the module without the rack.

The chosen schematics / layout software is Kicad, and all current files can be found on our github. Others will be uploaded once we have tested the other modules currently in the pipe. As the ones we’re developing are physics oriented, we hope that enthusiasts will bring easy-phi to other domains. Don’t hesitate to contact us if you have any question or if you’d like to contribute.


Filed under: Arduino Hacks, ARM, hardware
Apr
02

Script to query Gerber file outer dimensions

code, kicad, manufacturing, pcb, script Commenti disabilitati su Script to query Gerber file outer dimensions 

At Wayne & Layne, we design a lot of circuit boards. During the request-for-quote (RFQ) process for getting a PCB fabricated, the outside dimensions of the PCB are an important driver of the overall per-unit price. As part of the W&L “prepare PCB for RFQ” process, we have a little script that uses the PCB’s board outline Gerber file to determine the dimensions of the PCB’s bounding box.

Pass in the filename of the PCB “board outline” Gerber file, and it will print out the dimensions in both the original units (decimills for Gerbers exported from Kicad) as well as inches (again, assuming decimills). It does this by analyzing all the lines of the gerber file, and determining the minimum and maximum in both x and y directions. The script is based on a little chunk of code written by @laen on Twitter (who makes no claim to the code, and also runs the most excellent OSH Park PCB service). We’re releasing this script into the Public Domain, use it however you like.

#!/usr/bin/env python
# Gerber query script
# Usage: ./gerber_query.py board_edges.gbr
# Written by Matthew Beckler for Wayne and Layne, LLC
# Based on a script from @laen
# Released into the Public Domain. Have fun
 
def main():
    import sys
    if len(sys.argv) < 2:
        print "Usage: %s gerberfile" % sys.argv[0]
        sys.exit()
 
    import re
    filename = sys.argv[1]
    xmin = None
    xmax = None
    ymin = None
    ymax = None
    with open(filename, 'r') as fid:
        for line in fid:
            results = re.search("^X(\d+)Y([\d-]+)", line)
            if results:
                x = int(results.group(1))
                y = int(results.group(2))
                if not xmin or x < xmin:
                    xmin = x
                if not ymin or y < ymin:
                    ymin = y
                if not xmax or x > xmax:
                    xmax = x
                if not ymax or y > ymax:
                    ymax = y
    print "Board dimensions:"
    w = xmax - xmin
    h = ymax - ymin
    print " ", (w, h), "original units"
    print "  (%.4f, %.4f) inches" % (w / 10000.0, h / 10000.0)
    print "  (%.4f, %.4f) mm" % (w / 10000.0*25.4 , h / 10000.0*25.4)
 
 
if __name__ == "__main__":
    main()
Feb
27

Kicad Tutorial: Gerber file generation

kicad, kicad tutorial, Kicad Tutorials, open source, pcb Commenti disabilitati su Kicad Tutorial: Gerber file generation 

This is part of a series of short tutorials on advanced topics of using Kicad, the favorite schematic/PCB design software here at Wayne and Layne.

Once you’ve finished working on your PCB and are ready to send it off for fabrication, one step remains: “Plotting” the PCB design to Gerber files. The Gerber file format is a very old format with its roots in the 1960s, and is used to completely describe a single layer of a PCB design. You need to generate one gerber file per layer of your PCB design (Copper, SolderMask, and SilkScreen, for both the top and bottom sides, plus the PCB Edges layer). The information about where the holes are drilled, and what size the hole should be, are stored in a separate file with a different format, called the Excellon format, named after the market leader in CNC drilling machines during the 1980s.

To generate the gerber and drill files for production, click on the Plot toolbar button in PCBNEW. It is located in the top toolbar and looks like a printer with a “P” overlaid. This brings up the plot dialog box. (Click to enlarge image.)

gerbers_01_plot

Here, ensure that the “Plot format” is “Gerber”. Leave the “Output directory” field blank, and it will default to saving the files into the project directory. Make sure you check all the layers you want to send to production. If you didn’t use back-side silkscreen, or don’t want to use any back-side silkscreen (some places charge extra for that), you can un-check the B.SilkS layer. The other checkmark boxes are the defaults, but ensure that “Exclude PCB edge layer from other layers” and “Use proper filename extensions” are checked. Press “Plot” to generate the files, one per layer. You will see output in the “Messages:” box at the bottom. When that is finished, click “Generate Drill File” to bring up the next dialog box. (Click to enlarge image.)

gerbers_02_drill

Again, leave the “Output directory” text field empty. The settings here are very important, especially the Drill Units (Inches), Zeros Format (Suppress leading zeros), and Options (Minimal header). You absolutely must check “Minimal header” and un-check “Mirror Y-Axis”. Since we aren’t making a drill map, the “Drill Map File Format” option doesn’t matter. Click the “Drill File” button to generate the drill file. Then press “Close” and “Close”.

Now you can zip up the generated gerber/drill files and send them off for fabrication. At Wayne and Layne, we really like the prototype PCB fabrication services from OSH Park. They describe themselves as

This is a community printed circuit board (PCB) order. We take designs from lots of people, put them all together on a panel and then order the panel from a fab. Since we’re all splitting the panel setup cost, this lets us make circuit boards inexpensively.

This service grew out of the DorkbotPDX PCB Order run by @laen and now comprises of a two-layer panel every other day, a four-layer panel every three weeks and a periodic two-layer medium run service for people needing more than 150 square inches of board.

They have very inexpensive rates, decent production time, and very high-quality output. Plus, the gold and purple boards just look very nice! Here are the details about pricing and design rules (minimum clearance and trace width, minimum hole size, etc).


Other tutorials in this series:
Feb
27

Kicad Tutorial: Using the autorouter

kicad, open source, pcb Commenti disabilitati su Kicad Tutorial: Using the autorouter 

This is part of a series of short tutorials on advanced topics of using Kicad, the favorite schematic/PCB design software here at Wayne and Layne.

Routing, the process of connecting all the pads of a printed circuit board (PCB) layout, can be a time-consuming and tedious process. To avoid the time and frustration of manually routing your PCB, there are various software tools called autorouters which can do this for you. This post will show you how to use the external autorouter from the FreeRouting website.

First, ensure that you have selected the proper trace thickness and clearance values in Kicad’s PCBNEW application, by going to “Design Rules”->”Design Rules”. Once you have confirmed the design rule settings, press the “traffic sign” icon in the top toolbar to bring up the FreeRoute interface.

autorouter_01_button

The three buttons on the left will let us export the DSN file that is input to the autorouter, launch the autorouter application, and finally import the SES file that was exported from the autorouter. To start with, press the top button on the left, “Export a Specctra Design (*.dsn) File”. This will open up a file save dialog box, and you can just accept the filename as the default filename is correct.

autorouter_02_export_dsn

Now, click the second button to launch the autorouter. This utilizes the Java Network Launching Protocol (JNLP), which downloads a small XML file that is used by your Java system to download the rest of the autorouter. You may see a browser window open up briefly when the JNLP file is downloaded. Chrome gives a warning about the file type, you can press “keep” to retain the file for use. Your browser might do the Right Thing with the .jnlp file, and open it with Java. If not, you can probably double-click the downloaded freeroute.jnlp file to launch it, or on Linux you can type “javaws freeroute.jnlp”. When the Freerouter window opens up, click “Open Your Own Design”.

autorouter_03_load_own_design

Due to the Java security restrictions, unsigned applets downloaded from the web are not trusted very much, so you have to give it permission to read files on your machine. For whatever reason, on my computer it won’t let me check “Always allow this action”, so it asks me every time.

autorouter_04_read_warning

Click “Allow” and then navigate to select the .dsn file you exported from PCBNEW earlier. Click on “Open” and it will load your design.

autorouter_05_select_dsn

When your design has finished loading (which may take a minute or two) all you need to do is to click the “Autorouter” button, then sit back and watch the magic happen. The autorouter will do an initial route, then go through a series of optimization steps to try and reduce the number of vias used, as well as trying to reduce the total trace length.

autorouter_06_autoroute

You can wait for the optimization steps to finish, or you can click once in the board area to interrupt the optimization if you are in a hurry, or the results are already good enough.

autorouter_07_done_routing

When you are satisfied with the routing, use the “File”->”Export Specctra Session File” menu option to save the routing results to the .ses file. You will likely get another security warning, click “Allow” to continue. Navigate the file system to where you found the .dsn file, and save as the same filename but with a .ses extension.

autorouter_08_save_ses

In PCBNEW, select the third and final button on the left. It will open a file select dialog box, and it should already have selected the .ses file you just exported from the autorouter. Accept the filename and Kicad will load the file into your design. It will ask if you want to reload the board connectivity. I’m not exactly sure what this means, but I always click “Yes”.

As a side note, some people dislike autorouters, considering their own manually-routed designs to be superior, and there’s some truth to that feeling. Sometimes the autorouter makes silly decisions, sometimes I can spot ways to route things different and save a via or two, but generally I prefer to let the autorouter have a go at it, then clean up the results.

Feb
27

Kicad Tutorial: Using the autorouter

kicad, kicad tutorial, Kicad Tutorials, open source, pcb Commenti disabilitati su Kicad Tutorial: Using the autorouter 

This is part of a series of short tutorials on advanced topics of using Kicad, the favorite schematic/PCB design software here at Wayne and Layne.

Routing, the process of connecting all the pads of a printed circuit board (PCB) layout, can be a time-consuming and tedious process. To avoid the time and frustration of manually routing your PCB, there are various software tools called autorouters which can do this for you. This post will show you how to use the external autorouter from the FreeRouting website.

First, ensure that you have selected the proper trace thickness and clearance values in Kicad’s PCBNEW application, by going to “Design Rules”->”Design Rules”. Once you have confirmed the design rule settings, press the “traffic sign” icon in the top toolbar to bring up the FreeRoute interface.

autorouter_01_button

The three buttons on the left will let us export the DSN file that is input to the autorouter, launch the autorouter application, and finally import the SES file that was exported from the autorouter. To start with, press the top button on the left, “Export a Specctra Design (*.dsn) File”. This will open up a file save dialog box, and you can just accept the filename as the default filename is correct.

autorouter_02_export_dsn

Now, click the second button to launch the autorouter. This utilizes the Java Network Launching Protocol (JNLP), which downloads a small XML file that is used by your Java system to download the rest of the autorouter. You may see a browser window open up briefly when the JNLP file is downloaded. Chrome gives a warning about the file type, you can press “keep” to retain the file for use. Your browser might do the Right Thing with the .jnlp file, and open it with Java. If not, you can probably double-click the downloaded freeroute.jnlp file to launch it, or on Linux you can type “javaws freeroute.jnlp”. When the Freerouter window opens up, click “Open Your Own Design”.

autorouter_03_load_own_design

Due to the Java security restrictions, unsigned applets downloaded from the web are not trusted very much, so you have to give it permission to read files on your machine. For whatever reason, on my computer it won’t let me check “Always allow this action”, so it asks me every time.

autorouter_04_read_warning

Click “Allow” and then navigate to select the .dsn file you exported from PCBNEW earlier. Click on “Open” and it will load your design.

autorouter_05_select_dsn

When your design has finished loading (which may take a minute or two) all you need to do is to click the “Autorouter” button, then sit back and watch the magic happen. The autorouter will do an initial route, then go through a series of optimization steps to try and reduce the number of vias used, as well as trying to reduce the total trace length.

autorouter_06_autoroute

You can wait for the optimization steps to finish, or you can click once in the board area to interrupt the optimization if you are in a hurry, or the results are already good enough.

autorouter_07_done_routing

When you are satisfied with the routing, use the “File”->”Export Specctra Session File” menu option to save the routing results to the .ses file. You will likely get another security warning, click “Allow” to continue. Navigate the file system to where you found the .dsn file, and save as the same filename but with a .ses extension.

autorouter_08_save_ses

In PCBNEW, select the third and final button on the left. It will open a file select dialog box, and it should already have selected the .ses file you just exported from the autorouter. Accept the filename and Kicad will load the file into your design. It will ask if you want to reload the board connectivity. I’m not exactly sure what this means, but I always click “Yes”.

As a side note, some people dislike autorouters, considering their own manually-routed designs to be superior, and there’s some truth to that feeling. Sometimes the autorouter makes silly decisions, sometimes I can spot ways to route things different and save a via or two, but generally I prefer to let the autorouter have a go at it, then clean up the results.


Other tutorials in this series:
Feb
26

Kicad Tutorial: Copper pours / fills

kicad, kicad tutorial, Kicad Tutorials, open source, pcb Commenti disabilitati su Kicad Tutorial: Copper pours / fills 

This is part of a series of short tutorials on advanced topics of using Kicad, the favorite schematic/PCB design software here at Wayne and Layne.

A copper pour or fill refers to an area on a printed circuit board where the original copper is not etched away, and remains in place, usually electrically connected to the Ground signal, producing a “Ground Plane”. This has a number of advantages, including decreasing the amount of etching fluid required during manufacturing, as well as reducing the amount of electrical noise and signal crosstalk experienced by the circuit elements.

It is relatively easy to create a copper fill in Kicad. We usually add fills after having already drawn in the PCB outline in the Edges layer. First, ensure that you have selected one of the copper layers (such as “Front” or “F.Cu”). Then, select the “Add Filled Zones” from the toolbar on the right side of the screen.

Select Tool

Next, click in one corner of the PCB outline to start drawing the copper fill.

Click board corner

Once you click in the first corner, the following properties box will appear. Select the relevant copper layer (here, either “F.Cu” or “B.Cu”) and the desired net for the fill (usually you want “GND”, but sometimes you might want some other net, or “<no net>” which will make an isolated copper fill). The settings in the bottom half are important for controlling the drawing of the filled area as well as the “thermals”. One potential problem with adding ground fill is that the ground pads will become very difficult to solder, as the ground plane will suck away all the heat from your soldering iron, and the pad won’t ever heat up hot enough for the solder to flow. To avoid this problem, you almost always want to add “thermal relief” to your ground pads, which means there is a keep-out area adjacent to each ground pad where there is no fill, and instead each ground pad is connected by a number of thinner traces. This still provides a very good electrical connection for the ground pad, but makes it much easier to solder. The “Clearance” setting controls the general clearance between the filled area and pads/traces of other nets. The “Minimum width” setting controls the thinnest that the fill can be when flowing around other pads/traces. The “Thermal Reliefs” settings control the clearance around the ground pads (0.040″ here) and the width of the traces connecting from the fill to the ground pads (0.009″ here). We’ve found these settings to work pretty well for most of our projects. You also want to select “Arbitrary” for the “Outline Slope” setting to make it easier to draw the zone outline. Click “OK” to close this window and continue drawing the fill outline. (Click the image to enlarge)

Zone properties

Once you have closed the zone properties window, click once in each of the other three corners (in order) on the board outline. Then, to complete the final segment, double-click on the original corner to end the zone. You should see red or green hatching (depending on which copper layer you used) on the edges of your PCB indicating the filled region, as shown in the image below.

Outline hatching

Generally you want to have a copper fill on both the top and bottom of the PCB. To add the fill on the other side, the easiest way is to right-click on the existing board edge, select “Zone outline”, then go to “Zones”->”Duplicate Zone”. This brings up the zone properties box for the new zone, so select the other copper layer and press “OK”.

To see the copper fills in your design, click on the “Show filled areas in zones” button, the 10th button in the left-size toolbar. The button below that will hide the fills. Then, you can run the DRC tool (Ladybug Checkmark in the top toolbar) which will fill all your zones. You should see something like the image below. The brown-yellow color is the combination of red (top side) and green (bottom side) copper fills. We can see the 20 mil clearance between the fill and non-ground copper, and the larger 40 mil clearance between the fill and GND pads.

Finished fills


Other tutorials in this series:
Feb
26

Kicad Tutorial: PCB edges

kicad, kicad tutorial, Kicad Tutorials, open source, pcb Commenti disabilitati su Kicad Tutorial: PCB edges 

This is part of a series of short tutorials on advanced topics of using Kicad, the favorite schematic/PCB design software here at Wayne and Layne.

An important part of designing a PCB is to clearly indicate the outline of the board, so the board house will know how to cut your boards apart. Most PCBs are rectangular, but sometimes you want to add a more complex outline (like a circle or hexagon) or a very complex outline (like the PCB for the Video Game Shield, shown below).

vgs_complex

To make it easier to determine where the PCB edges should be, you probably watch to switch your cursor to be the full-screen cross, by clicking the cursor toggle button in the left-most toolbar (6th down from the top).

edges_2_cursor_switch

Then, select the “Edge.Cuts” layer from the list on the right side of the screen. Select the blue dashed line toolbar icon to draw graphic lines in the Edge.Cuts layer. Using the full-screen cross cursor, it is easy to find the corner of your design. Make sure to leave a little bit of clearance between the outer-most components and the PCB edge. Click to start drawing the edges, and click once in each corner of the PCB. Double-click to end the drawing.

edges_3_layer_corner

If your edge lines are not very thin, we suggest reducing their width. Right-click on each line (you might have to zoom in to ensure that your mouse cursor is pointing at the yellow line itself) and select “Edit Drawing”. Then, change the Item and Default thickness values to be 0.001″ each. We feel that this reduces confusion with the board house as to where exactly the board should be cut (“Inside of the thick line? Outside of the thick line? Middle of the thick line?” With a thin line there is no ambiguity.)

edges_4_settings


Other tutorials in this series:


  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook