element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Design for a Cause - Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Design for a Cause - Design Challenge
  • More
  • Cancel
Design for a Cause - Design Challenge
Blog Audio4Vision #9 - Interfacing Amplifier and Speaker with MKR1000
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: pranjalranjan299
  • Date Created: 13 Sep 2018 3:44 PM Date Created
  • Views 1325 views
  • Likes 2 likes
  • Comments 1 comment
Related
Recommended

Audio4Vision #9 - Interfacing Amplifier and Speaker with MKR1000

pranjalranjan299
pranjalranjan299
13 Sep 2018

Welcome to our 9th blog post! In this update we are going to guide you through the process to play .wav files on the MKR1000. The components we have used are -

 

  1. Arduino MKR1000
  2. PAM 8403 Amplifier (5V with Potentiometer)
  3. Speaker (4 Ohms, 3 Watts)
  4. Jumper cables

 

Speaker 3 diameter 4 ohm 3 watt 7961087309image

                                       Speaker (8 Ohms, 3 Watts)                                                                                                                                                                      PAM 8403 Amplifier

 

The library designed for SAMD boards is called AudioZero. This library enables an Arduino Zero or MKR1000 board to play back .wav files from a storage device like an SD card. More information can be found on https://github.com/arduino-libraries/AudioZero

 

Pin diagram -

 

image

After connection -

 

imageimage

image

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Code -

 

#include <SD.h>
#include <SPI.h>
#include <AudioZero.h>


void setup()
{
  // debug output at 115200 baud
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  Serial.print("Initializing SD card...");


  if (!SD.begin(4)) {
    Serial.println("initialization failed!");
    while (1);
  }
  Serial.println("initialization done.");
  delay(2000);


  // 44100kHz stereo => 88200 sample rate
  AudioZero.begin(2*44100);
}


void loop()
{
  int count = 0;


  // open wave file from sdcard
  File myFile = SD.open("a.wav");
  if (!myFile) {
    // if the file't opden, print an error and stop
    Serial.println("error opening test.wav");
    while (true);
  }


  Serial.print("Playing");
  
  // until the file is not finished  
  AudioZero.play(myFile);


  Serial.println("End of file. Thank you for listening!");
  //while (true) ;
}

 

Demonstration -

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Stay tuned for our next blog!

  • Sign in to reply
  • DAB
    DAB over 6 years ago

    Interesting project.

    I look forward to seeing this build progress.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube