Conductive Paint Piano

by mcclymontcam17 in Circuits > Electronics

301 Views, 0 Favorites, 0 Comments

Conductive Paint Piano

tinywow_IMG_5980_21250700.jpg

This project aims to develop an electrical piano with conductive paint for keys, which will revolutionize the way people interact with musical instruments. The piano will feature a unique design that uses conductive paint to create a simple, elegant, and intuitive interface for the player.


The piano will be built on the principles of minimalism, making it easy to use and understand. Each key will be painted with a layer of conductive paint that will allow the user to generate sound by simply touching the key. The use of conductive paint will eliminate the need for mechanical components such as switches, making the piano lightweight and easy to transport.



Supplies

MicrosoftTeams-image (1).png

Listed Below are all of the materials used in crafting this project! All of the material can be found on Amazon and the estimated completion time for this project is around 1 hour and 30 minutes. The Arduino 2560 Mega was used in this project, however any microcontroller that is Arduino IDE compliant will work!


Using Conductive Paint

To start one must paint a thicker piece of paper with the conductive paint that was bought online. You will want to let the paint dry and repeat this step 3 or 4 times to ensure that there is a thick coat and no connectivity issues will occur. Once you have done this, you can next grab some banana clips and hook the piece of painted paper up to a multimeter to test the conductivity. Although this step isn't necessary, it is recommended to ensure you will not run into problems at a later step.

Electrical Schematic

Brighter Schematic.png
IMG_20230502_121022_01[9690].jpg
IMG_20230502_121613_01[9693].jpg

In the schematic Pin, 2 from the Atmega 2560 is connected to the red bus of the breadboard. Eight 1M ohm resistors are connected to this bus that will have a jumper cable attach them to pins 3-10. In the breadboard, the jumper cables will be attached in series to another jumper that will be taped to metal pins that are connected to the conductive paint. After this you will be connecting the piezo buzzer to ground, +5V, and pin 44 on the 2560. The LED also becomes connected to the same pin 44 that the buzzer is attached to through the breadboard. Lastly, the 2560 plugs into the USB port of you're computer to have the code uploaded in later steps.

Downloading CapactiveSensor Library

Screenshot 2023-04-19 194120.png

In this step, you will have to open up Arduino IDE software and download the CapactiveSensor Library. This Library allows the human body acts as a capacitor, with the proximity of the hand to the painted surface affecting the capacitance. A threshold value must be set to prevent accidental triggering of the keys by simply hovering the hand above them. This value must be high enough to ensure that only intentional key presses are registered.



Software

#include <CapacitiveSensor.h>
#define buzzer 44
#define sensi 100
#define limit 1000
// Set the Send Pin & Receive Pin.
CapacitiveSensor   cs_2_3 = CapacitiveSensor(2, 3);
CapacitiveSensor   cs_2_4 = CapacitiveSensor(2, 4);
CapacitiveSensor   cs_2_5 = CapacitiveSensor(2, 5);
CapacitiveSensor   cs_2_6 = CapacitiveSensor(2, 6);
CapacitiveSensor   cs_2_7 = CapacitiveSensor(2, 7);
CapacitiveSensor   cs_2_8 = CapacitiveSensor(2, 8);
CapacitiveSensor   cs_2_9 = CapacitiveSensor(2, 9);
CapacitiveSensor   cs_2_10 = CapacitiveSensor(2, 10);
CapacitiveSensor   cs_2_11 = CapacitiveSensor(2, 11);


int melody[] = {784, 659, 659, 0, 784};
int noteDurations[] = {12, 20, 20, 12, 12};


boolean muted = false;
//const int mute = 21;


void setup()
{
  // set serial baud rate
  Serial.begin(9600);


  for (int thisNote = 0; thisNote < sizeof(melody)/sizeof(int); thisNote++) {
    int noteDuration = 1000/noteDurations[thisNote];
    tone(buzzer , melody[thisNote], noteDuration);
    int pauseBetweenNotes = noteDuration *1.30;
    delay(pauseBetweenNotes);
    noTone(buzzer);
  }


}


void loop()
{


  // Set the sensitivity of the sensors.
  long sense1 =  cs_2_3.capacitiveSensor(sensi);
  long sense2 =  cs_2_4.capacitiveSensor(sensi);
  long sense3 =  cs_2_5.capacitiveSensor(sensi);
  long sense4 =  cs_2_6.capacitiveSensor(sensi);
  long sense5 =  cs_2_7.capacitiveSensor(sensi);
  long sense6 =  cs_2_8.capacitiveSensor(sensi);
  long sense7 =  cs_2_9.capacitiveSensor(sensi);
  long sense8 =  cs_2_10.capacitiveSensor(sensi);
  long mute =  cs_2_11.capacitiveSensor(sensi);


  if (mute > limit) {


    delay(300);
    Serial.println("Muted / Unmuted");
    muted = !muted;


  }


  // When we touched the sensor, the buzzer will produce a tone.


  if (muted == false) {
    if (sense1 > limit) {
      tone(buzzer, 400);
      Serial.println("Key 1");
    }
    if (sense2 > limit) {
      tone(buzzer, 270);
      Serial.println("Key 2");
    }
    if (sense3 > limit) {
      tone(buzzer, 650);
      Serial.println("Key 3");
    }
    if (sense4 > limit) {
      tone(buzzer, 900);
      Serial.println("Key 4");
    }
    if (sense5 > limit) {
      tone(buzzer, 1100);
      Serial.println("Key 5");
    }
    if (sense6 > limit) {
      tone(buzzer, 1300);
      Serial.println("Key 6");
    }
    if (sense7 > limit) {
      tone(buzzer, 1670);
      Serial.println("Key 7");
    }
    if (sense8 > limit) {
      tone(buzzer, 2000);
      Serial.println("Key 8");
    }
  }
  else {
    
    Serial.println("Piano Is Muted!");
    }
  // When we didn't touch it, no tone is produced.
  if (sense1 <= limit  &  sense2 <= limit  &  sense3 <= limit & sense4 <= limit  &  sense5 <= limit  &  sense6 <= limit &  sense7 <= limit &  sense8 <= limit)
    noTone(buzzer);
  delay(10);
}


