Forum

Does using PIR sensors require different coding?

More
1 year 1 month ago #622 by iz-112
iz-112 created the topic: Does using PIR sensors require different coding?
I am working on a project that is trying to use PIR sensors as buttons. I have used the count to twelve sample project and all I have edited is exchange the wav files for the ones I want to use. I have the program loaded and tested and all of the sounds will play. I have initially connected the PIR sensor and have got one to work, but when I connect more than one sensor I cannot get other wav files to play unless i plug and unplug the input. The only file that will play seems to be the initial one that is triggered. Do I need to manipulate the code to alter the way the sensors will act as buttons? Any help you can provide is appreciated.
Thanks.
-Ron

Please Log in or Create an account to join the conversation.

More
1 year 1 month ago #623 by foxonix
foxonix replied the topic: Does using PIR sensors require different coding?
Hello Ron:

No special code should be required. The chip is simply looking for a low-to-high transition on the input pin. So as long as the outputs of your PIR sensors are connected to the input pins of the Foxonix chip, then the program should trigger and the audio should play. I assume that you have one sensor connected to pin P1.0, one sensor connected to P1.1, and so on. What are you using for the power supply, and what PIR sensor are you using? This would help me to debug your problem.

Also, if you have a circuit diagram that shows how you've got everything connected, that might help, too.

- Will @ Foxonix

Foxonix - make your ideas heard.
@foxonixdev

Please Log in or Create an account to join the conversation.

More
1 year 1 month ago #624 by iz-112
iz-112 replied the topic: Does using PIR sensors require different coding?
WIll,

You are correct with your assumption about the connections. The diagram is showing the connection of just one sensor, but the other sensors are connected to the other individual pins with the same ground and power layout. I have been adjusting the POT's to see if that will have any effect on getting the other sensors to trigger and it did seem to help but it is still very inconsistent. The program/run led on the board takes about a minute or so to flash/reset for some of the pins which is when another sensor can be activated. Does this have to do with the sensitivity/time setting of the PIR, or the length of the audio file being played?

-Ron


Attachment diagram.jpg not found

Attachments:

Please Log in or Create an account to join the conversation.

More
1 year 1 month ago #625 by foxonix
foxonix replied the topic: Does using PIR sensors require different coding?
Hi Ron:

Your diagram looks correct. As long as the sensor and the Foxonix board are on the same power supply, and if the output of the sensor is connected to the input pin, then the connections should be correct.

In the basic "Counting to Twelve" program that you started with, the PRG/RUN LED should only be on for as long as the audio is playing. If you didn't modify the program then yours should behave the same way. When the audio stops, the LED should turn off. If it's not, then it may be because there is extra silence at the end of your audio files. The chip would continue to play this silent audio and the LED would stay on. If this is the case then you should remove the extra silence at the end of your audio files.

Regardless, the sample program you started with is set so that the inputs will interrupt each other. So if audio is playing and another sensor is triggered the current audio would stop and the new audio would start.

Most PIR sensors have controls to set the sensitivity and the delay time. (Probably the two pots on your board.) It could be that the sensors that aren't triggering are set for really low sensitivity or a really long delay time, in which case it would appear that they are not triggering the chip. If you have a multimeter (to measure voltage) or an oscilloscope, you could check the output of the sensor to see if the output signal is high or low. That way you can tell if the motion sensor is triggering correctly.

One other question. When your PIR sensor is triggered does the output go low or does it go high?

Let me know what you find.

- Will

Foxonix - make your ideas heard.
@foxonixdev
The following user(s) said Thank You: iz-112

Please Log in or Create an account to join the conversation.

More
1 year 1 month ago #626 by iz-112
iz-112 replied the topic: Does using PIR sensors require different coding?
WIll,
Thanks for your help. I will try and get my hands on a multimeter to see if it is low or high. In the meantime I will keep playing with the POTs to see if adjusting the sensitivity/time will produce the effect I am after.
Thanks again.
-Ron

Please Log in or Create an account to join the conversation.

Time to create page: 0.372 seconds