/*------------end here---------------------*/
// if less than timeBudget, then you still have (timeBudget - timeStamp)
to
// do your work
delayMicroseconds(500);
// if more than timeBudget, the sample rate need to reduce to
// SAMPLE_FREQ_500HZ
}
Calibration
Calibration is recommended for every time when you use it, for the EMG signal is
different in different position even of the same person.
1. Modify the variable Threshold in the sample code to 0, namely: static int Threshold = 0;
2. Upload the sample code to Arduino control board and open the serial monitor of Arduino IDE
to check the printed value.
3. Relax the arm muscle and check the printed value of serial port. Calm down and relax for a
while to check and record the maximum value printed by the serial monitor. If the value is too
large, such as more than 1000, you can try fine-tune position of the dry electrode.
4. Modify the variable Threshold in the sample code to the recorded maximum value, and
reload the sample code to Arduino control board.
5. Open the serial plotter of arduino IDE and the myoelectricity waveform could be seen.
In general, the waveform is a line of 0 when the muscle is relaxed, shown as below. It is
normal along with occasional peak waveform.
Obviously myoelectricity waveform could been seen in the process of making a fist, shown
as below.
BasicApplication
This application explains the way to distinguish whether the EMG signal is made by
fisting counts. It can be applied to push-up counts, dumbbell curl counts. It also can be
applied to human-computer interaction, such as play Flappy Bird with EMG signal made
by fist.
Please refer to the Chapter 4: 4.1 Preparation and 4.2 Connection Diagram for
hardware connection and sensor position.
This sample code needs EMGFilters library file, please download and install the
EMGFilters Library first.
https://codeload.github.com/yuyouliang/EMG_Filter/zip/master
How to install Libraries in Arduino IDE
https://www.arduino.cc/en/Guide/Libraries#.UxU8mdzF9H0%7C
/*
Copyright 2017, OYMotion Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or withou
t
modification, are permitted provided that the following condition
s
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyri
ght
notice, this list of conditions and the following disclaimer i
n
the documentation and/or other materials provided with the
distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTO
RS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRE
CT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDI
NG,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSE
D
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABI
LITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OU
T OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF S
UCH
DAMAGE.

SEN0240

Mfr. #:
Manufacturer:
DFRobot
Description:
Multiple Function Sensor Development Tools Gravity: Analog EMG Sensor by OYMotion
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet