Hello Everyone :)
I have constructed an op-amp based circuit to measure a biosignal known as Electromyogram or EMG. I have attached the image of the output signal measured from an oscilloscope. EMG signal is basically a measurement of electric potential generated due to muscle contraction. In the attached figure, the portions of the signal which have higher amplitude occur when Im flexing my forearm muscles. Im flexing my muscles three times, and each time i flex my muscles the amplitude of the signal increases.
Now im interested to digitize this signal by inputting this signal to an ADC pin of an arduino board and transmitting these signals wirelessly (using a pair of xbee tranceivers) to a computer for further signal processing. However this signal has both positive and negative components. Should I 'offset' the signal (using additional op-amp circuits) so that the signal falls within the 0-5V range? How should I go about to transmit this signal wirelessly?
Ive also attached the circuit i have constructed. The outputs of these circuits will be sent as inputs to the arduino pins.
Yes, you should avoid driving signals outside the 0V-5V range to the Arduino A/D pins. You can add another op-amp to your circuit to level-shift your output, or do some clever level-shifting in your final output stage (you can use a circuit like this (http://ruggedcircuits.com/html/circuit__25.html)).
Since you're probably just interested in the magnitude/energy of your waveform you could always just rectify it and basically construct an envelope detector:
It'll only cost you a diode, resistor, and cap. Plus, you won't have to worry about negative voltages.
The Rugged Motor Driver (http://ruggedcircuits.com/html/rugged_motor_driver.html): two H-bridges, more power than an L298, fully protected
Thanks RuggedCircuits! :)
I think my best option would be to full wave rectify this signal in order for the signal to be limited to the 0-5V range. Ive used an envelope detector circuit in a previous project. Envelope detectors are very useful when we are interested in the amplitude of the signal. However the drawback of using either an envelope detector circuit or a half wave rectifier is that the frequency components of the signal gets altered. A full wave rectifier 'flips' the negative portion of the signal onto the positive portion of the signal, keeping all the frequency components intact.
But then I have to deal with another issue - the signal is kinda 'spiky' and 'sharp'. Previously I have only dealt with 'smooth' signals. Can I use an arduino and xbee tranceiver pair to transmit this spiky signal to a computer? (Assuming I limit the signal within the 0-5V range)
A full-wave rectifier is going to double your frequency components and introduce some harmonics too. The basic question is what are you interested in: raw signal energy or time/frequency components. You are right in that if you actually want to dig in to the time structure or frequency structure of your signal then an envelope follower will remove that information.
The "spikiness" of your signal has to do with the frequency content. You can use a wireless transmitter to transmit the signal but you will have to obey the Nyquist criterion and sample the signal at at least twice its maximum frequency content (assuming, again, that you are really interested in preserving that).
The Aussie Shield (http://ruggedcircuits.com/html/aussie_shield.html): breakout all 28 pins to quick-connect terminals
Rugged circuits has raised some of the issues I was considering a detailed reply to. This looks like a University research project. I know because I consulted on what seems to be an identical project many years ago... :)
I just checked the specs for XBEE by going here...
They had everything organized that I needed to see quickly...
20MS is the Packet rate. The ADC sample rate is faster -- but you are limited by the lower of all the relevant specs.
(20/1000) .02 1/.02 gives you the frequency.... of 50HZ That will not sample your waveform!
But if you follow Nyquist -- that is just going to allow you to resolve the frequency -- not preserve the waveform.
And ADC of better than 10 bits might be appropriate for medical research -- but this looks like a Kineseology Masters thesis sort of stuff..
Is this serious commercial stuff or student stuff or medical stuff??? -- I would give very different answers depending on the specifications for the data requirements.
The conversion time on the ADC will be the issue here -- then the ability to store or transmit at the required rate.
I am not speculating -- I am working on a project which is processing almost identical looking signals at about the same frequency range -- though they have an entirely different source.
I am transmitting the packets to a PC Via a UDP client on the Arduino which is talking to a UDP server on a Windows Vista 64 system (4 core). It seems to be barely possible. I may yet decide it is not possible on a 16MHz Arduino.
Regardless -- the prototyping capability of the Mega2560 is fabulous.
This discussion should really be in the Scientific processing forum. This is not a sensor question but a compendium of issues....
Thanks Rugged Circuits &WillR
Yes, this is my university final year project under the biomedical instrumentation category :). This is a student project and its not meant for commercial or medical use. Il bring this discussion over to the Scientific processing forum. Ive attached the complete schematic of the biosignal/EMG sensor circuit just in case it may come in handy to anyone who comes across this discussion.
That last graph is interesting...
You don't really need that circuit, you can do the same with a moving average of an RMS function if that makes sense to you. Just ask an electrical engineer -- if you don't understand -- they might think that you're nuts -- but that's life.
I use that type of function to detect a signal "buried in the mud". I use it on my low frequency analysis suite to determine if a time frame is worth further analysis. It's cheaper than building a board and thinking. Thinking is stressful. :)