Qwiic Shield interfering with infrared analog read values?

Hi everyone.

I have a Infrared distance sensor ( GP2Y0A60SZLF, Polulu sds02a, Pololu Carrier with Sharp/Socle GP2Y0A60SZLF Analog Distance Sensor 10-150cm, 5V) which works fine If I plug it directly into my Arduino UNO R4 Wifi.

I had set up all my hardware including a potentiometer slider, a flex sensor and some buttons. It all worked perfectly.

Now I did by a Qwiic Shield from sparkfun (SparkFun Qwiic Shield for Arduino), because I thought this would give me a perfectly matching protoboard to solder some of my cables directly onto that custom shield. I don’t need any 3.3V or I2C ports. I just wanted a shield that fits my Arduino UNO.

Now after using the shield, still everything works perfectly, but my infrared values don’t work anymore.

Chat GPT gave me the hint that the qwiic shield is maybe interfering with A4 and A5 as they are connected to SDS or SDA, so I switched to A2. But still my values are just not correct at all…!

The sensor works and the arduino works. It is just the combination with the qwiic shield is problematic. Any idea why?

I don’t really understand the schematic in the image. Is my 5V being changed?
I currently use a passthrough pin, but I still get false values:

In the first picture of my setup you can see my 1. shield with some more stuff attached, but the actual shield that is connected does not have anything else than the three jumper cables attached to it. I reduced to the max to simplify debugging…

If I connect the pins to the exact same pins on the Arduino just without the shield, I get correct values!
(second image).

So the shield must be interfering with my signal, but how?!?

Further I measured the voltage between 5V and GND: 4.85V both on shield and arduino.
I measured the A2 input: if connected to the 5V I get a value of 1023 and if connected to ground it is 0 as expected.

I would be really glad if somebody could tell me what the qwiic shield is doing with my values.
(As the slider potentiometer with a analog read works perfectly fine)…

Thank you

Ps: Sorry I had to combine all images into one, as I am a new user…

It’s hard to tell what all is going on in the photo, but it looks like when using 2 shields you’re stepping down the 5v twice

To experiment you could try isolating the issue by bending A4/5 pins a bit so they miss their holes (careful, they can only be bent like 3-4 time before they become very weak!) and only push the shield down ~70-80% (enough for the other pins to make good contact) and seeing if the infrared values re-appear

Flux residue on your shield can do this. Make sure you have all the flux cleaned off the board and see if that helps.
Another thing you can try is moving the sensor over to A1 and ground A0 and A2 to provide a “buffer” around the analog pin you’re reading from.

1 Like

Ah no no, I am not trying to stack 2 shields, that is just the image giving the impression of 2 shields.
I have one, but because it is attached to the cables I could not fully remove it.

Just ignore the one with the cables and look at the one with the 3 jumper cables attached.

Why do you think that A4 and A5 could have an influence on A2 or A1?

I currently think it is the shield messing either with my 5V signal or the GND.
i tried to scratch off the 5V connection to whatever is in the left upper corner of the qwicc shield. No effect so far.

But as I said I have no idea why that could be.

Regarding flux residue I don’t think so either, because I have the same problem on both qwicc shields you can see in the image.

And why would I need a buffer on the qwicc shield but not on the Arduino itself?

Thanks for all the replies and further help. It’s still a mystery to me…

1 Like

You did solder the headers to both shields, no?

Flux is slightly conductive. A4 and A5 have 5 volts on them. The flux can conduct some of that 5 volts into the pin you’re trying to read causing it to affect your readings.

The analog pins are very sensitive and will definitely be able to sense some of that voltage leaking through the flux.

An old toothbrush and some 99% rubbing alcohol are good at getting the flux residue off. Just make sure everything is totally dry before testing.

1 Like

Yes I did solder them both. I thought that would be a very rare case that would not appear on both, but OK, I will definitely try that! Thanks. (Unfortunately the stuff is at the office, so I need to wait with testing).

You would agree though, that the qwicc shield should not interfere with my values and if everything was connected and soldered carefully I should also get good values?!

