Need 60 sec. delay after sensor activation, ignoring subsequent activation

Discussion in 'The Projects Forum' started by Media Man, Feb 1, 2016.

  1. Media Man

    Thread Starter New Member

    Feb 1, 2016
    8
    0
    HI, this should be easy for the talented people here. I am using an PIR sensor that when activated by movement trips an MP3 player device that plays an audio file. The audio file plays approx. 45 seconds. Every time the sensor is activated by movement it starts playing the file from the beginning. If file is playing and sensor activates the file starts over. I need a simple way to have the sensor activate, start the audio file and let it play through completely, regardless of subsequent sensor trips during playback. Then once finished playing is reset and ready for next trip. Hope that makes sense.
     
  2. crutschow

    Expert

    Mar 14, 2008
    12,990
    3,226
    What signal characteristics are needed by the MP3 player to start it's playing?
    Can this signal stay in the active state for longer than 45 seconds without causing the MP3 player to restart playing?
     
  3. Media Man

    Thread Starter New Member

    Feb 1, 2016
    8
    0
    3.3V - 5V, active low inputs, w/ internal pull ups.
    As for the signal staying active: No. If active for longer than 45 seconds it will start to play the over immediately.
     
  4. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,969
    744
    Sounds like a job for the 555 timer, or cd4093 chip.
     
  5. dannyf

    Well-Known Member

    Sep 13, 2015
    1,771
    358
    Fairly easy to code on a mcu.

    Or a PLC.
     
    absf and djsfantasi like this.
  6. crutschow

    Expert

    Mar 14, 2008
    12,990
    3,226
    Is there any signal generated when the MP3 stops playing?
     
  7. Media Man

    Thread Starter New Member

    Feb 1, 2016
    8
    0
    I thought about the 555 timer , not certain how.
     
  8. Media Man

    Thread Starter New Member

    Feb 1, 2016
    8
    0
    No, waits for next sensor input.
     
  9. crutschow

    Expert

    Mar 14, 2008
    12,990
    3,226
    Just to be clear: a signal switching from 3.3v-5v to ground triggers the MP3 player on the falling edge (?).
     
  10. Picbuster

    Member

    Dec 2, 2013
    373
    50
    Use a pic12f675 to handle the on/off from the devices concerned use one input to trigger the state machine.
    1:look at pir
    2:start sound(mp3)
    3: wait >45 sec
    4: go back to 1
     
  11. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,969
    744
    So your mp3 player needs a negative (low)pulse to start it, what is coming from the pir sensor a low pulse or high or open?

    Here is a timer using a Cd4093 cmos chip, it has two different inputs, B pos trigger, or A neg trigger, and complimentary outputs positive or negative, time adjustable from 10 to 100 seconds.

    DSC_0009.JPG
     
    Last edited: Feb 2, 2016
    absf likes this.
  12. Media Man

    Thread Starter New Member

    Feb 1, 2016
    8
    0
    I guess leading edge. Like a momentary switch.
     
  13. crutschow

    Expert

    Mar 14, 2008
    12,990
    3,226
    Okay. But in your description the leading edge is a falling edge, correct?
     
  14. Media Man

    Thread Starter New Member

    Feb 1, 2016
    8
    0
    Correct.
     
  15. Sonoran Desert Tortoise

    Member

    Oct 30, 2014
    53
    34
    You said...

    Does your PIR have any time control on it? If so, How long does it stay on when it senses motion?

    If not, the PIR will sense movement and go low as long as there is a difference between the lenses of the "fly's eye" type lenses. until the motion across the PIR. In this case,
    - a person walks into the room and the PIR goes low and starts playing mp3
    - the person stops, the mp3 continues playing
    - the person continues, the mp3 starts over

    I hope you've described exactly how the PIR works and decided what you want the response to be.
     
  16. Media Man

    Thread Starter New Member

    Feb 1, 2016
    8
    0
     
  17. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,969
    744
    The circuit i posted in #11 will ignore further pules until it times out, then its ready for the next pulse.
     
  18. crutschow

    Expert

    Mar 14, 2008
    12,990
    3,226
    Use the negative going output from Dodgydave's circuit with a series capacitor and resistor to ground to give a short, negative going pulse to trigger the MP3 player.
     
  19. Media Man

    Thread Starter New Member

    Feb 1, 2016
    8
    0
    I will try it and let you know the outcome. Thank you all for your help thus far!
     
Loading...