element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Pi-Fest
  • Challenges & Projects
  • Design Challenges
  • Pi-Fest
  • More
  • Cancel
Pi-Fest
Blog e-tabla part #2: Touch Sensors Experiments
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Leaderboard
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: arjuna_dev
  • Date Created: 12 Jul 2022 2:13 PM Date Created
  • Views 759 views
  • Likes 5 likes
  • Comments 1 comment
  • pi-fest
Related
Recommended

e-tabla part #2: Touch Sensors Experiments

arjuna_dev
arjuna_dev
12 Jul 2022

One of the needs of this project is to detect where the hands of the player are touching the drum. For this an breakout board will be used. It communicates with the I2C protocol and has 12 different pins to detect touch:
  image 

While I am not using Adafruit's board, I am using their library and code example:

import audiocore
import board
import audiobusio
import busio
import time
import adafruit_mpr121

i2c = busio.I2C(board.GP9, board.GP8)
i2c_touch_address = 0x5A

mpr121 = adafruit_mpr121.MPR121(i2c)

right_drum_strokes = ["Na", "Ta", "Tin", "Te", "Ti", "Tun", "TheRe"]
left_drum_strokes = ["Ghe", "Ga", "Ke"]
all_drum_strokes = right_drum_strokes + left_drum_strokes
waveObjects = []

for i in range(0, len(all_drum_strokes)):
    waveObjects.append(audiocore.WaveFile(open("tabla_samples/" + all_drum_strokes[i] + ".wav", "rb")))


audio = audiobusio.I2SOut(board.GP0, board.GP1, board.GP2)


while True:
    for i in range(12):
        if mpr121[i].value:
            audio.play(waveObjects[0])
            while audio.playing:
                pass



This code though, blocks the program while a .wav file is being played, which feels quite unintuitive when trying to simulate a drum, which can always produce sound when stroked. On the other hand, if we play a sound every time the sensors are being touched, the file gets played hundreds of times per second just upon touching the sensor's pins. The following code fixes that:

import audiocore
import board
import audiobusio
import busio
import time
import adafruit_mpr121

# Configure touch sensor
i2c = busio.I2C(board.GP9, board.GP8)
i2c_touch_address = 0x5A
mpr121 = adafruit_mpr121.MPR121(i2c)

# Load .wav files
right_drum_strokes = ["Na", "Ta", "Tin", "Te", "Ti", "Tun", "TheRe"]
left_drum_strokes = ["Ghe", "Ga", "Ke"]
all_drum_strokes = right_drum_strokes + left_drum_strokes
wave_objects = [] 
for i in range(0, len(all_drum_strokes)):
    wave_objects.append(audiocore.WaveFile(open("tabla_samples/" + all_drum_strokes[i] + ".wav", "rb")))

# Configure I2S output
audio = audiobusio.I2SOut(board.GP0, board.GP1, board.GP2)

ready = True

while True:
    touched = any(mpr121.touched_pins)
    if not touched:
        ready = True
    for i in range(12):
        if mpr121[i].value and ready:
            audio.play(wave_objects[0])
            ready = False


Now we can play it "like a drum"!

Another tricky part with this project is how to build a drum and allow for touch sensitivity on the drum itself. For that I am experimenting with DIY conductive ink. I am trying out the following materials:

image

- Graphite powder
- Liquid tape
- Acrylic paint

My favourite resources I came across when researching about conductive paint where this webpage: 

https://www.instructables.com/Make-Conductive-Glue-and-Glue-a-Circuit/ 

And this video:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image


Basically we try to saturate either acrylic paint or liquid tape with graphite powder.

While the instructable suggests using liquid tape as the best cheap option after having tried other glues and powdered metals, I believe he did not experiment with plain acrylic paint. I tried both and found the acrylic paint to be much more easier to handle and it definitely smells less toxic than the liquid tape. While the graphite-saturated liquid tape did prove to have less resistance than the graphite-saturated acrylic paint, this might be because it has a very thick texture and naturally there is a thicker layer of it when painting. With acrylic paint one can simply add a second layer of paint and the resistance will drop approximately by half. Acrylic paint: Approved!

Here is a video where I am trying out the touch sensitivity and responsiveness of the DIY, open sou(r)ce, conductive paint at different lengths away from the metal touch sensor pin:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image


Success!

Stay tuned for a prototype of the actual drum, audio and more!

  • Sign in to reply
  • DAB
    DAB over 3 years ago

    I saw a great example of conductive paint at the Dayton Maker Fair about three years ago.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube