Current Updates

This blog is an informal, and sometimes intermittent, record of my MEng project.

Wednesday 29 February 2012

Finalising the Hardware and Designing a PCB

I've been working towards the inevitable PCB production stage, making decisions and testing designs to allow a PCB to be designed sensibly.  Designing a PCB takes quite a lot of time to do properly, and learning to use the software effectively can take a little time.


Floor Sensor Circuit
I'd been meaning to test a floor sensor circuit for quite a while, and with a grey scale already produced last week, it seemed about time to get on and do it.  Because the floor sensor packages weren't marked like the wheel sensors, I had to use a diode drop detector to determine which way round the connections were.  This didn't take much effort at all.  I wired a single sensor up, using a resistor to load the phototransistor, and another to set the LED current.  I used a current of about 20mA, and started with an 18k resistor.

I tested the sensor's response at the extremes of the scale, and then changed the resistor to find a good response.  47k seemed to give a good result - in the final design, I'll use a variable resistor in series with a fixed one to allow some adjustment to be made.

With a 47k load resistor, the output from the sensor is quite linear - I recorded 5 points, and found the output to be very linear over most of the range, with a small positive error at the low end where the transistor goes into cutoff.

PCB Design
I'm using KiCad to do my PCB - I've used it successfully a few times, and apart from a couple of odd bugs / quirks, it is very good.  It's free and it can do up to 16 layers, if memory serves.  I'm only doing a double-sided board, and I'll be taking advantage of the online autorouting software which KiCad is designed to work with (the built-in autorouter isn't very good at the moment).

I used a hierarchical schematic to help keep the circuit diagrams legible, and I've taken advantage of KiCad's ability to re-use circuit parts.  The board I'm designing will be a Mini-ITX form factor board (about 17x17cm), and will incorporate all of the functions that I've prototyped, with a few extra circuits and capabilities added in.

I've spent a couple of days plus an evening designing the board, and I think it's pretty much finished.  I'll run it past our PCB guy in the lab before submitting the job, in case there's anything he spots which needs attention.  All of the components are through-hole mounting except for a USB to serial IC, which may be added later (there was plenty of PCB space, and it seemed a shame not to put the capability in).

Autorouting took many attempts, with semi-automatic routing and some manual routing used to get a good result.  Several iterations of routing and adjusting some parts of the layout were used to get a good result.

To make the board easy to modify, I created components which would allow pin headers to be added later, but which short each pair of pins together so nothing needs to be mounted to begin with.  These were very simple to work with in the schematic editor, but proved to be a real headache in the PCB software.  While I managed to make them work suitably, there were still some issues which upset the design rule checker, and which made some manual input necessary, such as adding zone exclusions from the ground planes around the units to prevent them being grounded.

As there was plenty of space left around the board, I added labels to just about everything - it's a shame KiCad doesn't let you put text cutouts on zones though (it puts a box around the text instead) - and I moved the tracks further apart where possible.  I used three net classes in the design - one for most nets, one for 2A power nets (which isn't much different), and one for 5A power nets (+5V, +12V and GND).  I've saved images from the 3D viewer - I think they look pretty awesome.  Some of the packages don't have 3D models, but I think what is present gives it a sense of scale.

3D rendering of the board (back view)

3D rendering of the board (front view)

No comments:

Post a Comment

Comments are moderated. Sometimes it might take me a long time to get round to it, so please be patient.