Is it normal that analog sensors influence each other? Arduino Pro Mini

Hi guys

I have a little problem.
I have connected 8 force resistive sensors to a Arduino Pro Mini, and I´m sending data through bluetooth to my pc.
As seen on the image attached - I´m pressing sensor “a” and “f” but the following sensors, “b” and “g” is influenced by this, and give a little output. It does not matter which sensor i press, the next in line will then be influenced.
I have inserted my Arduino Code just in case.

Is this normal or can I do something to resolve it?

Another thing; as seen in the Arduino code, I have a delay of 10ms = 100 cycles/second. But i´m pretty sure that it runs slower than that - is there a limit for how fast the output can be of the Arduino Pro Mini? I use 9600 baud.

Regards - Kasper

// Reads the analog inputs every 10ms and sends voltage value over serial

void setup() 
{
  // Start serial at 9600 baud
  Serial.begin(9600); 
}

    void loop() 
{
  // Read the input on the analog pins:
  int sensorValue0 = analogRead(A0);
  int sensorValue1 = analogRead(A1);
  int sensorValue2 = analogRead(A2);
  int sensorValue3 = analogRead(A3);
  int sensorValue4 = analogRead(A4);
  int sensorValue5 = analogRead(A5);
  int sensorValue6 = analogRead(A6);
  int sensorValue7 = analogRead(A7);
  
  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 3.3V):
  float voltage0 = (sensorValue0 * (3.3 / 1023.0));  
  float voltage1 = (sensorValue1 * (3.3 / 1023.0));
  float voltage2 = (sensorValue2 * (3.3 / 1023.0));
  float voltage3 = (sensorValue3 * (3.3 / 1023.0));
  float voltage4 = (sensorValue4 * (3.3 / 1023.0));
  float voltage5 = (sensorValue5 * (3.3 / 1023.0));
  float voltage6 = (sensorValue6 * (3.3 / 1023.0));
  float voltage7 = (sensorValue7 * (3.3 / 1023.0));
    
  // Print out the values you read:
 
{
  
  Serial.print(" a ");
  Serial.print(voltage0,2);
  Serial.print(" b ");
  Serial.print(voltage1,2);
  Serial.print(" c ");
  Serial.print(voltage2,2);
  Serial.print(" d ");
  Serial.print(voltage3,2);
  Serial.print(" e ");
  Serial.print(voltage4,2);
  Serial.print(" f ");
  Serial.print(voltage5,2);
  Serial.print(" g ");
  Serial.print(voltage6,2);
  Serial.print(" h ");
  Serial.print(voltage7,2);
  Serial.println(); 
  
}
 
    
  // Wait 10 milliseconds
  delay(10);
}

Arduinoforum.jpg

Try

// Read the input on the analog pins:
  (void)analogRead(A0);
  int sensorValue0 = analogRead(A0);
  (void)analogRead(A1);
  int sensorValue1 = analogRead(A1);
  (void)analogRead(A2);
  int sensorValue2 = analogRead(A2);
  (void)analogRead(A3);
  int sensorValue3 = analogRead(A3);
  (void)analogRead(A4);
  int sensorValue4 = analogRead(A4);
  (void)analogRead(A5);
  int sensorValue5 = analogRead(A5);
  (void)analogRead(A6);
  int sensorValue6 = analogRead(A6);
  (void)analogRead(A7);
  int sensorValue7 = analogRead(A7);

Hello Kapper86

The Arduino has one ADC that is multiplexed between the analog inputs. If the sensor impedance is greater than 10k ohm, the previous reading from one pin can influence the next reading from a different pin.

Try using two analogRead() for each pin, possibly also with a short delay between them. Discard the first reading and use the second one.

int sensorValue0 = analogRead(A0);
delay(5);
sensorValue0 = analogRead(A0);
int sensorValue1 = analogRead(A1);
etc

The Pro Mini serial can run faster - I use it with bit rate of 115,200.

Regards

Ray

Thank you guys, that was a very quick response :smiley:

I used AWOL´s method, it works very well, and then I dont need a delay - thank you :slight_smile:

Thanks for your reply Ray. I have just tried a few options but none seems to work. I tried to just change the delay to 1ms instead of 10ms in the code. Guess it should output values 10 times as quickly, but it did not change anything?

// Wait 1 milliseconds
delay(1);

Then I tried to change the baud rate in the code to both 14400 and 28800 but then I just got alot of weird stuff when viewing the serial - see attached image.
// Start serial at 14400 baud
Serial.begin(14400);

Can it be because of the bluetooth module (HC-05) is to slow, or should i set the baudrate other places that in the beginning of the code?
Any other suggestions?

Regards - Kasper

Hi Kasper

Sorry, I missed that you were using bluetooth. I have only used an FTDI interface to the Pro Mini; not sure if bluetooth can run faster than 9600 bps.

At that speed, maximum throughput is 960 bytes per second. You are printing 7 bytes for each sensor, I think, plus 1 or 2 bytes for new line. So say 57 bytes. That will take about 59ms to send.

EDIT: You can reduce this somewhat by removing the " a ", " b ", etc from each print iteration and instead print a row of column headings in setup().

Regards

Ray

Yea, that makes sense Ray - I will try that tommorow. I know the HC-05 bluetooth is a pretty cheap board, cost around 10 dollars. Would more exspensive boards send faster, or is 9600 standard for bluetooth?

Thanks again -Kasper

This article suggests the HC-05 can go faster.

http://www.instructables.com/id/Modify-The-HC-05-Bluetooth-Module-Defaults-Using-A/

Hackscribble: The Arduino has one ADC that is multiplexed between the analog inputs. If the sensor impedance is greater than 10k ohm, the previous reading from one pin can influence the next reading from a different pin.

Thank you! So many years later and you helped me solve my problem very quickly! I'm using an ESP32 which has 2 separate multiplexed ADC channels, so I swapped one of my inputs to the other ADC rather than one of the multiplexed channels and the variations I was seeing on the inputs was prevented!