# Why does the Arduino give me a value of 1023?

I'm using an EMG sensor V3 from Advancer Technologies connected to the A0 pin of an Arduino Uno 3. When I read data from the sensor it always shows 1023 values. What is the reason for this?

I used a 9V battery with this circuit.

Note: Sometimes it works well and sometimes does as I described.

Sensor datasheet

• "... it always shows 1023" and then "... sometimes it works well ..." Which is it? What is the voltage between SIG and GND when working and when not? Please edit to fix your question, provide the voltage readings and the code (properly indented and formatted using the { } button) if it's relevant. May 7 at 15:58
• What powers the Arduino? If it is via USB connected to your PC, then you have a safety issue as well as an electrical issue. Try using a laptop running off batteries. May 7 at 16:12
• "volt is 9". The Arduino inputs accept 5 V maximum. You'll be fortunate if you haven't destroyed it by feeding 9 V into it. At >= 5 V in the ADC will read 1023, the maximum value possible in a 10-bit ADC. May 7 at 16:30
• "SIG is the output of the sensor" Which could reach almost +9V. Have you checked the link SamGibson posted below my answer? There are two important warnings there. May 7 at 16:42
• Note that 1023 is the maximum reading of a 10 bit A2D, indicating that the input is at or above the maximum voltage that it can measure. May 7 at 19:27

read data from the sensor it always shows 1023 values

The TL084 amplifier on the board is powered by the +- 9V rails. This means that the output (SIG) could be above the 5V that are powering the arduino (1023 is the highest value from the ADC).

You should use the trimpot to reduce the gain, and even better, use some additional circuit to protect the arduino ADC (clamping the maximum voltage).

More than 5.5V or less than -0.5V applied to the arduino pins may damage the microcontroller:

The product page has an important warning regarding this (source):

"Warning: This sensor’s output signal can be as high as the supply voltage (Vs). If you are using a supply voltage higher than the rest of your system can handle, we recommend using the gain potentiometer to adjust the sensor’s maximum output to an appropriate voltage before connecting the signal line to the rest of your system. Alternatively, you could lower the output voltage using an external circuit such as a voltage divider before connecting it to your microcontroller."

Here is something you can do (assuming the arduino is not damaged):

1. Change your code using the analogReference function to use the internal 1.1V reference
2. Do not connect the SIG pin directly to the ADC input. Use a voltage divider as shown below
3. Use the board trimpot to adjust the gain accordingly

Note that in this application you may get saturated readings occasionally, so take this properly into account as required (it may or not be acceptable for your intended use). The R2 value is conservative (to allow readings below 1023) but you may need higher values (1k2, 1k5) as the battery is used or if you get a saturated analog signal.

Connect the 2 grounds together .The 2 batteries form a circuit which doesnt have a return path inside the Arduino.

• The schematic in the datasheet linked in the question shows that the output Gnd connection is already connected to the power input Gnd on the sensor's PCB, so connecting them again has no benefit. May 7 at 16:25