Downloads

Testing/Playing Music

tinywow_IMG_5982_21250627.jpg

Congratulations! You have successfully created a functional capacitive sensor array capable of producing tonal output. If you do not hear any sound, it may be necessary to adjust the parameters of the CapacitiveSensor library or increase the thickness of the conductive paint applied to the paper keys. Enjoy your fun electrical piano!



Citations

•[1] CUI Inc., "SWI10-N Series Datasheet," [Online]. Available: https://www.cui.com/product/discontinued/swi10-n.pdf. [Accessed: Mar. 03, 2023].

•[2] Texas Instruments, "TPS2544 USB Charging Port Power Switch and Controller with Integrated USB 2.0 High-Speed Data Switch," Texas Instruments, Dallas, TX, USA, Datasheet, Jan. 2022. [Online]. Available: https://www.ti.com/lit/ds/symlink/tps2544.pdf. [Accessed: Mar. 03, 2023].

•[3] Energizer Holdings, Inc., "Energizer MAX Batteries," Energizer Holdings, Inc., St. Louis, MO, USA, Datasheet, Mar. 2020. [Online]. Available: https://data.energizer.com/pdfs/e91.pdf. [Accessed: Mar. 03, 2023].

•[4]   H. Yao, L. Fang and R. Henderson, "Evaluating conductive paint performance on 3-D printed horn antennas," 2018 IEEE Radio and Wireless Symposium (RWS), Anaheim, CA, USA, 2018, pp. 191-193, doi: 10.1109/RWS.2018.8304983.

•[5] S. Krstic and P. Theisen, "Push-Button Hybrid Switch," in IEEE Transactions on Components, Hybrids, and Manufacturing Technology, vol. 9, no. 1, pp. 101-105, March 1986, doi: 10.1109/TCHMT.1986.1136612.

•[6] T. Ao, A. Ng, K. Widmann, M. E. Foord, D. F. Price and P. T. Springer, "AC conductivity of warm dense aluminum," IEEE Conference Record - Abstracts. 2002 IEEE International Conference on Plasma Science (Cat. No.02CH37340), Banff, AB, Canada, 2002, pp. 207-, doi: 10.1109/PLASMA.2002.1030445.

•[7] Electronics Hub. "Arduino Based Piano." [Online]. Available: https://www.electronicshub.org/arduino-based-piano/. [Accessed: Mar. 03, 2023].

•[8] JBL, "JBL Link Music," Harman International Industries, Inc., 2020. [Online]. Available: https://www.jbl.com/on/demandware.static/-/Sites-masterCatalog_Harman/default/dw9b26a056/pdfs/JBL_Link_Music_English.pdf. [Accessed: Mar. 4, 2023].

•[9] School Outfitters, "Earbud Headphones w/ In-Line Mic & Volume Control," School Outfitters, 2023. [Online]. Available: https://www.schooloutfitters.com/catalog/product_info/pfam_id/PFAM45253/products_id/PRO57938?sc_cid=Google_EGG-IAG-1011&adtype=pla&kw=&gclid=Cj0KCQiA9YugBhCZARIsAACXxeLymtI2PMm4xD2L-H6KOkh6MaVfidDtf7p3XQ4oRdb5zJ5S7LO23FkaAgsJEALw_wcB. [Accessed: Mar. 4, 2023].

•[10] Microsoft, "Surface Laptop 3 Tech Specs," Microsoft, 2023. [Online]. Available: https://support.microsoft.com/en-us/surface/surface-laptop-3-specs-and-features-75315c06-5d74-07fe-55d5-a8c5cb626849. [Accessed: Mar. 4, 2023].

•[11] Atmel Corporation, "8-bit AVR Microcontroller ATmega640/1280/1281/2560/2561 datasheet," Microchip Technology Inc., 2013. [Online]. Available: https://ww1.microchip.com/downloads/en/devicedoc/atmel-2549-8-bit-avr-microcontroller-atmega640-1280-1281-2560-2561_datasheet.pdf. [Accessed: March 4, 2023].

•[12] Arduino. "Arduino Uno Datasheet", Arduino, 2011. [Online]. Available: https://docs.arduino.cc/resources/datasheets/A000066-datasheet.pdf. [Accessed: Month Day, Year].