Week 5 - Electronics production
Assignment tasks for this week
Group assignment: characterize the specifications of your PCB production process.
Here is a link to our lab's page which includes links to all our group assignments.
Individual assignment: make an in-circuit programmer by milling the PCB, then optionally trying other processes.
Assignment summary
what I achieved/learned this week:
- take a .png file of a PCB layout and use fabmodules to generate g-code for the machine
- setup the CNC milling machine and cut traces and outlines for the PCB
- put together a BOM of parts to create a PCB
- 'stuff' the board by soldering all the components onto it
- debug the board, checking for shorts and open circuit elements
- burn the bootloader on the programmer using another programmer
- programme a board using a the arduino IDE
- making my own 2x3 ISP connector
Here is a link to the TRACES.png file
Here is a link to the OUTLINE.png file
Individual assignment
In electronics design, we need to get to grips with a number of processes and skills including milling, stuffing, debugging and programming our boards. Firstly we'll need to use software to layout the board, then to generate G-code to control a milling machine to cut the board with various parameters (feeds/speeds, cutter diameter, cutting depth etc). Then we'll need to stuff the board with all the components, soldering them onto the copper pads on the board - starting with the small/low components first.Then comes debugging, looking to check that connected traces are indeed connected properly using a multimeter to check for shorts, but also checking that adjacent pins and pads aren't shorted when they shouldn't be (open circuit). Then comes programming the board, which involves burning the bootloader using a programer, then actually sending a programme to the board using the arduino IDE or other IDE.
I'm perhaps most excited by this project, as it's an area that I feel I will learn the most. I really liked Ali's page and Brian's page toowhich both helped me understand the process and how the FabtinyISP works. We were also encouraged to read up on the ATtiny44 datasheet
My recent experience with electronics PCBs, has been to build some basic electronics kits that are available on the internet.
I've also been doing some introductory classes here using simple kits for measuring temperature, moisture, light sensing circuits, where a LED is turned on when a threshold value for T,RH,light is reached. This gives students an introduction to soldering, basic electronic components, PCB layout and how this relates to the development of the product in terms of constraints for the casing, power etc. I wonder if as part of this week or more realistically moving forward in the coming months, rather than buying the kits, I could design my own PCBs and get them made professionally?
My first question was what is a in-circuit programmer? it's a circuit board with components attached.
We then went through and generated a full set of instructions for milling our boards, here's the link to the instructions and here are a few pictures of my own, taken when Andrew and I were doing our boards (some of the pictures are from his board, but the process is the same). We created the .rml file using the workflow in fabmodules.org using a .png image of the board.
including the toolpath visualiser
the 0.4mm machine tool, so sharp!
the NC milling machine interface.
the z0 sensor to automatically detect the level of the board.
To machine the board, we first have to attach it to the board. We use 2-sided tape. Clamping will make the board bow, which can damage the tool with the residual stress as it gets machined.
Under the board there's an underlay - a sacrificial layer - to save the machine underneath. We need to periodically make sure that the underlay is still intact. Some notes from the lecture. We then zero the machine at the top of the stock. When putting the tool in, only nip it up snugly, not too tight or the thread will get stripped. Once machined, we need to de-bur the baord - using a small stainless steel ruler or small piece of sandpaper will do. Wash the board in soap and water - to wash off any oils from your hands - before putting on the components. note that you can also make the board on the vinyl cutter! check out Honghao Deng's work where he wrapped the circuit around a cube... FR4 is the most common material, it is glass reinforced epoxy, this is FR1 is paper reinforced - it machines beautifully, but is not so good at high temperatures. This is the one we have in our lab. Machining boards is good up to about 10 units, anything more (say up to 100) it's best to go to a board house, some good ones are: PCB-ng. Typically you pay for SPEED! Anything more than 100, then the Shenzen mass producers would be best. Design rules: how skinny can traces be (trace width)? and how far apart can they be (the pitch)? when machining, you can go down to about .38mm (15thou), in a batch production this can be down to .127mm (5thou). You can use 'vias' to connect the top to the bottom of the board. This can be done with pop-rivets, or by putting in a wire into the board and soldering it in. Why are breadboards no good? connections can be problematic, there can be electrical coupling between the components, and now most parts are surface mount anyway. In the time you can make a breadboard, you can actually make a PCB. Soldering and stuffing involves putingt a blob down on the pad, then place component with tweesers, then solder the other side, then go back and reflow the first connection. The order matters! a common mistake is to not consider the order first...go from bottom to top, and from inside out, and do low components first. For milling the boards, we use PNG is better than JPG - high resolution is needed, we need at least 500 dpi, perhaps 1000 dpi in order to be working at the same resolution as the machine.
First, we get everything we need: cutting mat, soldering iron, thin solder, steel cleaning wool, magnifying glass (ideally!), list of parts...and of course then the parts themselves!
And here's the full list for the Attiny 44 version.
Here's my board, ready to go!
Here's my list of parts, all ticked off after they've been mounted.
and here it is all soldered up. The main challenges were to remember to snip the lugs off the bottom of the USB connector, and it was quite fiddly to connect the 20Mz resonator.
I then checked all the connections with the multimeter and it all seemed ok, and also checked the orientations on the zener diodes and LEDs.
I then installed the firmware and connected it up.
It seems that there's something not right yet with either my connections (there's a short somewhere?) or with the orientation of a zener diode or LED...I need to recheck this, or perhaps even redo the board now that all the surface mount components have arrived and I realise that the design of the board could be tweaked to make it easer to assemble.
I had to start again really. The old programmer was not done so well, with a mixture of large and small components and it didn't manage to programme well, so with the advice of our guru I started again and made a new board from scratch using the same approach with a slightly different design. This was much more straight forward - it all seemed to work quite well quite quickly with almost no issues.
And here is a link to the redesign of the ISP, the one that I managed to get working!
As part of the input devices week, I also made another board which can be used as an ISP, here is a link to the input devices week, which also shows the development process of that board.
So here are the boards I've made so far, the bottom two are the ones working!
Here's how we verified that the computer recognised the programmer through the USB port.
Once I knew that the programmer was working I adjusted the existing blink LED programme to get my board to do the basic flashing LED programme using the Arduino IDE, here's the code I used:
The first step, once the arduino sketch is saved, is to set the board to the ATtiny44:
Then you can set the processor, also to ATtiny44:
Then ensure that the clock is set to 20MHz:
Then set the programmer to USBtinyISP:
Then click the upload button on the arduino
here is the downloadable PNG file for my outline
here is the downloadable PNG file for my traces
here is the downloadable Illustrator file with the outline and the traces
I also made a connector to join my programmer to my board. I started by inserting the ribbon to the connector.
Then press the top onto the connector, using the vice or something flat and hard...it takes quite a bit of pressure to push it down all the way.
Then fold over the ribbon cable and press the cap on until it goes click.
And here's the board with the LED blinking, using my arduino board as the 5V power source for my board (using pins 1-GND, and 3-VCC), and the USB port for the power supply for my programmer.