Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

Voice Record and Playback from SD Card Using GR Sakura

By Ajish Alfred

There are so many devices available which can record and playback voice. Most of the digital devices like mobile phones can use the SD card to record the voice signals and playback. This project demonstrates how to record voice signals on a micro SD card and play it back using the GR SAKURA board.

 

Voice signals are continuous analog signals and the digital devices like microcontrollers cannot handle the continuous analog signals. Most of the microcontrollers have an ADC module which can do analog to digital conversion. The microcontroller uses sampling technique to convert the continuous analog signals to discrete digital equivalent samples. 
While recording the voice, the GR SAKURA board samples the voice signals and writes the sampled values to a file at the sampling time itself. The same file is opened again and reads the values at the same frequency at which they are sampled. The digital microcontrollers based devices cannot produce analog output also, since their output will be always either logic high or logic low. To generate the effect of the continuous analog voice signal, the GR SAKURA uses PWM (Pulse Width Modulation) technique.
DESCRIPTION

 

The GR SAKURA board has a micro SD card slot and the board is connected to a microphone amplifier circuit at its input and loudspeaker driver circuit at its output. The project uses a simple condenser microphone which captures the voice input and the fetch them to one of the ADC channels of the GR SAKURA. The GR SAKURA reads the digital equivalent value of the sampled analog signal and writes the same value to the micro SD card at the same sampling time itself. While playing back, the GR SAKURA reads the same sampled values from the micro SD card to generate the PWM equivalent of the analog voice signals at an output pin where the loudspeaker is connected.
The entire system can be divided into the following blocks:
Block Diagram of GR Sakura based Voice Recoder and Playback
 
Fig. 1: Block Diagram of GR Sakura based Voice Recoder and Playback

1)      MICROPHONE AMPLIFIER CIRCUIT

The microphone used here is a small commonly found condenser microphone. The microphone captures the voice signals from the surrounding and produces the voltage equivalent of the sound signals. The amplitude of the sound signal output from the microphone is very feeble and they need to be amplified several times before they are applied to the microcontroller or any other devices. This circuit blocks uses two stage transistor based amplifier which are designed amplify the analog voice signals to the required amplitude level for the GR SAKURA.

Circuit Diagram of Microphone Amplifier

Fig. 2: Circuit Diagram of Microphone Amplifier

The supply voltage is taken from the GR SAKURA board itself operating with USB power. To get the +5V from the 5 volt VCC pin of the SAKURA board, the jumper J2 is shorted.
      2)      GR SAKURA

 

The voltage at the ADC channel or the analog input of the GR SAKURA will be the sum of quiescent voltage of the transistor amplifier + amplified voice signals. The quiescent voltage is subtracted from the total voltage to get the voice signal. The GR SAKURA samples the voice signals at a sampling frequency of 20 KHz. Sampling the voice signals at 20 KHz means it converts the analog signal at the analog input pin to digital value and reads the value at every 50 micro seconds.
The TIMER 0 of the GR SAKURA is used to generate exact time intervals of 50 us at which the voice signals needs to be sampled. At the same time interval the same voice sampled value is written to the micro SD card using memory card interfacing library. A file of predefined name is created and opened in writing mode into which the sampled values are written at each and every sampling period. Once the recording is completed the file is closed.
For playing back the voice, the same file is opened in the reading mode and the sample values are read back with the same sampling frequency. Thissample values are used to modify the ON period and the OFF period of the timer in such a way that the entire sampling period is always constant. At every ON time the digital output pin where the loudspeaker is connected is turned on and at every OFF period it is turned off.
Thus the digital output pin of the GR SAKURA has a digital waveform of which the ON period and OFF period varies according to the amplitude of the input voice signals but keeping the entire (ON + OFF) period constant as the sampling period. This is nothing but a PWM equivalent of the input voice signal at that digital output pin. When this PWM wave is applied to the loudspeaker it will produce the same sound which has been captured through the microphone.
The code written for this uses the functions like digitalWrite()and analogRead()to write digital values to a digital output pin and read the analog input values from an analog input pin respectively. The files “intvect.c” of the Cloud Compiler IDE is modified to enable the TIMER0 interrupt. For writing into and reading back from the micro SD card the GR SAKURA uses the functions like begin(), open(), write(), read(), close() and remove() from the SD card interfacing library.

Loudspeaker Driver and Playback

      3)      LOUDSPEAKER DRIVER
The Loudspeaker used to reproduce the sound signals in this project is an 8 ohm loudspeaker. The 8 ohm loudspeaker consumes lot of current while it operates but the current sourcing capabilities of the digital output pin of the microcontrollers are limited. Here the output pin is connected to the base of a transistor and the Loudspeaker is connected to the collector of a transistor. Very low base current is required to drive the loudspeaker at the collector of the transistor with the required amount of current.

Circuit Diagram of Loud Speaker Driver

Fig. 3: Circuit Diagram of Loud Speaker Driver

      4)      RECORD/PLAYBACK SWITCH

The record and playback switch is a simple push button which is pulled down using a 1K ohm resistor and when pressed it makes contact with the VCC. The button is connected to the pin number 8 of the GR SAKURA which is configured as an input pin. Before recording, the code will wait till the value at the pin number 8 becomes logic high which will happens when someone presses the button.The digital value is read from this pin using the functiondigitalRead().

Circuit Diagram

 

Circuit Diagram of GR Sakura based Voice Recorder and Playback

Fig. 4: Circuit Diagram of GR Sakura based Voice Recorder and Playback

 

Circuit Diagram of GR Sakura based Voice Recorder and Playback

Fig. 5: Circuit Diagram of GR Sakura based Voice Recorder and Playback

 

Project Datasheet

https://www.engineersgarage.com/wp-content/uploads/2019/10/code_0.zip


Project Video


Filed Under: Electronic Projects
Tagged With: GR Sakura, sd card
 

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


Featured Tutorials

  • PS2 Keyboard To Store Text In SD Card Using Arduino Circuit Setup On Breadboard
    How To Use PS2 Keyboard To Store Text In SD Card Using Arduino- (Part 42/49)
  • Wireless Path Tracking System Using Mouse, XBee And Arduino Circuit Setup On Breadboard
    How To Make A Wireless Path Tracking System Using Mouse, XBee And Arduino- (Part 43/49)
  • How to Make a Wireless Keyboard Using Xbee with Arduino- (Part 44/49)
  • Making Phone Call From GSM Module Using Arduino Circuit Setup On Breadboard
    How to Make Phonecall From GSM Module Using Arduino- (Part 45/49)
  • How to Make a Call using Keyboard, GSM Module and Arduino
    How To Make A Call Using Keyboard, GSM Module And Arduino- (Part 46/49)
  • Receiving SMS Using GSM Module With Arduino Prototype
    How to Receive SMS Using GSM Module with Arduino- (Part 47/49)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • What is a low power design?
  • Renesas partners with Tata to accelerate progress in advanced electronics
  • STMicroelectronics’ new touchscreen controller for smartphones enables longer runtime
  • Samsung unveils ISOCELL image sensor with industry’s smallest 0.56μm pixel
  • Renesas and Cyberon to deliver integrated voice-user interface solutions

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Code Optimization
  • How to define decrement variables in HFSS opt?
  • simple LSB explanation please
  • Difference between pierce and colpitts
  • Natural Convection Heatsink for 80W power dissipation?

RSS Electro-Tech-Online.com Discussions

  • Review of electric circuit with Arduino
  • intro to PI
  • Lighting a .010 green fiber optic with led
  • Bridge purpose in connecting the two functional circuit
  • ICM7555 IC duty cycle limit at high frequency?
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering