Muscle Sensing with the Pi?


9 posts
by Ilikelego » Sat Jun 08, 2013 8:53 pm
Hey People,

I'm wanting to make an EMG project to control an application or another piece of hardware. I was going to go with an arduino but I thought the Pi might be nicer as I could do most of the classification on the Pi itself etc?

Has anyone got any experience with this or can they offer any advice on getting started with this?

I'm new to hardware as i'm mainly programming nowadays and so i'm a bit confused by what I would need exactly.

Thanks
Posts: 4
Joined: Sat Jun 08, 2013 8:28 pm
by mahjongg » Sat Jun 08, 2013 8:58 pm
You will need an instrumentation amplifier to measure the muscle voltages, followed by a suitable A/D converter chip (the PI doesn't have analog inputs). The latter is simple, there are a couple of projects that have figured out how to interface simple SPI controlled AD converter chips to the PI.

Be safe with electronics that interface to people!!!!
User avatar
Forum Moderator
Forum Moderator
Posts: 8958
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands
by Ilikelego » Sat Jun 08, 2013 9:53 pm
Ok thank you.

Do you know of any good documents, books or journals regarding setting up an EMG sensing device?

I've read academic journals but they seem to be focussed on results than their actual hardware setup, plus many have custom boards or do not explain the whole procedure.

Thanks
Posts: 4
Joined: Sat Jun 08, 2013 8:28 pm
by Ilikelego » Sat Jun 08, 2013 9:56 pm
I know it's custom and i'll have to figure some bits out myself as that's the point. Plus no study i've read has actually used a PI for it. I've only spotted the odd post of forums and found a youtube vid. However, being new to this feels similar I guess to when I started to first learn C. It's a whole new world and I just need a bit of guidance/a point in the right direction..

Thanks
Posts: 4
Joined: Sat Jun 08, 2013 8:28 pm
by mahjongg » Sat Jun 08, 2013 9:57 pm
http://en.wikipedia.org/wiki/Electromyography would be a good start.
and http://en.wikipedia.org/wiki/Instrumentation_amplifier

but do note that I know little about medical electronics.

this is also a nice starter, white paper explaining the principles involved:
http://www.analog.com/static/imported-f ... _FINAL.pdf
User avatar
Forum Moderator
Forum Moderator
Posts: 8958
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands
by Ilikelego » Sat Jun 08, 2013 10:09 pm
Lol. Yeh i've read those. I've actually read a fair bit on EMG and understand the principles of it it works. Also been on the receiving end of it for some medical stuff a while back lol :P

It's just creating a device myself that I'm not really comfortable with as I'm essentially fresh off the boat with hardware. This will be my first hardware project EVER as I'm normally programming. I don't really have ANY experience with micro electronics. That's another reason why I was attracted to the PI, its fairly easy and hardware noob friendly as oppose to an arduino etc that's only a micro controller and requires a bit more know how...

Anyway, thanks for taking the time to reply. I appreciate it and sorry if I come across as stupid or noobish. I just thought i'd ask on the forums as there may be a lot of ppl here with experience like yourself. I guess I'm out of my depth but I want to give it a go as thats how we improve and learn things :)

Thanks

Oh and thanks for the last paper. I haven't actually read that one just noticed you added it. I'll have a look at it
Posts: 4
Joined: Sat Jun 08, 2013 8:28 pm
by mahjongg » Sat Jun 08, 2013 10:17 pm
no thanks needed, and you didn't come over as a noob at all! this is advanced stuff!

as for the electronics, jut be careful not to electrocute anybody. all else is of secondary importance :roll:

If you have an oscilloscope, build the analog front end first, and test it with the scope, before proceeding!
User avatar
Forum Moderator
Forum Moderator
Posts: 8958
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands
by techpaul » Sat Jun 08, 2013 10:58 pm
Medical or medical style devices are complicated, I must finish the ECG project. Have been through medical device designs and have some prototypes sitting in my attic including a 3D medical dispaly from 15 years ago.

STICK with SURFACE type measurements, the other method of needles has way too many issues to consider using.

Consider getting some cheap TENS pads and cables, cheap in multiple packs and some are self adhesive and pre gelled, multiple use to stick on skin. This would be a cheap starting point many sellers from larger Boots, chemists and Amazon.

To improve contact you can use the best lubricant between electrode and skin that most hospitals use and is readily available KY jelly or some shampoos. I kid you not.

Whatever you do you need to measure VERY small voltages and probably try to distinguish muscle from other muscles (the heart) and other body signals, let alone noise.

Above all else keep your inputs HIGH impedance and avoid current above 100micro Amps from your circuit in any way getting into leads.

The Anaglog Devices document mahjongg referenced is a good starting point, Analog Devices have several refernces to such circuits and have a look for EMG on their website and even ECG may help you as quite a few op-amps have application examples for this sort of thing.

At least for your own use (do not recommend a circuit like this for others to use unless you want to get sued), you do not have to put in earth and other safeguards, let alone be able to survive a heart defibrillator event which is a nice high voltage spike...
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/
Posts: 1514
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
by techpaul » Sat Jun 08, 2013 11:16 pm
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/
Posts: 1514
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK