Show Posts
Pages: 1 2 [3] 4 5 ... 7
31  Using Arduino / Audio / Re: New Library: RF24Audio - Realtime Audio Streaming, Multicasting and More on: April 19, 2014, 07:08:53 pm
... tell me please the source to convert from the analog port to PWM port (analog to digital) cuz i already tried it and i just got noise coming out smiley-sad

Not sure what you are asking here?  In my video, I used an iPod connected to the preamp circuit. If using a microphone breakout, they usually have an opamp or something to manage the pre-amp function, and the gain would need to be adjusted. It uses the onboard ADC reading pin A0 to convert from analog to digital, then uses timer1 pwm functions to reproduce the PCM audio.  The default volume might be a bit high, so adding rfAudio.setVolume(4); may resolve the issue also.
32  Using Arduino / Audio / Re: New Library: RF24Audio - Realtime Audio Streaming, Multicasting and More on: April 19, 2014, 06:13:23 pm
Heh, that would be me.
I've posted some initial board/wiring info here: and attached a few pictures here, including schematic type diagrams, which will likely get added to the main documentation page eventually. I couldn't seem to find a good fritzing part for NRF24L01 modules, so that is probably not the best example. The buttons aren't needed if using serial commands for testing etc.

The SD module in the video is only really there because it was just easier to not disconnect it, since I was also experimenting with improvements when streaming audio from SD card at the time. You can probably tell that video production is not one of my strong points.

Please keep in mind the current schematics are designed to be about as simple as possible, while producing OK results, and have just been put together (Hopefully no errors). During development, I generally just grab the closest parts that will work, and stick them together. I'm sure that adding some low-pass filters etc would increase sound quality a fair bit, and that there are at least a few folks on these forums who could provide much better advice on that type of thing than I. 
33  Using Arduino / Audio / Re: New Library: RF24Audio - Realtime Audio Streaming, Multicasting and More on: April 19, 2014, 03:38:06 pm
Thanks robtillaart!

tsunamy_boy: Yeah, pretty much any board with an ATmel 328 chip like the Uno should work fine. I've specifically tested with Arduino Duemilanove, Nano, Pro-mini (5v 16mhz), and Mega2560 boards. Arduino Due is not supported currently.
34  Using Arduino / Audio / New Library: RF24Audio - Realtime Audio Streaming, Multicasting and More on: April 17, 2014, 03:54:17 am
I mentioned a little while back in a couple posts that I was developing a wireless audio library for Arduino, and it has finally come to fruition. Many people are familiar with my WAV Audio library for playing audio from SD cards using Arduino, and I've developed another related library for wireless audio streaming.

The new library relies on my optimized RF24 library fork which enhances the speed and reliability of NRF24L01 radio modules, and is required for proper use of the RF24Audio library. The integration with the core radio library allows additional features like streaming wireless audio directly to a PC for analysis and/or recording of the audio.

Beginner Arduino users can create simple radios or intercom devices at very low cost, simply by connecting a microphone, speaker and radio module, and running one of the example sketches. The audio can be broadcast in realtime to one or more groups of radios running the RF24Audio library.

The library also integrates directly with the TMRpcm audio library, so users can also broadcast audio from SD card wirelessly in the case of such things like halloween displays etc, where everything can be timed and broadcast wirelessly from a single Arduino.

Documentation/Downloads can be found here:

Optimized RF24 Radio Library:
TMRpcm SD Audio Library:

*Edit to add youtube demonstration :
35  Using Arduino / Networking, Protocols, and Devices / Re: rf24 library question (nrf24l01) on: April 11, 2014, 04:19:57 am
Using ACK Payloads, you can send back data without switching out of RX mode, and it makes a much more efficient call-response scenario, since the transmitter does not need to be interrupted.

See for an example.

36  Using Arduino / Networking, Protocols, and Devices / Re: Serial Communication at 1Mb on: April 06, 2014, 12:08:18 pm
Well technically, the UART is capable of up to 8Mhz in Synhronous Master Mode.

I've had the UART set to run at 8Mhz and outputting video data smoothly in Master SPI mode. I believe the max rate in UART Synchronous master mode is 8Mhz as well. It is double buffered, so actually seems to perform better in some ways than the actual SPI hardware. This would put the maximum transfer rate at 8mHz/8bytes = 1MB/s minus overhead (start, stop bytes etc)  So 1MB/s or 8Mbps would be the max rate minus overhead. In non-synchronous modes, the limit is 2mbps according to the datasheet (250KB/s minus overhead).

