Turning an Arduino Project Into a Prototype
An anonymous reader writes: Those of us who fiddle with electronics are probably familiar with this scenario: you've just finished assembling a project using your Arduino/Raspberry Pi/whatever, and it works! You'd like to set it up for long-term use, but... it's just a mass of wires and LEDs and switches. Alexis Matelin has written up a brief but handy guide for turning that mess into a self-contained prototype. He goes from planning out your circuit to designing your schematic to making your board, then working on an enclosure and a battery holder. Matelin also links to a variety of resources for the individual steps involved. It's a straightforward guide written for amateurs. Those of you who have experience with building permanent micro-controller projects: what would you add?
Make sure the silkscreen contains enough information so that populating the PCBs is as free from errors as possible.
If you are using polarized components (diodes, electrolytic caps, etc.), it helps if all components are oriented in the same way.
If not, make sure it is properly marked on the PCB.
Even if the prototype works fine, spend some time hardening your project for possible problems. Add diodes to protect against accidental reverse polarity connections. Your final design will probably run for much longer than your prototype ever did, so make sure it doesn't get too hot, and that everything is well within the maximum ratings of the components. Not every power supply is the same, add a capacitor and/or line regulator to the input. Maybe some components can be put into a socket instead of directly soldered on board. LEDs are cheap, add some to provide diagnostics.
Make it easy for an end-user to reprogram the Arduino/Rasperry/whatever.
Wish I'd come across this earlier. I've been developing a Raspberry PI hat circuit over the last six weeks and it's been a steep learning curve since I'm not a circuit nerd. Doubtless all the circuit nerds here will find that article overly simplistic but I'm a code monkey and had to piece this together from a number of other tutorials over the last six weeks. The things I have to add is really only the observation that Eagle Cad is the most counterintuitive piece of software I have ever tried to use. I decided to do a schematic and convert it into a PCB using Eagle which worked well enough. However, I have used any number of circuit simulators (eventually selected a href="http://icircuitapp.com">iCircuit, nice simple and available for: OS X, iOS, Android and Windows) and the UI in all of them much worked pretty much the same way but it's like Eagle Cad's developers went out of their way to make the UI of their schematics editor different. That said, Eagle Cad works like a charm one you figure out how the UI works. The component libraries can also be pretty overwhelming. After a lot of searching I came across this PCB prototyping service. No generating Greber files, just hit the "Get Started Now." button, upload the Eagle CAD file and pay the man, $18 for three boards and free shipping, turnaround time is c.a. 3 weeks. I'm still waiting on the boards so I can't judge their quality but I loved the simplicity of their site and I really hope their work is as good as people say it is because the pain of figuring out how to generate Gerber files in Eagle is bound to be as counter intuitive and painful to learn as everything else with Eagle.
If your time is expensive and you will only be running a very small number of PCBs, consider using ExpressPCB's design tool, because it's easy to learn and it seamlessly connects to their board printing service. (Their service is expensive though, so this is only good if you're doing a few boards, and thus the labor you save will not be eaten up by the extra you pay per board.)
Your perception of size on screen is very different to real life. Print a paper dummy of your board. Try to avoid components with pins any denser than SOIC or 0805.
Consider putting a bridge rectifier just after your DC IN connector. Then the polarity of incoming power doesn't matter: the bridge rectifier sorts it out. (It costs you a small voltage drop, of course.) Or use a connector that's hard to get backwards, such as USB or USB micro.
Tie the RESET pin to Vcc via a resistor. A floating RESET pin may lead to random resets. (I made a PIC board that reset when you brought your hand near it.)
Make sure you put the crystal close to the CPU, and connect to it via short traces. Same with the two capacitors either side of the crystal.
Your first draft will contain errors. Expect to have to trouble-shoot these.
Tie any unused digital lines to places where you can populate LEDs for troubleshooting and diagnostic info.
You'll need to include the six-pin programmer header: your CPUs will arrive blank, without the Arduino bootloader.
When you receive your first blank board, first populate the bare minimum components needed to make the CPU run. Then connect to it from the Arduino software on your PC and burn the bootloader into it. (You'll need a programme.r) (If you've never burned a bootloader, re-burn the boot loader on your actual Arduino to make sure you have all the steps and setup correct.) Only once your CPU is running should you populate further components. This particularly applies if you're using the MOSI, MISO or SCK pins: once you connect these to other chips on your board (e.g. you're using them for SPI), you may be unable to burn the bootloader.
fritzring is fun for simple stuff, but if you try to make a moderately complex board you will find that their parts libraries are pretty scant and you will end up spending a lot of time in the parts editor.