Connect with us

Modify circuit to add switch and timer

Discussion in 'General Electronics Discussion' started by 3DPiper, Dec 10, 2014.

Scroll to continue with content
  1. 3DPiper

    3DPiper

    2
    0
    Dec 10, 2014
    I am working on a project where I need a very loud beep when a switch is pressed. The beep only needs to last for a short time, like half a second, even if the switch is still held. Once the switch is released, everything is reset and ready to beep again.

    I found a simple battery operated door/window alarm that may very well suit my needs if I can modify it. See here:

    http://www.dollartree.com/Window-and-Door-Alarm-System/p184790/index.pro

    Once you turn the unit on, if the magnetic sensor is pulled away from the main unit an alarm is sounded until the magnetic sensor is returned to the main unit.

    I need to modify this in this way:

    - instead of a magnetic switch I have a mechanical switch that activates the alarm when pressed
    - the alarm stops after a half second even if the switch is still pressed
    - when the switch is released the system resets and the alarm is ready to beep again

    Possible? I can post pics of the circuit board if needed.
     
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    11,662
    2,697
    Nov 17, 2011
    Welcome to electronicspoint.


    No problem, any switch can be used. I'd expect the switch of the "normaly closed type", meaning it opens when activated. A typical bushbutton would be "normally open", therefore you'll have to look specifically for a normally closed pushbuton, or a "changeover type" pushbutton where yo'd use the normally open closed contact.

    Use a 555 monoflop (Google for circuits) to set the duration of the sound.

    THis is achieved by a capacitor in the connection from pushbutton to trigger input.

    Here is a basic circuit . You need to modify the timing components R3, R4 and C3 to match your timing requirements. Use any of the 555 online calculator tools.
     
  3. Harald Kapp

    Harald Kapp Moderator Moderator

    11,662
    2,697
    Nov 17, 2011
    O.K., sorry, I need to elaborate a bit more:

    With the circuit I linked you can use a standard pushbuton (normally open) from the trigger-input to ground (0V).
    You will need the output of the timer IC to control the input to the alarm circuit. An easy way (without caring about the circuitry of the alarm box) would be to use a relay where the coil is connectd to the output of the timer and a contact is used instead of the magnetic switch.

    Do you think you'll be able to cobble up the circuit yourself? Or do you need more details?
     
  4. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    Harald,

    That circuit might be confusing to a beginner since, though it does use a 555 as a monostable, it is using it as a frequency meter, which is not what the OP is trying to do.

    Here is a link to a better tutorial of the 555 including monostable mode.

    http://www.electronics-tutorials.ws/waveforms/555_timer.html

    Bob
     
  5. Colin Mitchell

    Colin Mitchell

    1,416
    313
    Aug 31, 2014
    You just need a couple of electrolytics and a few resistors.
     
  6. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Colin, this post helps no one at all. Please don't waste space and time posting useless comments like this.
     
  7. Colin Mitchell

    Colin Mitchell

    1,416
    313
    Aug 31, 2014
    Colin, this post helps no one at all. Please don't waste space and time posting useless comments like this.

    I want the OP to get back and place a comment. So many times I answer these forums and the OP never bothers to get back.
     
  8. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    That's a valid complaint but posting a useless response isn't going to help. The OP only gets notified of the first response on his thread after each time he visits the site.

    If you really must, you could post a teaser, outlining the basics of your suggestion, and asking the OP to come back and tell us more. But if he hasn't been following the thread, he won't be notified of your post. So I don't normally do that.
     
  9. 3DPiper

    3DPiper

    2
    0
    Dec 10, 2014
    Thanks for the help guys!
    I understand both links' circuits, they both look simple enough to prototype.

    Let me explain my project to make sure I'm on the right path. I teach a small band and I'm working on marching in step. I want to place a device on each left shoe so when we all step together a collective 'beep' is heard. If someone is out of step it should be obvious!

    I only chose the window/door alarm above because I can get he whole package for $1 (housing, speaker, batteries, etc).. I thought it would be a good start point. It looks like I can replace the circuit completely and put in the 555ic, correct?
     
  10. Colin Mitchell

    Colin Mitchell

    1,416
    313
    Aug 31, 2014
    The $1.00 alarm is not suitable for your application. It produces a beeping alarm
     
  11. Harald Kapp

    Harald Kapp Moderator Moderator

    11,662
    2,697
    Nov 17, 2011
    Here is an almost complete schematic:
    [​IMG]

    • V1 is the battery, I assumed a 9V block. 4*AA(A) cells or 2*2032 lithium coin cells in series should also work and the latter take up less space.
    • U1 is the timer IC (555), set up as a one-shot with ~500ms duration.
    • Q1 is a driver for the buzzer. The buzzer is represented here by Rbuzzer (there is no buzzer in LTSPICE). Instead of Rbuzzer use e.g. a self-oscillating, DC-operated piezo buzzer.
    • S1 is a model for the contact/switch on the shoe. It is meant to be closed when the foot is set on ground, open when the foot is in the air. V2 is used to model the marching of the band by giving a pulse every second. In your project you will not have V2. This is for modeling the circuit only.
    • R2 and C2 define the timing (duration) of the one-shot. Note that C2 should probably be a small electrolytic capacitor (observe polarity!). But you can even buy ceramic SMD chip capacitors with 10µF which may be more handy due to smaller size.
    • R3, R4 and C3 are used to differentiate the signal from the switch. This means instead of a constant on/off signal the trigger input (pin 2) of the timer IC sees only a short pulse ebery time the switch S1 is opened or closed.

    Regards,
    Harald
     

    Attached Files:

  12. Colin Mitchell

    Colin Mitchell

    1,416
    313
    Aug 31, 2014
    What is the point of C1, C4, R1 and Q1 ???

    You will find this circuit is unsuitable as it only works when the foot is placed on the ground.
    It needs to work when the foot is lifted.
     
    Last edited: Dec 12, 2014
  13. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    C1 decouples the "CV" pin to ground. This is recommended, especially when the 555 is used as a monstable, because it's an inherently noisy device and prone to false triggering. The CV pin is the top tap on a three-resistor voltage divider that sets the threshold voltages for the trigger and threshold comparators.

    C4 decouples the whole 555. This is recommended for every configuration because the 555 generates sharp current spikes on its VCC pin during output switching and needs a stable local reservoir for reliable operation.

    Both of those capacitors are less important if a modern version of the 555 is used because they don't suffer from these noise problems.

    R1 and Q1 provide a saturated switch (see https://www.electronicspoint.com/resources/using-a-bipolar-transistor-to-turn-a-load-on-and-off.30/ and https://www.electronicspoint.com/resources/saturation-in-transistors-bjts-why-and-how.28/) to ensure that the buzzer receives nearly all of the power supply voltage when activated. A low-current load like a beeper could be driven directly from the 555 because its outputs are specified to sink and source up to 200 mA directly, but the 555 monostable produces a high-going pulse, so the beeper would need to be connected from its output to the 0V rail, and its output is a totem pole type using NPNs and it does not pull close to VCC if loaded; a voltage drop of 1.5V or more is common (again, this generally applies to the original 555).
    What makes you think that? I would have thought that the timing of the foot coming down on the ground would be more important for a co-ordinated group.

    There is one potential problem with that design though. Depending on the design of the switch, it's possible that the switch will produce contact bounce when it is released, as well as when it is activated. Bounce when it's activated isn't a problem (as long as it's shorter than the monostable period), but bounce when it's released will retrigger the monostable. So if the circuit always or sometimes produces a beep when the foot is lifted, as well as when it is put down, that is the reason. This can be fixed with some debouncing circuitry.

    Edit: I think an acceleration detector (used to detect sudden deceleration) would be a much better way to detect the foot coming down. And I don't think a beep is the best annunciation either. Small differences in timing would be more detectable if you used a pitch sweep; the early or late activation would stand out during the whole half-second chorus of sounds, instead of just at the start and/or end.
     
    Harald Kapp likes this.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-