Cause the only difference I can see from arduino to the qwicc is this blue circle:

I also tried to draw blue lines for where I can see that 5V is connected…
This could not be the culprit?

Thank you

The Sparkfun Qwiic shield uses 3.3V logic levels, but the Pololu sensor requires 5V.

There are 2 i2c buses on the shield, the blue circled section = the upper left area here (logic level conversion)

A4 and A5 are 5v SDA/SCL
The qwiic connectors and the pins labeled SDA & SCL are 3.3v

Use A4 & 5 if connecting to the pololu (like jremington said to use 5v IO)

But I am not using anything that qwicc does. I just use the 5V which is also labeled on the protoboard. I even measured that. I get 4.85V out of the 5V on the qwicc.
Measured on the arduino itself I get the exact same value…

Or am I misunderstanding something?

(Also: would that be fixed if I scratch off all the 5V connections to the logic level conversion?)

Ok thanks for the explanation.
So just to repeat to be sure I understood you correctly.
So why should I not use A0 to A3 to receive the 5V from the polulu?

I tried with A5 and A4 in the first place which did not work. I thought because they are connected to SCL and SDA (I don’t know what that is, I will have to look that up) that this might interfere.

But you tell me now that ONLY A4 and A5 would work, correct?

PS:
I tried to tell the arduino to explicitly use 5V:
analogReference(AR_DEFAULT); // Forces 5V reference on UNO R4

is that what you mean?
Also I am not sure if I understand correctly what it means if you say that logic levels on qwicc are 3.3V.
does that mean my 5V is clamped to 3.3 when used in a circuit, although I can measure with the multimeter?

Please post a carefully double-checked wiring diagram of your setup (hand drawn is fine) with all connections, pins and parts clearly labeled.

This is it. It’s just the polulu connected to the passthrough pins. The shield is then put directly onto an Arduino UNO R4 Wifi.

So I think the wiring should be correct.

To me two things remain:

  1. I did not have the chance to test a board clean from any flux residue.
  2. I am still unsure what it means, that the qwicc is changing the logic levels to 3.3V. Would that also affect my wiring shown in the image above?

thank you so much for your patience. :folded_hands:

1- You still need to do that.

2- Qwiic devices run on 3.3 volts and an Uno on 5. The Qwiic shield adjusts the I/O voltage on A4 and A5 to 3.3 volts on the Qwiic side of the board and 5 volts on the Uno side of the board.

You need to avoid using A4 and A5 because they are already busy making the Qwiic connectors work.

Also, I2C and Qwiic can be thought of as the same thing. Qwiic describes the connector that I2C works through.

Did you notice that it is almost impossible to read the markings on the image of the qwiic shield board? Compare that image with this much simpler and clearer diagram of a different circuit.

If I squint hard enough, it looks like you connected the wire labeled A2 to the pin labeled A2, which is not affected by the logic level conversion on the shield, and should be OK, if properly soldered.

Use your multimeter to test the continuity of the connection of A2 all the way from the sensor to the actual input pin on the Arduino.

1 Like

To add, maybe another point to check. The Wifi R4 has additional headers, circled in Red

Check you they do not short circuit to the Sparkfun Qwiic shield ?

As the connections moved around many times, is the sketch still inline with the A2 or A3 or which ever connection point?

1 Like

Thank you for all the advice. In the end it was a nasty mix of things.

First I had the A5 soldered, which does not seem to work with the Qwicc (due to different logic levels).

After I switched to testing with the A2, I started to test with another infrared sensor (with jumper cables), which in the end turned out to have a weak contact.

Weirdly every time I plugged it into the Arduino I must have held it in a different way, than when I plugged it into the qwicc shield. So I accidentally made the assumption that it had something to do with the shield. :see_no_evil_monkey:

By switching to the A2 and using good contacts it now works.
I did nonetheless clean all the flux with a flux remover. This is never a bad idea!

Thank you for all the help. It is much appreciated and I am very happy that it works smoothly now! (And that I now know that the qwicc shield changes behaviour on A4/A5).

2 Likes

Glad you figured out the problem!

1 Like