Analog input enough to power on-board LEDs but not readable from analogRead

Hi!

So I'm using the Advancer EMG board which is powered by two 9 volt batteries. When the arduino uno itself (not connected to a computer or power source) is connected to the EMG board via the Gnd pin and Analog In pin, the L-led and On-led light up when I contract my muscle. However, when I use the analogRead and check the results using pyserial.readline(), I hardly see any significant jump beyond noise.

This is where I'm having an issue. How can there be enough signal coming from the EMG board to light up the Arduino UNO's LEDs, but the UNO not read it as a significant jump in signal?

I've also attached the files I'm using, but I don't know if it'd be helpful. Overall, any help would be greatly appreciated! Thank you so much!

(picture of setup+wiring)

runArduino_EMGserver.ino (1.01 KB)

Muscle Sensor v3 Users Manual.pdf (257 KB)

You can paste your sketch between code tags.
Use the </> icon in the posting menu.

Looks like you are setting the analog inputs as digital inputs then trying to do an analogRead on them.

If you want to read an analog input you don't make it a digital input.

cloudlife:
So I'm using the Advancer EMG board which is powered by two 9 volt batteries. When the arduino uno itself (not connected to a computer or power source) is connected to the EMG board via the Gnd pin and Analog In pin, the L-led and On-led light up when I contract my muscle. However, when I use the analogRead and check the results using pyserial.readline(), I hardly see any significant jump beyond noise.

What do you think makes the Arduino work, without connection to a power source? The Analog In pin will draw current from the EMG board, tying the signal almost to Gnd :frowning:

Hi,

Also,

are you sure you have connected the two batteries

positive(protruding part) negative negative positive(protruding part) correctly ?

That would be +9VDC ground+ground - 9VDC.

accept my apologies since my answer is confusing.

This morn when I answered the question, I did not click open the picture you posted here

I thought you would make a mistake by connecting the batteries as above

but after i have clicked open your pic although i cannot see everything clearly, it seems
your connections are right

if you are connecting your two batteries

positive 9v(+9vdc) ( gnd -------positive 9v) ----gnd (-9vdc) as stated in the manual

Please ignore my post.

For the example you are using, I have never set my analog pins as inputs

i guess analogRead is input as default

by all means you need power supply for your arduino board and fix the code in order to make this sensor work

The LED lights up because the program tells it to. Regardless of what is on the analog input.

@LarryD Actually the pins are properly set as an analogInput: pinMode(analogInput*, INPUT);*
@DrDiettrich Yes, of course I realize the board is pulling current from the EMG board. It's for that very reason I know the EMG board is actually working, because it's providing more power/signal whenever I contract my muscle. The issue is why does reading the analog pin that receiving this much power (enough to light up the LEDs) not register significantly above background noise from the other pins.
@siutoejai The battery is connected properly + to +V, battery - connected to other batteries +, and the other batteries - connected to -V as according to the wiring diagram. The EMG board is functioning as told to us by the LEDs on the arduino modulating according to muscle tension.
@Paulcet LEDs light up because electricity goes through them, not just because the program tells it to do so.
Such a mysterious problem......

What are you doing here?

for(int i=0;i<6;i++)
{
 analogInput[i] = i+1;
 value[i] = 0;     
 pinMode(analogInput[i], INPUT);    
}
. . .
for(int i=0;i<6;i++)
{
value[i] = analogRead(analogInput[i]);
}

I also would like to know why the example is written this way. hm...

@LarryD @siutoejai The example code is essentially looking at all six analog pins. One will have the actual signal, and the rest I guess is to measure background.

  // declaration of pin modes
  for(int i=0;i<6;i++)
  {
    analogInput[i] = i+1;
    value[i] = 0;     
    pinMode(analogInput[i], INPUT);    
  }
for(int i=0;i<6;i++)
{
value[i] = analogRead(i);
}