Maybe a dumb question or a noob question, but is it possible to connect a screen on an esp32 board and use the same esp board to connect and read some sensors?
I would like to show several values on the display, but at the same time add some sensors to it for temperature/humidity/air quality…
Or do I need to use a second esp board for the sensors?
I have ordered a 4 ich display, but today I have tested with a tiny 0.91 inch
But I succeeded in connecting a bme280 board and show its measured values on the display, which has been connected to the same esp board!
It is pretty easy!
And within the Home Assistant dashboard the sensors are also visible.
That looks pretty good. the largest ILI9488 I could find a while back was 3.2 inch. I use heaps of them and the driver and resolution are the same so this should be fine.
I have received the display and the esp32.
I will now have to experiment.
To be honest, besides of the small oled display, I am a newbie with tft screens.
If I search the internet I found a lot of posts about it, but for the moment I did not find a clear tutorial about the connection between the display and the esp32. There are about 13 pins or so on this display, but I have to find out the function of each, which ones I really need and how to implement in esphome.
If one of you have a good tutorial, I would be interested!
Maybe I must try first without esphome, and with Arduino ide?
The pins are described in the product’s description in your Aliexpress link in case you missed it, with picture (assuming it’s right…).
You might want to take a look at this post.
I thought I should mention the One-Wire bus, which also allows you to use multiple sensors on the same pin: ESPHome dallas. The DS18B20 allows for distant readings; you can find versions up to 10m (33ft) on Aliexpress, though I personally only used ones up to 3m (10ft). Works great in a greenhouse for example to measure outside/inside/soil temperatures from a single ESPHome device; low cost.
At the least, post a photo of the board clearly showing the labelled pins. They are relatively easy to hook up but sometimes the pin abbreviations need a bit of guesswork.
NOTE: I assume you have a WROVER ESP32 with extra PSRAM? A WROOM chip will not have enough memory.
I am also assuming you got a touchscreen variant and it’s an XPT2046 touchscreen - the purchase page specs don’t say. You may also get “strapping pin” warnings - ignore them.
spi:
clk_pin: GPIO18
mosi_pin: GPIO23
miso_pin: GPIO19
output:
- platform: ledc
pin: 32
id: backlight_pwm
# define as light
light:
- platform: monochromatic
output: backlight_pwm
name: "Backlight"
id: back_light
restore_mode: ALWAYS_ON
touchscreen:
platform: xpt2046
id: touchscreen1
cs_pin: 21
interrupt_pin: 27
update_interval: 50ms
report_interval: 1s
threshold: 350
calibration_x_min: 280
calibration_x_max: 3806
calibration_y_min: 185
calibration_y_max: 3884
swap_x_y: false
binary_sensor:
# Screen is one big button, read touchscreen docs if you want to divide up
- platform: touchscreen
id: touch_key0
x_min: 0
x_max: 240
y_min: 0
y_max: 320
on_press:
then:
# actions to do on touch.
display:
- platform: ili9xxx
model: ili9488
id: my_display
rotation: 180 # put whatever rotation you need for your application
dc_pin: GPIO22
cs_pin: GPIO15
reset_pin: GPIO16
# Display pages and code goes here
On the website they point to this instructions: S2 Mini manual
Do those boards have anough functionality and capacity?
I do miss some of the pun numbers, but they are different on these boards?
When I look at This scheme, which pin numbers do I need?
It seems in every scheme the names/numbers of the pins are different…I tried it, but please can you take a look with me?
1 VCC power input (3.3V~5V) ------------------------------------------ 3V3
2 GND power supply ground ------------------------------------------- GND
3 CS LCD film selection ------------------------------------------------- GPIO 10 or 34
4 RESET LCD reset ------------------------------------------------------ GPIO ?
5 DC LCD bus command/data selection ----------------------------- GPIO ?
6 SDI (MoSi) LCD SPI display bus data input ---------------------- GPIO 11 or 35*
7 SCK LCD SPI display bus clock signal ---------------------------- GPIO 12 or 36 *
8 LED LCD backlight control (high level lighting) ------------------ GPIO ?
9 SDO (MISO) LCD SPI display bus data input and output ----- N/A (37)
10 t _ clk SPI bus clock signal of touch panel ----------------------- GPIO 12 or 36 *
11 t _ cs touch panel - Chip selection of SPI bus for -------------- GPIO 10 or 34
12 t _ din touch panel SPI bus data input ---------------------------- GPIO11 or 35 *
13 t _ do touch panel SPI bus data output --------------------------- GPIO ?
14 t _ IRQ touch panel interrupts IRQ signal ------------------------ GPIO ?