When the volume of ambient sound reaches the set threshold, an interrupt is triggered.
The most important parts of the circuit are the microphone, an RMS-to-DC converter, two dual rail-to-rail Input/Output 10 MHz operational amplifiers, and a 12-bit digital-to-analog converter (DAC).
The 12-bit DAC provides the reference voltage — the noise threshold — for the comparator. You set the exact level through the SPI interface. The threshold should be configured through trial and error (4096 discrete values to select from).
Beside SPI, EN and OUT pins provide additional functionality.
The board works on a 3.3V power supply.
Type | Microphone |
Applications | Ambient sound monitoring for alarm systems and environmental monitoring |
On-board modules | MCP4921 12-bit DAC, Microphone, two dual rail-to-rail Input/Output 10 MHz operational amplifiers |
Key Features | Hysteresis circuitry for stable operation |
Key Benefits | Noise detection threshold |
Interface | GPIO,SPI |
Input Voltage | 3.3V |
Compatibility | mikroBUS |
Click board size | M (42.9 x 25.4 mm) |
Noise click is a mikroBUS™ add-on board with noise detecting circuitry. It enables you to set a noise detection threshold for alarm systems, environmental monitoring or data logging. When the volume of ambient sound reaches the set threshold, an interrupt is triggered.
One operational amplifier processes the microphone signal. The amplified voltage passes through the RMS-to-DC converter. The signal then goes into the second operational amplifier which functions as a voltage comparator (from which the interrupt signal originates).
To avoid triggering the interrupt hundreds of times per second as ambient noise oscillates near the threshold, a hysteresis circuit is also employed.
Alternatively, Noise click also enables you to directly monitor the voltage levels from the microphone through the AN pin.
The board works on a 3.3V power supply.
This snippet sets a threshold of 600 and begins displaying the ADC value from the Noise Click on the terminal. If the Interrupt pin is pulled high ( threshold exceeded ), then the terminal will say "Interrupt!!!!!".
1 #include <stdint.h> 2 #include "noise_hw.h" 3 4 sbit NOISE_CS at GPIOD_ODR.B13; 5 sbit NOISE_INT at GPIOD_IDR.B10; 6 7 void system_setup( void ); 8 9 void main() 10 { 11 //Local Decalartions 12 uint8_t buffer[20] = { 0 }; 13 uint32_t value = 0; 14 uint16_t threshold = 600; 15 16 //Setup 17 system_setup(); 18 19 noise_set_threshold( threshold ); 20 21 //Loop 22 while(1) 23 { 24 value = ADC1_Read( 4 ); 25 LongToStr( value, buffer ); 26 UART1_Write_Text( buffer ); 27 UART1_Write_Text( "rn" ); 28 Delay_ms(20); 29 if( NOISE_INT == 0 ); // Do nothing 30 else 31 UART1_Write_Text( "Interrupt!!!!!!rn" ); 32 } 33 34 }
Code examples that demonstrate the usage of Noise click with MikroElektronika hardware, written for mikroC for PIC, dsPIC/PIC24, PIC32, ARM, AVR, FT90x are available on Libstock.