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!
Adafruit Audio FX Sound Board inverting pull-up resistor pin
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 18
- Joined: Sun May 19, 2013 6:30 am
- adafruit_support_bill
- Posts: 88086
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit Audio FX Sound Board inverting pull-up resistor
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.
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.
-
- Posts: 18
- Joined: Sun May 19, 2013 6:30 am
Re: Adafruit Audio FX Sound Board inverting pull-up resistor
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 (260.54 KiB) Viewed 178 times
- adafruit_support_bill
- Posts: 88086
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit Audio FX Sound Board inverting pull-up resistor
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:
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.
- Connect the Collector pin of your transistor to the Fx trigger pin.
Connect the Emitter pin of the transistor to GND.
-
- Posts: 18
- Joined: Sun May 19, 2013 6:30 am
Re: Adafruit Audio FX Sound Board inverting pull-up resistor
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 (276.42 KiB) Viewed 168 times
- adafruit_support_bill
- Posts: 88086
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit Audio FX Sound Board inverting pull-up resistor
How are you measuring that?the trigger PIN is HIGH whenever the button is pushed
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?
-
- Posts: 18
- Joined: Sun May 19, 2013 6:30 am
Re: Adafruit Audio FX Sound Board inverting pull-up resistor
[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 ...
[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 ...
- adafruit_support_bill
- Posts: 88086
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit Audio FX Sound Board inverting pull-up resistor
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 transistor base when the button is not pressed?] R: 4,65 V
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.[What is the voltage on the base when the button is pressed?] R: 0,45V
Please post a photo showing your actual circuit
-
- Posts: 18
- Joined: Sun May 19, 2013 6:30 am
Re: Adafruit Audio FX Sound Board inverting pull-up resistor
I'm aware of the nonsense... here it goes:
- Attachments
-
- IMG_1504_LR.jpg (690.13 KiB) Viewed 142 times
- adafruit_support_bill
- Posts: 88086
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit Audio FX Sound Board inverting pull-up resistor
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.
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.
-
- Posts: 18
- Joined: Sun May 19, 2013 6:30 am
Re: Adafruit Audio FX Sound Board inverting pull-up resistor
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!!
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 (237.61 KiB) Viewed 133 times
-
- Posts: 18
- Joined: Sun May 19, 2013 6:30 am
Re: Adafruit Audio FX Sound Board inverting pull-up resistor
Correction: sound stops whenever the LDR is "touched" :)
- adafruit_support_bill
- Posts: 88086
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit Audio FX Sound Board inverting pull-up resistor
That makes more sense.
Please be positive and constructive with your questions and comments.