Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Hardware Hacking

Turning an Arduino Project Into a Prototype 107

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?
This discussion has been archived. No new comments can be posted.

Turning an Arduino Project Into a Prototype

Comments Filter:
  • Watch a few episodes of the Ben Heck Show. He does this kind of stuff all the time.
  • by thegarbz ( 1787294 ) on Sunday May 17, 2015 @06:54AM (#49710089)

    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.

    • by wirefarm ( 18470 )

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

    • Re: (Score:2, Funny)

      by Anonymous Coward
      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.
      • by itzly ( 3699663 )

        If you target an audience that's too big, the actual audience becomes smaller.

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

        You missed the point. It's not about interest. I do find this interest.

        It's about stories. Slashdot is a news aggregator. This isn't a news article of any type. It's a how-to guide. A DIY guide. It's for nerds, but not even remotely news in any way shape or form, and there are a multitude of sites dedicated to precisely that.

  • Later I'll write to the author and try to explain to him why marketing an anti-procrastination device to procrastinators is a bad idea. Right after I finish
  • by gsliepen ( 303583 ) on Sunday May 17, 2015 @07:00AM (#49710097)

    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.

    • 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

      • by itzly ( 3699663 )

        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.

        I always do one capacitor per power supply lead. And they always get populated. Unless you make high volume (thousands), there's no sense in optimizing.

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

        read the documentation carefully for your system on chip. sometimes the best practice is a little more involved than that. some of the more complex ones have internal dc-dc converters that require external capacitors, they need extra care in layout.

    • Not every power supply is the same, add a capacitor and/or line regulator to the input.

      And don't be stingy with decoupling caps.
      • by itzly ( 3699663 )

        And don't be stingy with decoupling caps.

        And put them right next to the power pins. I've seen boards where all the decoupling caps are bunched together in a corner of the board, far away from the action.

        • I've seen boards where all the decoupling caps are bunched together in a corner of the board, far away from the action.

          Yeah, kinda defeats the purpose. I've seen something dumber though - many years back, a friend of a friend tried to get rid of the ignition noise coming over the radio in his car by installing a filter cap across the battery terminals and then wondered why it didn't make any difference. Guy was an electronics tech in the Navy, for crying out loud.
    • What you're talking about is "productionization" - in other words making a prototype able to be manufactured. That sounds over-the-top for a hobbyist project, especially a one-off, but I think it's often worth doing for several reasons: those you state, i.e. for reliability, longevity, but also a) because it gives you some insight into what's needed to create a real product not just a hobby project, b) it adds greatly to the satisfaction you get from the finished article. If (b) isn't a consideration for yo
  • by Feral Nerd ( 3929873 ) on Sunday May 17, 2015 @07:12AM (#49710125)
    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 [oshpark.com]. 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 [youtube.com] 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.
    • I have to agree with you - Eagle is downright obstructive. Maybe you can get used to it, plenty seem to, and that perhaps blinds them to how awkward it is for occasional, casual users. Even the dedicated Racal CAD minicomputer system we used in the 80s was a lot easier to use than Eagle, and that's saying something.
      • Eagle is pretty horrible.

        If you want to try something that's much easier and, frankly, sane, try Diptrace [diptrace.com]. Really nice software, totally Wine friendly, and there's a free version.

        Saving out Gerbers is trivially easy, too.

  • We need more tutorials like this, people who can break larger projects into steps for amateurs to follow. Well it might be no big deal for an embedded engineer to take a breadboard arduino proto to PCB and bootload it over ethernet, it would be for someone just starting out, well done :-)
  • Comment removed based on user account deletion
  • My comments (Score:4, Informative)

    by Ronin441 ( 89631 ) on Sunday May 17, 2015 @08:09AM (#49710313) Homepage

    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 [sparkfun.com]) (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.

    • Comment removed (Score:5, Informative)

      by account_deleted ( 4530225 ) on Sunday May 17, 2015 @08:29AM (#49710393)
      Comment removed based on user account deletion
      • Do not use any of the express layout tools if you are handling a CPU.

        This is 100% untrue. These are modern, system-on-chip designs. Many of them are 100% self contained and they will fire up and run with just power applied. The only external circuitry required in many circumstances is a quartz crystal and its tuning capacitors. Even these are only required in applications where the SOC's internal RC oscillator is not accurate enough. You do need to use care in laying out the crystal, but SOC manufacturers issue application notes detailing the requirements necessary for

      • by Ronin441 ( 89631 )

        ExpressPCB comes with a schematic tool nowadays: ExpressSCH.

        I agree that doing a schematic first is definitely a smart thing: the pin assignments on the CPU don't make any sort of sense that was evident to me, and the mapping between Arduino pins and CPU pins is similarly nonsensical. Doing a schematic gives you a much better chance of getting it all straight on your first try. (That's certainly the way I've done it.)

    • 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

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

        • by itzly ( 3699663 )

          One time I got a bunch of boards made in China that specified a Molex part. They substituted it with a Chinese replica that fitted quite poorly to the original Molex mating part. I guess they were 90% indistinguishable.

          • They substituted it with a Chinese replica that fitted quite poorly to the original Molex mating part.

            you are making the probably incorrect assumption that that connector was supposed to mate with a molex connector. there is probably a proper mate that you did not purchase

            • by itzly ( 3699663 )

              No, my BOM listed the proper Molex part number. They mounted a lookalike. Superficially looking, it was the same, but the measurements were a little off. I unsoldered one, and when viewed side by side with the specified Molex you could see the difference.

            • by sjames ( 1099 )

              Since he specified a Molex part, it seems reasonable that it was supposed to be a part that is meant to mate with a Molex connector, don't you think? What he actually got instead was clearly not what was ordered if it was meant to mate with anything else.

      • by Ronin441 ( 89631 )

        TXD/RXD aren't used as part of the 6-pin header: it's +, -, MISO, MOSI, SCK, RESET.

        Once you've burned the bootloader using the 6-pin header, of course, you can switch to using USB or serial to program from the Arduino environment. And yes, if you're using serial to send down a new version of the code once every five minutes during development and you're also using that same serial port in your application, then moving jumpers around to redirect the serial could get old fast. I'm thinking you only need t

  • I wouldn't make a PCB for one project, I'd use a perf. board. You also don't need a stencil for SMT boards. I just got done soldering up ten prototype boards at work that had all SMT parts on them down to 0602. I used a microscope and a soldering iron.
    • I wouldn't make a PCB for one project, I'd use a perf. board.

      Not so good for modern low-power chips with low-power crystal oscillator designs. Your prototype will have serious reliability issues if you don't adhere to the manufacturer's guidelines for use of ground planes and layout.

      If you really want to do this, you can get "mini system" boards that have the processor and the crystal circuitry. You can easily mount one of these on a perf board.

      • by itzly ( 3699663 )

        Or you could use a canned crystal oscillator instead. These are quite fool proof.

        Or pick a controller that doesn't need a crystal. Modern controllers have factory calibrated internal oscillators good enough to run a UART port. I even saw one that could run USB without a crystal.

        • Or you could use a canned crystal oscillator instead. These are quite fool proof.

          except when their duty cycle or rise time is not compatible with the SOC

          except when the oscillator costs more than the SOC (look up parts costs! you will be shocked at what oscillators cost)

          I even saw one that could run USB without a crystal.

          this is not due to an "accurate" rc oscillator, this is because the USB host generates a pulse of precise duration and the USB device can calibrate its oscillator to the pulse duration.

          • by itzly ( 3699663 )

            except when their duty cycle or rise time is not compatible with the SOC

            Very hypothetical problems.

            except when the oscillator costs more than the SOC (look up parts costs! you will be shocked at what oscillators cost)

            I know they cost more, but for low volume, that's usually not a big deal. If you use a DIP type, you can even put a socket on the board, and borrow oscillators from another project.

            this is not due to an "accurate" rc oscillator, this is because the USB host generates a pulse of precise duration and the USB device can calibrate its oscillator to the pulse duration.

            For the purpose we're talking about, the RC oscillator is accurate. Whether they achieve this by design, or by continuous calibration isn't really relevant for most people.

            • >Very hypothetical problems.

              you still need to carefully read the specs for all of the parts involved, even simple parts can have complex requirements for reliable operation.

            • if you are working with MSP430 or STM32L series ultra-low power processors, an external oscillator will consume more power than your entire processor

              • by itzly ( 3699663 )

                you still need to carefully read the specs for all of the parts involved

                That's even more the case for crystals.

                an external oscillator will consume more power than your entire processor

                If that's important, then don't use it, obviously.

  • Comment removed (Score:5, Insightful)

    by account_deleted ( 4530225 ) on Sunday May 17, 2015 @08:42AM (#49710447)
    Comment removed based on user account deletion
    • First, don't roll your own PCB with a microcontroller on it unless you know what you're doing. T

      Modern processors are systems -on chip. Just about all of the external wiring is low frequency. The only high frequency signals emerging from the SOC are the connections for the quartz crystal. If you download and follow the manufacturer's guidelines for crystal layout you will be good.

      • Comment removed based on user account deletion
        • If you're even using a crystal at all, you're doing something wrong.

          What an absolutely backwards thinking statement. There are a multitude of applications available to beginners which require crystals, and at the frequencies we're talking about these applications even work on a breadboard. Crystals are in no way shape or form even remotely out of range for a beginner to use.

          • Comment removed based on user account deletion
            • Unless you have any kind of application that requires any kind of critical timing, or you actually want to run an AVR at even remotely above half its rated speed.

              Yep beginner projects like making a clock without an external RTC, flashing or multiplexing LEDs, or god forbid you do something as amazing as connect it to USB which is a built in feature of many microcontrollers these days which they can't do with the horrendously inaccurate internal RC oscillator.

              You'll need a crystal for any of the above applic

            • by vyvepe ( 809573 )
              A lot of controllers require a crystal if you want to use them only as a low or at most full speed USB device.

              Did you want to tell that people should not try to build something which would be able to do a low speed USB connection?

              But it is true there are controllers which do not need a crystal for USB.

    • by itzly ( 3699663 )

      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

      It's pretty easy, actually, if you follow a few simple guidelines. Put a bypass cap on the power leads, and put the crystal close to the CPU (if you need a crystal). Check the datasheet for other helpful advice. Often there will be a minimum schematic shown. Look at schematics of existing boards to see what they do.

    • by bitrex ( 859228 )

      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.

      Yeah, just about none of that is true.

    • by sjames ( 1099 )

      First, don't roll your own PCB with a microcontroller on it unless you know what you're doing.

      With parts like AVR, it's become nearly stupid simple. All the fiddly bits you are talking about are on the chip now. In some cases where you can use the internal clock, you really only need power and a reset connection (just a pull-up and a momentary switch will do, add a cap to be really clean about it).

      • Comment removed based on user account deletion
        • by sjames ( 1099 )

          Most of those issues will be a problem for ANY circuit, not just one with a CPU. There are plenty of schematics and diagrams of a bare AVR on a board to crib from if it isn't obvious enough. Fully agreed that it makes sense to prototype the circuit on a breadboard first, but again, that applies to anything, not just a CPU.

          If you will need to make a shield for your project, the board is a sunk cost. However, you did mention an important threshold. Unless I was going to make thousands, A Pi based project woul

  • Why did he use that ridiculously oversized LM7805 in the TO-220 package for the final project? A 78L05 in a TO-92 would have been plenty for such a small project. IIRC it's what's used on the Arduino board itself.
    • by itzly ( 3699663 )

      Maybe to allow for higher input voltage.

    • by Agripa ( 139780 )

      Derating is a good reason although I tend to avoid the 78L05 simply because its quiescent current is high compared to its output current. The 7805 is not much more expensive than a 78L05.

    • He probably had them on hand and they both cost roughly the same amount as a 78L05. Plus this is a prototype.

  • Just make sure you don't use FTDI chips... as you never know whether they are legit and the current FTDI Windows drivers will brick them. Sure, it is reversible but if anybody connects your FTDI chip to a Windows machine then it is bricked... Not nice. Not nice at all. Just avoid FTDI.
    • Just make sure you don't use FTDI chips... as you never know whether they are legit and the current FTDI Windows drivers will brick them. Sure, it is reversible but if anybody connects your FTDI chip to a Windows machine then it is bricked... Not nice. Not nice at all. Just avoid FTDI.

      Or god forbid you can buy your parts from places other than ebay. You're pretty much guaranteed legit parts if you buy from reputable sources.

      While this may sound like their reliability is in question, I would say worse from other vendors as the only alternatives to FTDI have had just utter garbage drivers to begin with.

      • by cpotoso ( 606303 )

        Just make sure you don't use FTDI chips... as you never know whether they are legit and the current FTDI Windows drivers will brick them. Sure, it is reversible but if anybody connects your FTDI chip to a Windows machine then it is bricked... Not nice. Not nice at all. Just avoid FTDI.

        Or god forbid you can buy your parts from places other than ebay. You're pretty much guaranteed legit parts if you buy from reputable sources.

        While this may sound like their reliability is in question, I would say worse from other vendors as the only alternatives to FTDI have had just utter garbage drivers to begin with.

        As if you have full control over what you get. Are you buying the FTDI chips yourself? You may be buying from a reputable vendor only to know in the end that their supply lines were not as clean as you thought. What FTDI did (brick chips that used their driver, vs. the correct thing: simply ignore the chips) is extremely unethical, I will NEVER BUY ANYTHING FROM FTDI or that has FTDI on them (whether it is fake or not fake, since I can't be sure until it is too late). Next time they'd better think twice

        • You don't have full control, but you have a very tight control and recourse available should you get stung.

          As a designer you shouldn't be pissed about this. As an end user you definitely should.

          Also I disagree they should have ignored the issue. Fake parts are the scurvy of the industry and should be eradicated. I'd much rather a part that produces a predictable but bad result when connected to the computer (bricks), than a part that I'm forever debugging because it doesn't seem to work quite right. Brickin

          • by cpotoso ( 606303 )
            Bricking = taking something that does not belong to you. It is immoral and if it weren't for the fact it is not worth it they should be sued out of existence. Acceptable = make your drivers not respond to the fake chip anymore. In the meantime, just stop using this company's chips altogether. That's my opinion. There are other alternatives (e.g., use atmega chips with USB in them).
            • Actually they aren't taking anything from you. There is only one person who is doing anything immoral and that's the person who made the fake device in the first place. Today it was bricked on purpose, tomorrow it's bricked by accident. These fakes are none the less working devices which would be just fine in their own right if they didn't pretend to be something they're not, using a driver they aren't supposed to, and channelling funds away from someone who did all the work.

              I don't avoid the company that's

My sister opened a computer store in Hawaii. She sells C shells down by the seashore.

Working...