Skip to main content
15 votes
Accepted

Want to create bluetooth audio control (volume up/down, play, pause, etc.) for smartphone

Bluetooth supports multiple protocols for multiple purposes. There is low latency low quality monorail bi-directional communication with a little bit of bandwidth for control for Bluetooth phone ...
st2000's user avatar
  • 7,325
5 votes
Accepted

What is the best way to get more RAM for a sound buffer?

A simple SPI SRAM chip. Available up to 128KB, such as the 23LC1024: http://www.microchip.com/wwwproducts/en/23LC1024
Majenko's user avatar
  • 105k
5 votes
Accepted

Is it possible to start audio playback when headphones gets plugged in?

A lot of 3.5mm jacks come with built-in normally-closed contacts, and their state can be tested through the pins of the jack with a multimeter or sensed by your MCU like any other switch. There are ...
SoreDakeNoKoto's user avatar
5 votes

Transistor amplifier to drive speaker using Arduino PWM

Your amplifier arrangement is fundamentally flawed. At the moment you are "tickling" the top end of the electromagnet in the speaker - that is, you are energising it when the Arduino outputs a HIGH, ...
Majenko's user avatar
  • 105k
5 votes
Accepted

Writing "theremin" outputs to a MIDI file on an SD card

The short answer would be "yes, it is possible". There are lots of gadgets around that record MIDI. They would have microprocessors in them, and they would have something like an SD card, ...
Nick Gammon's user avatar
  • 38.2k
4 votes
Accepted

How to connect Arduino to headphone jack?

This project connects the headphones directly to a digital pin. Here is the schematic: I would, however, be more cautious and add a limiting resistor. The output of an Arduino pin should be limited ...
st2000's user avatar
  • 7,325
4 votes
Accepted

Audio sampling and serial communication

You calculation of the data rate is wrong: Serial.println() adds CRLF (i.e. "\r\n") to terminate the line, That's 2 bytes, not one. Each byte is sent by the serial port as one start bit, followed by ...
Edgar Bonet's user avatar
  • 43.1k
4 votes

Applause reactivity

Not really an applause detector, but I have written a sound meter program you could use as a starting point for your own project. It is available here: Arduino sound meter. It works as follows: the ...
Edgar Bonet's user avatar
  • 43.1k
4 votes
Accepted

Streaming audio from PC to Arduino over WiFi

