Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: A question for smart people - Vibration sensor closes transistor for a period of time

  1. #1
    Junior Member
    Join Date
    Jan 2016
    Posts
    16

    A question for smart people - Vibration sensor closes transistor for a period of time

    I want to make a circuit that does not include a teensy, despite my drive to include a teensy in everything even when its not called for. The goal is that when a vibration sensor closes (when it is moved, it closes its contacts), it triggers a transistor for a period of time (I'd like it to remain closed for an hour or two, preferably two), then it opens again until triggered by the vibration sensor again.

    The point of this is it is an auto-shutoff, in case someone forgets to turn off whatever the transistor is in line with while that device is not in use (not being handled).

    I was hoping something simple like a 555 timer (I know nothing of them but I don't think that'd do it, just an example of what kind of simple I am looking for) could do the trick. A microcontroller would be fine, but I suspect the power usage would be higher than I'd like for most projects which will be in the 3-6mA range at 4.5v-3v. I have some wiggle room for how I power things, but I'd like the option of both without adding in a lot of components for a voltage regulator. Right now, everything I have in mind would run on either 3AAA or a CR2032.

    Cheap and compact is my main goal.. This will all be dead-bugged or on a bit of project board. I'm not at the custom-pcb level yet.

    Since this is my favorite forum for people who know way more than I do about these sorts of things I thought I might as well ask here.

  2. #2
    Senior Member
    Join Date
    May 2017
    Posts
    208
    A PIC 12F series would do what you wish. With 6 I/O pins, you would have 4 spares that could be used with jumpers to select one of 16 delay times.
    The LF parts are very low power, as low as 30 mico amps per Mhz clock speed. A battery self discharge rate is probably higher.

    https://www.microchip.com/ParamChart...?branchID=1001

  3. #3
    Junior Member
    Join Date
    Jan 2016
    Posts
    16
    rcarr, thanks for that fast response!

    That sounds like it is really the best solution. Reading up on them, I think I get why some people are so strongly driven toward using PICs for everything. I don't have a programmer for them, and have never worked with them, so its a bit of a rabbit hole to accomplish something so simple right now. But, like I said, it looks like the best solution, so I'm going to start picking at learning a bit more about PICs and see if I can't slam together a programmer with what I have on hand already (ATmega328 based boards, a handful of various Teensy boards, an FTDI and a basic ST-link programmer).
    Last edited by usererror; 05-16-2019 at 12:33 AM. Reason: left out the "start" in "start picking at"

  4. #4
    Senior Member pictographer's Avatar
    Join Date
    May 2013
    Location
    San Jose, CA
    Posts
    664
    Since you mentioned a 555, it's pretty easy to add some resistors and capacitors to make a timer. Check out monostable mode.

    http://www.555-timer-circuits.com/operating-modes.html

    You can also find packages with multiple 555 timers if you want to do something slightly more complicated. No programmer needed.

    555 ICs are generally inferior to microcontrollers. You can even get microcontrollers cheaper, but there's one thing they're still useful for: wider voltage range.

  5. #5
    Senior Member
    Join Date
    May 2017
    Posts
    208
    50% off on a Pickit3 currently until the end of the month. That puts the cost in what I consider the pocket change range.
    https://www.microchipdirect.com/prod...h/all/PG164130

  6. #6
    Junior Member blittled's Avatar
    Join Date
    Sep 2017
    Location
    Northwestern PA
    Posts
    10
    I just googled for a 555 vibration circuit and found https://www.electroschematics.com/60...ensor-circuit/ . It uses a M74HC123 Monostable Multivibrator which is similar to the 555 and uses a piezo element for sensing vibrations. I haven't tried the circuit nor do I know if it can handle durations that you require.

Posting Permissions

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