Sunday 24 November 2013

Seeedstudio - cheap PCBs for the hobbyist



This article describes my experience with a low-budget China based PCB service. 

Although making PCBs with homebrew methods is perfectly feasible, it still remains a painful task nobody likes. For me personally the manual drilling is the last step after which the PCB is ruined. This is why I prefer SMD.
The alternative to stains and stench in your bathroom is to use a professional PCB service. Unfortunately, for a couple of prototype PCBs typically needed the starting price is usually about 40 EUR - too much for hobby projects bringing no financial reward. For a couple of years I've been looking for a cheap PCB service. Many companies were offering good prices, but just in theory. After adding the costs for shipping, money transfer and possible customs the 40 EUR constant remained. Here I exclude all services where you have to contact the people per mail to find out the price.

Recently I came across Seeedstudio (www.seeedstudio.com) from China offering extremely low prices. Having a little project in the queue I immediately decided try them out. I adapted my design slightly to fit into the 50 x 50 mm window. If you stay below that size you get 10 double-sided PCBs for 10 USD. The shipping price was calculated on the website to 8 USD giving 18 USD in total, far below the customs limit of about 30 USD in Germany.
I guess this price comes close to the do-it-yourself price when taking into acount FR4 material, chemistry and all the broken drills. 

Here are the detailed steps of the order:

Adapted my design to 50 x 50 mm for the lowest price. 

Created Gerber files using the Eagle script downloadable from the website. BTW, this was the first time I played with Gerber. It turned out to be very simple. I used the free tool gerbv (http://gerbv.geda-project.org/) to view and check the Gerbers and the Excellon file under Linux. Because I had just a single layer, I omitted the top layer Gerber files in the uploaded zip archive completely. No complains from the service.

2013-10-25 Placed the order uploading the Gerbers. Payment via PayPal, 18 USD.

2013-10-30 Confirmation of shipping

2013-11-23 Received the PCBs! There were even 12 instead 10. The build quality is decent and totally OK for my needs. The drills are centered and the traces look clean. It's of course hard to fail with a design with 24 mil routing. Have a look at the high resolution picture below.




Conclusion

Seeedstudio seems to be a serious business. If you are OK with one month processing time you can enjoy unbeatable prices. The website is user-friendly showing clearly the final price you have to pay. The scripts to generate the Gerbers are provided.
No, I don't have any shares in the company;)

Saturday 20 April 2013

Falling drop simulation with OpenFOAM in 2D



In this post I describe a simple simulation of a falling drop with OpenFOAM. The case data can be downloaded here: drop2d.tgz. All you have to do to run the simulation is to untar it with  

tar xvzf drop2d.tgz

and type

./Allrun 

in the drop2d folder. Your results should look like this:



Please note that the results are not validated in any way and are just of qualitative nature. 2D drops are also not very typical in nature;)


The Setup

Now a few words about the setup. The case is modification of the damBreak tutorial case which uses the solver interFoam. This solver is based on the VOF (volume of fluid) method and is usually used for multiphase problems like the one presented here.
   
The mesh consists of a single block generated with blockMesh. There are separate patches for the top, the sides & bottom and front & back. I observed that the results look realistic or not completely artificial even for very low mesh resolutions. 

The essential setting for a free surface problem like the one described here is the initial condition. In the VOF solver the alpha1 variable describes the local proportion of the fluids in the simulation. In our case 0 stand for pure air and 1 for pure water. Using setFields the scenario shown below can be generated easily.
 
Initial conditions: left: alpha, right: velocity.
The initialisation of alpha consists of just two blocks, the water pool and the drop. Here the corresponding setFieldsDict (it's located in the system folder):

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

defaultFieldValues
(
    volScalarFieldValue alpha1 0
);

regions
(
    boxToCell // drop
    {
        box (0.046 0.14 -1) (0.054 0.148 1);
        fieldValues
        (
            volScalarFieldValue alpha1 1
            volVectorFieldValue U (0 -1 0)
        );
    }

    boxToCell // water
    {
        box (-1 -1 -1) (1 0.025 1);
        fieldValues
        (
            volScalarFieldValue alpha1 1
        );
    }
);

// ************************************************************************* //

I also prescribed an initial velocity of Uy = -1 to the drop. This simulates a bigger fall height without extending the computational domain. Setting positive values will cause the drop to fly up first and then fall into the water. SetFields allows only boxes for initialisation so the drop looks edged in the beginning. It gets a more physical form during the fall.
One thing that often causes confusion are the .org files in the 0 folder. After running setFields the chosen variable files are extended with volume data for each cell. They might become very large and are only valid for the given mesh. In case you want to change the grid or archive the case, you have to get rid of the volume data. As there is no undo for setFields, it's a good idea to keep the originals (.org) and just make a copy. In the presented case the copying is done by Allrun.

Visualisation  

The case is set up to write out the solution for several time steps. Just type

paraFoam 

in the case folder to view the results. To visulalise only the water and blank out the air the clip filter (everything in paraview is called filter;) is a good choice. It can be found in the menu Filters > Alphabetical > Clip or as a shortcut, see screen shot below. Just select scalar as clipping function, choose alpha1 and set the threshold to 0.5. You should see something like this:

Paraview pipeline for the drop simulation

Clicking on play should start the animation. To make a movie, go to File and choose Save Animation. The time steps will be then saved as single images. Under this link you'll find a quick method to merge the images to a movie:
http://doc-diy.net/photo/image_processing_linux/#makingtimelapse


Happy simulating!


Friday 19 April 2013

Hello world!

Some of you may know my web site www.doc-diy.net related to do-it-yourself projects in electronics, photography and other technical topics. In contrast to the more static site, this blog is going to be the more dynamic counterpart and the place for smaller projects, good and not so good ideas, images, code snippets, etc...
You are welcome to read, comment, criticize, link, follow, add or interact in whatever way this medium allows to.

Stay tuned!

Luk