Arduino + 16x2 displayx + I2C not working

Thread Starter

alecrimi

Joined Aug 8, 2018
3
Hi,

I bought a IC2 driver and a 16x2 digit display from you Adafruit (MPC23008) , put them together as explained in their website.
Now I am trying to connect this to to one of the arduino/flora devices I have.
Unfortunately none of them is working:
Arduino micro, Arduino nano (repro) and Flora v2.
I also tried to add 2 pull-up resistors of 4k7 Ohm connected to the between the V5 and the busses of the I2C.
For the Micro I have used the D2 and D3 pin respectively for Data and clock, while for the Nano I have used the D4 and D5 as shown in pictures. The display connected directly to the arduino works properly (but it needs 16+ wires).
The Lat pin is not used, and the SPI enable is not welded together.
Why is the I2C not detected at all?

They all are not even able to detect the address of the I2C. Tested with this code:
Code:
#include <Wire.h>
void setup()
{
  Wire.begin();
  Serial.begin(9600);
  while (!Serial);             // Leonardo: wait for serial monitor
  Serial.println("\nI2C Scanner");
}
void loop()
{
  byte error, address;
  int nDevices;
  Serial.println("Scanning...");
  nDevices = 0;
  for(address = 1; address < 127; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();
    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");
      nDevices++;
    }
    else if (error==4)
    {
      Serial.print("Unknown error at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.println(address,HEX);
    }   
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");
  delay(5000);           // wait 5 seconds for next scan
}





I have checked if the SDA and SCLOCK are shortcuirted, and no.
whether SDA or SCLOCK are shortcuirted to 5V, and no (unless I connect the pull-up resistors.)

I have double checked again which pin to connect to both the MICRO and the NANO, and they were correct.

I have tried different pull-up resistors and nothing.
I have to conclude that the I2C drivers is damaged somehow.
 

Raymond Genovese

Joined Mar 5, 2016
1,653
Welcome to AAC.

Your post generates a lot of questions in my mind.

If you will, let me just focus on one aspect with the Arduino NANO..
"For the Micro I have used the D2 and D3 pin respectively for Data and clock, while for the Nano I have used the D4 and D5 as shown in pictures."

That is a problem. For the Nano (and, hopefully whatever clone you are using) the I2C pins are A4 and A5. These are different pins than D4 and D5. So, it is no wonder you can't detect any I2C devices.

Look at this diagram: (from https://bigdanzblog.wordpress.com/2...c-to-work-on-an-arduino-nano-pinout-diagrams/)


Note that A4=SDA and A5=SCL. Hook one device up - with the same voltage as the Nano, and use the pull up resistors. Run the scan program again and let us know what you get.

I don't think anything is necessarily bricked and there are plenty of folks here that will help you get it up and going.

Edited to add: I looked at the pictures again and, while they are blurry, it looks like you are using A4/A5 and not D4/D5 as you stated. Also, is the LCD actually soldered onto the Adafruit board?

One thing you can do that is fairly easy is to hook the Micro and Nano (assuming it is 5V) together and have them talk to each other on I2C - see here.

The other thing is to see if you can talk to any other I2C device - do you have one apart from the LCD backpack?
 
Last edited:

Thread Starter

alecrimi

Joined Aug 8, 2018
3
Hi,
my mistake.
1. I actually followed the datasheet and connected to A4/A5 not D4/D5 as stated.
2. The pins are soldered but on the other side, from the picture it seems not, but they are. I checked the connection with the tester.

Ok I ll try the communication between the arduinos
 

Raymond Genovese

Joined Mar 5, 2016
1,653
Hi,
my mistake.
1. I actually followed the datasheet and connected to A4/A5 not D4/D5 as stated.
2. The pins are soldered but on the other side, from the picture it seems not, but they are. I checked the connection with the tester.

Ok I ll try the communication between the arduinos
Something else...it appears that you have either this LCD or this LCD - is that correct and which one?
When you put +5V and GND into the backpack (no connections to micro), does the display light up at all? I mean just the back light, not any characters?
 

Thread Starter

alecrimi

Joined Aug 8, 2018
3
Yes I can't tell which one but one of those.
no characters, no the "usual squares" filling all pixels, I would say not even the back light. What I see is just 5 of the squares (in both rows) with very mild intensity and also there is some kind of scanning as sequentially each pixel-row is turned off. It is probably very hard to understand the explanation.
But why is this relevant? Isn't the I2C driver (the backpack) independent? I mean the scanning code I posted should be able to detect it anyway, no?
 

Raymond Genovese

Joined Mar 5, 2016
1,653
Yes I can't tell which one but one of those.
no characters, no the "usual squares" filling all pixels, I would say not even the back light. What I see is just 5 of the squares (in both rows) with very mild intensity and also there is some kind of scanning as sequentially each pixel-row is turned off. It is probably very hard to understand the explanation.
But why is this relevant? Isn't the I2C driver (the backpack) independent? I mean the scanning code I posted should be able to detect it anyway, no?
It is difficult to do this over the forum.

My thinking behind the question is something like this....
In general, getting one of these up and running is a pretty easy task - at least most of the time. One problem can be bad connections or wrong connections. If that is the case, "anything or nothing" can happen, and the nothing can mean no I2C address detected. Of course, if the backpack is bricked, "anything or nothing" can also happen.

That is why it is relevant, I'm trying to isolate the different elements of the situation. So, for example, connecting the two Arduino Boards together as per that link, is a pretty decent test of I2C functionality (I suppose switching Master and Slave roles to test both is more complete). If that works, as I would expect, then you know the Nano and Micro are probably just fine.

One inevitable problem is in communication (if we were sitting at the bench together it would be different). So, when I ask about the back light, I am trying to see if the connections (backpack) are not ok. I expect the display back light to illuminate - if not, we don't need to get to the I2C scanner part yet.You already stated that you had tested the LCD without the backpack and it was ok.

When you say, "Yes I can't tell which one but one of those." Do you mean that one of the RGB back lights is coming on? I would only expect one to come on, since the backpack does not touch the other two as per the docs.

It is a concern, that you can't tell which, but even more of a concern is the other stuff - the "no characters, no the "usual squares" filling all pixels, I would say not even the back light. What I see is just 5 of the squares (in both rows) with very mild intensity and also there is some kind of scanning as sequentially each pixel-row is turned off. It is probably very hard to understand the explanation"

Yes, it is hard to understand exactly what you are describing, but I can understand enough to believe that it probably should NOT behave that way (not having experience with that exact backpack, I am not 100% sure of that, but pretty darn sure). Based on that, again, don't worry about not getting the I2C scanner to see it, because without even considering the I2C addressing part, it looks like something is wrong.

You might consider re-soldering the backpack connections and trying again - and also chekind the +5V and GND power supply and the screw terminal connections.

It is possible that the back pack is not compatible with that particular display. Adafruit makes them both and there is nothing in the blurbs that I read to indicate as much, but you might also want to ask them directly.

That's my take at this point - maybe someone else here has some other insight.
 

MrChips

Joined Oct 2, 2009
30,795
You have four separate things to confirm in working order:
  1. 16 x 2 LCD
  2. Adafruit I2C backpack
  3. Arduino
  4. Arduino code

Trouble shoot one at a time, i.e. confirm that the first three items are functional.

I see in your first photograph that the LCD module is not soldered to the Adafruit backpack.
 

Raymond Genovese

Joined Mar 5, 2016
1,653
I see in your first photograph that the LCD module is not soldered to the Adafruit backpack.
This was already raised (by me) and addressed by the TS. He has soldered it and from the other side. How well is a question and was raised in my previous post.

Beyond that, yes, I agree with your strategy at least in the main.
 

Raymond Genovese

Joined Mar 5, 2016
1,653
Something else and this may be significant.

From the Backpack page:

"You can try to connect our RGB 16x2 or 20x4 LCDs up but this backpack will not control the RGB backlight so you'll have to use the backpack only for the 14 digital IO pins (pins #1-14) and connect the backlight pins (#15-#18) directly to your microcontroller with 4 extra wires for color/PWM control as if they were just an RGB LED."

Here is the back pack schematic.

You don't know which RGB LCD you have, Here is what they *think* is the pinout for the + one and there is no analogous schematic for the negative one. For the positive LCD, pin 15 is VCC and that is consistent with the backpack and #16,#17,#18 ground the RGB to illuminate. I am thinking that for the negative LCD, pin #15 is Ground and #16,#17,#18 need VCC to illuminate. IOW common anode vs. common cathode.

Either way, it seems to me that you should NOT connect pin #15 and pin #16 to the back pack (cut/unsolder them at the header so there is no contact). You will need to control the RGB back lights with I/O pins.

Then again, maybe I am not seeing things clearly - that can happen :)

In any event, please let us know what happens.
 
Top