Making a PIR communicate with an FXsound Board

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Pseudot4
 
Posts: 2
Joined: Tue Jun 17, 2014 7:49 am

Making a PIR communicate with an FXsound Board

Post by Pseudot4 »

Greetings,

I am building a semi complex sensor-effector project. The sensor is one of your PIRs and the composite effectors are a set 6 color-changing LEDs arranged in ring and also one of your small led illuminated panels which displays a printed warning text. Currently both these display elements work fine in synchrony when the PIR turns them on as you approach, and they both stay illuminated for about 20 seconds: I would now like to add an audible warning as well, consisting of a 5 sec. playback of a wav file running on your FX soundboard. To trigger this sound board to initiate apparently I need a less than 50ms connection between the appropriate pin on the FX board to GND. When my PIR triggers it sends out signal of 3.3+ volt for about 15 seconds. So all that I need now is some sort of small circuit to make the PIR’s 3.3V+ signal activate a switch for less than 50 ms to GND the appropriate FX pin and thus play the FX's audio file. What is the easiest, simplest and cheapest way to do this? Perhaps by the addition of a small appropriate switch circuit controlled by the PIR and acting on the appropriate control pin of the FX Board?

Kriburg

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

Re: Making a PIR communicate with an FXsound Board

Post by adafruit_support_mike »

This should do it:
pulse.jpg
pulse.jpg (16.48 KiB) Viewed 304 times
The 100nF capacitor and 220k resistor make a high-pass filter. Only the rising edge of the PIR pulse will make it to the transistor.

The instant the PIR pulse arrives, it will send both sides of the capacitor to about 5v. Putting 5v across the resistor causes current to flow through it, then through the transistor to GND. That current turns on the transistor and pulls the FX pin low. It will take about 20ms for the voltage on the right-hand side of the capacitor to fall low enough to shut the transistor off again.

The diode is there to protect the circuit when the PIR pulse goes low again. The instant before the falling edge, the left side of the cap will be at 5v and the right side will be somewhere near 0v. When the pulse goes low it pushes the left side of the cap to 0v, and will try to push the right side to -5v. That probably wouldn't hurt the transistor, but it might cause odd triggering effects.

As soon as the voltage on the right side of the cap goes past about -0.5v, the diode will become forward biased and stop the cap voltage from falling much lower. That should keep the transistor from doing anything unexpected.

User avatar
Pseudot4
 
Posts: 2
Joined: Tue Jun 17, 2014 7:49 am

Re: Making a PIR communicate with an FXsound Board

Post by Pseudot4 »

Hi Tech Support Guy Mike,

Many Thanks for your rapid response to my query but I am getting increasingly frustrated since your brief negative pulse generating circuit did not work. I even wired your circuit twice and both attempts failed. The circuit is simple enough that I don’t believe I made an error in constructing both versions.

Could it be that the AdaFruit instructions about how the FX board operates are just not correct? If I very briefly connect FX pin #2 to GND then my wav file # 2 plays just fine. Maybe connecting Pin2 to your circuit’s output signal is somehow not really equivalent as far as the FX trigger circuit is concerned to simply briefly grounding it. Does that sound at all possible/probable/feasible to you?

Lacking an oscilloscope I have no way to test if such an output pulse would or would not work since I cannot verify circuit is currently actually generating the desired wave form signal. Is there some simple diagnostic test to actually verify I am making the desired signal pulse? For example, is a such a pulse enough to make a LED or something else detectably briefly turn off?

As a workaround, all I really need is simple electronic switch that as long as +3 volts is applied to its own trigger pin it will close and thus make a direct connection between the FX pin2 and ground. Is there any easy way make (or better yet, buy?) a circuit to do that?

Regards and Thanks,

Kriburg

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

Re: Making a PIR communicate with an FXsound Board

Post by adafruit_support_mike »

You can test the circuit by connecting an LED and resistor to the transistor's collector (replace the 10k resistor in the diagram above). A 20ms flash of light is easy to see.

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

Return to “General Project help”