ELECTRONIC WHISTLE SENSOR WITH MICROCONTROLLER

20170193764 ยท 2017-07-06

    Inventors

    Cpc classification

    International classification

    Abstract

    An improved implementation of the electronic whistle sensor provides more accuracy in determining if the whistle has sounded, utilizes a ubiquitous sensor, and enables versatility in the signaling device.

    Claims

    1. A system that comprises: a whistle that produces a sound; a battery; a battery charger sub-circuit; a digital MEMS based accelerometer; a microcontroller; wherein said system is configured such that: the battery charger sub-circuit charges the battery when the whistle is connected to a voltage source; and the microcontroller and the accelerometer communicate via a serial connection; and the microcontroller uses data produced by the accelerometer to determine whether or not the whistle is producing a sound.

    2. A system as in claim 1 wherein said system is further configured such that the microcontroller can be put in a battery conserving, low power state.

    3. A system as in claim 2 wherein said system is further configured such that the microcontroller can be awakened from said low power state via an interrupt from the accelerometer.

    4. A system as in claim 1 wherein said system further comprises one or more lights; wherein said system is further configured such that the microcontroller causes the lights to begin emitting a visual signal when the microcontroller determines that the whistle is generating a sound.

    5. A system as in claim 4 wherein said visual signal is one or more distinct pulses of light.

    6. A system as in claim 1 wherein said system further comprises an RF transmission subsystem; wherein said system is further configured such that the microcontroller causes the RF transmission subsystem to send a signal when the microcontroller determines that the whistle is generating a sound.

    7. A system as in claim 1 that further comprises an external port; wherein said system is further configured to detect the charging of the battery when a voltage is detected on the external port and the battery is being charged via the external port.

    8. A system as in claim 7 that further comprises one or more lights; wherein said system is further configured to provide a visual indication via said lights when the battery has finished charging.

    9. A system as in claim 1 that further comprises an external connection; wherein said system is further configured to communicate with an external system via the external connection.

    10. A system as in claim 9 that further comprises one or more lights; wherein said system is further configured such that when a TEST command is received via the external connection, the system executes a self-test, and upon successful completion of said self-test provides a visual indication via the lights.

    11. A system as in claim 9 that is further configured such that when a TEST command is received via the external connection, the system executes a self-test, and upon successful completion of said self-test, sends a signal via the external connection.

    Description

    BRIEF DESCRIPTION OF THE DRAWINGS

    [0025] FIG. 1 is a block diagram showing the accelerometer, PIC, and signaling device connections.

    [0026] FIG. 2 is a block diagram of the system showing the test mode and charge detect features.

    [0027] FIG. 3 is a typical accelerometer FIFO dataset when a whistle is sounding.

    [0028] FIG. 4 is a typical accelerometer FIFO dataset due to whistle shock.

    [0029] FIG. 5 is a system timing diagram.

    DETAILED DESCRIPTION

    [0030] Here we describe the connections between the main elements.

    [0031] The accelerometer in the block diagram circuit of FIG. 1, attached to whistle 100, records vibrations.

    [0032] A common accelerometer, the LIS2DH12 from ST Microelectronics, contains a 32 byte FIFO buffer that holds the sampled digitized accelerometer values. The fastest sample rate of 5.376 kHz is chosen to capture the whistle vibration of an industry standard FOX 40 whistle which is in the vicinity of 3.5 kHz. Even though for each vibration cycle there are only approximately 1.5 samples (5.376 kHz/3.5 kHz=1.54), this sample rate suffices for identifying the whistle using a time based method.

    [0033] When a vibration is of great enough amplitude, the accelerometer sends an interrupt on the INT line to the PIC on one of the PIC external 10 ports shown as P.sub.INT. The PIC microcode in turn services the interrupt signal and determines whether the interrupt was due to the whistle sounding. Here, communication between the PIC and the accelerometer is over a standard bidirectional serial interface such as I.sup.2C (Inter-Integrated Circuit), which requires 2 wires, or SPI (Serial Peripheral Interface), which requires 3 or 4 wires, shown as P.sub.SER. The interrupt source determination is made by employing a short delay; after which the PIC issues a command to the accelerometer to collect 32 samples in the accelerometer FIFO. Once the FIFO has filled with data, the data is analyzed. By identifying local maximum and minimum, the magnitude of each transition can be calculated by subtracting the minimum from the maximum. The sequential difference in samples is also calculated along with the magnitude to determine if the local maximum and minimum are close together. If the magnitude is greater than a threshold, and the samples are close together, then that transition is counted. If there are enough of these transitions, then the sample set is determined to be associated with a whistle sound. If not, it is discarded. If the data is determined to be associated with a whistle sound, the microcode instructs the PIC to activate a signaling device.

    [0034] A dataset example is shown in FIG. 3. Here, the sample set is recorded 50 ms after the interrupt has been generated. If a local maximum minus a local minimum is greater than 32, and closer than 3 samples apart, then that transition is counted. If the number of transitions is greater than 7, it is determined to be caused by a whistle sound. In FIG. 3, there are 22 transitions. Each transition is shown by a number in the figure.

    [0035] FIG. 4 shows a decaying waveform caused by shock, and only two transitions numbered 1 and 2, meet the criteria to count. This dataset would be discarded and no signaling event would occur.

    [0036] Ideally, the dataset would be analyzed using a form of digital signal processing such as a DFT (Discrete Fourier Transform) which requires a sample rate that is greater than twice the frequency of interest. Since the accelerometer sample rate in this embodiment is less than twice the frequency of the whistle vibration, the DFT contains distortion and the signal cannot be identified. A sample rate of 8 kHz is needed to decipher the 3 kHz to 4 kHz signal produced by the whistle vibration.

    [0037] In the case of an LED signaling device, a timed signal can be generated by the PIC microcode. For example, as shown in FIG. 5, the FIFO begins to fill with samples 50 ms after the interrupt is generated due to the start of a whistle vibration. After processing the dataset and determining that the dataset corresponded to a whistle sound, an LED signal consisting of a group of short duration ON pulses followed by a longer ON pulse is generated. In this embodiment, the short pulses have a 50 ms period with a 50% duty cycle, and the long pulse is 1 second in duration. The interrupt is cleared after the signaling is complete.

    [0038] Additional features shown in FIG. 2 depict a TM (test mode) and a charge detect circuit attached to two USB ports. The Test Mode is implemented with the pullup resistor R1 connected to a port on the PIC, P.sub.TM, integral to the circuit attached to the whistle. An external pushbutton switch, 200, serves to short the P.sub.TM port to ground when pushed. P.sub.TM is configured as an interrupt input by the microcode so that when there is a falling edge on P.sub.TM, it is interpreted as Test Mode. Once Test Mode has been determined, the PIC sends a command to the accelerometer that places the accelerometer in test mode. A handshake between the PIC and accelerometer over the serial interface indicates whether the accelerometer is functioning properly or not. If it is functioning properly, the PIC signals this by driving the signaling device ON while the push button is active. Alternatively to pushbutton switch 200, The TM input can be controlled by any external automated test hardware configuration.

    [0039] A charge detect function is implemented with on-board resistors R2 and R3. These two resistors serve to scale down the battery charger adapter voltage, 300, to be compatible with the PIC supply voltage when the adapter is attached to the system to charge battery, 400. In this embodiment, the 5V DC adapter voltage, 300, is scaled down to 2.8V. The scaled down adapter voltage is connected to the port P.sub.CDET on the PIC which is configured as an interrupt. When the adapter is removed, the voltage on port P.sub.CDET falls and triggers an interrupt which signifies that charging has ended. To provide a signal to the user that the electronic whistle sensor is alive and well, the interrupt service routine sends a signal to the signaling device. For example, if the signaling device consists of one or more LEDs, the LEDs will blink on and off twice. At this time, the accelerometer is re-initialized as well.