An example sketch for outputting NTSC video at 8mhz is a bit messy but is here:

I did a bit of a writeup on ensuring the output is timed correctly and smooth, which can be found at my blog:

It may not work that well at 8mhz for actual communication, I haven't tested that specifically. It might require a kind of custom solution as well, as the Arduinos would not be able to stream at 8MHZ continuously without a large memory buffer.

*Edit to add: Just remembered, that I have used it at 8mhz in SPI mode for controlling a radio module and it worked well for that communication, so there is no reason it wouldn't work otherwise.
37  Using Arduino / Networking, Protocols, and Devices / Re: Is it possible to have a bidirectional arduino connection with one wire? on: April 06, 2014, 11:02:00 am
Yes. It would be very similar to developing a wireless protocol, where all the devices use the same channel/frequency. The start/stop indicator would be more complicated, as you would have to have addressing or signaling to indicate which device is to receive the data being sent, or to indicate to a device when to send back data.
38  Using Arduino / Networking, Protocols, and Devices / New RF24 Library Fork for NRF24L01 modules on: April 06, 2014, 07:47:53 am
I've been working on a new library fork to improve upon the current state of the RF24 driver. Mainly, the new library fork should be more reliable and responsive, while providing faster data transfer rates, especially with multicast or NOACK streaming. As I've found with any system or scenario, its not about having the right recipe or ingredients, its always about the process.
Users will notice notice differences when using things like ACK payloads, as data is never flushed from the FIFO buffers unless required, and responsiveness is much faster. The new fork also makes better use of the FIFO buffers, which improves things greatly when transmitting large quantities of data, or streaming realtime data such as audio data, and should be more reliable due to how it manages and checks for incoming data.

I've done a direct comparison between this fork and the gcopeland fork, which I think is about the fastest alternative.

The new library includes the sketch used in the transfer testing, as well as simplified versions and additional examples.

The main issue with compatibility, is that no longer returns a boolean value if more data is available. The new library is more in-line with standard Arduino libraries, in that radio.available() will always return 1 if data is available to be read instead. This is the only change required for compatibility with the original RF24Network library.

I've added full support for the Arduino Due as well, with the extended SPI methods, which improves performance quite a bit for the Due as well. note: Do not include printf.h  and don't do printf_begin(); , this is already enabled on Due.

 ATTiny support is there, but my chip is in the mail, so testing is not complete. To use, Don't include SPI.h, and optionally uncomment #define MINIMAL in RF24_config.h

Source Code:
Library Package:

Blog ( Overview and more detailed info ):

39  Using Arduino / Networking, Protocols, and Devices / Re: Questions on NRF24L01+ on: April 06, 2014, 07:32:35 am
On the Mega I know for sure, there seem to be issues with the voltage levels or something. I've found a few posts about connecting a small (100nf) or larger capacitor to the VCC and Ground leads on the module to help even it out, and have had some luck with that. I've also had luck using a simple resistor voltage divider working off 5v and filling a larger capacitor connected to the leads. 
40  Using Arduino / Audio / Re: High pitched noise when playing wav files on: March 24, 2014, 02:29:10 am
I think that if the the author happened by the forum tonight, he would recommend something like using tmrpcm.quality(1); to oversample the audio at double rate, and mention that it defaults to 0 to now after a bunch of changes were made. Otherwise a low pass filter if the source is not the audio itelf. Power sources can be a source of noise also.

*edit to add: You can also raise and lower the volume a bit, and use complimentary output if wanted. The wiki at has more details on that stuff. I always just connect my little 8Ohm speakers directly, but most folks would recommend a resistor.

41  Using Arduino / Audio / Re: Arduino recording .wav files ? on: March 19, 2014, 09:38:00 am
Well, my library will do it and yup you can play them from a PC also. You can also easily generate your own wav files using wav templates.

I am also nearing completion on a live audio recording/streaming library using wireless/radio RF24 modules. No ETA, but soon.
42  Using Arduino / Audio / Re: Audio over Wireless on: March 07, 2014, 08:47:51 pm
I've had some success transmitting audio via NRF24L01+ radio modules, which will cover some distance if using the models with PA and LNA onboard. Technically though, any wireless module that can handle the data transmission speeds (16-20kB/s) would be capable.  A one-to-one communication wouldn't be that difficult, but adding multiple devices adds more complexity of course.

