Tuesday 9 October 2018

Making Light Work

Whilst the circuit boards were being manufactured far away, I have been able to spend time getting the neck ready. The old frets were pulled out and the f-board was planed until the lighter coloured maple could be seen. As the shavings of faux-rosewood fell away, the truss rod assembly also became visible. The truss rod is the type that has a U-shaped extrusion so there is a 10mm wide piece of conductive metal running just under the place where the PCBs will sit. A (thin) layer of insulation will be required here to avoid any short circuits.







A pair of 4mm carbon fibre square rods were glued at the edges of the planed neck surface. This should replace a little of the strength that the f-board was previously supplying and forms the sides of the LED PCB tunnel. This was glued with two-part epoxy resin and clamped to keep flat and the correct distance apart.










The PCBs arrived and thus began the tedious process of soldering 400 decoupling capacitors followed by 400 LEDs. This took a few dedicated days and evenings with some timeout to buzz out each board for build errors. The LEDs look eye wateringly bright to me!






The boards were tested (and a few dodgy joints repaired) before they were offered up to the neck. The head PCB is joined to the next five strip PCBs by short lengths of solid core Kynar wire. This daisy-chaining approach is taken to electrically connect all the boards together.












Small offcuts of 0.5mm x 3mm carbon fibre flat bar were attached with double sided tape to keep the spacing of the strip boards consistent and were placed between capacitors. Lastly a good quality 15way D plug was fixed to the neck and wired to the last five strip PCBs.




















The f-board

5mm dark tinted perspex was chosen for the new f-board. It is dark enough so that when the LEDs are off, it looks quite normal (but very black and shiny). When the LEDs are on, they are bright enough even through the dark tint. I could only find the 5mm thick perspex in a 500 x 500mm size which at first glance seems too small for a 630mm f-board, but there's always a way...



Before the f-board is attached to the rest of the neck, it makes sense to cut the fret slots whilst it is nice and flat. An attachment for a Dremel I concocted in the past has been improved by adding a rotary encoder, motor, leadscrew and Inphase / Quadrature digital readout. This allows me to precisely (well within +/-0.2mm over 600mm) navigate along the length of the work-piece before making a transverse Dremel circular saw cut. With my table-of-fret-positions all freshly worked out on a spreadsheet it was childs play (ie noisy and messy) to zip through. The slots were checked against a handy Westfield bass and looked pretty good.








The rough cut f-board resembled a stripey tie. After a bit of trial and error, it seems that ordinary two part epoxy resin isn't very good at sticking perspex to carbon fibre, so an acrylic based adhesive (I should have known!) was required. I eventually found some Voodoo glue that claimed to do the trick and also cured to a black colour to blend in. This was also a two part system, but had a working time of just a few minutes so it took some careful planning of the sequence of events to get the glue mixed, spread on the top of both 4mm carbon fibre neck rods carefully to avoid to much squeeze-out followed by placing the perspex on top once and not moving it around.

After the clamps were released, it didn't fall apart which is success in my book!

24 hours later, the LED assembly was carefully slid into place and connected to the test board for the first glimpse of how it will look!



The f-board edges were trimmed to remove excess material and then the nice shiny surface had to be destroyed by the profiling process. This time around, I purchased a 12" radius wooden block which looked a bit like a school blackboard rubber to me. Coarse 80 grit sandpaper was used to remove the bulk before going through the grades to 2500 grit.



This was followed by T-cut and car polish to return the surface of the f-board to (nearly) its original splendour.


Fretting

Fitting frets into a wooden f-board is a nice affair that involves tapping lightly with soft faced hammer so that the wood gently eases out of the way leaving a superb result. Not so with nasty perspex - especially one with no real visible means of support under most of it. One clout with a hammer and it could easily crack resulting in several weeks of work being wasted and blood pressure reaching new and exciting levels...

After initial checking, the interference fit of the frets would be too risky, so the fret slots had to be widened carefully with a handsaw until they could be pushed in by hand. This is where the term 'kerf' became part of my dictionary! The frets then had to be glued in to prevent them from falling out or moving around. These additional steps did occasionally have a bad effect on the beautiful surface finish of the f-board, but there's no use crying over spilt sodium...

The frets were levelled and dressed as normal, the neck ends trimmed and the finished article looks quite decent to me.



Next are circuit boards that control the LEDs and the pickup active tone buffering!





Sunday 13 May 2018

Board games

