Help with LCD Keypad Shield & ArduCam ESP8266 Uno

Hi everyone,

It's been a long while since I've tinkered with an arduino, and so far have been successful working with some sensors I've bought, and displaying the output to the serial monitor, but I'm banging my head as to why I can't get this DFRobot LCD Keypad shield to work on my new ArduCam ESP8266 Uno board. I have a feeling that some of the pinouts might be different than a standard arduino uno which is why I'm not having any luck figuring it out :frowning:

Here's a picture of the arducam esp8266 uno itself:


and here is the tech docs for the DFRobot LCD Keypad, with the pinout requirements and some sample code:

When I load up the sample code on the DFRobot site, or sample LiquidCrystal code from the IDE, I can see that the LCD Keypad power LED is lit, but the display never lights up, and only displays a bunch of black boxes when the contrast is set to the lowest setting. I am able to get the LCD Backlight to light up only if I press the reset button, nothing else, and never see any text appearing on the screen. If you need any additional photos of either device, or sample code, just let me know and I'll post it.

Thanks for all your help.

c0ntra

c0ntra:
I have a feeling that some of the pinouts might be different than a standard Arduino UNO which is why I'm not having any luck figuring it out

Here's a picture of the arducam esp8266 uno itself:


Correct. They are highly incompatible.
OK, probably compatible if you can get the pin designations figured out.

However the voltages generated by the buttons would not be compatible with the ESP8266.

More particularly, D9 and D10 but particularly D9 as the Enable control for the LCD, are simply missing from the ESP8266.

Thanks for the reply, that kind of makes a lot of sense now. I was just responding on the arduino subreddit that the missing D10,D11,D12 pins etc were completely baffling and suspected that's probably why I'm running into so many issues. It's a real shame since this board has a lot of nice features including the built in sdcard and wifi. I guess I'll have to go pick up an actual uno r3 to finish my project :slight_smile:

Or a display with an I2C "backpack".

(Mind you, you have to modify the backpack to work with a ESP9266 - remove the pull-ups.)

The buttons on that "shield" are not much use anyway.

I think you can get the LCD working.
I REALLY dislike that pinout on that esp board. It looks like the same used on the Wemos D1 R2 board.
I absolute hate that pin mapping. I think it was a really stupid thing to do as it makes things messy and confusing.

The issue is that they offset all the digital pins to skip over the TX and RX pins.
Because of this you can't use the digital pin numbers that all the other boards use to reference the same physical pin since the physical pin on that board uses a different digital pin number.

For example digital pin 0 which is normally the physical pin on the end where RX is on all other Arduino boards, is two pins over on that board.
i.e. the physical pin referenced by digital pin 0 on that board is digital pin 2 on all the other Arduino boards.

What you have to do is pick the digital pin number that maps to the physical pin that the shield expects.

So while that board doesn't have a digital pin 9 you won't need it on that board because on that board the digital pin assigned to the physical location of digital pin 9 on an aduino shield is actually digital pin 7.
This is because that board doesn't assign the digital pins in the same locations as every other Arduino board and the way the shield expects.
Just count the "Arduino way" starting with D0 where RX is and you get to the break between headers and you can see that
shield pins D8 and D9 are D6 and D7 on that board.

So while the LCD shield uses these pins:

 E - digital 9
RS - digital 8
D4 - digital 4
D5 - digital 5
D6 - digital 6
D7 - digital 7

For that board you would use these pins:

 E - digital 7
RS - digital 6
D4 - digital 2
D5 - digital 3
D6 - digital 4
D7 - digital 5

Now if all that were not confusing enough, there can be another issue when using the esp8266 core depending on the board variant you use and the way the board wires up and labels its pins on the board.
I'm not sure what board type you are using but if you are using one of the Wemos boards like say "Wemos D1 R2 & mini", then things can get even more tricky.
That is because those variants define Dn symbols
i.e. D0, D1, D2, etc...
And these perform pin mapping to the GPIO bit numbers.
The significance of this is that digital pin n is not the same as digital Dn
i.e. digital pin D7 is the not the same physical pin as digital pin 7
This is because raw pin numbers in the esp8266 core always represent GPIO bit numbers
However, the Dn symbols are used to map to a GPIO bit number.

