Home > Articles > Hardware

  • Print
  • + Share This
This chapter is from the book

Interfacing with Electronic Circuits

While getting your sketch uploaded to the Arduino and running is a significant accomplishment, most likely you’ll want to do more in your Arduino projects than just watch the L LED blink. That’s where you’ll need to incorporate some type of external electronic circuits into your projects. This section covers the basics of what you need to know to add external electronic circuits to your Arduino sketches.

Using the Header Sockets

The main use of the Arduino is to control external electronic circuits using the input and output signals. To do that, you need to interface your electronic circuits with the Arduino analog and digital signals. This is where the header sockets come into play.

If you remember from Hour 1, “Introduction to the Arduino,” the header sockets are the two rows of sockets at the top and bottom of the Arduino Uno circuit board. (Some more advanced Arduino units, such as the Arduino Mega, also include a third header socket on the right side of the board to support additional ports.) You’ll plug your electronic circuits into the sockets to gain access to the Arduino input and output signals, as well as the power from the Arduino.

The basic Arduino Uno unit that we’re using for our experiments uses the standard Arduino tworow header socket format. Figure 4.5 shows the layout of the upper and lower header sockets.


FIGURE 4.5 The Arduino Uno upper and lower header sockets.

The lower header socket has 13 ports on it, as described in Table 4.1.

TABLE 4.1 The Arduino Uno Lower Header Socket Ports




Provides the reference voltage used by the microcontroller if not 5V.


Resets the Arduino when set to LOW.


Provides a reduced 3.3V for powering low-voltage external circuits.


Provides the standard 5V for powering external circuits.


Provides the ground connection for external circuits.


A second ground connection for external circuits.


An external circuit can supply 5V to this pin to power the Arduino, instead of using the USB or power jacks.


The first analog input interface.


The second analog input interface.


The third analog input interface.


The fourth analog input interface.


The fifth analog input interface, also used as the SDA pin for TWI communications.


The sixth analog input interface, also used as the SCL pin for TWI communications.

The upper header socket has 16 ports on it, as described in Table 4.2

TABLE 4.2 The Arduino Uno Upper Header Socket Ports




AREF Alternative reference voltage used by the analog inputs (by default, 5V).


The Arduino ground signal.


Digital port 13, and the SCK pin for SPI communication.


Digital port 12, and the MISO pin for SPI communication.


Digital port 11, a PWM output port, and the MOSI pin for SPI communications.


Digital port 10, a PWM output port, and the SS pin for SPI communication.


Digital port 9, and a PWM output port.


Digital port 8.


Digital port 7.


Digital port 6, and a PWM output port.


Digital port 5, and a PWM output port.


Digital port 4.


Digital port 3, and a PWM output port.


Digital port 2.

TX ->1

Digital port 1, and the serial interface transmit port.

RX <- 0

Digital port 0, and the serial interface receive port.

For our test sketch, we need to access the digital port 13 socket, in addition to a GND socket, to complete the electrical connection to power our electronic devices.

To access the sockets, you can plug wires directly into the socket ports. To make it easier, you can use jumper wires, which you can easily remove when you finish experimenting.

Building with Breadboards

When you build an electronic circuit, the layout is usually based on a schematic diagram that shows how the components should be connected. The schematic shows a visual representation of which components are connected to which, using standard symbols to represent the different components, such as resistors, capacitors, transistors, switches, relays, sensors, and motors.

Your job is to build the electronic circuit to mimic the layout and connections shown in the schematic diagram. In a permanent electronic circuit, you use a printed circuit board (called PCB) to connect the components according to the schematic.

In a PCB, connections between the electronic components are etched into the PCB using a metallic conductor. To place the electronic components onto the PCB, you must solder the leads of the components onto the PCB.

The downside to using a PCB for your electronic project is that because it’s intended to be permanent, you can’t easily make changes. Although that’s fine for final circuits, when you’re developing a new system and experimenting with different circuit layouts, it’s somewhat impractical to build a new PCB layout for each test.

This is where breadboards come in handy. A breadboard provides an electronic playground for you to connect and reconnect electronic components as you need. Figure 4.6 shows a basic breadboard layout.

Figure 4.6

FIGURE 4.6 A basic breadboard.

Breadboards come in many different sizes and layouts, but most breadboards have these features:

  • A long series of sockets interconnected along the ends of the breadboard. These are called buses (or sometimes rails), and are often used for the power and ground voltages. The sockets in the bus are all interconnected to provide easy access to power in the circuit.
  • A short series of sockets (often around five) interconnected, and positioned across a gap in the center of the breadboard. Each group of sockets is interconnected to provide an electrical connection to the components plugged into the same socket group. The gap allows you to plug integrated circuit chips into the breadboard and have access to the chip leads.

The breadboard allows you to connect and reconnect your circuits as many times as you need to experiment with your projects. Once you get your circuit working the way you want, you can transfer the breadboard layout onto a PCB for a more permanent solution.

Adding a Circuit to Your Project

Now that you’ve seen how to add external electronic circuits to your Arduino project, let’s create a simple circuit to add to our Arduino sketch. Instead of using the L LED on your Arduino, let’s use an external LED.

For this project, you need the following parts:

  • A standard breadboard (any size)
  • A standard LED (any color)
  • A 1000ohm resistor (color code brown, black, red)
  • Jumper wires to connect the breadboard circuit to the Arduino

The circuit uses a 1000ohm resistor to limit the voltage that flows through the LED to help protect the LED. The LED doesn’t need the full 5V provided by the Arduino output, so by placing a resistor in series with the LED, the resistor helps absorb some of the voltage, leaving less for the LED. If you don’t have a 1000ohm resistor handy, you can use any other resistor value to help lessen the voltage applied to the LED.

Figure 4.7 shows connecting the resistor and LED to the GND and digital pin 13 ports on your Arduino Uno unit.

Figure 4.7

FIGURE 4.7 Circuit diagram for the sample project.

Just follow these steps to create your electronic circuit for the project.

Now you should be ready to test things out. Power up the Arduino, either by connecting it to the USB port of your workstation or by connecting it to an external power source. Because the Arduino maintains the sketch in flash memory, you don’t need to reload your sketch; it should start running automatically.

If things are working, you should see the LED on the breadboard blink once per second. If not, double-check your wiring to ensure that you have everything plugged together correctly on the breadboard and that the wires are plugged into the proper socket ports on the Arduino.

  • + Share This
  • 🔖 Save To Your Account

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020