Chapter 16. Analog

16.0 Introduction

This chapter builds on some of the fundamental principles of resistors, capacitors, and transistors that you have learned about earlier in the book. It also introduces the extremely useful and versatile 555 timer IC.

The analog theme will be continued in Chapters 17, 18, and 19.

16.1 Filter Out High Frequencies (Quick and Dirty)

Problem

You want to filter out the high-frequency component of a signal, for instance, to convert a pulsed digital output into a smooth analog output using a low-pass filter.

Solution

In these circumstances, a simple RC filter (Figure 16-1) will suffice to remove most of the unwanted high-frequency PWM carrier.

Intuitively, all the resistor and capacitor do is make the output slow to respond to changes to the input. All that remains is to decide on suitable values for R and C. We can illustrate this with an example.

F16_01
Figure 16-1. Low-pass Filtering of an Arduino-generated PWM Signal

The Arduino Mozzi library (Recipe 18.1) generates PWM (Recipe 10.13) audio output. The length of the pulses on the constant PWM frequency of 32.7kHz determine the amplitude of the lower frequency underlying the audio signal (440 Hz). Figure 16-2 illustrates this.

F16_02
Figure 16-2. PWM of an Audio Signal

The average output voltage is shown ...

Get Electronics Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.