My name is Jeremy and I'm currently working on building a midi controller. The purpose of the midi-controller is to be played using mallet that strikes pads (74 of them). I choose FSR as sensor (and not piezo) because I want to have the possibility to detect sustain. But I'm actually facing issues concerning data aquisition with the FSR's.
The major problem is that the arduino doesn't seem to capture the peak when I'm striking with my mallet (it detects something 1 time on 20). Nevertheless the FSR seem to work pretty well because when I touch it with with my finger everything is in order and the FSR is very reactive. So I suspect the ADC of the arduino UNO to be too slow to capture the peak. I decided to lower the precision of the ADC to make him work faster and I succeded to capture peaks 4 time on 5 when downgrading the scale from 128 to 4 (I'm sampling at around 130KHz here). But the problem is now also the resolution, I think that the precision is too bad at this scale.
So I have severall questions:
Do you think that the ADC speed is indeed my problem?
This project needs a lot of sensor (74), so do you have recomandation of microcontroller which would be better than an arduino UNO in this case. Also if you have advice for the implementation of project with many sensors like mine it would be nice.
Do you have idea or advice for easy implementation of external ADC.
You need something that captures the analog signal fast. Something programmable with analog inputs. For example a Arduino board
Perhaps 10 cheap Arduino boards and one Arduino as control board.
Arduino Uno, 5V, 6 analog inputs.
Pro Mini, 5V or 3.3V, 8 analog inputs, no usb connector.
Pro Micro, 5V, 9 analog inputs.
Can you capture the analog signal ?
A microphone input for a electret mic has power. When you use a FSR instead of a mic, then you can record the signal. For example with Audacity. Then you know how fast the signal is. Can you make a screendump of it and show it to us ?
Can you measure the signal amplitude when it is powered with 5V and the 10k resistor ? Perhaps let the Arduino capture one channel, and dump the data with a very high rate to the serial monitor.
Can you show your sketch that you used for testing with the 130 kHz ?
A Arduino Uno can capture at 8kHz with the normal analogRead(). The analogRead() takes 112 µs.
Do you use a rubber mallet ?
Is there something covering the FSR to protect it ?
I think that your finger has a bigger surface and is much slower than a quick hit with a small edge of the mallet. It seems a very big difference.
Do you now how fast a FSR is ? I can not find that information.
I'd go with external SPI interface ADCs. Much faster sampling rates are possible.
Can even find parts with 8 analog inputs, and use 10 of them.
Each one gets its own slave select pin, and needs 3 SPI.transfers to read a result with SPI clock at 2 MHz.
Koepel:
You need something that captures the analog signal fast. Something programmable with analog inputs. For example a Arduino board
Perhaps 10 cheap Arduino boards and one Arduino as control board.
Arduino Uno, 5V, 6 analog inputs.
Pro Mini, 5V or 3.3V, 8 analog inputs, no usb connector.
Pro Micro, 5V, 9 analog inputs.
Can you capture the analog signal ?
A microphone input for a electret mic has power. When you use a FSR instead of a mic, then you can record the signal. For example with Audacity. Then you know how fast the signal is. Can you make a screendump of it and show it to us ?
Can you measure the signal amplitude when it is powered with 5V and the 10k resistor ? Perhaps let the Arduino capture one channel, and dump the data with a very high rate to the serial monitor.
Can you show your sketch that you used for testing with the 130 kHz ?
A Arduino Uno can capture at 8kHz with the normal analogRead(). The analogRead() takes 112 µs.
Do you use a rubber mallet ?
Is there something covering the FSR to protect it ?
I think that your finger has a bigger surface and is much slower than a quick hit with a small edge of the mallet. It seems a very big difference.
Do you now how fast a FSR is ? I can not find that information.
I use a mallet in wool, and I protected the fsr with a little piece of rubber. The fsr has no speed because it really acts like a resistor.
For the measure of signal, I'll send tomorow screenshots of the serial plotter.
My sketch is the following:
int fsrAnalogPin = 0; // FSR is connected to analog 0
int fsrReading; // the analog reading from the FSR resistor divider #define sbi(PORT, bit) (PORT |= (1<<bit)) #define cbi(PORT, bit) (PORT &=~(1<<bit))
CrossRoads:
I'd go with external SPI interface ADCs. Much faster sampling rates are possible.
Can even find parts with 8 analog inputs, and use 10 of them.
Each one gets its own slave select pin, and needs 3 SPI.transfers to read a result with SPI clock at 2 MHz.
So you could write some code to cycle thru all them, see how long that takes and if it's fast enough.
You don't need any parts to do it, just run the commands and use micros() to time it.
I was wondering if there were alternatives for using external ADC's than building a pcb. Because when you want to test features, the pcb is not very versatile.
This is a snapshot and a relatively long time to print it.
You could update a variable with the peaks of the result, maybe with a timed decay.
Try to build/code it with a common Arduino and a few FSR first, and see what problems you run into.
Only then can you decide on the right hardware.
Leo..
You could build it up on perfboard with wirewrap and just 1 part to start. If it works well, then add more parts.
Timing-wise, just write the code & run it, with no parts, see how long it takes. Won't be any data to look at - no parts yet - but you can see speed-wise if it will cycle fast enough.
Crank this up:
Serial.begin(9600);
to 115200, that will help a lot.
I doubt you will run into timing problems if you use five 16-channel 74HC4067 multiplexers connected to five analogue pins.
You should be able to sample all 74 FSR in under 10 milliseconds.
Use the right pull up resistor, and do use (10n) capacitors across each FSR, to not miss events.
Leo..