Electronic – Buzzer alarm problem

555digital-logicpiezo-buzzer

I've got an assignment to make some kind of alarm. When user presses the push button, 1kHz sound should be generated and outputted on some kind of speaker (I'll use buzzer).

That part I know how to make. I can use NE 555 to make astable to generate 1kHz output. But other part of the assignment is the problem. Is says that duty cycle should change from 50% to 0% while user is holding the push button … I don't even have an idea what to try …

EDIT: Duty cycle should decay from 50% to 0%.

Best Answer

Is the duty cycle supposed to switch from 50% to 0%, or decay from 50% to 0%? Is there any particular precision required on the 50%? Is there any requirement regarding quiescent current?

I would suggest that you start by using a 555 or similar chip to generate a symmetrical sawtooth-ish (doesn't have to have straight sides) wave, and then feed that into one side of a comparator. The other side of the comparator should be connected to a circuit which will generate a voltage that will start at half-rail when the button is first pushed, but will either rise toward VDD or fall toward ground after that. If you can use a SPDT pushbutton, a simple realization of such a circuit would be to connect the center pole of the button to a cap whose other leg is ground. Connect the normally-closed contact to VDD, and the normally-open contact to the comparator input. Connect a resistor from that comparator input to ground.

Conceptually, it would be nice if a single active device could be used to provide the output, without needing the separate comparator. It's possible for the 555 to provide an output whose duty cycle will be affected by an input voltage. Unfortunately, the frequency will also be affected by the input voltage; I'm not sure of any easy way to make a compensated circuit such that the decrease in high time will be balanced by an increase in the low time so as to yield a reasonably-constant frequency (as opposed to having a device generate a 1Khz reference signal which is then shaped by a second active device). A two-chip circuit doesn't seem unreasonable, though.

Here's a simple circuit which will illustrate the concept. For simulation purposes, it uses an op amp, but a comparator would work just as well. One slight note: many comparators ground the output when the + input is higher than the - input, so the polarity would be opposite that of an op amp.