AlexVend
Posts: 8
Joined: Mon Apr 05, 2021 7:37 am

EMG sensor and Raspberri Pi

Wed Jun 09, 2021 6:58 am

Hi guys! Can anyone help me? I have raspberry pi 3 and grove base hat (https://wiki.seeedstudio.com/Grove_Base ... pberry_Pi/). I want to connect an EMG sensor. I have already taught me how to read data in mV from sensor but I do not understand how to process this data that they were correct. Has anyone tried doing this?

Code: Select all

import time
from grove.adc import ADC

adc=ADC()
channel=4

def main():
	def getdata():
		data=adc.read_voltage(channel)
		return data
	while True:
		Signal=getdata()
		print('EMG: {0}'.format(Signal))
		time.sleep(.1)

AlexVend
Posts: 8
Joined: Mon Apr 05, 2021 7:37 am

Re: EMG sensor and Raspberri Pi

Wed Jun 09, 2021 7:08 am

Here's what is output:
EMG: 3246 
EMG: 1936 
EMG: 92 
EMG: 4 
EMG: 1 
EMG: 0 
EMG: 0 
EMG: 0 
EMG: 0 
EMG: 1443 
EMG: 3112 
EMG: 3204 
EMG: 3237 
EMG: 3249 
EMG: 3243 
EMG: 1458 
EMG: 22 
EMG: 0 
EMG: 0 
EMG: 8 
EMG: 0 
EMG: 9 
EMG: 1493 
EMG: 3138 
EMG: 3224 
EMG: 3231 
EMG: 3249 
EMG: 3255 
EMG: 752 
EMG: 15 
EMG: 4 
EMG: 1 
EMG: 4 
EMG: 0 
EMG: 0 
EMG: 0 
EMG: 0 
EMG: 3081 
EMG: 3191 

User avatar
B.Goode
Posts: 12299
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: EMG sensor and Raspberri Pi

Fri Jun 18, 2021 8:38 am

AlexVend wrote:
Wed Jun 09, 2021 6:58 am
I have already taught me how to read data in mV from sensor but I do not understand how to process this data that they were correct.

Why do you think the reported data is not correct? What independent calibration do you have to check the results?


(It seems unlikely that the results posted were produced by the accompanying code.)

twostage
Posts: 125
Joined: Sun May 07, 2017 6:31 pm
Location: Northumberland

Re: EMG sensor and Raspberri Pi

Sat Jun 19, 2021 11:02 am

The numbers you are getting back are millivolts with the max value being 4096 according to their github pages.

If you want volts then simply divide by 1000.

AlexVend
Posts: 8
Joined: Mon Apr 05, 2021 7:37 am

Re: EMG sensor and Raspberri Pi

Sun Jun 20, 2021 2:03 pm

It seems strange to me that the data periodically becomes close to zero. If I disconnect the sensor from the board, the data becomes maximum and is always equal to 4096.

AlexVend
Posts: 8
Joined: Mon Apr 05, 2021 7:37 am

Re: EMG sensor and Raspberri Pi

Sun Jun 20, 2021 2:05 pm

I do not calibrate the sensor because I do not know how and where it should be done.

Return to “Interfacing (DSI, CSI, I2C, etc.)”