How to Make an Impact Sensor with MPR121 for an Electronic Santur?

Status
Not open for further replies.

Thread Starter

hsoft_project

Joined Mar 9, 2025
9
Hello everyone,


I am working on an electronic Santur (a Persian hammered dulcimer) and need help designing an impact-sensitive sensor using the MPR121 capacitive touch controller. My goal is to detect both the intensity (force) and occurrence of hammer strikes on the sensor.


The problem:
The MPR121 works perfectly when I touch the sensor with my hand, but it does not detect hammer strikes (mallet hits) properly. I have tried different configurations, but the sensor does not respond well to non-conductive objects like my mallet. I need a way to make the sensor detect hits from external objects (mallets, sticks, or any non-human conductor) without requiring direct hand contact.


Current setup:


  • MPR121 with custom capacitive touch sensor: Two aluminum foils with a thin plastic sheet between them.
  • ESP32 microcontroller handling the I2C communication.
  • Threshold values adjusted, but still ineffective for hammer strikes.

What I have tried so far:


  1. Lowering the Touch and Release Thresholds (Touch: 6, Release: 3).
  2. Adjusting Charge Time to improve sensitivity.
  3. Adding a floating ground to improve capacitive response.
  4. Changing the sensor material (thin copper tape, aluminum foil).
  5. Modifying the debounce settings for better impact detection.

What I need help with:


  • How can I modify my capacitive sensor design so that it reacts to hammer strikes and not just hand touch?
  • Are there any circuit modifications or material changes that could improve sensitivity to external impacts?
  • Would an alternative approach (such as combining capacitive sensing with piezoelectric sensors) be more effective?

Any advice, suggestions, or alternative sensor recommendations would be greatly appreciated!
Thank you in advance!
 

Irving

Joined Jan 30, 2016
4,999
I think you already know that a capacitive sensor isn't going to respond to a wooden mallet. You need something more direct sensing. I'd suggest:
  • a strain gauge detecting the underlying deformation of the impacted surface,
  • a resistive sensor whose resistance varies due to distortion by the mallet head.
  • a piezo-microphone picking up the surface shock-wave from the mallet strike.
as possible options...
 

Thread Starter

hsoft_project

Joined Mar 9, 2025
9
Hello,


Thank you for your suggestions! I understand that a capacitive sensor like MPR121 isn't the best choice for detecting hammer strikes, and I appreciate your recommendations regarding strain gauges, resistive sensors (FSR), and piezo microphones.


However, I have a few challenges that prevent me from using these solutions:


Availability and Cost Issues:
In my country, FSR sensors are very rare and expensive, making them impractical for my project. I need 27 sensors, and purchasing that many FSRs would make the project economically unfeasible.


Sensor Size Constraints:
I need to detect strikes over a 20 cm long and 0.7 cm wide area. Most commercially available impact sensors are either too small or too expensive for this application.


Piezo Microphone Isn’t Suitable:
A piezo microphone picks up surface vibrations, but I need a direct impact detection sensor that can measure force intensity as well. Piezo discs were my initial approach, but they introduced unwanted noise from the structure of the instrument.


Because of these limitations, I must design and build my own sensor using materials that are affordable and locally available.


Would you be able to suggest a practical way to construct a custom impact-sensitive sensor that could work with capacitive sensing, pressure variation, or another cost-effective method? I would really appreciate any advice on how to improve my current MPR121-based approach or an alternative DIY solution.


Thank you in advance for any guidance!
 

sghioto

Joined Dec 31, 2017
8,633
but the sensor does not respond well to non-conductive objects like my mallet.
Could you place a thin metal plate or wrap on the mallet face with a connecting wire to the handle?
Basically making it conductive to the hand. Goes for any other objects as well.
 
Last edited:

Irving

Joined Jan 30, 2016
4,999
Maybe you could share a bit more about the form the instrument would take? Here is an image I found of the sort of dulcimer you mentioned...

1741606676981.jpeg
I understand you hit the strings with a small hammer like this...




I guess the electronic version has no strings? Does it matter where you hit it? Do you have a picture?
 

Thread Starter

hsoft_project

Joined Mar 9, 2025
9
Could you place a thin metal plate or wrap on the mallet face with a connecting wire to the handle?
Basically making it conductive to the hand. Goes for any other objects as well.
Thank you for your response! However, modifying the structure of the mallets would take the instrument away from its traditional form. Preserving the original characteristics of the instrument is a priority, as any modifications to the mallets would likely face strong opposition from music experts in my country.
 

Thread Starter

hsoft_project

