Build it step by step
0 of 6 doneRecord the clips
Record 'the time is', the 12 hours, o'clock, oh, AM, PM and minutes one to fifty-nine.
Prepare the card
Format FAT32, make a folder called MP3 and save the clips with four-digit names.
Test the player
Play track 1 with the example sketch from the DFPlayer library.
Add the clock
Set the DS3231 time with the RTClib example sketch.
Upload the talking clock
Press the button and listen to the sentence.
Fit a box
Mount the speaker and button where they are easy to find by touch.
How do you build a talking clock?
Press a button and the clock speaks the time from recorded MP3 clips, which helps people who cannot read a display. You need Arduino Nano, DFPlayer Mini MP3 module, Speaker 8 Ω 0.5 W, DS3231 RTC module, Tactile push button 6 mm, SanDisk microSD card 32 GB (A1, Class 10), Resistor 1 kΩ and Breadboard 830 Tie Points. It takes 6 steps and about 90 minutes.
- Level
- Beginner
- Time
- About 90 min
- Parts
- 8
Parts list
- Development BoardsBuyArduino Nano × 1
- InterfacesBuy
- Motors & ActuatorsBuy
- SensorsBuy
- SwitchesBuy
- SBC AccessoriesBuy
- PassivesBuyResistor 1 kΩ × 1
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| DFPlayer VCC, GND | Nano 5V, GND | Power |
| DFPlayer RX | 1 kΩ resistor then Nano D11 | Serial to the player |
| DFPlayer TX | Nano D10 | Serial from the player |
| DFPlayer SPK1, SPK2 | Speaker | Audio output |
| DS3231 SDA, SCL | Nano A4, A5 | I2C |
| DS3231 VCC, GND | Nano 5V, GND | Power |
| Button | Nano D2 and GND | Speak the time |
Code
Arduino IDE, board "Arduino Nano" (processor ATmega328P, or ATmega328P (Old Bootloader) for clones). Install "DFRobotDFPlayerMini" and "RTClib". Format the SD card as FAT32 and put your clips in a folder named MP3. Record the clips in your own voice with a phone and convert them to MP3, then name them exactly as in the comments. Set the DS3231 clock once with RTClib's example sketch.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
#include <SoftwareSerial.h>
#include <DFRobotDFPlayerMini.h>
#include <RTClib.h>
SoftwareSerial mp3Serial(10, 11); // RX, TX
DFRobotDFPlayerMini player;
RTC_DS3231 rtc;
const byte BTN = 2;
// Files in the MP3 folder of the SD card (0001.mp3 and so on):
// 0001 "the time is" 0002 to 0013 hours one to twelve 0014 "o'clock"
// 0015 "oh" 0016 "AM" 0017 "PM"
// 0101 to 0159 minutes one to fifty-nine
void say(int track) {
player.playMp3Folder(track);
delay(200);
unsigned long t = millis();
while (millis() - t < 4000) { // wait until the clip finishes
if (player.available() && player.readType() == DFPlayerPlayFinished) break;
}
}
void setup() {
pinMode(BTN, INPUT_PULLUP);
mp3Serial.begin(9600);
player.begin(mp3Serial);
player.volume(18); // 0 to 30
rtc.begin();
}
void loop() {
if (digitalRead(BTN) == LOW) {
DateTime now = rtc.now();
int h = now.hour(), m = now.minute();
bool pm = h >= 12;
int h12 = h % 12; if (h12 == 0) h12 = 12;
say(1);
say(1 + h12);
if (m == 0) say(14);
else {
if (m < 10) say(15);
say(100 + m);
}
say(pm ? 17 : 16);
delay(500);
}
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Press at 14:05 | "The time is two oh five PM" |
| Press at 09:00 | "The time is nine o'clock AM" |
| Press at midnight | "The time is twelve o'clock AM" |
| No button press | Silent |
If it does not work
No sound
Check the SD card format, the MP3 folder name and the 1 kΩ resistor on RX.
Clips overlap
The wait loop timed out. Increase the 4000 ms limit.
Wrong clip played
File names must be four digits and match the numbers in the sketch.
Time wrong
Set the DS3231 with its example sketch and check the coin cell.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the talking clock?
Arduino Nano, DFPlayer Mini MP3 module, Speaker 8 Ω 0.5 W, DS3231 RTC module, Tactile push button 6 mm, SanDisk microSD card 32 GB (A1, Class 10), Resistor 1 kΩ and Breadboard 830 Tie Points.
How long does the talking clock take to build?
About 90 minutes for a beginner maker, in 6 steps.
How do I know the talking clock works?
Press at 14:05: "The time is two oh five PM". Press at 09:00: "The time is nine o'clock AM". Press at midnight: "The time is twelve o'clock AM".
No sound: what should I check?
Check the SD card format, the MP3 folder name and the 1 kΩ resistor on RX.
Clips overlap: what should I check?
The wait loop timed out. Increase the 4000 ms limit.
Wrong clip played: what should I check?
File names must be four digits and match the numbers in the sketch.
Time wrong: what should I check?
Set the DS3231 with its example sketch and check the coin cell.
