Slashdot Mirror


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?

16 of 107 comments (clear)

  1. I like the that we have tech stories... by thegarbz · · Score: 3, Funny

    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.

    1. Re:I like the that we have tech stories... by wirefarm · · Score: 2

      "News for Nerds. Stuff that Matters"
      Some of what they post falls under the latter category, not the former.
      Could it be that this article annoyed you *because* you're an electrical engineer?
      Doesn't matter I was happy to see his article this morning.

      --
      -- My Weblog.
    2. Re:I like the that we have tech stories... by Anonymous Coward · · Score: 2, Funny

      I totally agree. I wish the only stories slashdot posted were stories that I personally find interesting. This other nonsense should be left to other sites that cater to other individuals.

    3. Re:I like the that we have tech stories... by itzly · · Score: 2

      Posting a link to one story does not shove another out of the way.

      Yes, it does. Quite literally, in fact. There's only so much room on the front page.

    4. Re:I like the that we have tech stories... by Zero__Kelvin · · Score: 2

      Combine that with the complete inability to look beyond the front page and you have an excellent point!

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    5. Re:I like the that we have tech stories... by thegarbz · · Score: 2

      Just because it's older doesn't mean it didn't happen today

      This is slashdot. I don't think anything we see has happened today.

  2. Make sure your project is ready for the real world by gsliepen · · Score: 4, Informative

    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.

  3. Nice little tutorial... by Feral+Nerd · · Score: 3, Informative

    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.

  4. My comments by Ronin441 · · Score: 3, Informative

    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.

    1. Re:My comments by geoskd · · Score: 4, Informative

      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.)

      Do not use any of the express layout tools if you are handling a CPU. The layout will not work on the first try, and you will have to modify it. Doing this with a schematic is relatively straightforward, and spotting faults is easy. Doing the same from a layout is obscenely difficult and prone to failure. You want to use a schematic capture / PCB layout combination tool such as kicad, eagle or gEda to name a few. The ability to check your layout against a schematic is invaluable, and will save you huge amounts of time.

      --
      I wish I had a good sig, but all the good ones are copyrighted
    2. Re:My comments by TheGratefulNet · · Score: 2

      the same advice is used for other overloaded programming pins (such as tx/rx which is used for the inline 6pin 'arduino' programmer, or the 6pin 2x3 isp connector).

      you want to have a high-z buffer (or play the resistor trick, which I don't personally love) that you can detach your i/o devices from 'a bus' while you program the controller chip. then, when the controller runs, it can either enable the line buffers (ie, tri-state) or you could just have hard jumpers onboard, but that gets tiring after a while.

      point taken, though; think about the lifecycle of software update and if anything on the bus can be in the way of that, you'll have to have an approach that removes the devices at the right time.

      other misc tips while I'm on the subject: its been mentioned to use silk screening and mark polarity (lytic caps, etc) but some pkgs like eagle tend to want to put the plus sign inside the cap's circle. once you populate that cap, the plus char is now hidden and you can't easily desk-check things. I always like to add another '+' char OUTSIDE the cap circle footprint so that even when the part is installed,I can still see the indexing mark. same with chips and diodes and everything else that has a footprint that might cover up an index mark.

      add lots of test points, even if its just an unfilled pcb via.

      add lots of diag leds and jumpers so you can change options or enable a debug mode via a simple jumper change.

      on any higher freq test points, have an eyelet that is a local ground neaby within a few mm distance, so you can use a spring clip probe instead of the 1" of alligator clip/lead that adds too much inductance for high freq grounding use.

      oh, this goes without saying but so many forget this: HOW ARE YOU GOING TO MOUNT THE BOARD? ie, add round screw holes on the 4 corners of the board. remember, it will be mounted somewhere. I see lots of boards (like the open-bench logic sniffer board; it has nearly no holes and mounting in a box is difficult) that forget about the holes. its one of those 'doh!' moments but lots of people seem to forget this simple thing.

      if a chip is hard to solder (fine pitch) consider making it a module that has its own chip carrier and follows .1" standard spacing. socket it so that if it blows you don't have to do serious board rework and can just replace the blown chip on a new carrier board. daughter boards are a great concept to follow.

      use tlv diodes to limit static on front panel buttons, or even use opto couplers. any outside world interface may also benefit from optos (I have a project where I'm allowing ttl serial i/o from a user to the board; and I'm using optos to allow 3.3v and 5v to mix but also no ground loops and no direct connection from control system to the controlled system). if you are using fast i/o, remember that most opto chips are slow and you want nanosecond speed, not microsecond, so pick a faster opto isolator chip (they are only a dollar or 2 more, at most).

      also, avoid all parts from ebay, especially china. goes without saying, but they are all likely fakes or factory rejects or even used parts that were manually removed! buy from mouser, digikey, jameco, etc. even stuff that 'should not matter' like IC sockets will be surprisingly low quality and even things you think 'should be ok' will break on you if you buy ebay china parts. its tempting, but never use that kind of part if you are building something for someone else or if you need it to last. some of us have 2 bins of parts: the junkers that are 'just for us' and for informal testing; and the parts bin from trusted sources that you will use for real builds.

      and if you do send a job to china to have your thing built, never give them all the plans. divide it up so that no one place has your whole design. make it so that you can have 'diag code' loaded for the manuf testing guys, but load your own code here (in your own country). its true about china theft, so know that going in. if you break up the project into a few different boards or modules and don't give the same work to all your sub-contract vendors, you will retain more ownership of the project over time, that way.

      --

      --
      "It is now safe to switch off your computer."
    3. Re:My comments by FranTaylor · · Score: 2

      avoid all parts from ebay, especially china. goes without saying, but they are all likely fakes or factory rejects or even used parts that were manually removed!

      this is true for semiconductor devices. but for switches, connectors, crimp pins, etc. you are just wasting your money. the connectors you get for super cheap on ebay are 100% indistinguishable from the ones at mouser that cost 10x more.

  5. Re:Make sure your project is ready for the real wo by Bing+Tsher+E · · Score: 2

    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.

  6. CPU by geoskd · · Score: 4, Insightful

    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
  7. Re:Fritzing by FranTaylor · · Score: 3, Informative

    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.

  8. Re:Board MFGR by ArcadeMan · · Score: 2

    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!