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?
I know it's funny to complain that slashdot hasn't been posting news for nerds, but this isn't news at all.
Please leave how-to guides on hackaday, make, and other such dedicated sites. Especially topics such specific would cater to only a very small subset of slashdot readership, and I say this as an electrical engineer.
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.
It's not a bad idea to put holes or pads for despiking capacitors all over the board, at least one per chip in your design. They should be connected as close as possible between the power and ground supply leads for the chips. These may not all need to be populated in the final design, but having them there will make it easier to add capacitors if they end up being needed to clean up the power distribution and prevent hardware glitches when the device is operating.
It's not a bad idea to explore around the power supply rails on the prototype circuit with a scope looking for glitches and noise induced into the circuit by rapidly changing digital signals into and out of the active parts of your circuit.
The original article talked about laying out your design with a microprocessor. Several things should be noted:
First, don't roll your own PCB with a microcontroller on it unless you know what you're doing. This is an involved process and not for newbies. You will need expensive lab equipment to debug even the simplest problems, and it is best to sidestep the problem if at all possible. Consider instead simply incorporating an arduino / Pi / Beaglebone into the actual product and do it that way instead. If the margins are low enough to make this impractical, and you don't have any experience designing microcontroller systems, then I would humbly suggest you are out of your depth, and the profit margins are probably too low for you to make money selling your product.
Second, take a serious look at your design tools. there are plenty of free tools out there that do an excellent job. Eagle and gEda come to mind. Both are free, and both will handle just about any job that an amateur is trying to accomplish. Eagle is primarily windows, and gEda is Linux only. The key part is that you want to design your system as a schematic, then export to the PCB layout. That way the tools will automatically check your PCB layout for errors such as short circuits, disconnected circuit, and a whole host of other problems that the free prototype tools don't handle. Put another way, if you get lucky on your first shot and the layout is perfect, then any tool will do. If you make a tiny mistake somewhere in your layout, then the expressPCB, etc tools will not catch it and your boards will not work. The schematic capture tools will catch the fault, and will save you massive amounts of trouble.
Be prepared for new debugging tools. Debugging a problem with the arduino or Pi is something you probably already know how to do. Debugging an embedded microcontroller is a whole other world. Even if the hardware is 100%, debugging software is trickier. Do your homework and be prepared for a radical departure from what you’re used to.
I wish I had a good sig, but all the good ones are copyrighted
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.
https://oshpark.com/
We bring you high quality, lead free boards (ENIG finish), manufactured in the USA, and shipped for free to anywhere in the world.
Can't beat that!
Get free satoshi (Bitcoin) and Dogecoins