Wake on piezo vibration detection A/D?


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2009
    Posts
    22

    Default Wake on piezo vibration detection A/D?

    I'm using a piezo disc with 1Meg resistor in parallel to detect vibration, using an analog channel on 16F690. (And planning migration to 8pin PIC, eg. 16F683.)

    A/D works great to detect the very small voltages generated by the piezo. I'd like to use vibration to wake the PIC but it doesn't generate sufficientvoltage for a digital high logic level, therefore I can't use IOC or the like. Any clever way to wake without complex amplification? Thanks.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Wake on piezo vibration detection A/D?

    Hello. I did something like this a long time ago. You can also experiment with the nap command, use word variables instead of bytes and change IF X <> Y Then... to if X > (Y + 001) to adjust sensitivity.

    '12f675
    @ DEVICE MCLR_OFF, INTRC_OSC, WDT_ON, BOD_ON, PWRT_ON, PROTECT_ON
    ANSEL = 0 'all inputs digital adcin command converts to analog
    CMCON = 7 'comparators off
    trisio = %00000001 'input for piezo
    GPIO = 0 'ALL LOW
    X VAR BYTE
    Y VAR BYTE

    START:
    ADCIN 1,X
    NAP 0 'GIVES TIME BETWEEN SAMPLES
    ADCIN 1,Y
    IF X <> Y Then PLAY
    GoTo START

    play:
    High GPIO.4 'RELAY ON
    Pause 5000
    Low GPIO.4 'RELAY OFF
    GoTo START

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: Wake on piezo vibration detection A/D?

    Hi,
    The 12F683 (and the 16F690) has a built in comparator which can wake the PIC when being tripped, perhaps you can use that.
    You need to check the datasheet for minimum input levels and compare that to what your piezo sensor outputs.

    /Henrik.

  4. #4
    Join Date
    Sep 2009
    Posts
    737


    Did you find this post helpful? Yes | No

    Default Re: Wake on piezo vibration detection A/D?

    I think that best way is to use internal comparator to wake up pic.

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: Wake on piezo vibration detection A/D?

    Hi,

    I'm thinking of doing something similar, I'm curious about how sensitive your set up is? Can you detect a tap (knuckles) on the surface the piezo is attached to? (I'm trying to emulate the tap people feel inclined to give a barometer.)

    George
    Last edited by towlerg; - 7th October 2013 at 21:16.

  6. #6
    Join Date
    Jan 2009
    Posts
    22


    Did you find this post helpful? Yes | No

    Default Re: Wake on piezo vibration detection A/D?

    Lowest comparator voltage seems to be 0.2v, which may work. Fixed Vref is 0.6v. Thanks for the suggestions.
    George - definitely should be able to detect that. You may need to glue the disk to the surface being tapped.

  7. #7


    Did you find this post helpful? Yes | No

    Default Re: Wake on piezo vibration detection A/D?

    @gmglickman - thanks a million for that info. I've never used a comparator, hope you find a solution, maybe you could post some code when you get it working?

    George

Similar Threads

  1. Tilt/Vibration Sensor
    By Ioannis in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 20th June 2013, 14:38
  2. connecting a piezo topic
    By tommytechcity in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 25th September 2010, 03:15
  3. Amplifier for Piezo Speaker???
    By bhiggenson in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 31st May 2009, 20:51
  4. Volume Control On Piezo
    By Peter1960 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th August 2007, 04:34
  5. Piezo input
    By TonyA in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 17th April 2006, 09:10

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts