This project utilizes a small, common electret microphone to convert audio into an electrical signal. These inexpensive microphones are typically found in most PC headsets. The output from the microphone must be amplified and zeroed before it can be recorded with the MSP430 microcontroller. This amplification is achieved using an operational amplifier (op-amp), which boosts the weak, uncentered audio signal into a full-range signal centered around 0 volts. The accompanying diagram illustrates the original signal (blue) and the amplified full-range signal produced by the op-amp (red). For those unfamiliar with analog design, various tutorials on op-amps are available, including Wikipedia, a flash tutorial, and op-amp basics. The op-amp design utilized in this project is derived from Texas Instruments' digital audio recorder application note SLAa123 (page 3). The original design employs a TI TLV2252 dual op-amp; however, a single-channel TI TLV2221 op-amp was substituted for this project. The circuit values were taken from the TI application note, but a 2K/0.01µF low-pass audio filter was chosen for implementation. The TLV2221 is only available in a surface mount package, so for a through-hole version, a TLV2252-based design is recommended. The MSP430's on-chip analog-to-digital converter (ADC) will be used to measure the audio signal. The ADC pin measures analog voltages, and the readings are recorded as a fraction of a voltage reference (Vref). In this prototype, the voltage reference is set to 3.3 volts. The smallest measurable voltage change by the ADC is represented in bits; an 8-bit ADC measures voltage on a scale from 0 to 255. An ADC reading of 127 (127/255 = 50%) corresponds to approximately 1.65 volts (0.50 * 3.3 volt reference). The diagram illustrates the relationship between bits, voltage reference, and ADC measurements. The MSP430F2012 features a 10-bit (0-1024) ADC, while the F2013 model offers a higher-resolution 16-bit (0-65535) ADC, which could theoretically capture better audio quality. However, the prototype design is untested and may encounter issues. A significant limitation is that many ADCs, including the Microchip PIC, ATMEL AVRs, and even the MSP430F2012, can utilize the circuit power supply as the ADC voltage reference. An internal switch, controlled via software, determines the reference source. The intention was to use this feature to measure the op-amp output scaled to the 3.3 volts used in the circuit. However, the F2013 does not appear to have an internal Vref connection to the chip power supply; instead, it derives its internal Vref from a precision 1.2-volt reference. An external voltage reference can be connected through pin 5 (P1.3), which is currently connected to an LED. Future designs should consider this limitation and connect the F2013 Vref pin directly to the power supply. A workaround was implemented by removing the LED and soldering a fly-wire from the power pin to the Vref pin. An external Vref is utilized if SD16REFON and SD16VMIDON are both set to 0, as detailed on page 24-4 of the MSP430F2xxx Family User's Guide. However, this approach proved unsuccessful. After multiple attempts, the MSP430F2013 was damaged and subsequently replaced with an F2012 model. Although the F2012 has only 10 bits of ADC resolution, it can utilize the chip supply as a voltage reference. The example program samples audio from the microphone and immediately places it into the PWM duty cycle register, resulting in a "middle man" effect that echoes everything captured by the microphone. This project builds upon the firmware from a previous article, where a timer triggers an interrupt 8000 times per second. An ADC measurement is initiated each time the interrupt occurs. The ADC measurement does not yield immediate results, as it requires several cycles for the conversion to become readable. This delay is not a concern since the ADC will trigger its own interrupt once the measurement is complete.
The schematic for this project includes an electret microphone connected to the non-inverting input of the op-amp. The op-amp is configured as a non-inverting amplifier, with appropriate feedback and gain resistors selected based on the desired amplification level. The output of the op-amp is connected to the ADC input of the MSP430, ensuring that the signal is within the acceptable voltage range for the ADC. The low-pass filter is implemented between the op-amp output and the ADC input to eliminate high-frequency noise, enhancing the quality of the audio signal being sampled. The power supply connections for the op-amp and the MSP430 are established to ensure proper operation, with decoupling capacitors placed near the power pins to stabilize the voltage levels. Additionally, the schematic should reflect the necessary connections for the external voltage reference, ensuring that the F2013 can operate effectively with the chosen reference voltage. Proper grounding practices should be followed throughout the circuit to minimize noise and interference. Overall, the design aims to provide a reliable method for capturing audio signals using a low-cost electret microphone and processing them with the MSP430 microcontroller.This project uses a small, common electret microphone to convert audio to an electrical signal. These are the cheap microphones found in most PC headsets. The microphone output must be amplified and zeroed before it can be recorded with the MSP430. This is done with an operational amplifier, or op-amp. The op-amp amplifies the tiny, oddly centere d audio signal into a full range signal based on 0 volts. The diagram shows the original signal (blue) and the amplified, full range signal outputted by the op-amp (red). I`m not much of an analog designer, so may I refer you to any of these tutorials on op-amps if you need more info: wikipedia, a flash tutorial, opamp basics.
The op-amp design I used came directly from TI`s digital audio recorder application note slaa123 [pdf!] (page 3). TI`s design uses a TI TLV2252 dual op-amp. We only need one, so I substituted a single channel TI TLV2221 op-amp. I used the circuit and values from the TI app note, but substituted the 2K/. 01uf low-pass audio filter I chose in part II. The TLV2221 is only available in a surface mount package. If you want to do an all through-hole version of this project, consider a TLV2252 based design. We`ll use the MSP430`s on-chip analog-to-digital converter (ADC) to measure the audio signal. The ADC is a pin that measures analog voltages. Measurements taken by the ADC are recorded as a fraction of a voltage reference (Vref). In the prototype, the voltage reference will equal that of the circuit - 3. 3 volts. The smallest voltage change that can be measured by the ADC is denoted in bits. An 8 bit ADC measures voltage on a scale of 0 to 255. A reading of 127 (127/255=50%) from the ADC represents ~1. 65 volts (0. 50 * 3. 3 volt reference). The diagram shows the relationship between bits, voltage reference, and measurements taken by the ADC.
The MSP430F2012 has a 10 bit (0-1024) ADC, while the F2013 has a higher-resolution 16 bit (0-65535) ADC. The higher resolution ADC could, in theory, be used to capture better audio. The prototype design is unproven and bound to have problems. Here`s a big one! Most ADCs, including the Microchip PIC, ATMEL AVRs, and even the MSP430F2012, can use the circuit power supply as the ADC voltage reference.
An internal switch, manipulated from software, determines the reference source. I planned to use this feature to measure the op-amp output, which is scaled to the 3. 3 volts used in the circuit. The F2013, despite my assumptions, does not appear to have an internal Vref connection to the chip power supply. The F2013`s internal Vref comes from a precision 1. 2 volt reference. An external voltage reference can be sourced through pin 5 (P1. 3), where a LED currently connects. Future designs should take this limitation into account, and connect the F2013 Vref pin directly to the power supply.
My work-around was to remove the LED and solder a fly-wire from the power pin to the Vref pin. An external Vref is used if SD16REFON and SD16VMIDON are both cleared to 0, according to page 24-4 of the MSP430F2xxx Family User`s Guide [pdf!]. This didn`t work for me. Eventually, I messed around enough to destroy the MSP430. In desperate need of a break, I removed the dead MSP430F2013 and replaced it with a F2012. The F2012 has only 10 bits of ADC resolution, but is able to use the chip supply as a voltage reference.
The example program samples audio from the microphone and puts it immediately in the PWM duty cycle register. The result is a useless "middle man" that echoes everything heard by the microphone. This project is based on the firmware from my last article. A timer triggers an alarm (an interrupt) 8000 times per second. An ADC measurement is started each time the alarm sounds. The ADC measurement isn`t ready immediately - it takes a few cycles for the conversion to be readable.
We don`t need to worry about this period, because the ADC will trigger it`s own interrupt when the measu 🔗 External reference
This project is based on the parametric equalizer proposed by Elektor in the late 1980s or early 1990s and later published in the book "Creations Electroniques" in 1993 (Publisher: Publitronic). Their design involved three stereo potentiometers per channel, resulting...
C9 is necessary to filter out RF input interferences. R3 in combination with C5 is used to limit the AF frequency bandwidth. The 470-f.IF power supply decoupling capacitor is C10.
C9 serves a critical role in the circuit by acting...
USB flash drives offer a convenient method for storing various types of information in a compact form. Also referred to as thumb drives and USB keys, these drives are well-suited for applications in data loggers and other projects based...
This amplifier circuit is based on the IC TDA2612 produced by Siemens. The minimum voltage required for this circuit is 10 volts, while the maximum voltage is 35 volts DC. The power output is 25 watts with a 4-ohm...
Completed STK465 is an amplifier of acoustic frequencies that offers qualitative output, using minimal exterior elements. Substantially he is one of big completed force. Has a line pins and incorporated metal surface for adaptation in cooler. The provision pins...
Often, there is a need for an additional telephone ringer in an adjoining room to be alerted about incoming calls. For instance, if the telephone is situated in the drawing room, an extra ringer may be required in the...
We use cookies to enhance your experience, analyze traffic, and serve personalized ads.
By clicking "Accept", you agree to our use of cookies.
Learn more