Joined Mar 9, 2025
9
What kind of noise and what was your circuit for this sensor?
mallet is a rectangle measuring 20 cm in length and 0.7 cm in width per sensor. A piezo disc, due to its circular shape, can only detect impact within its own diameter and does not cover the required length.


The noise generated by the piezo was not a major issue, but my main concern was that it couldn't provide uniform detection across the entire required area.


For my setup, I connected the piezo output to a non-inverting op-amp amplifier circuit and then sent the amplified signal to an ADC on the ESP32. This setup worked to some extent, but it did not provide the proper coverage needed for my application.
 

Thread Starter

hsoft_project

Joined Mar 9, 2025
9
I find stain gauges for < $1 a piece. I cannot imagine you can come up with a better cheaper solution.
Thank you for your response! I have also found options like the FSR408 online, but the issue is that these sensors are not available in my country. But it is my best choice. Even if someone were to import them for me, the cost for 27 sensors would be extremely high, making the project economically unfeasible.


If you have any alternative suggestions, I would really appreciate your help!
 

Thread Starter

hsoft_project

Joined Mar 9, 2025
9
Maybe you could share a bit more about the form the instrument would take? Here is an image I found of the sort of dulcimer you mentioned...

View attachment 344194
I understand you hit the strings with a small hammer like this...




I guess the electronic version has no strings? Does it matter where you hit it? Do you have a picture?
I truly appreciate your attention to this project!


Yes, I will share some images of the electronic Santur that I am currently building.

Image 1:
WhatsApp Image 2025-03-10 at 15.23.07.jpeg



This is a top view of the electronic Santur. Sensor #1 represents the area where the traditional strings are replaced by my custom-built sensors. The entire instrument will eventually consist of 27 of these sensors, but for now, I have only placed one for testing.


The player must be able to strike anywhere along this sensor's surface to produce the correct note. However, with the current MPR121 setup, it does not fully respond as expected. I must maintain the required length and width while ensuring accurate impact detection.


Sensor #2 (in Image 1):
This consists of three layers:


  1. A bottom aluminum foil connected to GND
  2. A thin plastic (polycarbonate) sheet
  3. A top aluminum foil connected to an MPR121 input

With this setup, I was able to detect mallet strikes using the ESP32, but the stability was not reliable.


Sensor #3 (in Image 1):
This is a piezoelectric disc, which almost met my requirements, but it did not provide the required length coverage.


Image 2:

WhatsApp Image 2025-03-10 at 15.23.07 (1).jpeg


This shows that Sensor #1 must maintain the same height throughout the instrument.
Image 3:
WhatsApp Image 2025-03-10 at 15.32.03.jpeg



This is a real traditional Santur, showing how the mallets strike the strings to produce sound. In my case, these mallets must strike the sensors instead, generating an electrical signal that determines the force of the impact.


If anyone has any suggestions for improving this design, I would be extremely grateful!
 

Irving

Joined Jan 30, 2016
4,999
Thanks for the pictures, they help a lot, but still need further understanding of your plans.

For clarity, in the traditional instrument, can you hit the strings anywhere, or do specific locations on a string produce different effects (but at same frequency for that string)? I assume the hammer is prevented from hitting the base by the string?

In your electronic version, are you trying to remove the string entirely? In which case, what stops the noise of the hammer hitting the base board? Do you need haptic feedback, ie the player feels the same response through the hammer as in real instrument?
 

Thread Starter

hsoft_project

Joined Mar 9, 2025
9
Thanks for the pictures, they help a lot, but still need further understanding of your plans.

For clarity, in the traditional instrument, can you hit the strings anywhere, or do specific locations on a string produce different effects (but at same frequency for that string)? I assume the hammer is prevented from hitting the base by the string?

In your electronic version, are you trying to remove the string entirely? In which case, what stops the noise of the hammer hitting the base board? Do you need haptic feedback, ie the player feels the same response through the hammer as in real instrument?
1️⃣ In the traditional Santur, are players able to strike anywhere on the string, or do specific locations on a string produce different effects (but at the same frequency)?
In a traditional Santur, there are 74 strings, with each group of 4 strings producing a single note. This means there are a total of 27 notes. Each sensor I plan to use will replace one set of 4 strings and correspond to a single note, meaning I need 27 sensors in total.


2️⃣ I assume the strings prevent the hammer from hitting the base, correct?
Yes, that’s correct. The strings ensure that the hammer never makes contact with the base. The hammer only strikes the strings, producing the note, and there is no impact between the hammer and the base surface.


3️⃣ In your electronic version, are you planning to remove the strings entirely?
Yes, the strings will be completely removed, and the sensors will replace them.


