@tutorial: Menu with voice & rotary encoder

This is the module that we will use and the scheamtic below are the connections that we need. The speaker output, the serial communication and the power supply.

External Link: https://electronoobs.com/eng_arduino_tut22_3.php

by: ELECTRONOOBS on 2026-05-06

We need to add the 1k resistors between the RX/TX serial communication Arduino pins and the module, because if not there will be a hiss noise when playing the sound. I don’t know why is that but the 1k ohm resistor fixed the problem.

Arduino Rotary Menu Schematic
Arduino Rotary Menu Schematic

We also need a micro SD card to store the MP3 files. On this SD card we have to put the files as this. On the SD card create a folder named mp3 and we start with file 0000, then file 0001, 0002 and so on. I’ve created my files using a webpage that will pass text to female robotic voice.


Ok, make the connections above between the module and the Arduino. At the output I’ve added a simple audio amplifier. Add a small speaker, connect 3 push buttons and upload the next code.

First, we need to install the DF player library. Download it from a link below and install it on your Arduino IDE. In the setup loop we define the pins fort the push buttons and prepare the audio module. To play the sounds we use the playMp3 folder track and select the file number where track one represents file 0000 on the SD card and so on… Each time I press a button a different sound will play. Upload the code and let’s see the results.


There you go. Now we know how everything works for this project.

5.1 Final project

Now we know how everything works for this project. In the final code I merge everything together. Use this final schematic that you could find below. Have it in front of you and make all the connections. In the code depending on the position encoded with the rotary encoder we navigate throw the first menu. Pushing the button, we select the menu and enter the second menu. My example is just two menus deep but you could go to even more.


Final Schematic
Final Schematic

Download the audio files for the menu below. Also download the final code below. In this code the step detection is made with pin interruption on D8 and D9. Read all the comments in the code in order to understand all the parts. Change the text of the menu if you want.

There you go my friends. I’ve got my scrolling voice menu and also with special characters. I can select my coffee then the sugar level. I can also activate or des-activate the LCD light or set the voice volume. You can make your own menu with different text and different actions. Check all the extra information in the code.


If you would like to help my projects like this one, I have a Patreon campaign. The link is down below. I would really appreciate that guys. I hope that you’ve enjoyed this tutorial. If so don’t forget to click the like button like crazy and share the video with your friends. If you have any question about this video or any other, just leave it in the comment section below or on my Q&A page. Also, don’t forget to subscribe and watch all of my other great tutorials. Remember, if you consider helping my projects check my Patreon page as well. Thanks again and see you later guys.

Leave a comment

Please login in order to comment.

Comments

ADVERTISERS
ADVERTISERS
PCBWAY