element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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
Pi-Fest
  • Challenges & Projects
  • Design Challenges
  • Pi-Fest
  • More
  • Cancel
Pi-Fest
Blog Pi-Fest - Making Some Noise with Raspberry Pi Pico (Blog1)
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Leaderboard
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: asokfair
  • Date Created: 23 Jun 2022 10:31 AM Date Created
  • Views 4082 views
  • Likes 10 likes
  • Comments 6 comments
  • raspberrypipico
  • asokfair
  • raspberry pi pico
  • micropython
  • embeddedclub
  • pi-fest
  • noise
Related
Recommended

Pi-Fest - Making Some Noise with Raspberry Pi Pico (Blog1)

asokfair
asokfair
23 Jun 2022

Hi All,

In this blog i write about my project concept and components required to make some noise with Raspberry Pi Pico.

My Project title name would be "Entry Theme Player" , The idea is to play theme track/music when people enters. This can be used in any party, events and sports for welcoming people etc.

In this design challenge i did not want to complicate with more stuffs like coding or using advanced technology since its going to be fun project. This project can be recreated by anyone like students or beginners.

In this design Raspberry Pi Pico is interfaced with sensor and amplifier. It detects the person entry and play a music for a few seconds.

Block Design

image

Components Required

  1. Raspberry Pi Pico
  2. MAX98357A I2S Amplifier
  3. Speaker
  4. Sensors (Radar/PIR Motion Sensor)
  5. Battery or Solar Cells

Block Design

Making of Noise

Board Setup:

To make some noise , I started with breadboard hookup. Took an Pico board and interfaced to the MAX98357A board from Ada-fruit.

It uses I2S communication to stream audio data from Pico.

The Amplifier board is capable of driving 3W speaker. I have connected 8Ohm , 3W speaker to the Amplifier.

image

Code with Mu Editor:

The coding for Nano is done using MicroPython , I have used Mu Editor for coding and dumping the binary.

To start with coding, i have taken up basic code which generates the sine wave and sends the audio over I2S.

image

The code has been running on Pico , the LED blinks and makes noise for every seconds once. It also supports the .wav , .mp3 formats to play on speaker.

image

Create MP3 File

The mp3 files are created/edited from audacity .with below limitations

Mono and Stereo is supported with less than 64kbs and sample rates from 8kHz to 24kHz.

The RP2040 has a PWM output with 10 bits, so there's not much point in using high bit rates.

In this project i have used Stereo with 56kbs bit-rate and 22kHz sampling rate.

image

image

Short working video is here -

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

In the next blog (blog2) , sensor will be integrated to make music on people entry.

Thanks

Ashok R

  • Sign in to reply
Parents
  • shabaz
    shabaz over 3 years ago

    Hi,

    Is there something wrong with the sine tone playback? It doesn't sound like a sine wave. I think there's some error.

    Also, regarding the comment: "The RP2040 has a PWM output with 10 bits, so there's not much point in using high bit rates."

    I think the comment cannot apply, because you're not using PWM. You're using I2S.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • asokfair
    asokfair over 3 years ago in reply to shabaz

    Hi Shabaz, Yes during my initial setup (sine wave) b clk signal is grounded by mistake. So its sounds like that , anyway the point is to make some noise :). later i have corrected it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • asokfair
    asokfair over 3 years ago in reply to shabaz

    Hi Shabaz, Yes during my initial setup (sine wave) b clk signal is grounded by mistake. So its sounds like that , anyway the point is to make some noise :). later i have corrected it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • jc2048
    jc2048 over 3 years ago in reply to asokfair

    I think the problem with the sinewave is that a frequency of 440Hz has a period of 18.1818(recurring) samples at 8ksps. But you approximate that with 18 samples in the array so, when you loop it, the pieces don't join up smoothly. A way to determine if that is the problem would be to try again with 500Hz. That has a period of exactly 16 sample times at 8ksps, so should be continuous when looped and played back.

    It doesn't affect your project, of course, because you want to play back long continuous samples and it sounds like the library code manages that fine, but I thought I'd mention it in case anyone wanted to use your Python code for arbitrary sinewaves.

    440Hz could be made to work if the array was extended to be 200 samples long with 11 full cycles loaded into it. That should loop properly.

    Good luck with your competition entry.

    • 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