- By Paulsin
- |
- Electronic Modules, Electronics, ESP32, General Blog, VS1003
- |
- 811 Views
- |
- 0 Comment
- |
- By Paulsin
- |
- Electronic Modules, Electronics, ESP32, General Blog, VS1003
- |
- 2480 Views
- |
- 0 Comment
- |
Arduino program for Internet radio using VS1003 and ESP32.
#include <VS1053.h> #include "freertos/FreeRTOS.h" #include "freertos/task.h" #ifdef ARDUINO_ARCH_ESP8266 #include <ESP8266WiFi.h> #define VS1053_CS D1 #define VS1053_DCS D0 #define VS1053_DREQ D3 #endif ////////////////////////////////////////////////////// ///// VS1053 - ESP32 Connections ////// ////////////////////////////////////////////////////// //////////// VS1053_CS - ESP32 G5 /////////////// //////////// VS1053_DCS - ESP32 G16 /////////////// //////////// VS1053_DREQ - ESP32 G4 /////////////// //////////// VS1053_SCLK - ESP32 G18 /////////////// //////////// VS1053_MOSI - ESP32 G23 /////////////// //////////// VS1053_MISO - ESP32 G19 /////////////// //////////// VS1053_XRST - ESP32 EN /////////////// ////////////////////////////////////////////////////// #ifdef ARDUINO_ARCH_ESP32 #include <WiFi.h>- By Paulsin
- |
- 74HC125, Arduino, Arduino MEGA, Electronic Modules, Electronics, General Blog, SD card module, VS1003
- |
- 1021 Views
- |
- 0 Comment
- |
After completing the circuit, upload the following program to Arduino Mega. Program tested and worked good on Arduino 1.8.10. Change the value of “audioName” to the name of audio file to be played in the SD card. Audio files should be stored in the SD card as shown in the following image.
#include <SPI.h#include <SD.h// SCI Registers const uint8_t SCI_MODE = 0x0; const uint8_t SCI_STATUS = 0x1; const uint8_t SCI_BASS = 0x2;- By Paulsin
- |
- 74HC125, Arduino MEGA, Electronic Modules, Electronics, General Blog, Integrated Circuit chips, SD card module, VS1003
- |
- 2414 Views
- |
- 2 Comments
- |
Upload the following program to Arduino Mega. Open the serial monitor. Now, press the push button switch provided in the circuit. Recording will start and stop in alternate presses of push button switch. Once recording started, press the push button switch again to stop recording. Speak something through the MIC. Voice will be recorded in SD card as “wavFile6.WAV”. Take the SD card from the card reader and play the recorded file on computer.
#include <SPI.h#include <SD.h//#include "SdFat.h" //SdFat SD;- By Paulsin
- |
- 74HC125, Arduino, Arduino MEGA, Electronic Modules, Electronics, General Blog, Integrated Circuit chips, SD card module, VS1003
- |
- 2107 Views
- |
- 1 Comment
- |
After completing the circuit, upload the following program to your Arduino Mega. A file named “wavFile6.WAV” should be there in your SD card.
//#include <VS1003ESP12.h//#include <ESP8266WiFi.h#include <SPI.h#include <SD.hconst int xcsPin = A3; const int sdCs = 10; File myFile; char fileName[] = "wavFile6.WAV"; byte data[4]; void disableVS1003(void) { digitalWrite(xcsPin, HIGH); } void setup () { pinMode(sdCs, OUTPUT); // digitalWrite(sdCs, HIGH); // initiate SPI SPI.begin(); // initiate a serial port at 57600 Serial.begin(115200);- By Paulsin
- |
- 74HC125, Arduino, Arduino MEGA, Electronic Modules, Electronics, General Blog, Integrated Circuit chips, SD card module, VS1003
- |
- 875 Views
- |
- 0 Comment
- |
VS1003 voice recording program tested on Arduino version 1.8.10.
#include <SPI.h#include <SD.h//#include "SdFat.h" //SdFat SD; SPIClass mySPI; // VS1003 SCI Write Command byte is 0x02 #define VS_WRITE_COMMAND 0x02 // VS1003 SCI Read COmmand byte is 0x03 #define VS_READ_COMMAND 0x03 // Size of the "wav" file set to 100*512 bytes including the header files const unsigned char RIFFHeader0fn[] = { 'R' , 'I' , 'F' , 'F' , // Chunk ID (RIFF) 0xF8,- By Paulsin
- |
- Arduino MEGA, Electronic Modules, Electronics, General Blog, SD card module, VS1003
- |
- 1152 Views
- |
- 0 Comment
- |
Upload the following program to your Arduino MEGA. “Hello” voice will be heard from VS1003. Use headphones to hear the voice.
#include <SPI.h// SCI Registers const uint8_t SCI_MODE = 0x0; const uint8_t SCI_STATUS = 0x1; const uint8_t SCI_BASS = 0x2; const uint8_t SCI_CLOCKF = 0x3; const uint8_t SCI_DECODE_TIME = 0x4; const uint8_t SCI_AUDATA = 0x5; const uint8_t SCI_WRAM = 0x6; const uint8_t SCI_WRAMADDR = 0x7; const uint8_t SCI_HDAT0 = 0x8; const uint8_t SCI_HDAT1 = 0x9;- By Paulsin
- |
- Arduino MEGA, Electronic Modules, Electronics, General Blog, SD card module, VS1003
- |
- 774 Views
- |
- 0 Comment
- |
Upload the program to your Arduino board. Some mp3 files named 1.mp3, 2.mp3, 3.mp3 and 4.mp3 should be saved in your SD card.

Press the switch SW, next song will be played in each switch press.
#include <SPI.h#include <SD.h// SCI Registers const uint8_t SCI_MODE = 0x0; const uint8_t SCI_STATUS = 0x1; const uint8_t SCI_BASS = 0x2; const uint8_t SCI_CLOCKF = 0x3; const uint8_t SCI_DECODE_TIME = 0x4; const uint8_t SCI_AUDATA = 0x5;- By Paulsin
- |
- Electronic Modules, Electronics, General Blog, NodeMCU, VS1003
- |
- 1305 Views
- |
- 0 Comment
- |
Upload the following program to your NodeMCU. Connect headphone and speak something through the MIC. Voice can be heard in the head phone.
#include <VS1003ESP12.h#include <ESP8266WiFi.h#include <SPI.h// VS1003 SCI Write Command byte is 0x02 #define VS_WRITE_COMMAND 0x02 // VS1003 SCI Read COmmand byte is 0x03 #define VS_READ_COMMAND 0x03 const int csPin = D1; const int dcsPin = D0; const int dreqPin = D2; const int resetPin = D3; // SCI Registers const uint8_t SCI_MODE = 0x0;- By Paulsin
- |
- Electronic Modules, Electronics, General Blog, NodeMCU, VS1003
- |
- 890 Views
- |
- 0 Comment
- |
Upload the following program to NodeMCU. Once uploading successful, connect head phone to VS1003. “HELLO” sound will be heard continuously from the VS1003.
#include <SPI.h// VS1003 SCI Write Command byte is 0x02 #define VS_WRITE_COMMAND 0x02 // VS1003 SCI Read COmmand byte is 0x03 #define VS_READ_COMMAND 0x03 const int csPin = D1; const int dcsPin = D0; const int dreqPin = D2; const int resetPin = D3; const int vs1003_chunk_size = 32; // SCI Registers const uint8_t SCI_MODE = 0x0;