4️⃣ In that case, what prevents the noise of the hammer hitting the baseboard?
If you check Image 2, you will see that the sample sensor I placed has a height of 1 cm, and underneath it, there is a soft foam layer. Because of this height, the hammer does not make contact with the base, and since the area under the sensors is soft, no unwanted noise is generated.


5️⃣ Do you need the player to receive the same haptic feedback from the hammer as in a real instrument?
No, it does not matter, and the player does not experience any significant tactile sensation. The hammer simply strikes the sensor, and the note is produced. In a traditional Santur, the strings are very strong and tight, so the playing experience does not rely heavily on haptic feedback.


Here is a link to a YouTube video demonstrating how the Santur is played.
 

Thread Starter

hsoft_project

Joined Mar 9, 2025
9
Not being strings present, who produces the note?
The impact signal from the sensor is sent to an ESP32 via ADC or any external interface such as I2C. After processing the signal and extracting the strike intensity, the ESP32 is programmed to immediately play the corresponding note through a speaker upon detecting a strike.


This is how the sound of the note is generated.
 

Irving

Joined Jan 30, 2016
4,999
Is a Santur polyphonic? And is your proposed output using the DAC or another approach (eg an arbitrary waveform generator) to provide an authentic sound?


BTW, have you done the math regarding ADC sample rate v note production rate.
 

Thread Starter

hsoft_project

Joined Mar 9, 2025
9
Is a Santur polyphonic? And is your proposed output using the DAC or another approach (eg an arbitrary waveform generator) to provide an authentic sound?


BTW, have you done the math regarding ADC sample rate v note production rate.
When I initially used piezoelectric sensors, each strike on the piezo generated a signal received via the ADC. Upon detecting this signal, I used the ESP-ADF framework to play a pre-recorded WAV file via I2S, replicating the actual sound of the instrument. I expanded this system to support five audio playback channels, ensuring that the sound output closely matched that of a real Santur.


If you are referring to simultaneous playback of multiple sounds, such as a percussion instrument (like a drum) alongside the Santur performance, this is not necessary for my project. The playback of the Santur sound alone is sufficient.


However, as I developed the project further, I decided to connect the ESP32 to an Android smartphone via Bluetooth. I wrote a custom Android application that receives strike signals from the piezo sensors and, upon detecting a strike, immediately plays the corresponding note (again in WAV format). The sound is then output through the Santur's audio amplifier.


This approach eliminated the limitations of the ESP32, giving me more flexibility for future enhancements.
 

Ya’akov

Joined Jan 27, 2019
10,226
It seems that a fruitful direction of your project is to replace the strings with something that approximates them, and place your sensors at the end, For example, 3mm 7x7 wire rope would provide a target for the hammers, and the sensor could be your peizo disk placed so the pushing down on the "string" would compress the disk. You could use two disks—one on each end—if necessary. Conceptually, this is the idea (very rough sketch, supports in blue, transducers in red, transmitter blocks in brass):

1741696005545.png

You could also use a thick aluminum strip, possibly covered in silicone rubber (like a drum pad) that would provide a larger target with two piezos, one at each end. the piezo is used in electronic drums and is a very reliable transducer, it seems your best bet.
 

Irving

Joined Jan 30, 2016
4,999
It seems that a fruitful direction of your project is to replace the strings with something that approximates them, and place your sensors at the end, For example, 3mm 7x7 wire rope would provide a target for the hammers, and the sensor could be your peizo disk placed so the pushing down on the "string" would compress the disk. You could use two disks—one on each end—if necessary. Conceptually, this is the idea (very rough sketch, supports in blue, transducers in red, transmitter blocks in brass):


You could also use a thick aluminum strip, possibly covered in silicone rubber (like a drum pad) that would provide a larger target with two piezos, one at each end. the piezo is used in electronic drums and is a very reliable transducer, it seems your best bet.
Hi Ya'akov,

I was just about to suggest something very similar, but with a low cost strain gauge/load cell in the loop. Another idea was to use a metal guitar string and a simple magnetic pickup, like an electric guitar, but not using the string to make the note, just record the impact.
 

MisterBill2

Joined Jan 23, 2018
27,186
My suggestion as to a simple cheap and easy substitute for a human hand is a small piece of wet (slightly moist) raw leather, held in place with a wrapping of thin bare copper wire, such as a few turns of #28 wire or #30, which you can connect to easily. That simulates a human finger tip for my dumb touch screen on my cell phone. Cheap, easy, and simple.
 
Status
Not open for further replies.
Top