element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • 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
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
  • Leaderboard
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: asokfair
  • Date Created: 23 Jun 2022 10:31 AM Date Created
  • Views 184 views
  • Likes 8 likes
  • Comments 6 comments
  • raspberrypipico
  • raspberry pi pico
  • micropython
  • 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

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.

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.

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.

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.

Short working video is here -

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

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

Thanks

Ashok R

Anonymous
  • jc2048
    jc2048 10 days 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
    • Up 0 Down
    • Reply
    • More
    • Cancel
  • asokfair
    asokfair 12 days 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
    • Up 0 Down
    • Reply
    • More
    • Cancel
  • shabaz
    shabaz 12 days 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
    • Up 0 Down
    • Reply
    • More
    • Cancel
  • dang74
    dang74 12 days ago

    Nice project.  The sound quality is pretty good too.

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
  • robogary
    robogary 13 days ago

    sweet, lots of potential to have some fun. 

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
>
Element14

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 © 2022 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

  • Facebook
  • Twitter
  • linkedin
  • YouTube