Cost-ing

The questions below are due on Monday February 26, 2024; 10:00:00 AM.
 
You are not logged in.

Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.

Cost & price

It's useful in developing HW/SW products if you know your costs. For one thing, if you're running a startup, selling your stuff for more than it costs to make them is very important for staying in business for any length of time (and if you're not, then you better be recouping that loss somewhere else)! But also, understanding where your costs are will help you figure out where to trim if you want to decrease them.

We are not an economics class, and understanding ALL the costs that go into products is a lot of work. But we can start to get a handle on some of them.

Perhaps first of all, we need to distinguish between price and cost. When we're buying cold medicine at CVS, they are the same to us. But when we are making products, they are different. Our cost is what it costs us to produce a product, whereas the price is what we sell it at. So, one might expect that as a company you set the price of your product to be higher than the cost of your product.

BOM

The first aspect of cost in a HW/SW product is the cost of all the HW bits and pieces that go into your product. This is called your "Bill Of Materials" or BOM (pronounced bomb).

To figure out your BOM, you make a list of all the parts that go into your product, how many of each you need, and how much each one costs. Then add it all up!

A spreadsheet is good for this. Here's one you can use. Make a copy and edit.

For this exercise we're going to figure out the BOM for the SHTC3 breakout board that we used in lab 01. Preparing this BOM will give some experience as you create the BOM for the Sentimet and/or MAQS class project. For Sentimet, things will both be a bit easier and harder. They'll be easier because KiCAD will help you make the electronics BOM, so you'll have a bit of a head start there. However, the BOM for the class project will include non-electronic parts (fasteners, enclosures, gaskets and adhesives, and so on). So there will be alot more parts.

If you take a look at the schematic for the SHTC3 board (you can find it on that website!), you'll see some capacitors, resistors, connectors, two Integrated Circuits (aka ICs), two transistors, and an LED. Those are all the components that go into the BOM.

An IC

We'll help a bit here to get started. In the power supply subsection of the schematic, you see an "AP2112K-3.3" chip. Putting that into a search engine will quickly turn up a page from Digikey. It's a voltage regulator that provides a 3.3V output voltage (hence the "-3.3" at the end of the part number) to provide the SHTC3 sensor with a nice, clean 3.3V power supply.

Digikey is one of the major electronics vendors (there are others, like Mouser, Newark, etc.). It's a pretty cool place. Back when physical catalogs were a thing, there was nothing more fun than just paging through the new Digikey catalog when it came out. The paper was telephone-book quality. It was great. Something lost...Someting gained.

Anyway, if you go to that page, you get the info you need to fill out the "Component Description", "Link to datasheet", "Vendor", and "Link to vendor page".

What about the footprint/package? And the manufacturer part number and the digikey part number seem to have lots of options. So let's dive in a bit more.

Click on the datasheet, and on the first page, you see six different versions of the chip package.

AP2112K packages

Many electronic components come in different form factors, namely different packages. These in turn have different footprints, which we got into in the KiCAD schematic design for our own sensor board. The part number and price differ for different packages. If the package is not specified on the schematic, we need to go to the PCB layout files or, in this case, a picture of the actual board will be fine. Do you see the regulator on the board? You'll also see three characters on the top of the chip. Those are the "chip marking". Go back to the datasheet and search for "marking". You should be able to narrow down to the manufacturer part number now and package.

Finally, we need the price. Make sure you are on the Digikey page for the actual package, and you'll see lots of different prices:

AP2112K pricing (2023)

Like many items, the more you buy, the less expensive it is per-part. So if you're Apple and sell 200+ million iPhones, then you get a very good price for the regulators in those iPhones. But if you buy 1 part, you get a worse price. Price can also be related to how the part comes to you. At the factory where the AP2112K are given birth to, they are placed into "reels of cardboard tape holding the component with the reels generally having some integer-number-of-thousand in quantity generally dependent on the size/complexity of the component. Those reels then go to the distributors. If you want less than a reel's worth of components, that will require the distributor (Digikey) to have to cut the cardboard tape and that requires more work on their part so they price them higher per component (that's why "cut tape" pricing is higher per unit than full reels").

Also note the price-breaks on components ARE NOT progressive...in other words, it is not like how US federal income tax is calculated. What I mean by this is, there are certain amounts of parts where it is just financially stupid to buy at. For example, with the AP2112K, buying nine devices will cost 0.35 \times 9 = 3.15 dollars. However buying ten devices will cost 0.25 \times 10 = 2.50 dollars. It is actually cheaper overall to buy more in this case. This is generally how the industry works at large. These price breaks are generally spaced logarithmically you'll notice. While it might seem minor and a curiosity, this price break structure really can matter:

  • When developing a system, try to keep these price breaks in mind. You might be prototyping a board and need seven of a part. If there's a price break at ten, maybe it makes sense to spend a tiny bit more (or possibly even less lol depending on what the price break is) to have some backups. We do this all the time.
  • Pricing structures like this really motivate you to make as many components be the same as possible and to figure this out ahead of time. Do you need a 9.8 kOhm resistor and a 10.2 kOhm resistor? Can you instead get away with just using a 10 kOhm resistor? If so money can be saved. Can every submodule use the same regulator? Even if one board needs bypass capacitors rated for 6.3V and the other needs them rated for 16V, maybe having everything use 16V-rated caps might actually be cheaper overall. These are all questions that need to be asked when determining the cost of a product. And while for our small scale of dozens to hundreds of boards, for larger runs, this can end up saving thousands of dollars.
  • Similar to the earlier point about this pricing not being "progresive" you really want to know what and how much you're buying ahead of time. Very, very rarely will a vendor or distributor take purchase history into account when pricing. So if you bought previously bought a reel of 3,000 AP2112K parts at 0.10082 dollars per part and now, you need to buy another 3,000, the vendor is not going to say, "hey we'll give you the pricing that goes along with 6,000 per part." No you'll be stuck paying at the worse rate...so you'll be out 36.66 dollars more than if you would have bought all 6,000 at once earlier. Of course, then warehousing all 6,000 might have cost money...and there's upfront cost factor and interest rates...and things snowball from there...so you can see why there are people who have jobs that focus just on supply chain management now...it gets complicated quickly and at scale optimizing this stuff can save hundreds of thousands of dollars.

For the sake of this exercise, it's reasonable to assume that Adafruit doesn't want to stock 10's of thousands of each breakout board they make (warehousing has its own costs). So let's price everything out assuming they make 1,000 at a time.

As mentioned above, looking at that pricing, we see two different tables: Cut Tape and Tape & Reel. The parts come from the manufacturer in huge reels. If you buy an entire reel (or more), you get the best price (like if you buy a case of ramen soup vs. an individual package). Cut Tape is when a human (or maybe a robot) goes up to a reel in the warehouse and cuts off 27, or 50, or 430 pieces from that reel. It's more expensive. That's what you mostly see around EDS, since we buy in smaller quantities.

So now you can price out the voltage regulator.

A passive

Let's do a different part. Connected to the AP2112 in the schematic are three capacitors, two 10 uF and one 0.1 uF. Let's cost out the 10 uF ones.

Finding passives can be overwhelming due to the options. If you just search for "capacitor" in the Digikey search bar, you'll find over a million items across different categories. Similar with resistors. So here's a reasonable approach:

The most common SMT capacitor is the ceramic capacitor. If you click on that you'll get to the so-called parametric search page. Here you can narrow down the options by the parameters you care about. So you can narrow down by the capacitance value, the manufacturer, voltage rating, and so on. For designs that really matter (i.e., you need high temperature, or high frequency, or really low failure rate, etc.), you can find that, and they will of course be more expensive.

For bread-and-butter stuff, we mostly care about the capacitance value, the package, and the voltage rating. So if you select a 10 uF capacitance, and a 10 V voltage rating (we really only expect 5V max in the system, so 2x safety margin is reasonable), and an 0603 "package / case" (this is my guess based on the board image, though we could measure to be sure), you'll get down to fewer than 100 parts. Then select "Exclude" Marketplace Product. This limits you to what Digikey actually stocks (it's similar to buying from Amazon vs. Amazon Marketplace...go to Digikey Marketplace only if desperate and trying to extend the lifespan of a old design by six months or something).

Then, hit "Apply All" to implement the filters. Finally, sort by quantity availabe. Typically the items that are most available are the ones that are most commonly used. You should finally get down to a part number, and can get pricing info and fill out the BOM.

You can repeat for the other caps. Taking a look at the board, you can maybe discern that the 0.1 uF cap is smaller, so let's use a 0402 package for that one.

The Rest of the Parts

You'll have to repeat for all the parts on the board. Here are some notes to make this a bit easier:

  • Resistors. There are five resistors in the schematic, but if you look at the board, you won't see five. Near one connector is one resistor (looks like 0402 sized). But if you look near the other connector you'll see a chip marked "103". That is a 10k "resistor array". So that is what you want to look for.

  • LED. There's one. Do you see it? Looks to me like 0402 sized. And it's green. That should help narrow things down.

  • Connectors. Adafruit uses these "STEMMA" connectors, which are really 4-pin JST PH connectors. They are surface mount, and right-angle (i.e., they don't stick straight up from the board). That should help narrow down to find a part. You can buy them on Adafruit, but you'll pay a premium because they make it easy. Find them on Digikey instead to save money.

The Board

It also costs money to fabricate the board, and to get all the components asssembled onto the board. The fabrication will go into the BOM. The assembly we'll deal with afterward.

To figure out the board cost, we need to find the cost on a PCB manufacturer's website. A common overseas low-cost manfacturer is JLCPCB. If you go to the JLCPCB website, you can get an instant quote for a PCB. There are lots of options here. But these simple Adafruit board are FR4, with two layers. You can find out the board size on the Adafruit website for the breakout board (or measure your own board if you wish). Choose to add "deburring" since we don't want to do that ourselves. Of course, choose the "black" PCB color as that is Adafruit's color. And get pricing for 1000 boards. Just like with components, PCB fabrication (and assembly) will have price breaks. Different vendors and products will have varying degrees of price cuts, but they generally work the same as we discussed for components above.

That should give you the pricing for fabricating the PCBs. Add it to your BOM.

COGS

So now you have a complete BOM for this product. However, the BOM is not your total cost. Because there's alot more to get this product in people's hands than just a pile of components and a board. Those costs summed up are the COGS: cost of goods sold.

COGS includes all the direct costs involved in producing a product, such as:

  • BOM
  • assembly
  • testing
  • packaging & shipping
  • taxes, tariffs, etc.
  • costs for hosting software (on cloud), or costs for your own hardware (including depreciation)

In a different part of your BOM spreadsheet, or a new tab, we'll add in these other costs. For any PCB created at reasonable volumes, you'll want to get things professionally assembled (i.e., have a machine do it). We can estimate the cost to assemble the PCBs from the JLCPCB assembly faq. You'll see the setup and stencil one-time fees (these are not per board, but for the overall order), and then you need to add $0.0017 per joint, which basically is each pad (these costs are per board). So a capacitor is two pads, the regulator is 5 pads, and so on. Add that all up to estimate the assembly cost/part. Add it to your COGS.

There is also packaging, i.e., putting the item in those little Adafruit bags. We will ignore that for now. And testing, since we don't really know what (if anything) Adafruit does for testing.

For Sentimet, your COGS will include the cost of labor for assembling the system, and any testing you need to do for the final product before you ship it out.

How to estimate these? Well, for example, time yourself putting the system together, then price that at a typical rate ($30/hr is a reasonable estimate). And so on.

What else

There are other costs beyond these.

There is overhead, which are all the costs that you can't easily assign to a particular product. Things like rent, utility costs, software tools that you might license, non-billable personnel costs, etc.

And then there are the one-time costs associated with developing the product, so-called non-recurring engineering (NRE) costs. For example, all the time you spend designing, prototyping, testing, etc. all costs money! Another substantial one for HW/SW products is writing software. So in the case of the SHTC3 board, Adafruit also provides a free Arduino library and a free CircuitPython library, and those take time to develop.

NRE is interesting because you can sometimes trade NRE for COGS. For example, imagine your system runs off a battery, and you have a choice:

  • spend more time writing the software so that the system spends as much time sleeping (in low-power mode), so that you can have a smaller battery

OR

  • buy a larger battery, and spend less time developing the software (since it will be simpler)

How do you make that tradeoff? Usually it will depend on how many units you want to sell. Imagine the extra software development time will take 2 engineers' time for 4 weeks, and you are paying the engineers around $150k/yr. So that is about (2 FTE \times 4 weeks/FTE \times \$3k /wk) or $24000.

If you are making 100 parts, then a larger battery that costs $5 extra will add $500 to your overall costs, much less than the $24k in software development. But imagine you are selling 1M parts. Then it is definitely worth it to spend the money to improve the software. (unless, of course, you have a deadline you have to hit that simply disallows the extra month of development).

When you're finished, put a link to your spreadsheet in the box below.

Enter a link to your Google sheet.