Well, a sort of... You can stream 64kbps MP3, get it via wifi from esp8266. Then for all the rest, forget the Arduino. You need a dedicated MP3 decoder chip (many out there, sta013 was one of the ...
Gee Bee's user avatar
  • 771
4 votes

Want to create bluetooth audio control (volume up/down, play, pause, etc.) for smartphone

I can add something to @st2000's excellent answer (in a better format than our discussion in the comments there). The original question is vague. Does Bluetooth mean Classic or is Low Energy (BLE) ...
jimhark's user avatar
  • 141
4 votes

DAC to play audio samples

One sample takes 38 I2C clock cycles to write. That's: 1 START 7 Address 1 R/W 1 ACK 8 Byte 1 ACK 8 Byte 1 ACK 8 Byte 1 ACK 1 STOP At the default 100kHz clock speed that's 100,000/38 = 2631.58 ...
Majenko's user avatar
  • 105k
4 votes

I want to stream audio from an Arduino to a device on the wifi

An Arduino can do this, but this is a very advanced problem on an Arduino. It sounds like perhaps you need something more plug-and-play. In that case, buy a Raspberry Pi 4 starter kit and a USB ...
Gabriel Staples's user avatar
4 votes

Generate a true analog signal using Arduino

I see that MCP4725 uses Wire library with the default clock of 100,000 kb/sec. At a rough estimation each call to MCP.writeDAC or MCP.getValue will be at least 32 bits long and you use three of them ...
Dorian's user avatar
  • 359
4 votes
Accepted

tone() corrupts the PWM on a different pin

To quote from the Arduino documentation of tone(): Use of the tone() function will interfere with PWM output on pins 3 and 11 (on boards other than the Mega). So yes, you should use a different pin ...
chrisl's user avatar
  • 16.3k
4 votes

Tone() generates a high pitched sound when button is released

Here is the result of my investigation. The problem is caused by two factors. First one is the contact bounce of the switch. Second one is inadequate pullup strength at the switch, but this may be a ...
jsotola's user avatar
  • 1,515
3 votes

Audio Input into A0?

Depending on how loud your audio signal is, you may be able to do it with just one capacitor and two resistors: If your signal is quite quiet, though, you may need to amplify it using an op-amp. For ...
Majenko's user avatar
  • 105k
3 votes

What is the best way to get more RAM for a sound buffer?

An FRAM chip? Non-volatile (though you don't need that) SPI or I^2C available on a breakout board from Adafruit Or roll you own from a bare chip, if you're handy with Surface Mount Devices.
JRobert's user avatar
  • 15.3k
3 votes

Using TMRpcm library, the audio does not play

This is now 5 months later - but I recently had the same problem. Because the TMRpcm library plays through pulse width modulation, make sure your speakers are hooked up to a PWM capable pin. That ...
Jeff Fortune's user avatar
3 votes

Practicality of recording speech

On my page about the ADC converter I attempted to record a 4 kHz sine wave on the ATmega328P with the following code: const byte adcPin = 0; // A0 const int MAX_RESULTS = 256; volatile int results ...
Nick Gammon's user avatar
  • 38.2k
3 votes

Listen for specific frequency

As stated in previous answers, frequency measurement is unlikely to be reliable because the microphone is going to pick up ambient noise, which is a combination of many individual frequencies. You ...
Edgar Bonet's user avatar
  • 43.1k
3 votes

Writing "theremin" outputs to a MIDI file on an SD card

Yes, read the MIDI file format specification. Create a single track midi file and append just note press / release commands / pitch or volume changes and delta times (reverse conversion of delta times ...
gabonator's user avatar
  • 371
3 votes

Arduino - Playing WAV files with a buzzer

When driving a passive buzzer, you should always have the signal output from the Arduino go to a transistor tied between the ground and the (-) negative side of the buzzer. Also, if you use a regular ...
Renee Cousins's user avatar
3 votes

Good quality sound using a microcontroller

One would think that single channel for voice would be enough. Remember the old Sprint commercials? "So quiet you can hear a pin drop", that was only single channel. 12 bits at 16 MHz for max 8 KHz ...
CrossRoads's user avatar
  • 2,415
3 votes
Accepted

Sampling stereo audio at greater than 40 Hertz using arduino

If you are only interested in getting a reading of the sound intensity, then 8 kHz may be enough. You can also convert the signal to mono using a pair of resistors. If you want the Arduino to do ...
Edgar Bonet's user avatar
  • 43.1k
3 votes

I want to stream audio from an Arduino to a device on the wifi

You can use a ESP32 with built-in WiFi and Bluetooth. Record a wave-File to a SD-card using this library, send it over Blutooth and play it on the PC with a little script.
Python Schlange's user avatar
3 votes

Multiple IR Sensors with Arduino

technically yes, there is no reason you can't do that project but the issues will come in how complex you wish to make system. For example, it shouldn't be too hard to hook up the three sensors to ...
Luke Bradley's user avatar
3 votes

Modify duty cycle of tone on AVR

I would recommend using a hardware PWM signal generated by Timer 1, or another 16-bit timer if you have more than one (like on the Mega). The 16 bits provide both a decent frequency range and a good ...
Edgar Bonet's user avatar
  • 43.1k
3 votes
Accepted

Tone() function pauses between notes

there is // to distinguish the notes, set a minimum time between them. // the note's duration + 30% seems to work well: int pauseBetweenNotes = noteDuration * 1.30; delay(...
Juraj's user avatar
  • 18.1k
3 votes

Perform Volume Control on arduino speaker

There is a library from LixieLabs that implements an audio-based PWM at super high frequencies that allows you to change the tone volume without additional hardware.
Lex Kravitz's user avatar
2 votes
Accepted

SN76489 - Ready pin not working?

The READY signal is open-collector. It will therefore require a pullup-resistor. Test circuit in datasheet shows a 2 kohm resistor. You could try with that. Alternatively use the internal pullup ...
Mikael Patel's user avatar
  • 7,969

Only top scored, non community-wiki answers of a minimum length are eligible