This is the chapter web page to support the content in Chapter 4 of the book: Exploring BeagleBone – Tools and Techniques for Building with Embedded Linux. The summary introduction to the chapter is as follows:

This chapter introduces you to the type of practical electronics that you need in order to work effectively and correctly with the BeagleBone platform. One chapter cannot be a substitute for full textbooks on digital and analog electronics; however, there are concepts with which you must be comfortable before connecting electronics to the interface headers on the BeagleBone, as incorrect configurations can easily destroy the board.

Learning Outcomes

After completing this chapter, you should be able to:

  • Describe the basic principles of electrical circuit operation, build circuits on breadboards, and measure voltage and current values
  • Use discrete components such as diodes, LEDs, transistors, and capacitors in your own circuit designs
  • Use transistors and FETs as switches to control higher current and voltage signals than would be possible by using the BBB outputs on their own
  • Interconnect and interface to logic gates, being particularly aware of the issues that arise with “floating” inputs
  • Describe the principles of analog‐to‐digital conversion and design basic operational‐amplifier circuits
  • Combine all of these skills to build the type of circuits that are important for safely interfacing to the BBB GPIOs and ADCs

Parts for this Chapter

Here is a full list of the components that are used in this chapter:

■ Breadboard
■ Diodes: 1N4001, general‐purpose LED
■ Transistors: NPN: BC547, FET: BS270
■ Voltage regulator: KA7805/LM7805
■ PTC: 60R110
■ Button and Switch: General purpose SPST and SPDT
■ ICs: 74HC73N, 74HC03N, 74LS08N, 74HC08N, 74HC14, LM358N
■ Resistors: 1 MΩ, 2.2 kΩ, 2×10 kΩ, 50 kΩ, 100 Ω, 50Ω, 1 kΩ, 470Ω, 220 Ω, 100 kΩ POT.
■ Capacitors: 10μF, 1μF, 0.33μF, 0.1μF.
■ Opto‐isolator: SFH617A

Digital Media Resources

Here the digital resources referred to in the chapter web page are provided. There are high-resolution versions of some of the important figures and links to videos, resources and websites that are described in the chapter.

The Analog Discovery

In this video I investigate the use of the Digilent Analog Discovery with Waveforms and look how it can be used for the analysis of analog and digital circuits. The Analog Discovery is a USB oscilloscope, waveform generator, digital pattern generator and logic analyzer. It is priced at $99 for US students and generally for $219. l demonstrate three different applications of the Discovery:
– Analog analysis of a rectifier diode.
– Using the digital pattern generator and logic analyzer to investigate the behavior of a JK flip-flop.
– Using the logic analyzer and its I2C interpreter to connect to the BeagleBone I2C bus and analyse how it behaves when we use the Linux i2c tools.

Debouncing a SPDT Slider Switch

This video discusses what is switch bouncing and explains how we can debounce a SPDT (single pole double throw) slide switch. It uses an SR latch to achieve debouncing and it shows how we can implement this circuit using 74LS00 NAND gates. It also examines the output of this circuit using an oscilloscope and demonstrates that the circuit is working effectively. This is part 1, in the next part I will explain how to debounce a SPST momentary push button switch using a RC circuit and a Schmitt trigger.

Debouncing a SPST Push Button Switch

This video explains how we can debounce a SPST (Single Pole Single Throw) momentary push button switch. It describes the concept of hysteresis and the use of a Schmitt Trigger. The circuit uses a RC low-pass filter as the input to a 74HCT14 Hex Schmitt Trigger to achieve debouncing and it shows how we can implement and test this circuit using an oscilloscope. This is part 2 – in the previous video I explained how to debounce a SPDT slide switch using a SR latch.

The Two’s Complement

The Two’s Complement is a method of representing negative/signed binary numbers that is commonplace in digital electronics and is the basis for how signed integers are represented in embedded systems. This tutorial explains the need for the Two’s Complement form and describes how you can perform operations such as additions/subtractions and multiplications using this form. It provides some numerical examples with solutions to allow you to test your understanding of the materials that are presented.

Overflow, Overflow Detection and Underflow

In this video I will look at the problems that can arise in unsigned and signed systems with overflow and underflow, which is where our system goes beyond its physical limitations. I will look at how you can detect that overflow is occurring in a digital system and how you can design a logic circuit to detect its occurrence. The video then describes underflow and finally, presents a few interesting questions with solutions.

Logic Gates – Integrated Circuits

An introduction to simple logic gates using the 74HC08 quad two-input AND gates.

The JK Flip-Flop

This video lecture/tutorial describes the JK Flip-Flop in detail. I begin by describing the general operation of a 7473 JK flip-flop, showing the toggle state that makes this flip-flop important for many applications. Then I show in detail how we can create a JK flip-flop using NAND gates, describing both edge-triggered and pulse-triggered configurations. I implement both types of circuit, using a pulse generator for the edge-triggered version and a master-slave JK flip-flop for the pulse-triggered implementation. Finally, I show how we can add asynchronous set and reset inputs for the master-slave configuration and implement a circuit to demonstrate that this works correctly.

A 555-Timer Circuit

This is an experiment to set up a low frequency clock signal that we can use to drive our logic gate circuits. The clock will have a frequency of 1Hz, which will allow us to see the changes to our circuit as the clock cycles.

Some Images from the Chapter

External Resources

Important Documents

External Web Sites

Lessons in Electric Circuits − Volume IV-Digital, T. R. Kuphaldt

The BeagleBone Black System Reference Manual (SRM)


  • Page 107. The manufacturer Owon is incorrectly named as Owen on this page.
  • Page 111. Reference is made to a “blue potentiometer” but the print text is in grey scale. The blue potentiometer is the 10kΩ resistor on the bottom left of the figure.
  • Page 117. (Loc. 3868) “If the diode is reverse‐biased by applying a greater voltage on the anode than the cathode…” should read “If the diode is reverse‐biased by applying a greater voltage on the cathode than the anode…”. It is correctly described elsewhere.
  • Page 130. In the equation: R = V/I = (3.3 V − 1.15 V)/0.0045 mA = 478Ω, the mA should be A. The calculation was performed correctly.
  • Page 144. The bottom of the page states “The circuit example used in 4-27(b) could be used to generate a PWM signal…”. This should be Figure 4-28(b).

Recommended Books on the Content in this Chapter