In this section, we'll cover early proof of concepts (PoC) with a developer kit. You'll typically make an early PoC quickly with off-the-shelf components.
Get a developer kit
A typical developer kit has two components: the SoM and a carrier board.
A System on Module (SoM) is a prefabbed module with an SOC, WiFi/BT, memory, and power management on one small board. These are all the components required to run Android Things. The benefit of this approach is that it reduces the cost and time for development of a hardware product. For example:
- SoMs are certified to work and are available at volume. You don't have to bring up this part and qualify it for your product.
- Android Things certified SoMs already has compliance, regulatory, and safety testing (e.g., FCC, UL). This is a costly step and takes time.
- SoMs can be interchangeable to enable developers to move from one SoM to another either for supply or for different specification.
- SoMs will typically have high availability to purchase in single to large quantities.
- SoMs will have long term support to make sure they will be support into the future.
Figure 1. A SoM
The SoM is attached to a developer kit carrier board during prototyping and development. The carrier board is relatively large and expensive because it typically comes with more IO than you need in your final product to enable flexible prototyping. When you go into production, you'll design a specific baseboard with only the components you need, making it smaller and cheaper.
Figure 2. A carrier board with common connections
Choose a way to build
Now that you have a developer kit, there's two ways to get started with building your proof of concept and connecting peripherals: breadboards and protoboards.
Using breadboards is a quick way to test out a few designs and to get your product working. They're easy to build and prototype with and don't require any soldering, so you can make wiring changes during development until the design is stable. Instead, you use bare wires called jumper cables to connect components to the breadboard, so it's easy to add components, test out wiring designs, and change designs quickly.
The holes of a breadboard are internally connected together in rows and columns to allow multiple components to share the same connection point. The outer rows are connected perpendicular to the rest of the board and form a single bus in each row across the top and bottom. These rows are typically used to connect power and ground, or other common signals needed across the entire circuit.
Figure 3. A breadboard with connected components
A protoboard is a blank board with holes to let you solder wires and components to it. You'll also need a header that fits into your carrier board. This approach is more robust since the connections are soldered. You typically should make a few samples with a protoboard after building with breadboards to show off a more polished working prototype.
Figure 4. A protoboard
Add components and peripherals
There are many types of peripherals such as temperature sensors, humidity sensors, relays, motors, and actuators that you can use with Android Things.
This section describes some basic hardware concepts that you'll need to know when working with these peripherals.
Embedded devices contain active circuitry, which means they need an external power supply to function. Power is the input voltage delivered to the components on the board from an external source such as a wall adapter, battery, or USB port. The following signals are provided to the board by the power supply:
- Voltage of the external source connected to the board. Many boards support a range of input voltages, and use an internal voltage regulator to provide stable power to the rest of the components.
- VCC or VDD
- Internal regulated voltage powering the components on the board. Common power supply voltages are +5V, +3.3V, and +1.8V.
- Ground (GND)
- Reference point for 0 volts on the board. All other voltages are measured with respect to ground. Voltages measured below ground are considered negative.
To shut down a board, it is safe to disconnect the power supply. No special shut down procedures are necessary.
Analog and digital I/O
Peripherals connect to your device using various input and output pins exposed on the board. Input pins allow your app to read and interpret the current electrical state. Output pins allow your app to control the electrical state of the pins. Peripherals and onboard I/O are either analog or digital in nature.
Analog devices produce voltage that's proportional to the physical conditions they measure. A good example is a temperature sensor, which may produce an output between 0-5V corresponding to a temperature between 0-100°C.
Analog inputs translate a discrete voltage level into a proportional integer value using an analog-to-digital converter (ADC). The range of integers used to express the voltage level is based on the resolution of the ADC, expressed in bits. A 10-bit ADC, for example, can express the input voltage as a value between 0-1023 (for example, 210 discrete steps).
Digital logic represents a voltage signal as a binary value:
- High: When the voltage is at or near VCC. Typically represented as a logical "1".
- Low: When the voltage is at or near ground. Typically represented as a logical "0".
It's rare for a digital signal to be exactly 0V or VCC. Most digital logic devices interpret a range of voltages near the extremes as a valid logic level. The following table indicates common input voltage ranges for each logic state.
|Supply Voltage (VCC)||Logic Low (0)||Logic High (1)|
|5V (TTL)||< 0.8V||> 2.0V|
|3.3V (CMOS)||< 0.8V||> 2.0V|
|1.8V (CMOS)||< 0.6V||> 1.2V|
Peripherals typically use digital I/O in a few common ways:
Stable state: Single on/off state mapped to a stable high or low value.
Pulse train: Series of digital signal pulses with variable frequency and width transmitted continuously over time.
Serial communication: Series of digital 1s and 0s representing individual bits of a binary number.
Pull-ups and pull-downs
In many digital interface circuits, resistors are connected between the I/O signal pins and VCC or ground. These are known as pull-up and pull-down resistors, respectively. They guarantee that each signal has a stable default state that the rest of the system can rely on, without significantly affecting the input or output signal directly.
A digital input that is not actively connected to any signal is a floating input. Floating inputs are susceptible to electromagnetic interference, which affects the value reported to your app and causes unpredictable readings. Pull-up or pull-down resistors ensure that the line is driven to a stable value, even when nothing else is connected.
As an example, think of a button or switch. A switch is a pair of contacts that connects an input pin to a high or low voltage when closed, but leaves the input floating when open. In addition, many digital transducers use open collector (or open drain) outputs to report a state change. These outputs act like a simple switch and require and external source to drive the input when the switch is open.
The resistor values you choose affect the system in different ways. Low value resistors are considered "strong" because more current flows. Strong pull-ups (or pull-downs) draw more power overall, but they can reset the signal to an idle level more quickly than a "weak" resistor with a higher value.
As an example, the I2C serial bus uses pull-up resistors to keep the clock and data lines stable when the bus is idle. Each device added to the bus loads down these lines, making it harder for the pull-up to keep the line at the appropriate level. As the number of devices on the bus increases, the strength of the pull-ups must also increase to handle the added load.
See Pull-up Resistors for more details on applications and calculating the proper values.
Many electrical input devices, such as switches and relays, have a mechanical component. As the mechanical motion of the device settles, the electrical signal can temporarily oscillate — or "bounce" — between multiple values. In many cases, this will be seen by your app as multiple input events in a very short time.
To correct this problem, you must debounce the signal using hardware or software. Software debounce involves setting a time delay between the initial input event and when the input is expected to stabilize (usually not more than a few hundred milliseconds).
To debounce your input with hardware, add a simple RC circuit (so-named because it contains a resistor and capacitor) between the input pin and the device. When the input device changes state, the capacitor will charge and discharge at a rate proportional to the size of the input resistor, effectively slowing down the transitions seen by the input pin.
See Input Interfacing Circuits for more information on calculating debounce and other techniques for connecting input signals to your device.
Protecting I/O pins
Each output pin has a limited capability to source (when high) or sink (when low) current from the circuitry connected to it. Peripherals that draw more current than the pin can handle — even temporarily — can damage the output. To protect the pin, insert a current-limiting resistor in series with the load.
To control higher power transducers, such as motors, buffer the load from the output pin using a transistor or similar electronically controlled switch and power the transducer directly from the power supply.
All I/O pins are designed to safely operate with in the voltage range between 0V and VCC. Connecting any pin to a voltage higher than the power supply for that component will likely damage it. Always verify that the voltage levels generated by your sensors and transducers match their connected I/O pins. To connect devices of variable supplies together, use a logic level converter circuit.
See Output Interfacing Circuits for more examples of circuits you can use to safely interface with digital and analog I/O.
Getting components and peripherals
There are many online retailers that you can search and purchase components. Here are a few in the US: