Wednesday, 25 May 2016

Etching homebrew PCBs - transfer

There are a few ways you can transfer your design onto your copper clad board. Our preferred way is using the laser cutter; paint the entire board with matt acrylic car paint, then etch away parts of it with the laser cutter, to create a mask.

But most people making PCBs at home aren't going to have easy access to a laser cutter. Quite often, we don't have easy access to ours (it's at the studio about half-a-mile away). So for one-offs and prototypes, we normally use the toner transfer method.

If you can afford it, Press-n-Peel blue paper is far and away the best medium. It's a powder-coated paper and gives great, consistent results.

We use a cheaper Chinese  alternative - it's a starch-based carrier which is water-soluble. It doesn't give quite as nice results as Press-n-Peel blue, and large filled areas are prone to "pitting". But it's a reasonable alternative to PnP.

One thing that a lot of people ignore is the quality of the toner you're using.
The idea with toner transfer is to get the PCB image onto the transfer paper, then - with heat and pressure - force the toner plastic to melt and re-set so it sticks to the copper clad board. The quality of the toner used is critical to getting good results.

  • The best printer we've found is a Xerox Phaser - the toner has a very high plastic content, melts at low temperatures and offers excellent coverage.
  • We gave our Phaser to the cool kids at BuildBrighton (it was getting to be far too big for the unit) so we now use a small desktop Dell laser printer. It's not as good as an HP Deskjet, but it's passable
  • We used to have a Brother laser printer. Don't even bother with these. Their toner is junk.
If your printer allows it, turn the fuser temperature down to as low as it will go - we only want the toner to stay on the paper for as little time as possible; we're not looking to make good, solid, long lasting images on the paper!


To save using up your expensive transfer paper, print the design on a sheet of plain paper. Then cut out a small square of transfer paper, stick it over the printed design with a piece of tape and re-feed the paper into the printer, to print the design again over the original image.



Cut the edges of the transfer paper up close along two of the sides of the design.


Clean the copper board thoroughly. You can use acetone and a tissue to remove greasy fingerprints,  or rub lightly with wire wool (or even a Tommy Walsh sanding block from the pound-shop) until the surface is shiny - but be careful not to make the surface too pitted. Wipe the surface of the copper down with a lint-free paper towel to ensure no dust or debris remains on the surface.


Align up the cut edges of the design with the edges of the board and hold in place using paper-based masking tape. By leaving a little extra transfer paper along the other edges, there's plenty room for the masking tape to get a good grip to stop it slipping.


Run the board, face up, through a laminator set at the hottest possible setting.
Depending on the laminator and its heat settings, you may need to do this five or six times. Don't always put the board through in the centre of the slot - put it in, off to one side, in case the rollers might "sag" towards the middle.


You can use an iron, but we've found it makes things more difficult than they need to be - the constant lifting and moving of the iron can easily cause the image to smudge. With our laminator (an Alphatec found on ebay a few years back) we've never yet had a smudged image.

When the transfer paper appears uniformly translucent on the back, you're done. For speed, we often quench the  board in cold water to speed up the cooling process. You can do this, or leave it for ten minutes or so to cool down.



After wetting thoroughly, carefully roll back the backing paper from the design. Don't lift it off in one go, or let it "snap" as press-n-peel has a tendency to do as this can easily introduce breaks and/or fractures in the traces.


Remove all traces of the tape used to hold the transfer paper down.
Cut the copper clad board to size, trying to get as close to the edges as possible. If there is lots of copper around the outside of the design, colour it in using a Sharpie permanent marker. All the time we want to reduce the total amount of exposed copper.

You're now ready to start etching!


Monday, 23 May 2016

Etching homebrew PCBs - design

One question we're asked - quite regularly, but especially after posting anything with a custom PCB - is how we make our homebrew boards. So we'll do a complete run-down of making a board, from design to printing and transfer, through to etching and drilling.

The first thing is to design the board properly.
For this, we use ExpressPCB. It's not Eagle. It's easier to use than Eagle. But it does a lot of things differently. If you must use Eagle, then use Eagle. But there are a couple of things to pay particular attention to - and very few people do, so play close attention!

First up, avoid square corners.
It's amazing the number of designs available online that use "square" corners.


When performing the toner transfer, you could end up with "weak points" across square corners - this is where the toner might easily flake off during etching, making the traces very thin at the square corner points. It's also easier to under-cut on a square corner than one "rounded-off" with a 45-degree section.

Secondly, use large pads and thick traces.
Those nasty "lozenge" shaped pads in Eagle might look cool - but drill one out of a homebrew board and it's very easy to separate the two parts of a pad with the hole. Make your pads big and round.
We use 2.03mm pads with a 0.89mm hole. Even if we have to go up to a 1mm drill bit, this still leaves plenty of copper around the entire hole once it's been drilled.

We tend to stick with 0.5mm traces for single sided boards. If the traces are going to SMT components (soic or 1206-sized pads/pins) we sometimes go down to 0.38mm. The smallest trace we'd normally try to etch is not less than 0.3mm.

Also, use "copper pour" or "fill plane" where available.


Your finished board might look cool with just the traces on it, but that leaves an awful lot of exposed copper on your board for the ferric chloride to have to etch away. More copper not only means a longer etching time, it also means you're using up your ferric chloride much more quickly than you need to.


A filled plane or copper pour with clearance of around 0.8mm not only gives your board a nice finish, it means far less copper actually has be etched away. Which in turn means faster etching - and in the longer term, your etchant lasts much, much longer.

When making boards for through-hole components, we print our single-sided designs directly from ExpressPCB. This means that when the design is copied onto the copper clad board, it arrives "flipped". But since the design is for the underside of the board, not the top, this is exactly what we want anyway.

When making boards for SMT components, we want the final board to look exactly as it does on-screen. To achieve this, we print our designs from inside Robot Room's Copper Connection software. This does a great job of flipping the design before sending it to the printer - which means after the toner transfer stage, the flipped design appears the right-way-around on the copper clad board.



Shit-faced Shakespeare @theWarren at the Brighton Fringe

For a few years Nick has asked about going to see Shit-faced Shakespeare.
Between us, we're neither particularly well-read in the classics; a million years ago, I once translated Romeo and Juliet into modern-day language (with the story set between the warring families of the Uncle Joe's Mint Ball Factory and Pimblett's Pies up in Wigan). And I could just about remember enough of the Merchant of Venice from a GCSE exam in the early nineties to recount the basic outline of the story.

Which is just as well, as this year, Shit-faced Shakespeare were doing The Merchant of Venice at the Warren as part of this year's Brighton Fringe. So at least we'd have an idea of what should have been going on, even if it went completely off-piste.



As it turns out, it was brilliant. The Warren has been pretty good to us this year, dishing up first Bane and  now this (sadly, the SpiegelTent was less favourable, since the Singing Hypnotist failed to live up to his billing - sure, he may be a hypnotist, and he did, indeed sing. But that's like advertising "the whistling plasterer" and a guy in splattered overalls turns up to do a few bird impressions without ever getting his trowel out - so to speak).

Anyway, back to Shakespeare. We weren't quite sure what to expect, but the clue was in the title. At first, we thought the entire cast would be drunk and before the play started, it was explained that only one cast member had been at the booze. At first this seemed a little disappointing - we'd come to see drunk actors - plural.

But after the first scene, it became apparent just how clever the format is.
Only one of the cast is, literally, shit-faced. Which means the whole performance is chaotic, without ever falling into shambolic. The other (sober) actors keep the play running - delivering authentic, Shakespearian dialogue - while the piss-head causes mayhem.

With the other actors playing it (mostly) straight, yet incorporating the (often nonsensical) ideas of the drunk characters, you end up with something that seems vaguely familiar - yet hundreds of times funnier than anything old Shakey would dare to call a "comedy".

The sober players "riff" off the drunk's part-remembered, muddled dialogue - but each keeping entirely in character (the drunk player may occasionally slip up but the rest of the cast keep everything on track and the play continues without ever losing pace).


For our performance, it was Portia who was pissed.
This was a stroke of genius. It'd be easy to do the play with a drunken Shylock, who could rant and rave and go all Alf-Garnett on us. But Portia was always the true hero of this play. So it as always going to be a challenge, when she turned up drunk in the very first scene (as it turned out, she simply followed the other actors onto the stage when she shouldn't have even been there and tried to pass herself off as "Shylock's whore" as the cast members introduced themselves). And it was all the funnier as the actor struggled to keep in character - Portia is supposed to be strong and decisive, clever and articulate, cunning and curious; all the characteristics you'd traditionally associate with a drunk!

Shit-faced Shakespeare is a genius idea.
Not quite as genius as Bane - but another great performance from The Warren this weekend!




Saturday, 21 May 2016

Bruce Bane @ thewarren Brighton Fringe

It's May and that means Brighton is a busy old place.
As well as the Artists Open Houses every weekend throughout May, we've got the Brighton Festival and the Brighton Fringe Festival going on every day.

In previous years, we've seen some real hit-and-miss productions. But we've also seen some interesting shows - stuff that otherwise we probably wouldn't have been exposed to. With the Brighton Fringe, it's a bit of a lottery.

This year - amongst other shows - we got to see Bane
It's a four-part show, but we joined the story in part III. Luckily, a brief synopsis was played out at the start of the performance, setting the scene beautifully.


Simply put, Bane isn't just the best thing we've seen at the Fringe for a long time (if ever - although the blue-men-pushing-barrels-of-fire a few years back was pretty awesome too) it's the best performance of anything we've seen, anywhere, for many a year. It's just incredible.

Yet to describe it is to do it a massive injustice.
A single performer plays all the parts, on an empty stage. No props, no staging, no costume changes. Just one guy playing the parts. And another playing the guitar. Live.

And yet, the performance is mesmerising.
You can "see" every scene - and the performance is played out like a movie; scenes cut quickly from one to another, the plot jumps around, and yet never once are you left thinking "who's that he's doing now?" At every stage in the play, you know exactly what's going on, which character is being acted out, and where you're up to with the story (something that they can't even get right in TV shows like Midsomer Murders!)

As Bane enters the Art-Deco inspired hotel via the revolving doors, you can "see" the entire layout. When we escapes through a window, you can see (and hear) the cars whizzing past on the street below. Joe Bone not only gives every character a unique voice, but puts in a performance so that even without speaking, you know exactly who is who - individual mannerisms, facial features, even just the way he stands or walks across the stage, and you know exactly who he's playing.

And all this is accompanied by an incredible live music track. It's so good, you don't even notice it. Ratcheting up the tension with spooky arpeggios, and driving the action along with rhythmic, thumping chord sequences, Ben Roe plays throughout the entire show with a spotlight - because without it, you'd probably not even notice him!
And that's meant as a compliment.

It's only when you really listen, you realise how clever the soundtrack is.
As Bane enters a lift in the hotel, the plinky-plonky musak is perfect. As the action cuts between a scene set in the kitchen of a hotel, out back, and in the dining area, up-front, the music cleverly goes from quiet to loud, perfectly setting the scene as the action unfolds.

Bane III is the third of a four part story.
After coming out of the performance we immediately booked tickets for the fourth and final part (not only because the play was so well performed, but because the characters we so believable, we just have to find out how it all ends!). And we also gutted not to have seen the first two parts.

Imagine what a live-action Dick Tracy comic would be like.
Not like the shitty Warren Beatty/Madonna film of the late 80s. Imagine a live action comic.
With over-the-top characters. Lots of fight scenes, guns and an all-action plotline. And a flawed, private eye character as the hero. A mafia-inspired KingPin and a gang of hoodlums.

This is all that.
And it just so happens to be played out by a single actor.
But played so well, you just have to see it to understand it, let alone believe it.

So if you're in Brighton on Sunday 22nd May 2016 and can spare an hour and a half at around 4pm, get yourself along to The Warren and see Bane IV. Or check out tour dates on the website (http://www.brucebane.co.uk) It deserves to be sold out every night. It's the best live theatre - probably ever.


Thursday, 19 May 2016

Mixing SMT and through-hole components on PCB designs

Just  don't do it.
That's it. End of post.




It's incredibly frustrating to have spent ages laying out a PCB (after redesigning the schematics and re-assigning pins in software) and etch it, only to discover - right at the very end - that you've gone and put the through-hole components the wrong way around!

How's that happened? Here's how:

We use ExpressPCB for PCB layout.
Make no mistake - it's awesome. And this kind of cock-up can be achieved irrespective of your PCB layout software; Eagle, KiCAD and others can all be used innocently, and you still end up with a duff board at the end of it.

Normally we design our boards from the "top down" - placing components as we would with the tracks on the underside of a (single-sided) board. So if our board were to be populated with an IC chip like this:


we'd  also draw our PCB like this:


But if these lines represented the tracks on the bottom of the PCB, and we're looking at them (on-screen) as if we're looking at the from the underside of the final printed PCB, then we really should have pin one on the right and pin 8 on the left.


BUT - here's where it gets tricky. Or at least, can do it you think about it too much. Better not to do too much thinking really (although not enough thought and you'll end up creating a duff board like we managed to earlier today!)

We don't design our PCBs "mirrored" because when we print the design onto our press-n-peel and transfer it onto the copper clad board, the process of transferring it mirrors the design at the same time!

So although we should probably design our PCBs mirrored, we don't. Because the act of transferring the design onto the copper board mirrors it for us. And in doing so, our pin one (in this example) appears not on the top-left (as designed) but on the top-right (where we actually want it).

So far so good.
But then things get complicated.

Because if you want to use surface mount components (particularly IC chips) you really do want to mirror the design. The reason? Well, you're not placing the component "over" the other side of the board and poking the legs through holes to meet with traces on the underside when you use SMT.

With SMT components, you're placing the component directly over the tracks - so you want the final etched design to be the right-way-around. Which means printing it onto the transfer paper mirrored (so when it's transferred, it's mirrored again, making it the right way around).

And that's fine too, if you're designing a board using nothing but surface mount components - because Robot Room's Copper Connection has a print option which will automatically mirror any design before sending it to the printer.

But if you mix surface mount and through-hole components (as we did with this last PCB layout) you have to remember to consistently mirror either all the through-hole components, or all the surface-mount components. It's no good either to mirror a few SMT components, and a few through-hole ones and hope it all works out in the end. It never does.

And we're forever forgetting to mirror either the SMT or through-hole components when laying out PCBs with mixed technologies. Which means, when we make the necessary corrections to our last board, we'll have to reassign some of the microcontroller pins again! Which means the whole of yesterday was a complete waste of time/important learning experience.

In short - mixing through-hole and SMT in the same board design = bad idea. Just don't do it!






Monday, 16 May 2016

Don't forget you can re-assign pins with a microcontroller!

Microcontrollers - PICs and Arduino/AVRs in particular - are great for quick and (relatively) easy prototyping. Stick one onto a breadboard, shove in some wires, hack a bit of code together and... ta-da! A working "thing".

Taking it a step further, once you've got your prototype down, is making a PCB.
Now, at this stage, a lot of people dedicate an awful lot of time to copying the pin-connections from the breadboard onto a PCB layout. Though it's almost always preferable to draw out a schematic first; schematics help make sure you don't miss any connections or introduce any dead-shorts - though it's quite a bit more work than going straight to the PCB layout.

With an electrical schematic, laying out the PCB is simplified - the schematic and the PCB layout software usually work hand-in-glove and the schematics can help with the layout, either through auto-routing, or by highlighting which pin connections need to be joined together.

An electrical schematic....

...enables the software to help you with your pcb layout


After spending all that time and effort designing not only a schematic, but a PCB layout, it's very easy to become "committed" to the design, quite early on. And in being so committed, it sometimes results in quite convoluted routing - particularly if any problem traces are left until towards the end!

And after committing so much time and effort, it's easy to forget that quite often your pin numbers aren't actually set in stone. Sure, if you're using an Arduino and some pre-build library (or, indeed a PIC micro and a hardware peripheral) you might be limited to which pins you can use. But sometimes - quite often - the pins are chosen by you, the firmware writer.

And quite often you, the firmware writer, doesn't give much thought to which pin(s) might lead to a simpler pcb layout - quite often you just stick to the pins in the example you've just copied off the internet (come on, don't pretend that's how a lot of us cobble together code when we're looking for a quick win). Or stick to sequentially numbered pins (how many of us start with pin3 for inputs on an Arduino, or count back from 13 for outputs? More than you might realise....)



But it's important to remember which pins you actually assigned yourself, and which you've no control over. Because shifting a few pins around in software can quite often make the PCB layout much, much easier in the long run.

Sure, it's a bit more work.
And if you're the kind of person who doesn't mind long jumper wires, or bits of multi-core tack-soldered to pins on the microcontrollers, maybe just ignore this entire post. But if you're thinking about making a few PCBs yourself (homebrew etching) or even having the boards manufactured, spending that extra time swapping pins is almost always worth it.

It's just one of those things that we tend to forget about.
Or maybe it's just me.

Thursday, 5 May 2016

Scrolling text on guitar fingerboard

This was always going to be an experiment. And one that we're not entirely sure would work. But, in true Nerd Club fashion, it wouldn't be the first time we'd invested a lot of time and effort in trying something out without being sure of success from  the outset. That's probably how all the best stuff gets invented anyway. Probably.

Our light-up guitar firmware is pretty much finished. But we've still got nearly 20% programming space left on the AVR. Which means there's still time to shoe-horn in some unnecessary functionality.



So what about.. scrolling text? The idea with this was to have a scrolling message running from the head, towards the body. The text would be made up of simple bitmap glyphs 6x4 pixels wide (6x5 in the case of the letters M and W).


Each character could be described by 5 bytes but since our fingerboard is 6, not 8, LEDs high, we're only interested in the lower 6 bits of each byte.

The letter A, for example, would be described as (binary)

00011110
00101000
00101000
00011110
00000000

(if you look at this sideways, you should "see" the letter A in the positive bits of the binary values) which in turn is represented by the decimal values 30, 62, 62, 30, 0.

Then a quick bit of VB6 code "read" our font bitmap and produced array values for each letter. The final Arduino code looked a little bit like this:


const unsigned char characters[] PROGMEM =
{
   30,40,40,30,0,
   62,42,42,20,0,
   28,34,34,34,0,
   62,34,34,28,0,
   62,42,42,34,0,
   62,40,40,32,0,
   28,34,42,46,0,
   62,8,8,62,0,
   34,62,34,0,0,
   4,34,34,60,0,
   62,8,20,34,0,
   62,2,2,0,0,
   62,16,12,16,62,
   62,16,8,62,0,
   28,34,34,28,0,
   62,40,40,16,0,
   28,42,38,30,0,
   62,40,40,22,0,
   18,42,42,36,0,
   32,62,32,0,0,
   60,2,2,62,0,
   56,6,4,56,0,
   62,4,24,4,62,
   54,8,8,54,0,
   50,10,10,60,0,
   38,42,42,50,0,


   4,42,42,30,0,
   62,18,18,12,0,
   12,18,18,18,0,
   12,18,18,62,0,
   28,42,42,18,0,
   31,40,40,0,0,
   9,21,21,30,0,
   62,16,16,14,0,
   2,46,2,0,0,
   1,9,46,0,0,
   62,8,8,22,0,
   60,2,2,0,0,
   14,16,12,16,14,
   14,16,16,14,0,
   12,18,18,12,0,
   31,18,18,12,0,
   12,18,18,15,0,
   14,16,16,0,0,
   18,42,42,36,0,
   60,18,18,0,0,
   28,2,2,30,0,
   24,6,4,24,0,
   28,2,12,2,28,
   18,12,12,18,0,
   25,5,5,30,0,
   18,22,26,18,0,
   

   28,34,34,28,0,
   18,62,2,0,0,
   38,42,42,18,0,
   34,42,42,20,0,
   56,8,30,8,0,
   58,42,42,36,0,
   28,42,42,4,0,
   32,38,40,48,0,
   20,42,42,20,0,
   18,42,42,28,0,   
   6,42,46,34,28,
   0,20,0,0,0,
   2,28,32,0,0,
   0,58,58,0,0,
   8,28,28,8,0,
   2,0,0,0,0,
   0,0,0,0,0,
   0,0,0,0,0,
   0,0,0,0,0,
   0,0,0,0,0,
   0,0,0,0,0,
   0,0,0,0,0,
   0,0,0,0,0,
   0,0,0,0,0,
   0,0,0,0,0,
   0,0,0,0,0
};


Which allowed us to recall and display the appropriate pixels in a recurring function call:

// move all previous "pixels" along to the left
for (int i = 0; i < NUM_LEDS-6; i++) {
     leds[i] = leds[i+6];
}

// now decide which pattern to display on the right-most six pixels
int k=scrollText.length();
if(curr_character < k){
currLetter = scrollText.charAt(curr_character);
}else{
currLetter = " ";
}

// unless we decide otherwise, assume a blank/space character
byte b[2];
currLetter.getBytes(b,2);
int p=b[0];
k=78;

if(isUpperCase(p)){ k=p-65; }
if(isLowerCase(p)){ k=(p-97)+26; }
if(isDigit(p)){ k=(p-48)+52; }

// get the pattern for the current letter
k=(k*5) + col_count;
curr_col_pattern = pgm_read_byte_near(characters + k);

if(curr_col_pattern==0){
     curr_character++;
     col_count=0;
}else{
     col_count++;
     if(col_count>=5){
          curr_character++;
          col_count=0;
     }
}

// now put the current column pattern onto the right-most pixels
k=curr_col_pattern<<1;
k=k<<1;

for(int i=5; i>=0; i--){
     if((k & 128) > 0){
          leds[(NUM_LEDS-(5-i))-1] = scroll_text_colour;
     }else{
          leds[(NUM_LEDS-(5-i))-1] = CRGB::Black;
     }
     k=k<<1;
}

// update the LEDs
FastLED.show();


After a bit of tweaking and debugging, we finally got our text scrolling along the neck.
Here's a (very) quick demo:


it's quite difficult to read, but if you focus on the left-hand edge of the display, you might just make out the shape of the letters  as they whizz by


The only thing is.... it doesn't actually look very good.
Sure, it might look fine on a small, closely or more densely populated LED matrix. But on a guitar fingerboard, where the LEDs are spaced so far apart (particularly higher up the neck) it just looks like a jumbled mess of flashing lights.

So there we go.
Another Nerd Club fail.
Another load of wasted hours on  something that doesn't work.

In fact, that's not strictly true. It does work. Or, at least, it works - functionally - how we expected it to. It's just not really suitable for this particular task. But that doesn't make it a failure. And, indeed, while quite a few hours went into developing, debugging and making it work, they were hardly wasted. We came up with an idea, executed it, and got the LEDs to flash in the sequence we determined at the start. To come up with an idea and bring it to life is never a waste of time. In this case, it wasn't the execution, but the idea that wasn't suitable.

And at the very start, we didn't know if the idea was going to work. So we built something to test the idea. And the thing worked, and proved that the idea wasn't a very good one. So in just about every respect, this one was a resounding success. Yet, somehow, it doesn't quite feel like a success....

Then again, if you're guaranteed success before you start, you're not actually creating anything; you may as well buy and build Ikea furniture and say you made it yourself!