Robot Building for Beginners, Third Edition

(Marvins-Underground-K-12) #1

CHAPTER 27 ■ ENCORE


For breadboard applications, oscillators are available in the space-saving half-can size (see Figure 27-16)
and the full-can size. Or, you can purchase crystals separately, which is better for microcontrollers that have
the ability to multiply the base crystal frequency to speed up or slow down for power savings.


Figure 27-17. Left to right: Speaker, microphone, and buzzer


Figure 27-16. Half-can oscillator (middle left), full-can oscillator (top right), and crystal (bottom)


When someone asks, “How fast is your computer?” and you answer 2.6 GHz, you’re actually giving a
number related to frequency of the crystal or oscillator. If your robot has a microcontroller, it must have an
oscillator. To make things simpler, the newer microcontrollers often have a fairly well-timed oscillator built-in.


Sound


You can add sound to a robot to enhance the theatrical effect (with music or funny noises), to provide a
friendly interface (with speaking or button feedback), or to aid in debugging (by playing a certain noise
when sensor readings are in a specific range or when you need to take actions).
Buzzers are the easiest to control (see Figure 27-17). Connect them to power, like you would a motor,
and they make a predetermined noise, like an alarm. Speakers are much more versatile and provide a much
higher-quality sound. Although tones and basic tunes can be played on a speaker without much effort,
specialized chips are usually required to reproduce digitized sounds or music.

Free download pdf