[RESOLVED] I2C LCD on Photon/Core (struggle)

I have a Photon with an official Shield Shield, and then a generic sensor shield on that with I2C pins.

I have used the “included” LiquidCrystal I2C libraries, connected up the LCD 1602 as per diagrams and works absolutely perfectly. This is a little bulky and a waste for my simple need. I also know that the LCD works and that my code is correct… so all is well.

I am trying to get it all working WITHOUT the Shield Shield and Sensor Shield. I am using the same code as before, and using the wiring diagrams as per this:

However, I am getting just BLOCKS instead of any characters. Also, using 4.7K resistors.

I have also used an I2C scanner (as advised from another thread) and the device is reporting “no I2C devices”, therefore, I am thinking that I am missing something pretty fundamental in the wiring…

Any ideas? Seems a waste to have a Shield Shield and Sensor Shield to run a simple LCD!!! :smiley:

If it’s this module:

then the problem is that the display requires 5V. The 3V3 pin on the Photon is only 3.3V.

Assuming you’re powering by USB, you can probably connect the VCC pin on the display to VIN. Also connect the pull-up resistors to VIN, not 3V3. The I2C pins of the Photon are 5V tolerant, so this will work fine without the shield shield.


Thanks Rikkas7.

I have also tried powering from VIN (with the appropriate resistors) too. Both from USB into my PC and proper wall socket. Everything powers up nicely, but the characters are all blocks and nothing shows on the scanner.

The 1602 LCD I have working fine (with Shield) is the following:

@brixo, you need to adjust the contrast potentiometer on the piggyback board to get the characters to show up.

@peekay123 - Thanks. Done this too! :smiley:

@brixo, can you please review how everything is connected again? Can you take a picture of it working WITH the shield shield and then how you have it wired without it?

I shall do this as soon as I get back home this evening! I’ve even replaced the resistors and breadboards! Crazy!

1 Like

So here are the pics.

First 2 are working setups - using a Shield Shield & Generic Sensor Shield.
Latter 2 are the not-so-working setups - using 4.7K ohm resistors.

And using the sample code of:

Jim Brower

#include "LiquidCrystal_I2C_Spark/LiquidCrystal_I2C_Spark.h"

LiquidCrystal_I2C *lcd;

int lastSecond = 0;

void setup(void)
  lcd = new LiquidCrystal_I2C(0x27, 16, 2);
  lcd->print("***Spark Time***");

void loop(void)
  if (Time.second() != lastSecond)
    lcd->print(Time.hour() < 10? "   0" : "    ");
    lcd->print(Time.minute() < 10? ":0": ":");
    lcd->print(Time.second() < 10? ":0": ":");
    lastSecond = Time.second();

[FIXED] I think

All documentation shows SCL > D0 and SDA > D1 - however, randomly, by accident, I swapped them over and everything comes to life. Unless I’ve read poor documentation or my particular device isn’t labelled correctly - this is a mystery.

Either that, or I can’t read.

@brixo, the docs show:

These pins are used via the Wire object.
SCL => D1
SDA => D0

I’m not sure which documentation you referred to but I’m glad you found that on your own by accident! :stuck_out_tongue_winking_eye:

@peekay123 - Indeed! A couple of docs (none official) point one way, but randomly, my setup is opposite!!

Thank goodness for mistakes!!

1 Like

That’s very odd, since that was the first thing I checked when I looked at your first image in your first post and there you had it correct :wink: (beware of the parallax error tho’)

1 Like