Android Things is the new kid on the block. Itis Google’s embedded platform designed specifically for use with low-powered, IoT (Internet of Things) devices. The Android Things dev preview is available for a few different IoT boards, such as the Raspberry Pi 3, the Intel Edison and theNXP Pico i.MX6UL.

As someone who has never worked with circuits, I had a bit of a steeper learning curve than others when tinkering with Android Things. I have studied all the theory around circuits and how they work but we never actually had hands on experience creating circuits. Besides that, school was a long time ago,so I needed to brush up on my theory too.
I think it is important to understand the basics of circuits and hardware components before diving in head first into Android Things development. This post will explain the basicsof circuits, hardware components andhow we can use this knowledge to build a simple blinking LED with Android Things.
Hardware ComponentsThere are different parts you would typically need to build something with Android Things (or any other IoT platform for that matter) depending on what you want to build.
Breadboard This is your c onstruction base for prototyping electronics. It allows you to connectdifferent components and wires to create a circuit. When you are finished prototyping, you would typically solder your components together and not use a breadboard anymore. The columns on the edges of the breadboard are connected vertically by conductive metal strips, and the inner rows are connected horizontally. Read more about breadboards here .

Breadboard
Jumper Wires Used to connect the components of a breadboard together and to connect an IoT board (Raspberry Pi, Arduino etc) to the breadboard.

Jumper Wires
Resistors Components that are u sed to resist the flow of electrical energy. It converts some of the electrical energy into heat. Resistors can have different resistance. It is important to calculate and use the correct resistor when building circuits. The stripe markings on a resistor reflect the resistance measure. More infoon how to calculate resistor values can be found here .

Resistors
LEDs Components that convert electrical energy into light energy. LEDs (or Light Emitting Diodes) are polarized components, this means they only allow electricity to flow in one direction . The short leg of the LED is called a cathode(-) and will connect to ground. The long leg of the LED is an anode(+) and will connect to power.

LEDs Light Emitting Diodes
Push Switch Component which a llows electricity to flow between its two contacts. When the switch is pushed down, the circuit is closed. When the switch is up, the circuit is open.

Push Switch

Push Switch
And many more components!
Power CalculationsWhen buildinga circuit, youneed to do some calculations before plugging componentsinto one another. For example, an LED can only handle certain a certain amperage (about 0.023A). If you provide more ampsthan it can handle, you can risk damagingyour LED. Thisis where resistors come in. In order to builda basic circuit where we havea blinking LED, we need to do some calculations as to what resistor we should use.
This is where Ohm’s Law comes in handy. Ohm’s Law states that the current through a conductor between two points is directly proportional to the voltage across the two points. This law will help us calculate the resistors we should use when creating our circuits.

Ohm’s Law
Ohms Law: V = I * R
This diagram translates into 3 different equations: V = I * R or I = V/R or R = V/I, where V is Voltage (volts), I is Current (amps) and R is Resistance (ohms).
GPIO PinsWith the Raspberry Pi 3 (and the other Android Things supported boards ), there are a coupleof GPIO (general purpose input output) pins that giveusa physical interface between the Pi and our breadboard. The pinsallow us to interact with different components and receive and send information to them. Each board is configured differently and the pins themselves provide different functionality. To understand how these GPIO pins work for each board, you should look at the manufacturer’s pinout diagram.
For example the pinout diagram for the Raspberry Pi 3 can be seen below:

Raspberry Pi 3 Pinout Source https://developer.android.com/things/hardware/raspberrypi-io.html
There are 40 pins on the Raspberry Pi 3 and you can see they have different functions. Some pins provide power, some are ground and others will be used for receiving or sending values to our circuit’s components.
Basic circuit for a blinkingLED with Android ThingsTo create the blinking LED example, we need to create a circuit. In this example, we will be using the Raspberry Pi 3. Using the Fritzing tool, I have created this example circuit that we want to build using our components.

Android Things Raspberry Pi 3 and Blinking LED
In the diagram above, the pins correspond to the Raspberry Pi pinout diagram shown earlier. In this example, we have used a 220Ω resistor, an LED and some jumper wires to connect them all together. We are supplying the circuit with 5V of power from the Raspberry Pi 3.
When applying Ohm’s Law, we can see that the ampsthat will flow through the LED is I = 5V/220Ω which means I = 0.023A or 23 milliamps ( 23mA ). This value is just about the max you can safely use with the LEDs, which is why we chose a 220Ω resistor. Some LEDs can handle different currents, it is worth checking out the specs for the LED you are using.
When setting up the above circuit with the Raspberry Pi 3, it is important to ensure the pins are used in the correct place as we mentioned before, since the pins have different uses. Make sure to connect the BCM6 pin (as indicated in the pinout diagram) to the 220Ω resistor.
It is also important to place the LED correctly into the breadboard, with the