ELECTRONIC WHISTLE SENSOR WITH MICROCONTROLLER
20170193764 ยท 2017-07-06
Inventors
Cpc classification
G08B7/06
PHYSICS
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]
[0026]
[0027]
[0028]
[0029]
DETAILED DESCRIPTION
[0030] Here we describe the connections between the main elements.
[0031] The accelerometer in the block diagram circuit of
[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
[0035]
[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
[0038] Additional features shown in
[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.