Step 6: Make It Wireless!

RevIO was designed to be XBee ready.
See details of RevIO pins at https://www.instructables.com/id/Build-The-RevIO-Arduino-Clone-My-Way/

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.

Many thanks for this 'ible. <br> <br>Been knocking around the idea of a midi/arduino Ocarina similar to the one on the iPhone but self contained. This helps me a lot, I hadn't considered using FSR's that will allow a level of pressure or &quot;hole coverage&quot; to be achieved. <br> <br>Cheers!
I'm glad this help. :) <br>And thanks for you appreciation. <br>
Why is this not featured ? <br>This is a great idea and the instructions are an excellent contribution to the website.
petrolhead, <br> <br>Thanks for your appreciation in my instructables. And make your voice to instructables.com for me. <br> <br>I am not worry about my instructables would get featured or not. Instructables may look at my project different than yours. That's why it did get featured. <br> <br>I would like to give you the gift of 3 months Instructables Pro membership in return to your apprecation of my project. Check your Instructables's mailbox for the redeem code. <br> <br>Thanks <br>

About This Instructable




Bio: I am Electronic Visualization Artist. I look at things through the Looking Glasses.
More by sath02:"Fortune Frog" Money Clip R/C LEGO "Coaster" Droid R/C LEGO 'Velocipede' Droid 
Add instructable to: