Adafruit Audio FX Sound Board inverting pull-up resistor pin

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
pat__reis
 
Posts: 18
Joined: Sun May 19, 2013 6:30 am

Adafruit Audio FX Sound Board inverting pull-up resistor pin

Post by pat__reis »

In my project with the Adafruit Audio FX Sound Board I would like to have pin 4 always HIGH (playing a sound in loop) while the "button" is not pressed, and switch to LOW (sound off) while the button is pressed.
Since there is no way to program the pins, I was wondering if there is a simple electronic solution. I looked into tutorials for inverting switches with transistors but sadly with no success.

Any ideas, help, very appreciated!

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Audio FX Sound Board inverting pull-up resistor

Post by adafruit_support_bill »

The trigger pins on the Fx are active low, there is no way to change that on the board. If you want a trigger to remain ON until the button is pressed, the simplest solution would be to use a "normally closed" switch wired between the pin and GND. There are many pushbuttons that have both NO (Normally Open) and NC (Normally Closed) pins.

A more complicated solution would involve an NPN transistor between the trigger pin and GND, with a pulldown resistor on the input and the switch wired to pull up the Base.

pat__reis
 
Posts: 18
Joined: Sun May 19, 2013 6:30 am

Re: Adafruit Audio FX Sound Board inverting pull-up resistor

Post by pat__reis »

Thanks! I would rather take the NPN version but my currently schematic is not inverting the PIN, just behaving as normal. I assume I'm doing something, wrong, feedback much appreciated!
Attachments
adafruit_audio_npn_bb.png
adafruit_audio_npn_bb.png (260.54 KiB) Viewed 178 times

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Audio FX Sound Board inverting pull-up resistor

Post by adafruit_support_bill »

With no connections at all to VCC, I would not expect that circuit to do anything. It is also not clear what specific transistor you are using. You will need to refer to the datasheet for your transistor to determine what the pinout is.

First you need to connect your switch so that it will pull the base of the transistor HIGH when the button is pressed:
  • Connect one side of the switch to VCC.
    Connect the other side of the switch to the base of the transistor via a 470 ohm resistor.
    Connect a 10K ohm resistor from the base of the transistor to GND.
Then you need to connect the transistor so that it pulls the trigger pin LOW when the Base goes HIGH:
  • Connect the Collector pin of your transistor to the Fx trigger pin.
    Connect the Emitter pin of the transistor to GND.

pat__reis
 
Posts: 18
Joined: Sun May 19, 2013 6:30 am

Re: Adafruit Audio FX Sound Board inverting pull-up resistor

Post by pat__reis »

Thanks! Did as mentioned, using a NPN BC547c and the trigger PIN is HIGH whenever the button is pushed. I've also tried with a TIP 120 which didn't work at all, and yes double checked the respective pinouts. heemmm, maybe using another transistor? Feedback appreciated
Attachments
Screenshot 2022-08-05 at 11.59.13.png
Screenshot 2022-08-05 at 11.59.13.png (276.42 KiB) Viewed 168 times

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Audio FX Sound Board inverting pull-up resistor

Post by adafruit_support_bill »

the trigger PIN is HIGH whenever the button is pushed
How are you measuring that?
What is the voltage on the transistor base when the button is not pressed?
What is the voltage on the base when the button is pressed?

pat__reis
 
Posts: 18
Joined: Sun May 19, 2013 6:30 am

Re: Adafruit Audio FX Sound Board inverting pull-up resistor

Post by pat__reis »

[What is the voltage on the transistor base when the button is not pressed?] R: 4,65 V
[What is the voltage on the base when the button is pressed?] R: 0,45V

Still, in only triggers the sound whenever the button is pressed ...

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Audio FX Sound Board inverting pull-up resistor

Post by adafruit_support_bill »

[What is the voltage on the transistor base when the button is not pressed?] R: 4,65 V
That makes no sense at all. According to your diagram, the base has a pulldown resistor to GND. When the button is not pressed, there is nothing to pull it HIGH.
[What is the voltage on the base when the button is pressed?] R: 0,45V
That makes no sense either. When the button is pressed, it has a pullup to VIN. So the voltage would be higher than when not pressed - not lower.

Please post a photo showing your actual circuit

pat__reis
 
Posts: 18
Joined: Sun May 19, 2013 6:30 am

Re: Adafruit Audio FX Sound Board inverting pull-up resistor

Post by pat__reis »

I'm aware of the nonsense... here it goes:
Attachments
IMG_1504_LR.jpg
IMG_1504_LR.jpg (690.13 KiB) Viewed 142 times

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Audio FX Sound Board inverting pull-up resistor

Post by adafruit_support_bill »

Best to start simple and take it one step at a time. If any of these steps fail, then you will have a better idea of where the problem is:

Disconnect the switch and transistor and test the trigger pin directly with a jumper to GND to verify that it plays the sound clip as expected.

Next, remove the jumper and connect the transistor with the collector pin to the trigger pin and the emitter pin to GND.
With a 10K resistor between the base and GND, verify that the sound does not trigger.
Then add a 470 ohm resistor from the base to VIN and verify that the sound does trigger.

[edit] Since you are using a BC547C, a higher value base resistor is probably better. Try 2K.

pat__reis
 
Posts: 18
Joined: Sun May 19, 2013 6:30 am

Re: Adafruit Audio FX Sound Board inverting pull-up resistor

Post by pat__reis »

Tested everything, didn't find the problem :(
In any case, I'm replacing the switch for an LDR and it fits my purpose: sound is triggered whenever the LDR is "touched".

Thanks!!
Attachments
Screenshot 2022-08-06 at 19.16.53.png
Screenshot 2022-08-06 at 19.16.53.png (237.61 KiB) Viewed 133 times

pat__reis
 
Posts: 18
Joined: Sun May 19, 2013 6:30 am

Re: Adafruit Audio FX Sound Board inverting pull-up resistor

Post by pat__reis »

Correction: sound stops whenever the LDR is "touched" :)

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit Audio FX Sound Board inverting pull-up resistor

Post by adafruit_support_bill »

That makes more sense.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”