As for my damp project, I use KiCAD for schematic entry, board layout and gerber creation. I've tried a few different packages and this one is free and unlimited. Like all CAD software it has a few quirks, but once overcome it allows the design of a PCBs beyond the usual rectangular two layer 100 component designs that some of its peers are limited to.

At the headstock end, the board is going to have 20 LEDs across by 5 LEDs high. The board needs to be slightly trapezoidal to allow for the increase in width as the neck continues to the body. At this point I can either design another 3 trapezoidal boards, or I can make thin 20 by 1 LED boards and then just space them further apart as they reach the body. I'm opting for the strip boards as this will keep the costs down.

Either way, the connections between boards needs to consist of five data lines and at least one power and one ground. With several amps being consumed by these LEDs, I am going to keep to five power and five ground so that each row has its own power lines. This should keep the incremental resistance down without having to resort to server blade power connectors.

After spending time trying to find 15 way connectors that are humanly solderable and less than 2.5mm or so high, I eventually decide that the only way to join these boards up is by individual wires. I don't like it, but on the other hand, I don't want to fork out for a 600mm long board either.
The final head-end board schematic looks a bit like this:


The board design looks like this:


The pads for connecting to the previous set of boards can be seen at the left hand end amongst the first 3 or 4 LED columns. The thin end will be approx 5mm from the nut when installed. LEDs are on the top side, and the decoupling capacitors are on the other side.

The individual strip board schematics are surprisingly similar, but with only one row of LEDs! Here is the single row board design, the data interconnects are at the far ends (to keep the data wire length to a minimum) and capacitors again are on the other side:


Finding space for the interconnect wires was a little more tricky on the single row board as although there will be space between them, both the top and bottom rows will be at the edge of the neck. This means the bottom row will have to have the boards fitted back to front so that the interconnect 'tabs' will stick up and will mesh together with the fourth row

Here are two boards laid top to tail to demonstrate how the interconnect pads are interleaved in order that it can all fit in the space provided.


It will be a tight fit where it joins to the end board, but will get easier as the spacing relaxes.

Using KiCAD, the board layout files are converted into gerbers (and drill files) for the PCB manufacturers. A really handy feature in KiCAD is that it comes with a separate gerber viewer application. This can be used to double check that all the layers required are present, sizes, scaling and thickness correct and no unsightly overlaps between layers. It's like printing a word document on paper - your eye is always drawn to the typo.

The boards are going to be made by PCBWay. They do a good job at a good price. Amongst the options they offer, different solder resist colours are available. For good contrast I am going for black solder resist.

