RETRO CLOCK RADIO PROJECT
In this project, I have built a Clock Radio using an Arduino Nano, a TEA5767 FM Radio Module, and a DS3231 real-time clock, along with some peripherals to display the time, output audio and select the FM station. I have built the entire circuit on a breadboard using jumper cables. The Dot Matrix Display gives it a classic look and feel akin to old-school radios I had growing up. This project is in its second iteration, and I plan to add upgrades to this personal project of mine down the line :)
Supplies
Here is the list of hardware components used in this project
- Arduino Nano V3
- TEA 5767 FM Radio Module
- DS3231 RTC Module
- PAM 8403 Digital Mini Audio Amplifier
- KY-040 Rotary Encoder
- MAX 7219 Dot Matrix Display
- 2 pieces DFplayer Mini 3 Watt 4 Ohm Mini Speaker
- Jumper Cables
- Breadboard
- 220 µF Capacitors
- 10K ohm Pull-up resistors
Core Components
Since this Instrucable isn't going to be a deep dive into how each of these individual components works, I'll be sharing links to other resources that will help you to better understand what they are and how they operate with the Arduino boards. The project was originally inspired by several other projects I had read over the years, and if this is your first time working with any of these components, I highly recommend checking out the following articles from others in the maker community.
Circuit Diagram
A connection diagram for all the components can be seen here. Note that the capacitors are used to filter out noise on the audio output, and the pull-up resistors are used on the serial clock and data lines, as we are connecting multiple I2C devices. Also, as this is largely a prototype, I have chosen to power everything using the 5V and GND pins on the Arduino, powered via a USB cable. However, in a practical scenario, this is not advised as the Arduino can only supply a maximum current of upto 500mA, which may not be sufficient to use some of the more power-hungry devices to their fullest capabilities, such as the dot Matrix display. Future iterations of this project will include an external power source, while the Arduino is largely responsible for running our code.
Libraries
Code
Below is the code for the sketch, as well as a link to my GitHub Repository for the Clock Radio.
I have written my sketch in VSCode using the PlatformIO extension for Embedded Development. But if you're new to IDEs and just want to hit the ground running, you can simply use the Arduino IDE. All that is needed is to copy the code below into your Arduino .ino file.
With this sketch, your Radio Clock will start by displaying the current time and starting the radio to a preset FM frequency. You can change the FM station by pressing the rotary encoder to select the next station or by turning the dial to manually change the FM frequency.
Key Changes for Your Code
Within the provided sketch, there are some variables that you may need to alter in order to tune into preselected FM stations based on your region.
The first of which you may wish to change are these:
where fm_freq_default, fm_freq_current, fm_freq_min and fm_freq_max correspond to the default FM station to tune into when starting, the current FM station, the minimum and maximum frequencies. These may be different in your region.
Once you've found the frequencies for all your local FM stations, you will need to update the array below accordingly:
Demonstration
Here is a demo of the Clock Radio at work. During this project, I ran into some issues with the hardware and my code, and after some weeks of tinkering with my setup and my code, I was finally able to get my desired outcome. I imagine others who might be interested in similar projects could also run into such issues so I decided to write my first-ever Instructable in the hopes it may aid those who need it.
In the future, I aim to update this Instructable with guides on how I design my custom PCB as well as the 3D-printed enclosure. I've been following guides from makers, hobbyists and professionals in the community over the years, and I wanted to contribute in my own way as well. If you found this Instructable helpful or have suggestions, please let me know. Good luck!