Skip to Content
Arduino Cookbook, 3rd Edition
book

Arduino Cookbook, 3rd Edition

by Michael Margolis, Brian Jepson, Nicholas Robert Weldin
April 2020
Intermediate to advanced
795 pages
17h 43m
English
O'Reilly Media, Inc.
Book available
Content preview from Arduino Cookbook, 3rd Edition

Audio Output

9.0 Introduction

There are millions of Google results for “Arduino music project” and there is only space in this chapter to introduce Arduino audio techniques and some examples to get you started. Arduino wasn’t built to be a sophisticated audio synthesizer, but it can certainly produce sound through an output device such as a speaker.

This chapter shows how to create noise, play prerecorded sounds and create some simple output, and even experiment with sound synthesis.

If you want inspiration for your project, look through some of the many websites featuring music projects:

Here are just two excellent examples of what can be achieved with Arduino, some hardware, and lots of creativity:

Sound is produced by vibrating air. A sound has a distinctive pitch if the vibration repeats regularly. The Arduino can create sound by driving a loudspeaker or Piezo device (a small ceramic transducer that produces sound when pulsed), converting electronic vibrations into speaker pulses that vibrate the air. The pitch (frequency) of the sound is determined by the time it takes to pulse the speaker in and out; the shorter the amount of time, the higher the frequency.

Tip

There are two types of Piezos you are likely to encounter. A Piezo speaker can ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Arduino for Arduinians

Arduino for Arduinians

John Boxall
Getting Started With Arduino, 4th Edition

Getting Started With Arduino, 4th Edition

Massimo Banzi, Michael Shiloh

Publisher Resources

ISBN: 9781491903513Errata PageSupplemental Content