“Hello” voice from VS1003 using Arduino Mega

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;
Read More
VS1003 MP3 player with “Next” select option using Arduino MEGA

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;
Read More
Patterns in cascaded 16-bit serial-in parallel-out shift register modules using Arduino UNO
/* Shift Register Example Turning on the outputs of a 74HC595 using an array Hardware: * 74HC595 shift register * LEDs attached to each of the outputs of the shift register */ //Pin connected to ST_CP (12) of 74HC595 int latchPin = 12; //Pin connected to SH_CP (11) of 74HC595 int clockPin = 11; ////Pin connected to DS (14) of 74HC595 int dataPin = 10; //holders for information you're going to pass to shifting function byte data;
Read More
Cascading two 16-bit serial-in parallel-out shift register modules using Arduino UNO

Cascading is an important feature of 74HC595. Cascading helps to create multiple outputs. Similarly, you can cascade more modules.

Upload the following program to Arduino UNO. Change the value in customDelay() function to change the speed of running LED.

/* Shift Register Example Turning on the outputs of a 74HC595 using an array Hardware: * 74HC595 shift register * LEDs attached to each of the outputs of the shift register */ //Pin connected to ST_CP (12) of 74HC595 int latchPin = 12;
Read More
Interfacing 16-bit serial-in parallel-out Shift register module to Arduino UNO

Here, we will see the circuit to interface a 16-bit serial-in parallel-out Shift register module using Arduino UNO. Shift register module is powered from Arduino UNO.

This module will help to create 16 digital outputs from only 3 digital pins of Arduino. This module can be used in applications where more digital outputs are required such as LED cube, LED matrix etc.

Upload the following program to Arduino UNO. Change the value in customDelay() function to change the speed of running LED.

Read More
“WAV” file creation on SD card using NodeMCU through “SdFat” library

This program will create a “WAV” file in the SD card using NodeMCU, through “SdFat” library. Upload the program to NodeMCU. A “WAV” file named “wavFile3.wav” will be created in the SD card.

#include <SPI.h#include "SdFat.h" using namespace sdfat; SdFat SD; const unsigned char createWavTemplateArray[] = { 0x52, 0x49, 0x46, 0x46, // Chunk ID (RIFF) 'R', 'I', 'F', 'F', 0x20, 0x20, 0x20, 0x20, // Chunk payload size 0x57, 0x41, 0x56, 0x45, // RIFF resource format type 'W',
Read More
“WAV” file creation on SD card using NodeMCU

This program will create a “WAV” file in the SD card. Compiled and uploaded on Arduino 1.8.10. Compilation gave errors in Arduino 1.8.8. Not tested with other versions of Arduino. Upload the program to your NodeMCU. A “WAV” file named “wavFile2.wav” will be created on the SD card.

#include <SD.hconst unsigned char createWavTemplateArray[] = { 0x52, 0x49, 0x46, 0x46, // Chunk ID (RIFF) 'R', 'I', 'F', 'F', 0x20, 0x20, 0x20, 0x20, // Chunk payload size 0x57,
Read More
Program to turn on VS1003 builtin MIC using NodeMCU

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;
Read More
Interfacing VS1003 to NodeMCU, generate “HELLO” sound from HEX, circuit and program

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;
Read More
.96″ OLED display using Arduino UNO, I2C programming basics

This tutorial illustrates the basics of programming .96″ OLED display from Arduino by I2C interface. This program will give you an idea about the control and data bytes that should be sent to the OLED display.

#include <Wire.h#define SSD1306_DEACTIVATE_SCROLL 0x2E #define SSD1306_MEMORYMODE 0x20 ///< See datasheet #define SSD1306_COLUMNADDR 0x21 ///< See datasheet #define SSD1306_PAGEADDR 0x22 ///< See datasheet #define SSD1306_SETCONTRAST 0x81 ///< See datasheet #define SSD1306_CHARGEPUMP 0x8D ///< See datasheet #define SSD1306_SEGREMAP 0xA0 ///<
Read More
X