Touch sensitive interface (MPR121)


#1

a touch sensitive interface (=velocity) would be great. I used a mpr121 ic with teensy to send touch note on/offs & velocity over usb-midi and cv like used by bare conductive touch board. I tried to get the mpr121 running with axoloti over I2C. my coding knowledge are not enough for it and it will take more time.

Here is a link to a mpr121 extension board:
Sparkfun MPR121
BC Touch Board

By the way, a MI cloud clone would be great. I build two for myself, but the sampling time is often to short. maybe a axoloti style can do longer sampling time with high resolution.


Popular Eurorack module - Requests
Capacitive touch module
#2

FSR sensors? Only takes an additional pullup resistor to connect to GPIO analog in.
Will be more responsive than MPR121 (28ms scan time), but apples to oranges....


#3

You can simply read the pin, but the autocalibation feature is worth the time smile I Build some prototypes with the MPR121 and they work nearly perfect in different situations. I use I2C not the GPIO Mapping.


#4

interesting topic (moved as might be worth further discussion)
a link, so others no whats being discussed here smile
https://www.sparkfun.com/products/9695
https://www.sparkfun.com/products/12017
( i assume both boards are needed?)


#5

1+ for splitting this thread!

It would be good to show the differences between a native GPIO and the MPR121 version.


#6

Good idea, to split the topic to a separate thread @thetechnobear

The second linked board (touch keyboard) has an own MPR121 IC build on. By using only the touch sensor breakout board, you will need to connect any conductive material to the sensor pins. I used conductive paint, but bananas & bamboo plants will also work really well wink
The sensitiv of the sensor can be adjust.

Johannes posted a reference to the I2C api on an other thread. This should be helpful to get started.
Axo I2C connectivity

I2C api


#7

does any got a I2C device work with axoloti and can help me?

I'm trying to get the MPR121 working but I've failed the whole day. Does anybody know, what I'm doing wrong? I tested the I2C commands with a bus pirate (IC2) and an oscilloscope (IRQ Pin) and it's working.
If I try to send the same setup commands via axoloti I2C port, my logic sniffer and oscilloscope only show "0xf0" commands and there is no IRQ pin HIGH/LOW. I used different clock rates, but nothing is working.
The script is based on sparkfun mpr121 github examples: GitHub

OLS Logic Sniffer screenshot

I2C MPR121 test.axp (5.1 KB)
axoloti I2C script

here are the IC2 commands for bus pirate:
BP I2C MPR121


#8

I think this is the issue you are seeing:
The buffers you use for I2C send and receive must be declared in a different section of memory. That is required for DMA. Check archive/tests/io/spi_lkm1638.axh for an example.

static uint8_t _txbuf[8] __attribute__ ((section (".sram2")));
static uint8_t _rxbuf[8] __attribute__ ((section (".sram2")));

#9

after a long time, I can read out the touch states…

Script code

Patch


#11

Thanks !
Work's like a charm with low cost mpr121.

Link to the good patch here.


#12

Yes, I use the same breakout board. Did you get to work the proximity function of all 12 electrodes internally combined?


#13

No sorry, certainly the next step :slight_smile:


#14

Hey, no need to apologize, I'm getting a little bit ahead of myself, since I learned just few days ago what the 'script' object does :slight_smile: I get the same messages in terminal. Is it possible to use the script outlets to actually trigger other objects or do I have to modify the code or even create a new object to get this working?
I found this guy who uses the proximity function for mouse scrolling:
https://miroslavbodis.com/index.php/home/article/2016/01/66/using-proximity-sensor-for-scrolling-documents


#15

Just modify the Paul's code :

For example, add "out1 = 1;" after "LogTextMessage("pin: [%i] was just touched", i);" (line 116) and "out1= 0;" after "LogTextMessage("pin: [%i] is no longer being touched", i);" (line 125).

Then connect out1 outlet of the script object to an adsr envelope.


#16

Thanks, this did the trick. I thought I could run the script 6 times and get 12 outlets for all pins, but when I try to run 2 instances it crashes. Is there any workaround?


#17

Perhaps MidiSend3 is a solution : I2C_MPR121_midi.axp (8.9 KB)


#18

Wow, thanks a lot. Works great!