loading

The ARD2-INNOV8 is an innovative shield which sits on top of an Arduino Uno providing various inputs and outputs.

The five analog pins running along the analog side of the shield are all fitted with 1M ohm pull-up resistors which allow these pins to form a very sensitive switch circuit where everyday bananas and other items can be used as touch keys.

Two programming options are provided in this Instructable - one using Snap4Arduino visual-block code, and the other using standard Arduino C++ code.

For this project you will need:

1 x ARD2-INNOV8 shield

1 x Arduino UNO (R3)

1 x compatible USB cable to attach your boards to your computer

6 x pin-to-socket jumper wires

5 x standard bananas

The complete kit and learning resources can be purchased at Wiltronics.

More learning resources will be available on the Firebugs Youtube channel and Facebook page.

Step 1: Step 1 - Setting Up the Circuit

Setting up the circuit is easy, you just need to ensure that your ARD2-INNOV8 shield is firmly attached to your Arduino board, and that the analog pin jumpers on the ARD2-INNOV8 are in the 'EXT' position (see the diagram).

Next you need to attach the socket end of one of your pin-to-socket jumper wires to each of the analog pins that extend from the connectors on the analog side of the shield; these are pins A1, A2, A3, A4, A5 (see diagram).

Once you have these wires in place, lay your five bananas in a row, and stick the pin end of each of your wires into the skin of each banana.

Finally you need to connect the socket end of your last jumper wire to one of the GND (ground) pins on the analog side of the shield.

Step 2: Step 2 - Snap4Arduino - Uploading the Firmware

If you wish to use Snap4Arduino visual-block code to program your banana keyboard, read through this step; otherwise you can skip to Step 4.

To use Snap4Arduino for programming this sketch you will need to install the Snap4Arduino program to your computer.

This program is available for Windows, Mac, and Linux. The software and instructions can be found here:

http://snap4arduino.org/

You will also need to have the Arduino programming IDE installed onto your computer. Once again this is available for Windows, Mac, and Linux. The software and instructions can be found here:

https://www.arduino.cc/en/Main/Software

Once you have installed these programs onto your computer, you need to open the Arduino IDE, open the StandardFirmata sketch (firmware) from the Examples library (see screenshot), and then upload this to your Arduino.

A video showing these steps can be found on the Firebugs Youtube channel.

After installing the firmware, you can open the Snap4Arduino program to begin programming.

Step 3: Step 3 - Coding With Snap4Arduino

If you have used Snap or Scratch before, then you should find this easy.

We have used a list to contain the notes that will be played when one of our bananas is touched.

There are five variables to hold the analog readings for each of our banana keys, and each of the readings are done via the analog readingfunction blocks which sit within our forever loop.

Also within this loop we have five IF statements which test to see if the value of any of the read variables has fallen below 800 (banana touched), and if it has then it plays the corresponding note via the play note function block (please note: you may need to adjust the value up or down from 800).

The ARD2-INNOV8 has a build in piezo buzzer which provides good sound, however, it is not easy to use this with Snap4Arduino, so this sketch plays the notes through the connected computer instead.

Once you have all of your code blocks in place and the code looks like the image on this page, then you are ready to send this to your board.

Under the Arduino blocks library in the Snap4Arduino IDE you will find a Connect Arduino block. Click on this block and you should see a message telling you that your Arduino is connected.

Once this is done you can pinch the GND pin with one hand, and play the bananas with the other.

Something fun to try, is to see how many people you can form a line with and still play the bananas - i.e. The person on one end of the line pinches the GND pin and with all people in the line holding hands, the person on the other end of the line plays the bananas.

Step 4: Step 4 - Coding With Arduino C++

To program this system using C++ code you will need to have the Arduino IDE installed on your computer.

The software and instructions for Windows, Mac, and Linux can be found here:
https://www.arduino.cc/en/Main/Software

There are a couple of Arduino sketch variations below.

The first makes use of two arrays and FOR loops to read the banana pins and play the notes, and the second sketch is a more simple version using IF statements where you need to complete the code.

Banana_Keyboard sketch - Arrays and FOR loops (copy the pitches.h file into the Banan_Keyboard folder)

Banana_Keys sketch - IF statements - You need to complete the other two IF statements yourself

Once you have one of these sketches uploaded to your Arduino you can pinch the GND pin with one hand, and play the bananas with the other.

Something fun to try, is to see how many people you can form a line with and still play the bananas - i.e. The person on one end of the line pinches the GND pin and with all people in the line holding hands, the person on the other end of the line plays the bananas.

<p>Please note: The Snap4Arduino website is down at present. Please be patient with this. Thank you</p>
<p>That looks like fun! :)</p>
<p>Thanks Swansong :)</p>

About This Instructable

548views

13favorites

License:

More by SevenV:Banana Keyboard - ARD2-INNOV8 and Arduino  
Add instructable to: