DEV Community

Kevin Sidwar
Kevin Sidwar

Posted on

Building an IoT Product: The Hard Parts 1

So you've prototyped the coolest new IoT device ever with an Arduino or Raspberry Pi and now you want to make a product from it. You're gonna be rich! Step 2 is always "Profit". What you don't realize is there are actually 497 steps between 1 and profit. My hope is that this series will shed some light on just a few of those things to help you be better prepared on your journey from maker to product builder.

My name is Kevin and I've spent the last two years turning a weekend maker project into a full-fledged IoT product. I want to share what I've learned to help others who may be thinking of taking the plunge.

I've been working as a software developer for 15 years. Not exactly where I thought I'd end up considering my degree is in Electrical Engineering. Little did I know my EE degree combined with my love of programming was going to perfectly coincide with the rise of the Internet of Things. 15 years ago there were virtually no software developers in the hardware maker arena. Nowadays I can't find a software person that hasn't tinkered in some form of hardware project. The progress we've made in that amount of time is astounding. Access to tools and hardware is unprecedented. Even with tariffs the costs are as low as they've ever been. The rise of Sparkfun and Adafruit has created a flourishing space for individuals to build their wildest dreams with little to no hardware experience. Components that were previously unusable due to hard-to-solder packages now have breakout boards. Thanks to more developers entering the space, sample code has flooded the internet making datasheet reading a lost art. For many projects it's a lot like Legos. Connect all the things together and run the sample code and it works. The downside of all this progress is that it tricks us into thinking that making a product is easy.

So let's run through a scenario. You've got your maker board wired up with all the sensors and actuators you need. It's a mess of wires and breadboard and you've never seen anything so beautiful. "This is awesome!" you think. "People will pay me for this!!" you convince yourself. How hard could it be? You have all of the open source schematics and source code. You're a smart person. All you have to do is combine it on a single board, put it in a case and slap a price tag on it. Hold on Tiger, let's talk about this. In part 1 of this series we're going to cover a few hardware bumps you're going to run into.

TL;DR - Hardware Design Costs Time and Money: You Better Have Lots...Of BOTH

The Schematic

The first thing you're going to need is an electrical schematic of your product. It seems like you should be able to take all of the breakout board schematics from your prototype and just combine them in a single schematic. Ok, that's not too bad. The first question you have to ask yourself is "Who is going to do that?". Are you going to do it? Are you going to pay somebody else? Whether it's with your time or money, you're paying for it. Maybe you've never used an EDA program before in your life. Sure, there are lots of options out there, even free ones. But do you want to spend weeks learning how to use it? Let's say the answer is no. We can solve this with money. "I'll pay somebody to do it for me." you say, feeling content you've solved your first major hurdle. Alright, great. We solved that problem. Wait...but how much should you expect to pay for that? If you're going to pay by the hour how many hours is reasonable for a job this size? How do I know I'm getting a good deal for the price? The answer is, you don't. If you did you wouldn't be asking those questions in the first place. You've just been hit with your first dose of "We're not in MakerLand anymore."

The Printed Circuit Board (PCB)

It's been several weeks since you started this journey and you finally have your schematic. In the delivery email the nice contractor/freelancer says "Let me know if you have any questions. I'd also be happy to quote you for doing the PCB layout when you're ready." WHAT!?! I gotta pay for more stuff? If that's your first reaction then I'm going to save you a lot of time and money. Product making is not for you. Stick to being a happy, financially stable nights and weekends maker. Making an IoT product is going to cost you sums of money that will make you blush. Convincing your significant other to let you buy some breakout boards and some Raspberry Pi Zeros is a very different conversation than "So...uh...I need to spend 10 grand for an enclosure mold". But I digress, more on molds later.

The cost of doing PCB layout will depend on the complexity of your product. Let's assume it's nothing fancy and doesn't require more than 2 layers and has no complicated high frequency routing requirements. You'll be doing well if you can stay in the $500-$1000 range. This is not an area where you want to cut corners. Shoddy work on the layout will cost you in spades down the road whether it's in redesign and additional prototype runs or even failure in the field.

As always, you can do the PCB layout yourself but a word of caution on this. At this point in the process the financial commitment is going to get real. Very real. Small prototype runs are going to cost you, at minimum, hundreds of dollars. Every time you make a PCB layout change you have to do another one of those runs. You may think you are saving yourself the thousand bucks by doing the layout yourself until you realize that you keep making mistakes and have to do another $400 prototype run to make sure your changes work. There is a careful balance here so be thoughtful about how and where you "save" money.

Whew, you've made it this far. It's been a couple of months now since you started this journey and you have your PCB laid out and ready to go. Things are moving and it feels great.

Component Selection

Before you can do that first prototype run you need a list of every component used on your printed circuit board. R23, which is a 10k resistor, now needs a part number. As does her neighbor C14, the 10uF capacitor. Component selection is not a singular event. It is ongoing and never ending. Let me explain. At a very minimum you have to do a form of component selection twice. Realistically plan on half a dozen just to get your first production run out. Here are some major milestones of component selection.

During PCB Layout

During PCB layout you need to know what footprint to use for every component. The footprint is the copper landing area on the PCB to which each component is soldered. If your board has 70 total components (resistors, capacitors, transistors, etc) your PCB will have 70 footprints. A surface mount resistor has over a dozen footprints to choose from. That open source breakout board schematic tells you the value of the resistor but oftentimes that's it. Sure, it's a 10k resistor but do you know what wattage it needs to support? If you put a 0402 SMD resistor on your board and find out it has to be rated for 1W your product is gonna go boom. The capacitor is labeled 10uF on the schematic but what voltage rating does it need to be? What the heck is the difference between an electrolytic, ceramic, and tantalum capacitor? Your product also has a micro USB connector on it for charging. You flip to Digikey and search "Micro USB Connector". Not bad, only 766 options available covering 3 dozen different footprint configurations. Which one do you choose? What do you mean you don't know? You better figure it out so the PCB layout can move forward.

Repeat this process for every component on your board. For most of the components you don't have to get as granular as a single part number to get PCB layout underway. In fact, where possible, you don't want to get that specific. More on that in a minute.

Prototype Run

Before you have 1000 of these new widgets made you need to verify that everything works. You have to do a prototype run with a fab and assembly house. Many places offer both services. "Fab" stands for fabrication and it's the process of actually producing a printed circuit board from the layout you did earlier. "Assembly" is just what it sounds like, it's the process of populating that PCB with all of the components. Typically you will place an order with a fab and assembly house by sending them your layout files and a list of all the components. At this point you have to have every component defined down to the part number. You can't tell the assembly house "Just use a 10uF resistor for C5". You have to say "C5 is a 10uF 16V X5R 0805 capacitor. Part number ‎CL21A106KOCL3RC‎." You can either mail them all the parts (I don't recommend this) or you can have them source the parts for you (better, but be careful on quality). Either way they need the exact part numbers. Depending on the number of components in your design this can take a very long time. You may even find that super cool button you chose is out of stock and now listed as "Not for New Designs" on Digikey. Time to call that PCB freelancer again.

Production Run

You somehow won the lottery and your prototypes worked flawlessly after extensive testing. No PCB layout changes and no component changes are required. "Great, I'll just place another order and set the quantity to 1000." You shoot off an email to the assembly house in China and get the best sleep of your life. It's all coming together. You wake up in the morning with the following note in your inbox from the assembly house. "Sir, thank you order. Please advise no stock on C5, C17, C31. Suggest other part number." Now is probably a bad time for you to learn that there is a global shortage of MLCCs (multi-layer ceramic capacitors) and you're almost guaranteed to have at least a few on your board. I've done 4 runs of my product and getting ready for a 5th. I've had to re-select capacitor part numbers on every single one. I had to do this even when 2 runs were only a couple of weeks apart. That's how bad it has been at times.

Future Runs

Hardware components, like everything, have an end of life. A linear voltage regulator that you've used for years is no longer being made by the manufacturer. They have a new part that's better. Most times they will make the new option footprint-compatible with the old. If so, all you have to do is find the new part number and update your BOM (bill of materials) that you send to the assembly house. If you can't find a replacement that is footprint-compatible it's time to get your wallet out again because you're going to need another PCB revision.

Mo Money Mo Money Mo Money

The hardware side of making a product is one of the most expensive parts. If you are serious about making an actual product you're going to need cash. A lot of cash. Everything costs money and there are little extra charges everywhere that you don't think of until you're paying them. Tariffs, as much as the news wants you to believe otherwise, are the least of your problems. Shipping is going to get you at every turn especially if you have to source parts from multiple locations. Most assembly houses require a 5% to 10% headroom on components. So even though you only need 100 capacitors you have to send them (or have them source) 105 to 110. Not a huge deal but it starts to add up across dozens of components. And last but not least volume is your best friend. Problem is, you don't have it yet so you're gonna pay the "I'm not Apple" price for everything.

That's going to do it for part 1 of this series. Hopefully that gives you some insight into what hardware challenges you might encounter when you have the crazy idea to turn your maker project into a real product. Next time we're going to talk about the hurdles you'll encounter trying to piece all of that open source firmware together now that you have your hardware in hand.

Top comments (1)