Wireless Finger Drum


Step 6: Make it wireless!

RevIO was designed to be XBee ready.
See details of RevIO pins at

Just plug the breakout board in, loads the sketch, and plays!

What's the sketch does?
RevIO or Arduino is monitoring the Analog pins connected to FSRs. Whenever the FSR get pressed, it transmits the command wirelessly via XBee transmitter (attached to Arduino) to XBee receiver module connected to the PC.
And the Processing program on the PC will translate the command and play the drum sound accordingly.

Following is an Arduino Sketch, upload the sketch to Arduino. (already included in the zip files in the following step, FSRControl.ina)

Note: The XBee module or XBee Breakout board need to be removed  while uploading the sketch to Arduino or RevIO.
Because the TX and RX pins on FTDI adapter for uploading sketch share the same TX and RX pins of XBee module.


// minimum reading of the sensors that generates a note 
const int THRESHOLD = 25;  

int pinA0 = 0;
int pinA1 = 1;
int pinA2 = 2;
int pinA3 = 3;

static const int avgCount = 4;

int valFSR1, valFSR2, valFSR3, valFSR4 = 0;

int arr1[avgCount];
int arr2[avgCount];
int arr3[avgCount];
int arr4[avgCount];

int i;
int index = 0;

//Average the values in the averaging arrays

void avg()
  valFSR1 = valFSR2 = valFSR3 = valFSR4 = 0;

  for(i = 0; i < avgCount; i++)
    valFSR1 += arr1[i];
    valFSR2 += arr2[i];
    valFSR3 += arr3[i];
    valFSR4 += arr4[i];

  valFSR1 /= avgCount;
  valFSR2 /= avgCount;
  valFSR3 /= avgCount;
  valFSR4 /= avgCount;

void setup() {
  // reset average arrays
  for (i = 0; i < avgCount; i++)
    arr1[i] = 0;
    arr2[i] = 0;
    arr3[i] = 0;
    arr4[i] = 0;
  index = 0;
   // start serial port at 9600 bps:

void loop() {

    // out actual values into the averaging arrays
    arr1[index] = analogRead(pinA0);
    arr2[index] = analogRead(pinA1);
    arr3[index] = analogRead(pinA2);
    arr4[index] = analogRead(pinA3);

    // increment index,
    // if index exceeds array sizes reset to zero
     if (index >= avgCount)
       index = 0;
    // calculate average values
    // divided the value by 4 to scale it down to 0 - 255
    // FSR 1
    if((valFSR1 / 4) > THRESHOLD) {
      //Serial.print(valFSR1 / 4, DEC); Serial.print(", ");

    // FSR 2      
    else if((valFSR2 / 4) > THRESHOLD) {
      //Serial.print(valFSR2 / 4 , DEC); Serial.print(", ");
    // FSR 3
    else if((valFSR3 / 4) > THRESHOLD) {  
      //Serial.print(valFSR3 / 4, DEC); Serial.print(", ");
    // FSR 4 
    else if((valFSR4 / 4) > THRESHOLD) {
      //Serial.print(valFSR4 /4 , DEC); Serial.println();
    else {

Wireless XBee

In order to wirelessly communicate between PC and Arduino, we need two XBee Modules, and one FTDI cable. One XBee module will be connected to Arduino without FTDI cable.

The second XBee Module will be connected to PC or Laptop via FTDI cable (or xBee Buddy).

It would take up a lot of space and time to explain the installation, configuration, and test the XBee module. Instead I provide you the links that you could use as the starting point on how to work with XBee module(s).

Here are my WIKI XBee tutorials, show how to configure and test XBee module using Hyperterminal, and X-CTU:

Configure XBee using AT Commands.

Configure XBee using X-CTU Software.

My XBee video tutorial.

Remove these adsRemove these ads by Signing Up

Get More Out of Instructables

Already have an Account?


PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!