Audio FX Sound Board Triggers

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
FredLorenzo
 
Posts: 6
Joined: Thu Jul 03, 2014 12:55 pm

Audio FX Sound Board Triggers

Post by FredLorenzo »

Is it possible to trigger the Audio FX Sound Board with a piezo ? My project needs to be triggered by sound/shock, a switch would not last long and would be unreliable. The piezo produces electricity, and I am not sure whether it would damage the inputs.

I thought about an optoisolator ?? Feasible ?

Thanks !

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Audio FX Sound Board Triggers

Post by adafruit_support_rick »

This tutorial shows you how to wire up a piezo as a digital knock sensor:
https://learn.adafruit.com/secret-knock ... ock/wiring

User avatar
FredLorenzo
 
Posts: 6
Joined: Thu Jul 03, 2014 12:55 pm

Re: Audio FX Sound Board Triggers

Post by FredLorenzo »

I have done just that with the small piezo and Arduino Uno. It works great. Reading the specs for the Sound Board, I understand the triggers will work when momentarily connected to ground. NOW, the piezo produces a small amount of electricity: It is positive when pressed, and negative when released.

So by connecting a piezo - + red to the trigger, and - black to ground, when pressed, it will produce a positive voltage - small, no doubt, but positive - back to the trigger. When released will send the opposite. This is my concern, that it could damage the Sound Board.

I have tried a DIODE in series with the piezo. It cuts out MOST of the voltage, but of course, there is a very small amount sent the opposite way.

Any further ideas ?? Thanks much!

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Audio FX Sound Board Triggers

Post by adafruit_support_mike »

Post a photo of how you have things connected now and we'll take a look.

Protecting the board from overvoltage is a valid concern, and there are ways to do that, but it will help to see how you're doing things now.

User avatar
FredLorenzo
 
Posts: 6
Joined: Thu Jul 03, 2014 12:55 pm

Re: Audio FX Sound Board Triggers

Post by FredLorenzo »

Sorry, some of my information was missing!

1. I do not have the Audio FX board - it is out of stock. For my experiments I am using the UNO.

2. With the UNO, FLORA, etc. the piezo is connected to an ANALOG pin. It triggers when the signal exceeds a set threshold.

3. The Audio FX triggers when a pin is momentarily connected to GROUND. I understand this as the pin being held high, and when set to LOW (grounded) , it triggers. There is no analog logic here!

I need the FX to trigger by a sensor in the same manner as your Flora Drum Glove. My project has to do with DANCING! A switch will not work. A pressure sensor will not work either, because it will be UNDER a shoe , and while standing still it will allow current flow.

My question rephrased: Is there a SAFE way to trigger the FX with a PIEZO ?

Thank you very much for your time! Much appreciated. I think this question will come in again from others, since the FX will make producing short bursts of sound a lot easier, and it will fit in smaller spaces than the UNO + shield, and a lot easier than Trinket/Flora and a flash chip. Being able to load sounds easily into the FX and selectively play them is a great way to go!

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Audio FX Sound Board Triggers

Post by adafruit_support_mike »

This will keep the piezo pulses from going too high:
clamp.jpg
clamp.jpg (14.07 KiB) Viewed 1532 times
The diode pointing to the right will allow current to flow into the capacitor, but not to flow back out. The resistor will drain the capacitor with a time constant of about 10 milliseconds.. falling from 5v to 1.5v will take about 12ms, and falling from 5v to less than 5v to less than 50mV will take about 50ms.

The diode connected to VCC clamps the input.

If the voltage from the piezo sensor rises to more than half a volt above VCC, the transistor connected to VCC will become forward biased and shunt the excess current away from the capacitor and into the supply rail.

All silicon diodes have roughly the same forward voltage, so if you connect two of them at their anodes, the voltages at their cathodes will be the same to within a few millivolts. The cathode connected to VCC can't rise higher than the supply voltage, so neither can the cathode connected to the capacitor.

User avatar
FredLorenzo
 
Posts: 6
Joined: Thu Jul 03, 2014 12:55 pm

Re: Audio FX Sound Board Triggers

Post by FredLorenzo »

Finally received the FX board ! And found a little problem. . . for my application, that is.

The sound files I need to play are very short - 1 second or less (T01.WAV, etc) So they repeat, which is not what I intended to do. Imagine using the board for a drum set. I guess that is the way the board was designed. Anyway, I wanted to trigger with a PIEZO, which also has some problems.

