SparkFun Forums 

Where electronics enthusiasts find answers.

Questions &/or issues related to products in the Flex / Force category should be posted in this forum. includes Force Sensitive Resistors, Load Cells & Amplifiers, Pressure Sensors, etc
User avatar
By akb515
#204580
Hi, I recently purchased two ADS1015 sensors in order to try getting values of 4fingers while wearing a glove. After getting the parts, I decided to test it, using the Qwiic Shield for the Arduino Uno. From the shield, there is one qwiic connector going to the first ADS1015, and then another qwiic connector going from that sensor to the next one (daisy chained together). The code is supposed to print the values of the 4 fingers (example code #2 SetUp Hand), however, the values are clearly wrong. When just one sensor connector, the first image shows the output of the flex sensors completely straight. I knew this was wrong because when I had forgotten to hook up the sensors, all 4 fingers read 4095, so I knew that there was some issue present. When bending the sensors on both sensors, the values for finger 1 and 2 change in a weird way, while fingers 3 and 4 remain 4095.
untouched.PNG
I decided to run the same code, but with only one ads15103 connected. Now, finger one and two print values close to 1000 when unbent and drop once bent (the correct response), while 3 and 4 print 4095, showing they are not connected.
only one.PNG
I have no clue what is going on, so if someone could help, that would be awesome! Thanks, Akash.
You do not have the required permissions to view the files attached to this post.
User avatar
By TS-Mark
#204621
Hi Akash,

From your description, it sounds like you have not adjusted the address jumpers correctly to use more than one of the Qwiic Flex Glove Controllers on a single I2C bus.

The second example in the Hookup Guide has the I2C addresses set to default (connected to GND) and 0x4A (connected to SDA). Make sure you have adjusted the solder jumper on the back of the board to switch from GND to SDA. If you are not sure how to modify those jumpers, take a look at this tutorial on working with Jumper pads and PCB Traces.

If you continue to have issues after adjusting that jumper and running the second example, please take a few photos of the top and bottom of your boards and attach them to your reply.
User avatar
By akb515
#204814
Hey TS-Mark,
This is my first time dealing with jumper boards so I am a little confused. Below, I have attached pictured of my circuit right now. Would I work with the jumper pad on the Flex Glove that is connected to the Quiic Shield or the last one daisy chained? Also, for soldering the jumper pads, there are two rows of 3 leads, so what should I connect together? Sorry for all the questions.
IMG_4252 (1).jpg
IMG_4254 (1).jpg
Thanks,
Akash.
You do not have the required permissions to view the files attached to this post.
By n1ist
#204817
Look at the pad labelled GND. You see a thin short trace connecting it to the middle pad. Cut that trace between the pads, and instead solder a jumper or blob between the pad labeled 3v3 and the middle pad on that row (between 3v3 and SCL). This will change the address to 0x49. Do this on one of the two boards; the other will remain at 0x48
/mike
User avatar
By TS-Mark
#204822
Thanks for helping out here, Mike!

Akash, try following Mike's instructions. This photo gives you a clear view of the default configuration for the address jumpers here and the table above it in the Hardware Overview section of our guide lists the addresses of each position. I would highly recommend reading through our How to Work with Jumper Pads and PCB Traces tutorial if you have never modified a solder jumper before. That will have step-by-step instructions for cutting a trace between jumper pads and adding a solder jumper.
User avatar
By akb515
#204988
Hi, I am still having trouble. Now, the one that I modified won't give me any values when I bend it, whether or not it is hooked up with the other sensor too. Can you guide me on what to do? Thanks,
IMG_4327.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
By TS-Chris
#205070
Hi akb515.

Is your code looking for the second board at the correct I2C address? Changing the jumper changed the address and if your code is looking for the old address it won't find the board.

Try this modified test code with the modified board and see if it works then.
Code: Select all
#include <SparkFun_ADS1015_Arduino_Library.h>

ADS1015 fingerSensor;

void setup() {

  Wire.begin();
  Serial.begin(115200);

  if (fingerSensor.begin(Wire, 100000, ADS1015_ADDRESS_VDD) == false) {
     Serial.println("Device not found. Check wiring.");
     while (1);
  }

}

void loop() {  
  uint16_t data;
  for (int finger = 0; finger < 2; finger++) {
    data = fingerSensor.getAnalogData(finger);
    Serial.print(finger);
    Serial.print(": ");
    Serial.print(data);
    Serial.print(",");
  }
  Serial.println();
}
User avatar
By akb515
#205190
Hey Chris, that code works! I am getting values for the sensor that I soldered the pad between. How should I get values from the other sensor that is daisy chained though? I tried the following based on the code you sent but it is not working. Do you know what I am doing wrong? Thanks,

I am pretty sure I am not setting up the second one correctly. I am not too familiar with how these addresses work.
Code: Select all

#include <SparkFun_ADS1015_Arduino_Library.h>

ADS1015 pinkySensor;
ADS1015 indexSensor;
uint16_t hand[4] = {0, 0, 0, 0};

void setup() { 
  Wire.begin();
  Serial.begin(115200);

  //Set up each sensor, change the addresses based on the location of each sensor
  if (pinkySensor.begin(Wire, 100000, ADS1015_ADDRESS_SDA) == false) {
     Serial.println("Pinky not found. Check wiring.");
     while (1);
  }
  if (indexSensor.begin(Wire, 100000, ADS1015_ADDRESS_GND) == false) {
     Serial.println("Index not found. Check wiring.");
     while (1);
  }  
}

void loop() {  
  uint16_t data;
  //Read and print our data
  for (int finger = 0; finger < 2; finger++) {
    hand[finger] = indexSensor.getAnalogData(finger);
    hand[finger + 2] = pinkySensor.getAnalogData(finger);
  }
  for (int finger = 0; finger < 4; finger++)
  {
    Serial.print(finger);
    Serial.print(": ");
    Serial.print(hand[finger]);
    Serial.print(" ");
  }
  Serial.println();
User avatar
By akb515
#205197
Sorry I included the wrong code there. This is the one I tried, modifying yours.
Code: Select all
#include <SparkFun_ADS1015_Arduino_Library.h>

ADS1015 mainSensor;
ADS1015 fingerSensor;
uint16_t hand[4] = {0, 0, 0, 0};
void setup() {

  Wire.begin();
  Serial.begin(115200);
  if (mainSensor.begin(Wire, 100000, ADS1015_ADDRESS_SDA) == false) {
     Serial.println("Device not found. Check wiring.");
     while (1);
  } 
  if (fingerSensor.begin(Wire, 100000, ADS1015_ADDRESS_VDD) == false) {
     Serial.println("Device not found. Check wiring.");
     while (1);
  }

}

void loop() {  
  uint16_t data;
  for (int finger = 0;finger < 2; finger++){
    hand[finger] = mainSensor.getAnalogData(finger);
    hand[finger+2] = fingerSensor.getAnalogData(finger);
  }
  for (int finger = 0; finger < 4; finger++) {
    data = fingerSensor.getAnalogData(finger);
    Serial.print(finger);
    Serial.print(": ");
    Serial.print(data);
    Serial.print(",");
  }
  Serial.println();
}
User avatar
By TS-Mark
#205218
Hi again Akash,

Try using this example from the library and adjust this line:
Code: Select all
 if (pinkySensor.begin(ADS1015_ADDRESS_SDA) == false) 
to this:
Code: Select all
 if (pinkySensor.begin(ADS1015_ADDRESS_VDD) == false) 
That should work if the jumper is configured properly. If that does not work, the issue is most likely with the jumper modifications on your board. You may have a small solder bridge going between the center pad and the SCL pad for the address setting. Try carefully reworking that jumper to make sure there is no solder connecting the center pad to the SCL pin and that should fix the problem. If, after reworking, you continue to have issues with this board, please take a couple of new photos of that jumper and attach them to your reply.
User avatar
By akb515
#205273
That works!!! Thank you so much!
Just one last question, the instructions on the product sheet say to cut the pull up resistors on the front of the board, like three rectangles that have a line connecting them. Should I also cut it, or just leave it how it is since its working?
Thanks, Akash.
User avatar
By TS-Mark
#205317
Hi again Akash,

I would leave the I2C pull-up jumper alone in this configuration. We include that jumper so users can disable the onboard pull-up resistors in long I2C chains. For example, if you have a circuit of, say, 10 I2C devices all with their own pull-up resistors, the combined resistance on your data and clock line can get so strong that the master device cannot drive them low to communicate with the slave devices. If you want to learn more about I2C communication, our I2C Tutorial is a good place to start. This document from TI on pull-up resistor calculation will go in much more detail on this specific piece of I2C communication.