[0001] The present invention relates to a method for driving an acoustic signalling device
according to the preamble of claim 1.
[0002] The invention also relates to a system capable of implementing such a driving method.
[0003] The invention is especially and preferably applicable to the field of household appliances,
wherein an acoustic signalling device, e.g. a buzzer, is turned on at the end of a
working cycle.
[0004] It is known, in fact, that a washing machine may activate an acoustic device in order
to inform the user that the wash cycle has been completed; it is also known that freezers
are available which carry out intensive cooling cycles (e.g. for cooling drinks quickly)
and warn the user when said cycle has ended in order to prevent the drinks from freezing.
[0005] In known household appliances, the acoustic signalling device employed is typically
a buzzer driven by a microcontroller through a PWM output, e.g. a 4kHz timer with
a 50% duty cycle.
[0006] It may however happen in some situations that the microcontroller has to drive a
large number of devices, so that there are no PWM outputs available for driving additional
acoustic devices or buzzers.
[0007] The present invention aims at providing an alternative method for driving a signalling
device, in particular an acoustic signalling device, which requires an alternating
input voltage, such as a buzzer.
[0008] This object is achieved through a method and a system incorporating the features
set out in the appended claims, which are intended as an integral part of the present
description.
[0009] The present invention is based on the idea of driving the signalling device through
a serial output of the microcontroller, e.g. an SPI (Serial Peripheral Interface)
output or a UART (Universal Asynchronous Receiver/Transmitter) output.
[0010] By adjusting the baud rate and pattern of the serial output, in fact, the microcontroller
can generate a periodic signal having a predetermined frequency and duty cycle.
[0011] By appropriately selecting the pattern and baud rate of the serial output, the microcontroller
thus generates a periodic signal which can control the signalling device.
[0012] It is therefore apparent that the proposed solution allows to drive a signalling
device even if all of the microcontroller's PWM outputs are already in use.
[0013] Further objects and advantages of the present invention will become more apparent
from the following description of a preferred embodiment thereof, which is supplied
by way of nonlimiting example with reference to the annexed drawings, wherein:
Fig. 1 shows a drive system according to the present invention;
Figs. 2a-2c show a drive signal used by the system of Fig. 1;
Fig. 3 shows a drive system according to a second embodiment of the present invention;
Fig. 1 shows the system that allows to drive a buzzer 1, e.g. a piezoelectric buzzer
available, for example, from manufacturer Murata.
[0014] Buzzer 1 is an acoustic signalling device that emits a sound when it receives an
alternating voltage having an appropriate frequency, in particular within the audible
band. In general, therefore, the system of Fig. 1 and the driving method described
below can be used with any other acoustic signalling device emitting an acoustic signal
in response to an alternating voltage signal.
[0015] Buzzer 1 has a pair of terminals 10 and 11 respectively connected to the 12V direct
voltage Vcc and to the collector of BJT transistor 2 in grounded emitter configuration.
[0016] Transistor 2 operates as a switch: when conductive, transistor 2 grounds terminal
11 of buzzer 1, so that across the buzzer terminals there is a voltage drop equal
to Vcc; vice versa, when transistor 2 is not conductive terminal 11 receives Vcc,
so that there is no voltage drop across the buzzer.
[0017] A resistor 3 arranged in parallel with buzzer 1 is used for locking terminal 11 to
Vcc when the transistor is interdicted, i.e. when it is not conductive. Resistor 3
is also used for discharging any charge accumulated into the buzzer, which typically
behaves like a capacitor.
[0018] For turning on the buzzer, microcontroller 4 is equipped with a serial interface
through which it sends a drive signal over serial output 41 (e.g. a UART output),
which then arrives at the base of transistor 2.
[0019] The drive signal present at serial output 41 (shown by way of example in Fig. 2a)
consists of N bits set to the high logic value (e.g. 5V) and M bits set to the low
logic value (e.g. 0V).
[0020] Therefore, the drive signal depends on the transmission protocol and on the data
sent through the serial interface.
[0021] In the examples of Figs. 2a-2c, the transmission protocol includes one start bit,
8 data bits and one stop bit; there is no parity bit.
[0022] Fig. 2a shows the signal generated by a UART peripheral for transmitting the data
0x55.
[0023] Normally, i.e. when not activated, UART peripheral outputs a high signal.
[0024] At time to the drive signal transmission is initiated with a start bit having a low
logic value.
[0025] The subsequent eight bits contain the data 0x55, consisting of an alternate sequence
of high and low bits.
[0026] The signal ends with a stop bit having a high logic value.
[0027] The signal thus generated has a duration T.
[0028] The choice of this particular transmission protocol and of the data 0x55 makes signal
2a a periodic signal with a period P equal to the duration of two bits and a 50% duty
cycle.
[0029] By acting upon the baud rate, it is therefore possible to define the duration of
period P and set the drive signal frequency in a manner such that the acoustic signalling
device can be driven appropriately.
[0030] After one data instance has been transmitted, UART peripheral will tend to hold output
41 in high state, as shown in Fig. 2a.
[0031] Microcontroller 4 is therefore programmed in a manner such that, as soon as the transmission
of one data instance has ended, another data instance is then immediately transmitted,
as shown in Fig. 2b.
[0032] The transmission of the new data instance is ensured by setting an interrupt when
the buffer containing the data to be sent becomes empty, so as to reload the data
automatically.
[0033] This solution ensures that the drive signal transmitted by the serial peripheral
has a periodicity at least equal to duration T required for transmitting one data
instance.
[0034] Fig. 2c shows a drive signal obtained by transmitting the data 0xFF.
[0035] In this case, a periodic drive signal is obtained only by programming the microprocessor
in a manner such that the data instance 0xFF is continuously retransmitted.
[0036] As can be seen in Fig. 2c, the drive signal has a period P equal to time T required
for transmitting one data instance according to the selected transmission protocol.
[0037] The baud rate (i.e. bit duration) being equal, the signal of Fig. 2c has a lower
frequency than that of Fig. 2b, but its duty cycle is much greater.
[0038] By modifying the transmission protocol, the duration of the single bits and the data
to be sent over the serial line, it is thus possible to obtain a periodic signal having
a predetermined frequency and duty cycle.
[0039] These characteristics of the drive signal then determine the frequency and duty cycle
of the voltage signal applied to the buzzer.
[0040] When the drive signal has a high logic value, transistor 2 becomes conductive and
a 12V voltage is applied across buzzer 1.
[0041] When the drive signal has a low logic value, transistor 2 is interdicted and a 0V
voltage is applied across buzzer 1.
[0042] The voltage applied across terminals 10 and 11 of buzzer 1 is therefore an alternating
voltage with a predetermined frequency and duty cycle, which can cause the buzzer
to buzz.
[0043] Fig. 3 shows a possible variant of the drive system of Fig. 1, which may be used
to advantage when no serial output is available for exclusively driving the buzzer.
This variant is based on the idea of using the serial line that drives the buzzer
also as a line for communicating with the outside world, which is its natural function.
[0044] According to this variant, the drive circuit comprises a communication module 5 which
allows the signal available at the microcontroller's serial output 41 to be transmitted
alternately over two different lines: the first line (hereafter referred to as "drive
line") is intended for driving the buzzer, whereas the second line (hereafter referred
to as "serial line") is intended for serial communications.
[0045] The switching between the serial line and the drive line is controlled by the microcontroller
through output 42.
[0046] Switching module 5 can be manufactured by using a single integrated circuit having
two inputs 51 and 52 and two outputs 53 and 54.
[0047] In the example of Fig. 3, the switch comprises two NAND ports and two inverters.
[0048] Input 51 that receives the signal from serial output 41 of microcontroller 4 is negated
by means of a first inverter 55, and the signal thus negated is inputted to NAND port
56, whose output is connected to the serial line, and to NAND port 57, whose output
is connected to the buzzer through transistor 2.
[0049] The switch control signal is sent from output 42 of the microcontroller and received
by input 52 of the switch.
[0050] The control signal is thus inputted to NAND port 56, negated by inverter 58, and
then inputted, thus negated, to NAND port 57.
[0051] If the control signal is high, then the signal outputted by serial output 42 will
be carried over the serial line, while a constantly high signal will be present on
the drive line.
[0052] By holding output 42 high, de facto the microcontroller allows serial output 41 to
be used for serial communications with other devices connected to the serial line.
[0053] On the contrary, when microcontroller 4 holds the control signal low, then there
will be a constantly high signal at serial output 41, and the signal present at microcontroller's
serial output 41 will be found on the drive line.
[0054] By holding output 42 low, the microcontroller utilizes serial output 41 for generating
a drive signal, as explained above with reference to Figs. 2a-2c, which signal drives
switch 2 in order to turn on buzzer 1.
[0055] It is clear that many changes may be made to the driving method described above by
those skilled in the art; in particular, transistor 2 may be replaced with any other
device or system capable of performing the described switch function, which is required
for applying an alternating voltage to the acoustic signalling device.
[0056] It is also apparent that, although the above-described circuit is made up of only
a few elements in order to limit production costs, several additional measures may
however be employed, such as, for example, using an optoisolator for transferring
the signal from the serial output of the microcontroller to the base of transistor
2 or of any other driven switch.
[0057] It is also conceivable to use devices for protection against electrostatic charges
at the input of transistor 2, or filters at the output thereof (e.g. a capacitor connected
across the collector and the ground) in order to suppress any noise which may affect
the voltage drop applied to the acoustic signalling device.
[0058] Furthermore, it should be pointed out that the variant shown in Fig. 3 may comprise
an additional inverter, arranged between output 54 of NAND port 57 and transistor
2.
[0059] Finally, it is apparent that the drive system described above with particular reference
to an acoustic signalling device may also be used for driving any other signalling
device, such as an optical signalling device, e.g. a LED.
1. Method for driving a signalling device, in particular an acoustic signalling device,
wherein an alternating voltage is applied to the signalling device in order to activate
it,
characterized in that
a microcontroller transmits a drive signal through a serial interface, and
a switch connecting said device to a direct supply voltage opens and closes in response
to said drive signal.
2. Method according to claim 1, wherein said drive signal is a periodic signal.
3. Method according to claim 2, wherein said drive signal has a predetermined frequency
and duty cycle suitable for activating said signalling device.
4. Method according to claim 1 or 2 or 3, wherein said drive signal comprises one start
bit, a plurality of bits representing a data to be transmitted, and one stop bit.
5. Method according to claim 4, wherein the duration of one bit is set.
6. Method according to claim 4 or 5, wherein the data to be transmitted is changed in
order to change the duty cycle of the drive signal.
7. Method according to one or more of the preceding claims, wherein said switch is a
transistor controlled by said drive signal.
8. Method according to one or more of the preceding claims, wherein said serial interface
is a UART (Universal Asynchronous Receiver/Transmitter) interface.
9. Method according to one or more of the preceding claims, wherein said serial interface
is an SPI (Serial Peripheral interface) interface.
10. Method according to one or more of the preceding claims, wherein said signalling device
is a buzzer (1).
11. Method according to any of the preceding claims, wherein the output (41) of said serial
interface is switched between a serial line and a drive line, said drive line being
adapted to transport said drive signal to said switch (2).
12. System for driving a signalling device, comprising a microcontroller and a switch
adapted to implement the method according to any of claims 1 to 11.
13. System according to claim 12, wherein said switch comprises a transistor in grounded
emitter configuration, wherein said signalling device is connected in series to the
collector of said transistor, and wherein said transistor is connected to said microcontroller
in a manner such that said drive signal can make said transistor become conductive
or interdicted.
14. System according any of claim 12 or 13, further comprising a switching module (5)
connected between said microcontroller (4) and said switch (2), said switching module
being adapted to transmit the signal present at the serial output (41) of the microcontroller
(4) alternately over two lines, one of said two lines being connected to said switch
(2).
15. System according to claim 14, wherein said switching module (5) comprises
a first inverter (55) adapted to negate the signal present at the serial output (41)
of the microcontroller (4),
an input for receiving a control signal from said microcontroller (4),
a pair of NAND ports (55, 57) having an input connected to said first inverter (55)
and an output connected to one of said two lines, a first one of said two NAND ports
(56) having an input connected to said first input, and a second one of said two NAND
ports (57) having an input connected to said first input through a second inverter
(58).