So I am thinking about using a trinket to handle the logic. Piezo triggers the trinket, and the trinket sinks the input pin in the FX to ground ( The FX pin is probable being held HIGH with a pullup ). Digital pin in the trinket pulled LOW when the piezo triggers, just long enough to trigger the FX, ( maybe 200 ms for a WAV file ? ) and then HIGH again.

Will this work (without damage to the FX) ? Thanks for your help.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Audio FX Sound Board Triggers

Post by pburgess »

Almost! There's a trick to this...

The Audio FX board logic runs at 3.3V. If you're using a 5V Trinket, don't write HIGH to the pins, or you might toast the audio board! A 3.3V Trinket is okay...but there's a better way to do this that handles both cases...

Immediately at startup, set all the Audio FX-connected pins to INPUT (not INPUT_PULLUP, just INPUT...the Audio FX board has its own pull-up resistors). Then write LOW to each pin.

Code: Select all

void setup() {
  uint8_t i;
  for(i=0; i<5; i++) pinMode(i, INPUT);
  for(i=0; i<5; i++) digitalWrite(i, LOW);
}
Why two loops? To get the pins to input mode ASAP. Alternately, you can fiddle with the DDRB/PORTB registers directly:

Code: Select all

void setup() {
  DDRB = 0x00;  // Input mode for all pins
  PORTB = 0x00; // LOW on all pins
}
The latter is Trinket-specific; other microcontrollers use other registers for doing this, so don't just copy-and-paste that code to J. Random Arduino or your Audio FX board may get a visit from the Blue Smoke Fairy.

To activate a trigger, momentarily set that pin to OUTPUT. Because it's state was previously set to LOW, this creates a path to ground. Then set it back to INPUT...the pullup resistor on the Audio FX board will pull it to 3.3V. Even with a 5V Arduino.

Code: Select all

  pinMode(x, OUTPUT);
  delay(100);
  pinMode(x, INPUT);
For pins that AREN'T connected to the Audio FX board, you can use pullups as normal for triggers, can write output HIGH, etc. The code above kinda takes over everything, but of course you'll have a pin (or a few) dedicated to other tasks. You can set those up the normal way (pinMode, etc.) after the Audio FX pins are configured.

User avatar
FredLorenzo
 
Posts: 6
Joined: Thu Jul 03, 2014 12:55 pm

Re: Audio FX Sound Board Triggers

Post by FredLorenzo »

Thank you very much. I think the Trinket Pro 3V is the right match for this job because of the number of pins available. I was wondering how to set the FX volume, and maybe this can be done in software from the Trinket. I will try your logic with my 3V Trinket, and when I have it working, order the Pro version. Best of both worlds!

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Audio FX Sound Board Triggers

Post by adafruit_support_rick »

Setting the volume would be done at your amplifier.

User avatar
ashleyjamesbrown
 
Posts: 48
Joined: Thu Oct 10, 2013 12:37 pm

Re: Audio FX Sound Board Triggers

Post by ashleyjamesbrown »

Is it possible to wire up capacitive input into these standalone or is a trinket / uno needed as well ? There must be a way to wire up so that touch will cause the trigger pins to activate ?

Thanks in advance

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Audio FX Sound Board Triggers

Post by adafruit_support_rick »

You could wire these through an inverter chip
https://www.adafruit.com/products/1374

User avatar
ashleyjamesbrown
 
Posts: 48
Joined: Thu Oct 10, 2013 12:37 pm

Re: Audio FX Sound Board Triggers

Post by ashleyjamesbrown »

adafruit_support_rick wrote:You could wire these through an inverter chip
https://www.adafruit.com/products/1374

Ok i was going to ask if they would work and then i can extend the sensor using a wire to what i want which is a large copper plate which will be touched to activate the sounds.

Could you possibly tell me how i would wire those up to the sound board directly and what other components i would need please?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Audio FX Sound Board Triggers

Post by adafruit_support_rick »

How many inputs do you want?

User avatar
ashleyjamesbrown
 
Posts: 48
Joined: Thu Oct 10, 2013 12:37 pm

Re: Audio FX Sound Board Triggers

Post by ashleyjamesbrown »

Only the 1 per board. Thats it.

Ive got 8 boards and they are for 8 standalone single keyboard piano notes triggered via 8 different copper plates.

Ill happily get the 8 touch sensors if they will do the job - really appreciate your advice.

Ashley

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

Return to “Other Arduino products from Adafruit”