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 1427 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…
  • jlusco
    0 jlusco over 7 years ago in reply to shabaz

    I thought about the schematic right after I asked. I took a look and now I am confused there are a hand full of pins not used but from the link you provided and looking at the GPIO Alt functions the only PWM pin free is 40. The designer has a PWN board as well that looks a lot like the circuit in the Pi Zero Adafruit page you provided. So Pins 3,5,7,8,16,27,28, and 40 are all free if I am reading it correctly but based on what I see here https://elinux.org/RPi_BCM2835_GPIOs only Pin 40 is PWM and it looks like you have to use a PWM1 and PWM0 pin am I understanding this correctly. I have also reached out to teh Designer to see how he suggests wiring his PWM board to the device.

     

    image

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

    Hi Jacob,

     

    I think your misinterpreting that table as only GPIO0-27 are available by way of the 40 pin header, its a bit confusing but there are two ways of referencing the pins on the 40 pin header.  If you look at the schematic symbol you have posted each pin has a pin number and a description associated to it, pin 40 is in fact GPIO 21.

     

    image

    Which if we look at your table you have linked to isn't capable of being used for PWM

    image

     

    After looking the link you posted I get the feeling the guy used a USB audio device rather then the IO, but if you don't need two sets of triggers you could use GPIO 18 (pin 12) and wire you amplifier to this pin and ground.  You'll need to make some software modification, according to Step 7 of the projects setup (https://github.com/32teeth/Gameboy-Zero-Kickstarter/blob/master/INSTALL.md ) you have to edit the control setup anyways.  You'll want to free up gpio 18, so delete the following two lines from the config file

     

    A 18  # Left shoulder button

     

    OR

     

    change

    A 18  # Left shoulder button

    to

    A 21  # Left shoulder button

     

    but doing this will require you to lift the tact switch from being connected to GPIO_18 and run a wire from the tact switch to the GPIO_21.

     

    Hope this helps

    Chris

     

     

    • 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