Often the labels on the Wemos boards label the physical pin using the Dn symbol names and not the raw digital pin number n which would be the GPIO pin number.
When that is the case, you must use the Dn symbol and not the raw pin number n.
i.e. if it says D7 you must use that instead of 7

So depending on how that board wired up the pins and which board variant (board type) you are using
It is likely that the LiquidCrystal constructor to drive that shield with either:

LiquidCrystal lcd(7,6,2,3,4,5);

or

LiquidCrystal lcd(D7,D6,D2,D3,D4,D5);

--- bill

I really appreciate everyone's help on this issue. It turns out that the company Arducam has another board called the ArduCam ESP32 UNO which has all the required pinouts I'll need for this lcd shield (and others). I opted to pick one up and have everything working just fine now. I'll end up using the ESP8266 one for another project instead. Live and learn! :smiley:

So far I have not seen a reason why the ArduCam board you have won't work that LCD shield.

Yes the pin mappings are a bit screwy and confusing since they mapped the ArduCam digital pins to the Arduino header pins differently than the standard Arduino board does, but the ArduCam board does have usable digital pins connected to all the needed header/shield locations for digital pins 9,8,4,5,6,7 to allow controlling the LCD.
They just are not digital pins 9,8,4,5,6,7 on the ArduCam board but you can work around that in the lcd object constructor as I showed in post #4

--- bill

It took me a while to find the correct pin setup.
I have a Wemos D1 2015-08. Based on the photos I found on the net, this should be a D1 R1.
I also have a supposedly DFRobot LCD Keypad shield that looks like this: https://www.jsumo.com/dfrobot-lcd-keypad-shield-1381-57-B.jpg but I'm pretty sure it's fake as one of the buttons says "RIGTH". :smiley:

Anyways, this is the correct snippet that worked for me:

#define D0 3
#define D1 1
#define D2 16
#define D3 5
#define D4 4
#define D5 14
#define D6 12
#define D7 13
#define D8 0
#define D9 2
#define D10 15
LiquidCrystal lcd(D8,D9,D4,D5,D6,D7);

kopiasa:
It took me a while to find the correct pin setup.
I have a Wemos D1 2015-08. Based on the photos I found on the net, this should be a D1 R1.
I also have a supposedly DFRobot LCD Keypad shield that looks like this: https://www.jsumo.com/dfrobot-lcd-keypad-shield-1381-57-B.jpg but I'm pretty sure it's fake as one of the buttons says "RIGTH". :smiley:

Anyways, this is the correct snippet that worked for me:

#define D0 3
#define D1 1
#define D2 16
#define D3 5
#define D4 4
#define D5 14
#define D6 12
#define D7 13
#define D8 0
#define D9 2
#define D10 15
LiquidCrystal lcd(D8,D9,D4,D5,D6,D7);

Your board is different from the OP. Yours is "normal", i.e. it does not offset the digital pins so it is relatively straight forward. You simply use the Dn macros provided by the esp8266 core rather than the raw arduino pin numbers.
You do not have to create your own macros, since the esp8266 core d1 variant/board-type already provides the symbols.

In your case you could use all the examples provided by the hd44780 library hd44780_pinIO i/o class directly. As they should "just work" out of the box with no modifications.

--- bill

Hi.

kopiasa:
I'm pretty sure it's fake as one of the buttons says "RIGTH"

I've got a board like that too.
This is one of the many things that were copied by a lot of these Chinese manufacturers.
My board also has this problem (click !), i'd check your board for this too if i were you.
So my advice is to read that thread and decide if this is a deal breaker for you, or not.
The thread offers you a solution, and so does @bperrybap's hd44780 library (of course in software instead of a hardware patch).