esp8266 how to connect extra hardware
Moderators: grovkillen, Stuntteam, TD-er
esp8266 how to connect extra hardware
Hi,
Is there an solution for this?
I have the TFT screen working!
For the PN532 i need the D2 pin, in use by the TFT screen.
And where to connect the Piezo? D5 is already in use for the TFT screen.
ESP pinout (working)
ESP8266 -> 2,8" TFT ST7789
D0 -> LED
D1 -> DC
D2 -> CS
V3,3 -> VCC
G -> GND
D5 -> SCK
D7 -> SDI (Mosi)
to be connected
ESP8266 -> RFID - PN532
D2 -> I2C
D3 -> I2C
to be connected
ESP8266 -> Piezo element
D5 -> D5 (already in use)
I need, SDA: GPIO-4 (D2), SCL: GPIO-5 (D3)
Is there an solution for this?
I have the TFT screen working!
For the PN532 i need the D2 pin, in use by the TFT screen.
And where to connect the Piezo? D5 is already in use for the TFT screen.
ESP pinout (working)
ESP8266 -> 2,8" TFT ST7789
D0 -> LED
D1 -> DC
D2 -> CS
V3,3 -> VCC
G -> GND
D5 -> SCK
D7 -> SDI (Mosi)
to be connected
ESP8266 -> RFID - PN532
D2 -> I2C
D3 -> I2C
to be connected
ESP8266 -> Piezo element
D5 -> D5 (already in use)
I need, SDA: GPIO-4 (D2), SCL: GPIO-5 (D3)
Re: esp8266 how to connect extra hardware
Why not use GPIO-12 (D6) for the I2C? (or the CS pin of the display)
GPIO-0 (D3) should not be used for I2C as the pin might be pulled down by some sensor if the ESP boots.
You may also want to refer to this page for reference on which pins to use: https://espeasy.readthedocs.io/en/lates ... on-esp8266
Any pin labelled as "green" in that table can be set to be used for I2C.
GPIO 5 & 4 are just the default pin assignments for I2C on an ESP8266, but they can be changed on the hardware tab in ESPEasy.
N.B. it is best to refer to GPIO numbers instead of those really non-intuitive NodeMCU/Wemos D-numbers.
That's way less confusing. But if you do refer to the "D" notation, please explicitly keep using the "D" (as you did now).
For the LED, why not use GPIO-2 (D4)? That's already connected to any onboard LED.
Only "problem" might be that the onboard LED is often "inverted" as in 0 = LED on, 1 = LED off.
But when connecting an external LED to it, it doesn't really matter I guess.
GPIO-16 (D0) should only be used for very 'basic' stuff, like activating a LED or buzzer.
It should not be used for "timing critical" tasks like addressing a display, I2C or pulse counting as it is a somewhat special pin.
GPIO-0 (D3) should not be used for I2C as the pin might be pulled down by some sensor if the ESP boots.
You may also want to refer to this page for reference on which pins to use: https://espeasy.readthedocs.io/en/lates ... on-esp8266
Any pin labelled as "green" in that table can be set to be used for I2C.
GPIO 5 & 4 are just the default pin assignments for I2C on an ESP8266, but they can be changed on the hardware tab in ESPEasy.
N.B. it is best to refer to GPIO numbers instead of those really non-intuitive NodeMCU/Wemos D-numbers.
That's way less confusing. But if you do refer to the "D" notation, please explicitly keep using the "D" (as you did now).
For the LED, why not use GPIO-2 (D4)? That's already connected to any onboard LED.
Only "problem" might be that the onboard LED is often "inverted" as in 0 = LED on, 1 = LED off.
But when connecting an external LED to it, it doesn't really matter I guess.
GPIO-16 (D0) should only be used for very 'basic' stuff, like activating a LED or buzzer.
It should not be used for "timing critical" tasks like addressing a display, I2C or pulse counting as it is a somewhat special pin.
Re: esp8266 how to connect extra hardware
Hi,
Thanks for your support
I can't use the GPIO-12, D6, because i am using SPI Interface. Otherwise the TFT is not working.
So i need GPIO-16, for the piezo
And GPIO-4 and GPIO-5 for i2c
All 3 are in use, can i move them (TFT) to another pin?
The led was for the TFT screen connection.
ESP pinout (working) update with GPIO
ESP8266 -> 2,8" TFT ST7789
D0 GPIO-16 -> LED (TFT screen)
D1 GPIO-5 -> DC (TFT screen)
D2 GPIO-4 -> CS (TFT screen)
V3,3 -> VCC (TFT screen)
G -> GND (TFT screen)
D5 GPIO-14 -> SCK (TFT screen)
D7 GPIO-13 -> SDI (Mosi) (TFT screen)
ESP8266 -> Piezo
?? -> IO piezo
ESP8266 -> RFID - PN532
?? -> I2C
?? -> I2C
Thanks for your support
I can't use the GPIO-12, D6, because i am using SPI Interface. Otherwise the TFT is not working.
So i need GPIO-16, for the piezo
And GPIO-4 and GPIO-5 for i2c
All 3 are in use, can i move them (TFT) to another pin?
The led was for the TFT screen connection.
ESP pinout (working) update with GPIO
ESP8266 -> 2,8" TFT ST7789
D0 GPIO-16 -> LED (TFT screen)
D1 GPIO-5 -> DC (TFT screen)
D2 GPIO-4 -> CS (TFT screen)
V3,3 -> VCC (TFT screen)
G -> GND (TFT screen)
D5 GPIO-14 -> SCK (TFT screen)
D7 GPIO-13 -> SDI (Mosi) (TFT screen)
ESP8266 -> Piezo
?? -> IO piezo
ESP8266 -> RFID - PN532
?? -> I2C
?? -> I2C
- Attachments
-
- firefox_2023-04-29_14-05-53.jpg (43.28 KiB) Viewed 2553 times
Re: esp8266 how to connect extra hardware
On ESP8266 for CS often GPIO-15 (D8) is used, and I think you can use GPIO-0 (D3) for DC.
/Ton (PayPal.me)
Re: esp8266 how to connect extra hardware
Keep in mind that GPIO-15 is pulled down (and needs to be pulled down during boot)
GPIO-0 is pulled up and needs to be during boot.
GPIO-0 is pulled up and needs to be during boot.
Re: esp8266 how to connect extra hardware
Thanks!
I am getting close. The TFT screen is still working with the new pin settings
But i have an error with the PN532 tag reader.
PN532: BUS error
Tools->Advanced->I2C ClockStretchLimit to 2000, setting is done.
I did see there was an other topic, but no solution.
And where to connect the Piezo? GPIO-12 is free, but SPI Interface is On.
So i guess that is not possible.
ESP8266 pin 2,8" TFT ST7789
D0 GPIO-16 -> LED (TFT screen)
D3 GPIO-0 - > DC (TFT screen)
D5 GPIO-14 - > SCK (TFT screen)
D7 GPIO-13 -> SDI (Mosi) (TFT screen)
D8 GPIO-15 -> CS (TFT screen)
V3,3 -> VCC (TFT screen)
G -> GND (TFT screen)
ESP8266 pin RFID - PN532
D1 GPIO-5 -> I2C
D2 GPIO-4 -> I2C
V3,3 -> VCC)
G -> GND
I am getting close. The TFT screen is still working with the new pin settings
But i have an error with the PN532 tag reader.
PN532: BUS error
Tools->Advanced->I2C ClockStretchLimit to 2000, setting is done.
I did see there was an other topic, but no solution.
And where to connect the Piezo? GPIO-12 is free, but SPI Interface is On.
So i guess that is not possible.
ESP8266 pin 2,8" TFT ST7789
D0 GPIO-16 -> LED (TFT screen)
D3 GPIO-0 - > DC (TFT screen)
D5 GPIO-14 - > SCK (TFT screen)
D7 GPIO-13 -> SDI (Mosi) (TFT screen)
D8 GPIO-15 -> CS (TFT screen)
V3,3 -> VCC (TFT screen)
G -> GND (TFT screen)
ESP8266 pin RFID - PN532
D1 GPIO-5 -> I2C
D2 GPIO-4 -> I2C
V3,3 -> VCC)
G -> GND
- Attachments
-
- firefox_2023-04-29_17-11-43.jpg (163 KiB) Viewed 2519 times
Re: esp8266 how to connect extra hardware
There is always the option of disabling the serial log (uncheck Use Serial Port on the Tools/Advanced page), that would make GPIO-1 and GPIO-3 available for use. You can still view logging via Tools/Log.
/Ton (PayPal.me)
Re: esp8266 how to connect extra hardware
You can set 'Force Slow I2C speed' checked for that device, but I've seen it cause I2C issues.
Maybe connecting the Rst to a GPIO, and configure it of course, could improve its behavior, it will be reset by the plugin if it misbehaves.
/Ton (PayPal.me)
Re: esp8266 how to connect extra hardware
YES its working!! Thanks for the support here.
When the esp8266 is powering on, the TFT screen is white. Is there a way to prevent that.
What i do at this moment, under devices/edit tft, click submit. And it is working.
Or is that because of this? I am in a learning curve, this is new for me.
Only did see an issue with a tag, one version not working, right one.
No problem, i will order the left one.