My wav audio library is currently capable of recording audio, saving it to SD card, and transmitting it wirelessly to another device, although the features are not really documented or finalized yet, but more in a proof of concept state.  Communication is only one-way right now, and I don't think it will come close to what you are looking for, but it can be found at if interested in how it works.
43  Using Arduino / Audio / Re: TMRpcm - multichannel, is it possible? on: March 07, 2014, 08:30:11 pm
It is fairly straight-forward but for a few important details. I'll be including an example sketch for multi track sometime soon, but until then, here is some info:

Recommended: 16-20khz Sample Rate

Steps on Uno or similar boards:
1. Edit the pcmConfig.h file included with the library
    a: Uncomment  #define buffSize 128    (A bit more memory is required for multi track. Needs to be an even number)
    b: Uncomment  #define ENABLE_MULTI

2.  Connect one speaker or other device from pin 9 to ground, and another from pin 10 to ground. Optionally from pin to pin.

3. Modify the following sketch to include the desired wav file name(s):"your.wav",1);

#include <SD.h>                      // need to include the SD library
#define SD_ChipSelectPin 4  //using digital pin 4 on arduino nano 328, can use other pins
#include <TMRpcm.h>           //  also need to include this library...
#include <SPI.h>

TMRpcm wav;   // create an object for use in this sketch

void setup(){

  wav.speakerPin = 9; //5,6,11 or 46 on Mega, 9 on Uno, Nano, etc
  //Enable the 2nd output:
  pinMode(10,OUTPUT); //Pin pairs: 9,10 Mega: 5-2,6-7,11-12,46-45

  if (!SD.begin(SD_ChipSelectPin)) {   
  }else{   Serial.println("SD ok"); }

void loop(){ 

    case 'a':"emb.wav",0); break;  //Play on pin 9
    case 's':"emb.wav",1); break;   //Play on pin 10
    case 'd':"one.wav",0); break;  //Play on pin 9
    case 'f':"two.wav",1); break;   //Play on pin 10
    case 'p': wav.pause(); break;
    case '?': if(wav.isPlaying()){ Serial.println("A wav file is being played");} break;
    case 'S': wav.stopPlayback(); break;
    case '=': wav.volume(1); break;
    case '-': wav.volume(0); break;
    case '0': wav.quality(0); break;
    case '1': wav.quality(1); break;
    default: break;


See for more detailed info

44  Using Arduino / Project Guidance / Re: TMRPCM WAV file player noisy sound before and after playing a wav file on: February 23, 2014, 12:20:11 pm
Thanks for the info! I just committed a whole pile of updates to the code including some that provide an automated workaround to the popping noises. I was able to completely prevent popping sounds on an Arduino Mega on timer start, between tracks, and on disabling. I found that it worked differently on my Duemilanove board, so the library now auto selects the ramping methods, but I have mostly tested it on a Mega. It also has an option to bypass metadata for files with song, artist, and album information which is another potential source of popping type sounds. The disable() command can be used to provide a ramp between tracks of differing sample rates as well.

The latest version should always be available at  if anybody is interested in providing feedback.

The two options for managing popping sounds are found in pcmConfig.h (Info available on the github wiki)
#define rampMega
45  Using Arduino / LEDs and Multiplexing / Re: LCD printing weird characters in loop function on: January 20, 2014, 05:34:42 pm
The PCM library uses pin 9 by default, and pin 10 for complimentary output. Either use a different pin (10) fro the SD shield or change the following lines in TMRpcm.cpp

*OCRnA[tt] = *OCRnB[tt] = buffer[whichBuff][buffCount];
*OCRnA[tt] = buffer[whichBuff][buffCount];

And this:
*TCCRnA[tt] = _BV(WGM11) | _BV(COM1A1) | _BV(COM1B0) | _BV(COM1B1);
to this:
*TCCRnA[tt] = _BV(WGM11) | _BV(COM1A1) ;

Not 100% sure if that is what is causing your specific problem, but figure it would... also SD cards usually use pins 11 and 12 for miso/mosi, so kind of wondering if multiple pins are being used between LCD and SD.
Pages: 1 2 [3] 4 5 ... 7