Need Help Creating a DAS (Data Acquisition System)

Hi guys and girls,

I'm currently drawing plans for a data acquisition system using the Arduino platform. I have a lot of experience programming, but very little experience with hardware design and creation.

My DAS will use vibration sensors (piezo discs) to record individual notes played on a gamelan instrument (a metalophone similar to a xylophone) so that I can write out a score of the music in real-time. This means I will need many analog inputs, and so I was thinking of using the MUX shield which provides 48 analog inputs.

Here are my current hardware questions (I'm fine for the software):

1) Since this will be a permanent system it needs to be rugged. I've read that the Arduino is mostly a prototyping platform so this has me worried a bit. Do you think solid permanent projects can be created with the Arduino?

2) My idea is to use an Arduino without headers so that I can solder my connections instead of using flimsy pin connections. The problem here is that I can't find a MUX shield without headers. Does that exist?

3) As far as I can tell the Arduino uses a 10bit ADC. Does that mean that I could gather 10bit with 44,100 samples per second on each of the 48 analog inputs? Or would I need a smaller sample rate? The reason I'm asking is that for certain notes it might be required that I do waveshaping analysis.

4) I was also looking at the Arduino nano with has 8 analog inputs since this means I could get 64 analog inputs with multiplexing, instead of 48 with the Arduino UNO. Is that right?

5) Does anyone have any experience using piezo elements with the Arduino? I did the knock tutorial here: http://arduino.cc/en/Tutorial/Knock but my level was way to low to detect a knock. I tried with various buzzers and always had the same problem. Perhaps I need to create a small amplification circuit.

Those are my main questions for now. I have a few others, but I don't want to flood you with that.

Thanks

My DAS will use vibration sensors (piezo discs) to record individual notes played on a gamelan instrument (a metalophone similar to a xylophone) so that I can write out a score of the music in real-time. This means I will need many analog inputs, and so I was thinking of using the MUX shield which provides 48 analog inputs.

Unless your time is for free why not use an Arduino Mega that already has enough pins? Next thing: why use ADCs and not digital inputs? Do your really need to sample 48 analog signals at high frequency? If so: forget the Arduino. It has 16 MHz System clock and very little RAM. There is no way that an Arduino without external help could sample 48 10bit analog channels @44.1kHz.

If you need to detect knocks and the piezo output is to low add an amplifier.

Hi tigertrainer,

1) Since this will be a permanent system it needs to be rugged. I've read that the Arduino is mostly a prototyping platform so this has me worried a bit. Do you think solid permanent projects can be created with the Arduino?

Use the Arduino board & shields to develop the project and then if it works just duplicate the electronics into your own custom hardware.

3) As far as I can tell the Arduino uses a 10bit ADC. Does that mean that I could gather 10bit with 44,100 samples per second on each of the 48 analog inputs? Or would I need a smaller sample rate? The reason I'm asking is that for certain notes it might be required that I do waveshaping analysis.

As your still using the onboard ADC to read the inputs (the CD74HC4067 is not separate ADC's) I suspect with circuit recharge time it will not manage this speed.

4) I was also looking at the Arduino nano with has 8 analog inputs since this means I could get 64 analog inputs with multiplexing, instead of 48 with the Arduino UNO. Is that right?

Once you have proved the the concept works with the shield then just add extra CD74HC4067 chips to your custom board. Each CD74HC4067 chip allows 1 arduino analogue pin to read 16 separate inputs so for an ATmega328 wired the same as used in the UNO with 6 analogue inputs you could connect 6x chips = 96 inputs

[quote author=Udo Klein link=topic=112455.msg845134#msg845134 date=1341143752] Unless your time is for free why not use an Arduino Mega that already has enough pins? [/quote]

The mega has 14 analog inputs, not enough. I need a minimum of 40.

[quote author=Udo Klein link=topic=112455.msg845134#msg845134 date=1341143752] why use ADCs and not digital inputs? [/quote]

How would I be able to detect if a note has been played on a xylophone type instrument using a digital input?

[quote author=Udo Klein link=topic=112455.msg845134#msg845134 date=1341143752] There is no way that an Arduino without external help could sample 48 10bit analog channels @44.1kHz. [/quote]

Do you know what the sampling rate would be using MUX and all 48 analog inputs?

Riva: Use the Arduino board & shields to develop the project and then if it works just duplicate the electronics into your own custom hardware.

I thought of this, but I don't want to re-invent the wheel if possible. Also, I never made my own hardware before and live in a remote area where it might be hard to get the tools I need to manufacture a PCB. I was thinking that buying an Arduino Pro-Mini which comes without header pins and can be soldered might be good. Then I'll build a multiplexer if I need to, or perhaps ask around if I can find someone to build it for me.


The other idea I had was to bypass the Arduino entirely and use a bunch of MCP3208 adc chips connected together. They use the SPI protocol. I'm not sure how they should be connected though? Daisy-chained? I'm also wondering if I could go directly from these chips to USB so that I wouldn't need a micro-controller at all.

I thought of this, but I don't want to re-invent the wheel if possible. Also, I never made my own hardware before and live in a remote area where it might be hard to get the tools I need to manufacture a PCB.

You don't need to design and build your own PCB, you can just use stripboard.

The other idea I had was to bypass the Arduino entirely and use a bunch of MCP3208 adc chips connected together. They use the SPI protocol. I'm not sure how they should be connected though? Daisy-chained? I'm also wondering if I could go directly from these chips to USB so that I wouldn't need a micro-controller at all.

Looks like you can get USB2SPI devices http://www.byvac.com/bv3/index.php?route=product/product&product_id=88 but this one only supports 3 SPI devices so you would be down to 24 ADC's (8 per MCP3208)

With this gamelan instrument (does it look like cooking pots hung up?) then does one pot produce one pitch or can the pitch vary depending on where the pot is hit. What I'm trying to say is can you just measure hits with something like this project http://www.makeymakey.com/

Yes, a stripboard. True. A bit ugly, but it would do the job I guess.

Wow! The Makeymakey system could be what I'm looking for. Indeed, most of the gamelan instruments are one sound per note, so I only need to get a hit marked. The only exception is a pair of drums which can be hit in various ways to produce high or low sounds, and I was thinking of doing wave shaping analysis to figure out which type of hit it was.

The only thing about MakeyMakey is that the player hits the note with a wooden stick. The notes themselves conduct electricity (they are made of metal), but I don't think the wooden stick would be a good conductor. Also, we don't want to be in the way of the players. It can't be something that bothers them while they are playing. I'm also scared that clipping the bronze notes affects their sound too much so that it annoys the players. You see, we want to record live performances in villages and so on, not just situations where the musicians are recording just for us. But, definitely, I have to look into this possibility as well. Hmm... Thanks for that link.

  1. As far as I can tell the Arduino uses a 10bit ADC. Does that mean that I could gather 10bit with 44,100 samples per second on each of the 48 analog inputs? Or would I need a smaller sample rate? The reason I’m asking is that for certain notes it might be required that I do waveshaping analysis.

Just to make sure you are clear, there is only one ADC on an arduino, with a multiplexor connecting it to the analogue input pins. The inputs are not being sampled constantly. When you call analogRead(), it connects the requested pin to the ADC, takes a sample and returns the result. This process takes about 100 microseconds. If you change pins, it is recommended that you take two readings, and discard the first. Add to that the time required to select the appropriate input on the external MUX, and you’ll see that you won’t get anywhere near 44KHz.

@dxw00d

Thanks for the clarification. Having multiple multiplexers constantly hounding Arduino's ADC one by one seems problematic; either the ADC enjoys all the attention, or it will feel like it's being stuffed by many strangers. Hmm... Perhaps I need to look at the MCP3208 solution I was thinking of.

@Riva

I thought about MakeyMakey some more, and although it sounds really great, there is one major problem. The musicians can and sometimes do connect their playing sticks to the notes by accident, or when they place their sticks on the instrument while taking a rest (if someone else is playing, but not them). This could add dirty data. It seems the only way to be really clear is to get a volume reading.

Tiger Trainer:

Please note that you are an ideal candidate for an earlier post I made today: http://arduino.cc/forum/index.php/topic,112462.0.html

The designnews.com training series would be worth your while!

You are an experienced programmer who needs some hardware knowledge right? The Arduino series is not appropriate for this project, but you lack knowledge. Simple. Buy the Mega 2560, gain some knowledge and decide on another platform. It is a long uphill climb on the other platforms -- with minefields and live fire exercises and lots of misinformation.

The Arduino platform is one of the simplest "get started" platforms I have seen in my 45 years of industry participation.

First: Get an analog accelerometer that can be used with the A/D interfaces. Hook it to your Arduino Mega 2560. Run the exercises -- learn how to read it and send it to your PC through the USB.

Second: Develop enough expertise to use the BOSCH accelerometers that use twin wire (digital) and have adjustable filters -- tuning ranges.

Third: Learn how to build a framework that gives you the results you want.

Fourth: Switch platforms and up the clock rate and move to 32 bit -- maybe even multicore. SAM7X the TI platforms etc. You can get the next system for a few bucks more than the Arduino if you look carefully. The difference is that you will have the skills to evaluate the software and see if you can live with their libraries and support systems.

In short: Nothing better than the Arduino to develop the need skills.

I have built Low Frequency Noise detectors tied to a PC with data collection and a Second PC for analysis -- using UDP packets over Ethernet -- easy-peasy. All with Arduino and Make controllers. It can be done but it is a bit beyond the power envelope for the Arduino.

Maybe if they add an XMega version with the 32 MegaHz clock rate....

@WillR

Thanks, I'll check that out. Yes, I'm a programmer, but I never really did hardware. I've owned an Arduino Uno for the last few months and have done some projects like controlling some solenoids to play musical notes, but that's about it. I understand most of the hardware concepts, but I'm not good at calculating details regarding sensitivity of sensors, required CPU speed for certain tasks, what resistors to use, etc...

Programming is easier to learn since you just erase your line and try again if it doesn't work. With hardware, it's a bit more expensive. I don't want to be buying the wrong parts on my budget!

tigertrainer: I thought about MakeyMakey some more, and although it sounds really great, there is one major problem. The musicians can and sometimes do connect their playing sticks to the notes by accident, or when they place their sticks on the instrument while taking a rest (if someone else is playing, but not them). This could add dirty data. It seems the only way to be really clear is to get a volume reading.

If they connect there sticks by accident (I assume producing a note) then no simple system is going to know it's a bum note and not a genuine one. Resting the stick on the instrument may not be a problem as you could ignore press durations longer than x millisecond if they normally tap it.

@Riva - The more I think about it, the more I realize the amplitude system is the only way to go. We have to measure the vibration of the notes. We can't use the Makey Makey way. What I forgot to mention and forgot to consider earlier is that the performer also kills previous notes by slightly touching them with his hand. So, let's say you hit note A with the stick, then when you play Note B you will hit it with the stick and use the side of your palm to muffle note A. Every time you play a note, you also shut another off. By detecting the amplitude of vibrations, we can not only know when a note was struck, but we also can measure how long the note lasts as the vibration will slowly die before the performer muffles the note to completely kill it. With the M&M (perhaps the first time this name is used to refer to MakeyMakey) system, notes that are played would be confused with notes that are shut off. With an audio recording system, we could also do wave analysis to know when notes are played normally, and sometimes hit in a chocked manner (yes, there are actually two ways to play the notes).

I'm starting to think I need something like 40 channels of 8-10-12 bit audio at 22,050 samples per seconds. I have no idea how doable this is. I'm going to test with MaxMSP to see what is the lowest bit rate and sample rate I need in order to do wave analysis to differentiate hit types.

Let's keep the M&M for another project. How about one where we trigger motors when certain M&M connections are made. So, we set up a passage that leads to our house and create a few steps on the way. When a visitor comes and has a foot on each step, we can trigger an event. Like a little toy soldier that says "Hi! Welcome!", or the bell that rings a bit before the person arrives.

@tigertrainer: with "a lot of experience in programming" I would have expected that you deliver reasonable description of your goal. Your new specification basically makes this something completely out of reach of Arduino.

My suggestion would be to implement a prototype for only two notes using a PC/Laptop + soundcard + microphone and then extend it to 40 notes.

Once you have a prototype you will know how hard this really is and how much processing power you will need. Then you can consider the required platform.

[quote author=Udo Klein link=topic=112455.msg845968#msg845968 date=1341214605] with "a lot of experience in programming" I would have expected that you deliver reasonable description of your goal. [/quote]

We cannot all be gods. I have been known to make mistakes... this is not my first one and most likely won't be my last.

The idea of dead notes (click type sounds) had completely escaped me. Now that it's clear we will have two different sounds to process, it's obvious I have to test what is the minimum quality signal that is acceptable so that I can apply simple wave shaping analysis.

But first, I'll drink some Nectar and eat some Ambrosia in your honor my god. Before you I bow, for my mistakes are sins and your perfection is the light that warms my heart, and the hearts of all other men.