How To Turn Your Arduino Project Into A Sellable Product
How To Turn Your Arduino Project Into A Sellable Product
Turn Your
Arduino
Project into
a Sellable
Product
This guide is written by John Teel and brought to you in cooperation by:
Table of Contents
Introduction 3
Step #1 - Preliminary Design 4
Critical Components Selection 5
Common Microcontroller Peripherals 7
Notable Microcontroller Cores 8
Estimate the Manufacturing Cost 9
Step #2 - Design the Schematic Circuit 10
Review of Arduino Uno Schematic Diagram 13
What About Any Shields? 16
Step #3 - Design Printed Circuit Board (PCB) 17
Step #4 - Order PCB Prototypes 19
Step #5 - Develop the Firmware/Software 21
Step #6 - Test, Debug, and Repeat 24
Step #7 - Electrical Certifications 25
Conclusion 27
Introduction
Creating a prototype based on an Arduino is an Secondly, and most importantly, you won’t make any
excellent start to bringing a new electronic hardware money unless your product is really expensive with
product to market. The Arduino is an ideal platform for high profit margins. Very few products have a retail
proving your product concept. price high enough to justify using an Arduino for
production. But, if you are lucky enough to have such a
However, there is still a lot of engineering work product then using an Arduino for production can be a
required to turn it into a product that can be low cost way to get your product to market very quickly.
manufactured and sold to the masses.
Arduinos may seem cheap when buying just one for
But why can’t you simply manufacture your product a DIY project, but they are very expensive once you
with an Arduino inside? The good news is you can, but move on to high-volume production. You can design
most likely you shouldn’t. your own microcontroller circuit to replace an Arduino
for only a few dollars, and that is the focus of this guide.
There are two main reasons this is not usually a good
idea. First of all, the Arduino is large so for many
products embedding an Arduino will make the product
much too big to sell as a finished product.
3
Step #1
Preliminary Design
Before you jump head first into spending big money Most entrepreneurs make the grave mistake of
on full development I highly recommend you first look jumping right into spending big money (and/or tons
at the big picture. This basically means you select all of time) on full development without any idea of the
the critical components, identify any development or costs, steps, and complexities that lie ahead. No big
manufacturing risks, and estimate the cost to develop, tech company would ever do this. They always analyze
prototype, scale, and manufacture the product. the big picture before spending the big money, and so
should you.
4
Critical Components Selection
The first step to design the electronics is to select all This will allow you to narrow down your search to
of the critical components. This includes the various only microcontrollers that are actively available. It also
microchips (i.e. integrated circuits), sensors, displays, allows you to quickly compare prices without limiting
connectors, and other electronic devices needed your choices to any particular manufacturer.
based upon the desired functions and target retail
price of your product. One word of caution when selecting components.
Take the time to do your due diligence to ensure
Most products require a master microcontroller with that you won’t run into supply issues with any of
various components (displays, sensors, memory, etc.) the components in the future. First of all, make sure
interfacing to the microcontroller via multiple serial you only select components that are currently in
port protocols (I2C, SPI, UART, I2S, USB, etc.). active production. Secondly, confirm that all critical
components are available from multiple distributors.
Should you select the microcontroller first or last? Finally, contact the component manufacturers to find
I recommend that you begin by creating a detailed out the forecasted end-of-life, or use a paid service
system block diagram. such as SiliconExpert.
A system block diagram is invaluable for this early The most easiest strategy to transition from an Arduino
planning. It can tell you how many input and output prototype to a sellable product is to use the same
(I/O) pins and serial communication ports are needed microcontroller as the Arduino you used for your
for the project. Once you have that information then project. Most Arduinos are based on simple 8-bit AVR
you can select the best microcontroller. microcontrollers from Microchip.
I recommend searching for microcontrollers via an Although there may be higher performance and lower
electronics component distributor such as Newark. cost microcontrollers available, the simplest option is
5
to just use the same microcontroller as your Arduino. My specific preference is the STM32 line from ST
There are two key reasons why using the same Microelectronics. The STM32 line is huge. It includes
microcontroller is the easiest option. First, the firmware everything from relatively simple microcontrollers
you’ve already developed is more easily ported over to all the way up to powerful microcontrollers running
the manufacturable version of your product. at hundreds of MHz. The upper echelons of the
STM32 line approach the performance of some
Secondly, Arduino is open-source hardware so for the microprocessors.
most part the circuit schematics can be simply copied
as-is, or at least serve as a reference starting point.
6
Common Microcontroller instead of having to remove it for programming. The two most
common ISP protocols are JTAG and SWD.
Digital General Purpose Input and Output (GPIO): These Serial Peripheral Interface (SPI): SPI is used for short distance
are logic level pins used for input and output. Generally they serial communication between microcontroller and peripherals.
can sink or source up to a few tens of milliamps and can be SPI is a synchronous protocol which means it includes a clock
configured as open drain or push pull. signal for timing. SPI is a 4 wire standard that includes data in,
data out, clock, and chip select signals.
Analog input: Most microcontrollers have the ability to precisely
read an analog voltage. Analog signals are sampled by the Inter Integrated circuit (I2C): I2C also written as I2C is a 2-wire
microcontroller via an Analog to Digital Converter (ADC). serial bus used for communications between the microcontroller
and other chips on the board. Like SPI, I2C is also a synchronous
Analog output: Analog signals can be generated by the protocol.
microcontroller via a Digital to Analog Converter (DAC) or a Pulse
Width Modulation (PWM) generator. Not all microcontrollers However, unlike SPI, I2C uses a single line for both data in and
include a DAC but they do offer PWM capabilities. data out. Also instead of a chip select signal, I2C uses a unique
address for each peripheral. I2C has the advantage of only using
In Circuit Programming (ISP): ISP allows you to program a 2 wires, but it’s slower than SPI.
microcontroller while it is installed in the application circuit,
7
Universal Serial Bus (USB) is a standard that is familiar to 8051
most people. USB is one of the fastest serial communication The 8-bit 8051 microcontroller was developed by Intel way
protocols. It is generally used for connecting up peripherals that back in 1980. It’s the oldest microcontroller core commonly still
require large amounts of data transfer. used today. The 8051 is currently available in enhanced modern
versions sold by at least 8 different semiconductor manufactures.
Controller Area Network (CAN) is a serial communication For example, the popular Bluetooth Low-Energy chip from CSR
standard developed specifically for use in automotive (CSR101x) uses an 8051 core.
applications.
AVR
The microcontroller line known as AVR from Microchip (originally
from Atmel) is best known for being the brains in most versions
of the Arduino. So for many makers it’s an easy transition from
Notable Microcontroller Cores an Arduino to an AVR microcontroller. However, I’ve found that
you can usually get one of the other cores with similar, or better,
performance for several dollars cheaper.
There are several microcontroller cores that have some
The large majority of Arduino models are based on an AVR
notoriety and are worth describing. Below are four of 8-bit microcontroller (see Table 1 below). The exceptions are
the most common ones: the Arduino Due, Zero, MKR1000, and MKRZero all of which are
based on 32-bit Arm Cortex-M architecture microcontrollers.
Arm Cortex-M
The 32-bit Arm Cortex-M series is one of the most commonly PIC
used microcontroller cores used today. Arm doesn’t actually PIC is another family of microcontrollers from Microchip.
make and sell microcontrollers, instead they license their They are very popular and come in a wide array of options.
architecture to other chip makers. The PIC microcontroller line includes 8-bit, 16-bit and 32-bit
versions. The number of pins, package styles, and selection of
Many companies offer Cortex-M microcontrollers including ST on chip peripherals are offered in an almost endless array of
Microelectronics, Freescale Semiconductor, Silicon Labs, Texas combinations.
Instruments, and Microchip.
8
Estimate the The total COGS consists of much more than just the
Manufacturing Cost electronic component costs. For more information
see my article that describes in great detail the
manufacturing cost for a new electronic hardware
I highly recommend that you estimate the production product.
cost for your product before you design the full
schematic. Most entrepreneurs and developers skip
this step and proceed right to the schematic design.
That’s a mistake!
9
Step #2
Design the Schematic Circuit
For the rest of this introductory guide we’ll be focusing
primarily on 8-bit AVR microcontrollers since that is the
easiest transition from an Arduino.
10
Figure 1 - Arduino Uno uses an ATmega328
microcontroller with 32kB of Flash memory
The ATmega328 used in the Uno is a through-hole Finally, DIP packages tend to be more expensive since
DIP (Dual-Inline Package) version in a socket. Use of a they are not generally used in high volume production.
socket allows the microcontroller to be easily swapped For example, the ATmega328 costs $1.66 @ 100 pieces
out if it becomes damaged. A socketed microcontroller in a DIP package, but only $1.18 for a much smaller SMT
may be a good idea for a development kit, but not for a package.
production product.
11
Operating/Input CPU Analog Digital IO/ EEPROM SRAM Flash
Name Processor USB UART
Voltage Speed In/Out PWM [kB] [kB] [kB]
101 Intel® Curie 3.3 V / 7-12 V 32 MHz 6/0 14/4 - 24 196 Regular -
Gemma ATtiny85 3.3 V / 4-16 V 8 MHz 1/0 3/2 0.5 0.5 8 Micro 0
ATmega168V
LilyPad 2.7-5.5 V / 2.7-5.5 V 8 MHz 6/0 14/6 0.512 1 16 - -
ATmega328P
LilyPad
ATmega328P 2.7-5.5 V / 2.7-5.5 V 8 MHz 4/0 9/4 1 2 32 - -
SimpleSnap
LilyPad USB ATmega32U4 3.3 V / 3.8-5 V 8 MHz 4/0 9/4 1 2.5 32 Micro -
SAMD21
MKR1000 3.3 V / 5 V 48 MHz 7/1 8/4 - 32 256 Micro 1
Cortex-M0+
ATmega168 3.3 V / 3.35-12 V 8 MHz 0.512 1 16
Pro 6/0 14/6 - 1
ATmega328P 5 V / 5-12 V 16 MHz 1 2 32
3.3 V / 3.35-12 V 8 MHz
Pro Mini ATmega328P 6/0 14/6 1 2 32 - 1
5 V / 5-12 V 16 MHz
That being said, the ATmega32U4 is quite pricey So, if there is a 6-20V DC input voltage supplied then
at around $3.47 @ 100 pieces. Whereas, ST the positive input of the U5A comparator is higher than
Microelectronics offers an Arm Cortex-M 32-bit the negative input (3.3VDC). In this case the output of
microcontroller with USB functionality for only $1.92 @ the comparator will be high, and PMOS transistor T1 will
100 pieces. be turned off. This disconnects the internal 5V signal
from the USB supply voltage.
Support Circuitry If the 6-20V DC input is not present then the output of
U5A will be low which turns on T1, thus the internal 5V
Each of the two microcontroller circuits in the Uno supply comes from the USB port.
consists of a crystal oscillator running at 16 MHz, various
GPIO (General Purpose Input/Output) signals, multiple The other op-amp in U5 (U5B) is connected in a
serial interfaces including one for programming, a configuration known as a unity-gain feedback amplifier.
power supply, and lots of decoupling capacitors. This is a fancy way of saying that it has a gain of 1 which
means it acts as a simple buffer.
14
Whatever voltage you put on the input of U5B is what If the NCP1117 didn’t have an internal thermal shutdown
you get on the output. The purpose is that now the feature, it would literally cook while trying to dissipate
output is able to drive a much larger load. In this case, this much power. Regardless, you will waste all of this
this buffer is there simply to flash an LED whenever the power as heat.
serial programming clock (SCK) signal is present.
If you need to step-down a high voltage to a
Power Circuit significantly lower voltage then a switching regulator
is a much better choice. I won’t get into the details of
switching regulators in this article, but they are many
The power circuit for the Uno is based on an NCP1117 times more efficient than linear regulators. However,
linear regulator from ON Semiconductor. This regulator switching regulators are also considerably more
generates a 5V DC voltage from the 6-20V DC input complex than linear regulators.
voltage and can source up to 1A of current.
On the Uno a LP2985 linear regulator from Texas
The use of a linear regulator in this situation is fine for Instruments is used to create a 3.3V voltage. The
some products, but not if your product is powered LP2985 is rated for 150mA of load current. This type
from a battery, or consumes large amounts of current. of linear regulator is also called a Low-Drop-Out (LDO)
A linear regulator such as the NCP1117 is extremely regulator because it requires very little differential
inefficient when the input voltage is significantly higher voltage from the input to the output.
than the output voltage. Being inefficient means it
wastes a lot of the power by dissipating heat. Older, non-LDO linear regulators required the input
voltage to be a few volts above the output voltage.
For example, on the Uno the input voltage can be as However, from a power dissipation standpoint it’s best
high as 20V, and the output voltage is only 5V. This to operate a linear regulator with an input voltage close
means the input-output differential voltage is 15V. If you to the output voltage.
pull the maximum current of 1A from this regulator the
power dissipated by the linear regulator would be (Vin The 3.3V voltage is fed into a comparator (U5A) that
– Vout) * Iout = (20V – 5V) * 1A = 15W! is used to switch to USB power, if available, when no
15
power supply is plugged in. by the shield you’ll either want to replace it with a
custom circuit or a module solution.
The LP2985 doesn’t dissipate that much power so a If the shield is providing wireless functionality then in
linear regulator is a good choice for this regulator. This most cases you are better off using a surface-mounted
is because the input-output voltage differential is only module which will solder directly on the main PCB.
5V – 3.3V = 1.7V, and the maximum current is only
150mA. There are two reasons for using a module for wireless
functions. First, the PCB for a wireless radio can be
A very common strategy is to use a switching step- quite complex to lay out correctly. Secondly, the use of
down regulator (also called a buck regulator) followed pre-certified modules will simplify the process of getting
by a linear regulator. In addition to the increased your product certified.
complexity, the other downside of a switching regulator
is it provides a “noisy” output voltage. Note that many wireless solutions (whether a module
or a chip) include an embedded microcontroller that
This is fine for many applications. However, if you can also serve as the master microcontroller for your
require a cleaner supply voltage it’s best to add a product. In such as case there is no need for a separate
linear regulator to clean up the output voltage from the microcontroller unless your product requires a more
switching regulator. advanced microcontroller than embedded in the
wireless module/chip.
17
Figure 4 - PCB layout for the Arduino Uno
A microcontroller circuit with a clock speed of only 16 Secondly, carefully lay out any decoupling capacitors
MHz, without wireless functionality, is a fairly simple so they are as close as possible to the pin that is being
PCB layout to design (assuming you know how to do decoupled. Be sure to always review the microcontroller
PCB layout). Things become much more complicated datasheet for PCB layout guidelines.
once speeds approach hundreds of MHz, or especially
GHz. Some general PCB layout tips include avoiding 90
degree bends in signal traces and making sure any
Be cautious about two things when laying out an traces carrying significant current are sized properly. If
Arduino Uno equivalent microcontroller circuit. First, leadless packages are used be sure to also include test
the crystal and it’s two load capacitors need to be laid points for debug purposes.
out correctly and placed as close as possible to the
microcontroller pins.
18
Step #4
Order PCB Prototypes
Once the PCB layout is completed it’s now time to
order the boards. However, before ordering any PCB
prototypes you should really get an independent
design review of the schematic and PCB layout.
19
Regardless of the designer’s experience level, an Once you’ve tested and debugged the first version,
independent design review reduces the likelihood that then increase the quantity for the second order
mistakes will make their way into your prototype. depending on your confidence level that all major issues
have been fixed.
Once you are finally ready to order boards you will
need to generate Gerber files for the PCB layout. There
are countless PCB design software packages and each
has its own proprietary file format. Gerber files, on the
other hand, are an industry standard supported by all
PCB design tools. Gerber files will be used to prototype
your boards as well as for production.
20
Step #5
Develop the Firmware/Software
As I eluded to earlier, one aspect of an Arduino that is
different than a custom microcontroller circuit is how
the programming is done. An Arduino is programmed
via a USB port. This allows it to be programmed from
any computer without the need for special hardware.
21
On the other hand, a custom microcontroller is usually so be sure the one you purchase works with your
programmed via a serial port protocol such as SPI, SWD, microcontroller.
UART, or JTAG. In order to program a microcontroller
using one of these serial programming protocols you’ll
need a special piece of hardware called an In-Circuit
Serial Programmer (ICSP) or In-System Programmer
(ISP).
22
Once you have the necessary programming hardware programming. Selecting a microcontroller from the same
it’s time to port over your Arduino sketch to native line of microcontrollers will still significantly simplify the
firmware code. transition from Arduino to production.
Just as with a custom microcontroller, an Arduino
is programmed using the C language. However, For example, porting your Arduino code over to any
programming is greatly simplified on the Arduino since 8-bit AVR microcontroller will be considerably less
it already contains a huge library of various functions. complex than porting it over to a 32-bit microcontroller.
pinMode(PinNumber, OUTPUT);
digitalWrite(PinNumber, LOW);
23
Step #6
Test, Debug, and Repeat
It doesn’t really matter how good you are at designing inherently dealing with unknown and unexpected
circuits. Unless your product is exceptionally simple, problems. This step almost always consists of both
you are almost guaranteed to make at least one or two hardware and firmware debug.
mistakes in your design, and likely many more.
24
Step #7
Electrical Certifications
In order to sell a new electronic product in most I’ll warn you that obtaining certifications isn’t cheap
countries there are several types of certification and most products will cost at least several thousand
required. The exact certifications needed depend on dollars to certify. Below is a quick overview of the
the country/region where the product will be sold. certifications required in the USA, Canada, and Europe.
25
FCC certification is required for all electrical products RoHS (Restriction of Hazardous Substances) certification
sold in the USA. Products that don’t purposefully radiate is required for electrical products sold in the European
electromagnetic energy (i.e. no wireless functions) are Union (EU). It certifies the electronics are free of lead.
classified as non-radiators.
26
Conclusion
In this article we’ve looked at the simplest example
of migrating from an Arduino prototype to a
manufacturable product. However, the simplest method
is rarely the best method.