When they arrive, I need to solder 400 LEDs and 400 capacitors on :-(




Friday 27 April 2018

Lighting Up

A tinted perspex f-board is going to be supported along each edge by some carbon extrusions. This will give me a 'tunnel' under the f-board where the LEDs can be positioned. Although missing from the WorldSemi datasheet, the WS2812B devices I sourced measure about 1.7mm high. They will be soldered to a 0.8mm thick PCB, with decoupling capacitors on the other side which should end up as around 3.5mm thick overall. The carbon extrusion is 4mm square which gives 0.5mm of wiggle room.

The neck width at the nut is 38mm (1.5"). With a pair of 4mm extrusions supporting the f-board, this leaves a tunnel width of 30mm. At the other end of the neck the width is 63mm (2.5") leaving 55mm of tunnel width. To keep the display consistent, I need to use the same quantity of LEDs across the width along the whole length of the neck so they will have to fan out. Although 30mm should in principle allow six 5mm LEDs, I want one of the modes to simulate traditional marker dots which will be down the centreline of the neck. This requires an odd number, so five LEDs across the width of the neck it will be. This gives a device-to-device pitch of 6mm at the nut. At the other end of the neck, the device pitch will be about double that.

Along the length of the neck, I cannot achieve the same pitch as I will need to get my soldering iron in there! After juggling some dimensions around, I have decided that a 7.5mm pitch is more realistic in the other direction. For a 21-fret, 34" scale neck and a display length of 600mm this requires 80 LEDs in each row, giving a total of 400 LEDs!

Each LED can take a maximum of 50mA (also missing from the datasheet) when all three colours are driven together. For 400 LEDs running at full beans, the guitar's 5V supply will need to provide 20A and the LEDs will collectively dissipate 100W!!! Ouch! At best this will cause it to go out of tune, at worst its a fire waiting to happen! 

The prospect of running this beast off a battery is a non-starter. The size and weight of a battery capable of 2-3 hours operation is not something I want to be lifting all the time whilst playing. It's going to need power sent down the lead. 

After further consideration, the maximum current is unlikely to happen as I'll be deciding how many LEDs are on at any one time, and also white isn't that interesting, so I will be more likely to be running single colours or combinations of two. So 2/3 of the colour, and maybe 1/2 of the LEDs are usually off gives a better (safer?) estimate of around 7A of current consumption. The neck should only(!) be dissipating 35W in that case which is barely a small fire. 

With some major design criteria understood, its back to the fun stuff. I bought a microchip PIC24EP256MC202 and a 8x5 device WS2812B test board to prove the concept. The PIC is a 16bit device and runs at up to 70MHz, but still has a DIL package for development. The 8x5 board needed a bit of hacking to get it from 40 serially connected LEDs to five lots of 8 serially connected LEDs. The PIC can be used with the Microchip's MPLAB X IDE software (free!) which provides a C compiler environment and makes coding for larger projects easier than trying to do it all in assembler. 

After pinching some code to get me started (thanks Robin!) I was able to get a line of LEDs lighting up in different colours. This proved I had the right pins connected and the logic the right way up. After that I wanted to control the five rows of LEDs more-or-less simultaneously. I didn't want an obvious ripple effect causing the bottom right LED to be noticeably lagging the top left. The WS2812B datasheet shows the critical timing is the width of the high pulse. A short high is seen by the LED as a zero, whereas a long high is seen as a one; after that the timing is more relaxed. During the relaxed time period I start to send data to the next row. The overall effect is to write to a column of five almost in parallel before moving on to the next five. After spending some time debugging with the oscilloscope, it finally started clocking out patterns taken from an array. Bingo!

The LEDs are so bright I had to cover the 8x5 board with tinted perspex so the phone camera didn't saturate too much. The development board can be seen on the right with a red PicKit3 programmer sticking up. It works! I'm excited! Still a way to go though...

Saturday 24 March 2018

It must be a sign

It was a dark and wet day at Guildford train station. Platform 5 is one of the few places in the world to be more than 10 metres from a Costabucks. On the one hand I could run up & down the stairs, join the queue, decide exactly which type of (basically all the same) beverage I wanted before returning with my prize, or I could just sit there and make do with a faint aroma wafting across from Platform 1. If the train were to arrive and depart whilst I am on this quest then it won't be just the milk that will be frothing.

To aid my naturally poor decision making ability, I glance up at an information display to see how much time I have to play with. I notice the sign full of LEDs displaying the next train and the stations it will stop at.



I start to count how many dots in the characters and wonder how they are multiplexed. I think about how much processing is done behind the twinkly lights and if it uses as much energy in one hour as a kettle boiling one cup of water to make instant coffee at home. I decide that Costabucks will probably survive without my patronage and before I know it, the train arrives.

Later that day I actually get round to practising a song (for one band or the other!) and I look at my dark fretboard and think wouldn't it be great if it had lots of LEDs on it. I've never seen a bass guitar with an LED sign on the fretboard. There really isn't enough room for it and it's a silly idea. Unfortunately I'm the sort of person that believes these are exactly the right reasons for building one anyway.

I have a reel of 800 RGB LEDs sitting in the cupboard (Everlight SAGBB7C). These use the standard 5050 SMD package with 6 pins. Each led will require its own driver channel and for any decent sized display that's a lot of complex-stuff-to-go-wrong to be installing inside a bass neck. 

The WS2812B LEDs used on my 'damp' project would be ideal. The same 5mm square SMD package, but this time only 4 pins. Power, ground, data in and data out. They use a clock-less serial data stream based on high and low mark space ratios giving 1's and 0's. The main bonus here is that apart from the LEDs themselves, there doesn't need to be much else in the neck - ie less-to-go-wrong-where-I-can't-fix-it. The downside is that these are NOT sitting in a cupboard, so it's more on the shopping list.

I want this bass to look reasonably normal when its off, so I'm going to purchase a jazz bass style body and neck online and pop a few RGB LEDs in along with the control circuitry. With multi-coloured action going on, this Jazz Bass has ended up with the name Jelly Bean before it has even begun. 


With confirmation of my mental age out of the way, it's time to work out how it is all going to hang together. Some prototyping is going to be needed up front before I spend serious money on the body as I need to prove that a (simple to solder) Microchip PIC will be able to control separate daisy chains of LEDs in parallel. There are many other devices out there which may be more suitable but I already have a PICkit3 programmer, so it's PIC or bust.