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
Community Hub
Community Hub
Member's Forum I am looking for some help
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Community Hub to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 12 replies
  • Answers 5 answers
  • Subscribers 538 subscribers
  • Views 1422 views
  • Users 0 members are here
Related

I am looking for some help

jlusco
jlusco over 7 years ago

I am newer to DIY electronics and I am working on a project. I have a project that I am building and I am stuck on this one part. I have an Adafruit Mono 2.5W Class D Audio Amplifier - PAM8302 and I want to bring teh Speaker out to another board that will have a Speaker and headphone jack on it. I want to wire it so when the headphones are plugged in the speaker is off and the sound comes through the headphones but when unplugged the sound comes out the speaker. Below is a basic mock up of what I want and I am just stuck on how to accomplish it.

I have tried to Google the answer but have had no luck. Orange dots are the thru hole solder points for each component any help will be appreciated.

 

 

MockUp

  • Sign in to reply
  • Cancel

Top Replies

  • genebren
    genebren over 7 years ago +5 suggested
    Jacob, The connections are really quite simple. The diagram below is how it should work. Keep in mind that the pin-out on the headphone jack will need to match the part that you are using. Good luck, …
  • genebren
    genebren over 7 years ago in reply to jlusco +3 suggested
    Jacob, Not quite sure that I know what you are trying to do here. Best I can tell, Vin and Gnd are your power supply connections (2.5V to 5.5V), SD is used to turn the amp 'on' (Vin) or 'off' (gnd). A…
  • genebren
    genebren over 7 years ago in reply to jlusco +3
    Jacob, Well then you might need another person who is smarter than me for this one. I have no experience with the Raspberry Pi, even though I recently purchased a Pi zero. I can see how a GPIO could be…
  • genebren
    0 genebren over 7 years ago

    Jacob,

     

    The connections are really quite simple.  The diagram below is how it should work.  Keep in mind that the pin-out on the headphone jack will need to match the part that you are using.

     

    image

    Good luck,

    Gene

    • Cancel
    • Vote Up +5 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • jlusco
    0 jlusco over 7 years ago in reply to genebren

    So can this audio amp be connected to the Raspberry Pi Zero without using the GPIO. Can I solder the Vin, GND, A+, and A- to the USB Test Pads and use it to get sound?

     

    Adafruit Mono 2.5W Class D Audio Amplifier - PAM8302

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • genebren
    0 genebren over 7 years ago in reply to jlusco

    Jacob,

     

    Not quite sure that I know what you are trying to do here. Best I can tell, Vin and Gnd are your power supply connections (2.5V to 5.5V), SD is used to turn the amp 'on' (Vin) or 'off' (gnd).  A+ and A- are your inputs (differential, if single-ended use A+ and tie A- to gnd.

    How this relates to the USB Test Pads is where I am getting lost.

    Gene

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • jlusco
    0 jlusco over 7 years ago in reply to genebren

    I want to connect the amp to a raspberry pi zero without using the GPIO and being new to this I am not sure if I can do it with this or not so figured I would ask people who were smarter then me when it comes to this. I know you can wire a USB sound card to teh pads on the bottom of the Pi but not sure If I can do the same with amp.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • genebren
    0 genebren over 7 years ago in reply to jlusco

    Jacob,

     

    Well then you might need another person who is smarter than me for this one.  I have no experience with the Raspberry Pi, even though I recently purchased a Pi zero.  I can see how a GPIO could be used to generate an audio signal, but I am not sure if I have heard of the USB port being used in this way.

     

    Any ideas from the more experienced Raspberry Pi people here?

     

    Good luck,

    Gene

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 7 years ago in reply to jlusco

    Hi Jacob,

     

    It's not possible in the way you mention, without additional hardware (a USB sound card effectively). Otherwise GPIO can be used.

    If you don't want to use GPIO connections, then a USB sound card is needed.

    If you do eventually decide to use GPIO, see here for the circuit you need (in additional to the amplifier which you have already got).

    https://learn.adafruit.com/introducing-the-raspberry-pi-zero/audio-outputs

    Or you could connect a digital audio card to the GPIO pins. But it uses GPIO pins.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • jlusco
    0 jlusco over 7 years ago

    SoI guess the question is can I, and if I can, hook up a Adafruit Mono 2.5W Class D Audio Amplifier - PAM8302 to a raspberry pi zero without using the GPIO since in the project I am doing they are all used. If it can be done I would like to know how.

     

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jlusco
    0 jlusco over 7 years ago in reply to shabaz

    Thanks for your help you got me half way to what I am trying to do. image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jlusco
    0 jlusco over 7 years ago in reply to shabaz

    So I am building a Gameboyzero (Link Below) and you mount the Raspberry Pi Zero W onto the PCB. I am not sure if I can use the GPIO PWM. Here is an image with the pins numbered maybe you can tell if I can do what I want to this way.

     

    image

     

     

     

     

     

    https://www.tindie.com/products/thirtytwoteeth/game-boy-zero-handheld-edition/

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 7 years ago in reply to jlusco

    Hi Jacob,

    You originally stated that all GPIO pins were in use, is the question now if some are actually free?

    If so, it is really better if you check (good learning experience). The way to do it is to either find the circuit diagram of this gameboy project if you can, or visually inspect the circuit board if you have purchased it, to see which of the GPIO pins are in use. You could also use a multimeter to probe pins if you really don't wish to find the circuit diagram or if it is not available (if you don't have a multimeter, it is highly recommended).

    If the GPIO pins are just soldered but really are not going anywhere, then those GPIO pins are free. However, as you can see from the adafruit audio link sent earlier, the audio available on the GPIO pins are on _specific_ pins. You can't interchange. So you'd need to see if those specific pins are free and unused on that gameboy project board.

    And as mentioned, all you have is an audio amplifier. It can't directly connect to GPIO pins anyway, even if the GPIO pins are free. You need to also assemble the small circuit described on the adafruit page (a total of 4 resistors and 4 capacitors).

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • 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