When the esp8266 is powering on, the TFT screen is white. Is there a way to prevent that.
What i do at this moment, under devices/edit tft, click submit. And it is working.
Or is that because of this? I am in a learning curve, this is new for me.
Code: Select all
Keep in mind that GPIO-15 is pulled down (and needs to be pulled down during boot)
GPIO-0 is pulled up and needs to be during boot.
Only did see an issue with a tag, one version not working, right one.
No problem, i will order the left one.
- Attachments
-
- rifd.jpg (222.68 KiB) Viewed 2493 times
Re: esp8266 how to connect extra hardware
There are 2 types of RFID tags, 125 kHz and 13.56 MHz, and AFAIK, the PN532 only supports the 13.56 MHz tags.
Well, that can also be caused by the reset not being connected. You could connect that to the reset of the ESP, that might improve things.marktn wrote: ↑29 Apr 2023, 20:33 When the esp8266 is powering on, the TFT screen is white. Is there a way to prevent that.
What i do at this moment, under devices/edit tft, click submit. And it is working.
Or is that because of this? I am in a learning curve, this is new for me.Code: Select all
Keep in mind that GPIO-15 is pulled down (and needs to be pulled down during boot) GPIO-0 is pulled up and needs to be during boot.
/Ton (PayPal.me)
Re: esp8266 how to connect extra hardware
Problem solved!
Thanks for your support.
Thanks for your support.
Who is online
Users browsing this forum: No registered users and 15 guests