Build a voice recorder lesson plan
A memo pen on an Uno: a microphone on A0, double buffers, an EEPROM that keeps up, real WAV files on microSD, PWM playback and debounced buttons.
Objectives and materials
By the end, students can
- A microphone, a sample rate, and buffers that swap.
- Bytes per second, then a real WAV file on the card.
- Playback, buttons, and a memo pen of your own.
Materials for the whole unit
- Arduino Uno R3
- Capacitor x 3
- Full-size breadboard
- Function generator
- I2C EEPROM, 24LC256
- LED
- microSD card module
- Piezo speaker
- Pushbutton x 2
- Resistor x 7
Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.
Sound in
A microphone, a sample rate, and buffers that swap.
| Lesson | Time | What students do |
|---|---|---|
| The microphoneTurn sound into numbers: a microphone module, a bias at mid-rail, 8000 samples a second on A0, and the level and pitch worked out from them. | 60 min |
|
| Double bufferingTwo buffers that swap: the interrupt fills one while the sketch stores the other. See what happens when storing takes too long, and why buffers cost RAM. | 50 min |
|
Materials
- Arduino Uno R3
- Capacitor x 3
- Full-size breadboard
- Function generator
- I2C EEPROM, 24LC256
- LED
- microSD card module
- Piezo speaker
- Pushbutton x 2
- Resistor x 7
Check for understanding
Each student finishes "Double buffering" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "The price in RAM".
Keeping it
Bytes per second, then a real WAV file on the card.
| Lesson | Time | What students do |
|---|---|---|
| Storage limitsBytes per second: what a sample rate needs, what an EEPROM and a microSD card can take on this Uno, how long a memo fits, and how to pick a rate that works. | 50 min |
|
| WAV filesRecord into the EEPROM, then save a real WAV file to the microSD card: the 44-byte header, field by field, little-endian, then the samples. | 50 min |
|
Materials
- Arduino Uno R3
- Capacitor x 3
- Full-size breadboard
- Function generator
- I2C EEPROM, 24LC256
- LED
- microSD card module
- Piezo speaker
- Pushbutton x 2
- Resistor x 7
Check for understanding
Each student finishes "WAV files" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Sizes come last".
The pen
Playback, buttons, and a memo pen of your own.
| Lesson | Time | What students do |
|---|---|---|
| PlaybackPlay the WAV file back off the card: read the header, run Timer 2 at its sample rate, and send every sample out as PWM through a filter to a piezo. | 50 min |
|
| ButtonsHold REC to record and PLAY to listen: pull-ups, debouncing, press and release events, and a lamp that shows when it is recording. | 50 min |
|
| Project: a memo penPut it all together: numbered memos that never overwrite each other, a list read from the card, playing and deleting any memo, and how much room is left. | 50 min |
|
Materials
- Arduino Uno R3
- Capacitor x 3
- Full-size breadboard
- Function generator
- I2C EEPROM, 24LC256
- LED
- microSD card module
- Piezo speaker
- Pushbutton x 2
- Resistor x 7
Check for understanding
Each student finishes "Project: a memo pen" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Make it yours".
Teach this unit as a class
Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.
The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.