First Project ESP32 development using the TTGO T-DISPLAY

preview_player
Показать описание
Code posted at:

Continuing from our last video on this topic on getting started with the ESP32 with the TTGO-T-Display, the first project will use a DHT22 sensor along with the existing screen and buttons on the unit. Firstly, I soldered the header pins onto the board before anything so it could be affixed to a breadboard. This allowed everything to be setup on the board.

We add one new library for ADAfruit Unified Sensor which I feel isn't necessarily needed, but may cause issues for some folks, and you may need it down the road. also, DHT sensor library, also from Adafruit.

Using the library documentation, we start with a simple program to get the sensor up and running to provide some sort of serial output. As we see the output working fine, we build upon this, adding the display functionality.

Simple output of hello world shows the color and font that is desired for what we want to do. This leads to some paper and pen design. Once established, its worked into code through trial and error in some cases until the desired result is achieved. Once dynamic values are added, we need a refresh, so screen blanking is employed. Its not the best method, but it keeps the project simple.

Building on this, new parameters are added to allow for the output to be Fahrenheit or Celsius. This is Boolean. Once incorporated we will need one of the buttons to change this value. The GPIO for the built in buttons are 35 and 0. For simplicity's sake we use interrupts for the buttons, since the work required in the interrupt is minuscule, its no big deal.

And while the interrupts are working, we see a bounce issue as expected and we will have to write in debounce filters into the code to stop this problem. 200millisecond filters seem to do the trick on this device. Once debounce is solved for, the boolean value change is tied to one of the buttons allowing for a change from F to C.

Now well create functionality for the next button for a heat index display. As the device will default to the screen we created we will design another screen and show a second screen based on a second boolean value controlled by button 2.

#esp32 #iot #arduino #maker
Рекомендации по теме
Комментарии
Автор

Ok another great Video, loved the explaination for all your actions. 2 pieces of constructive criticism.

1.) The diagram @1.50 is wrong and misleading. Compare it to the video of the actual wiring the USB connector is on the other end of the board. It could be confusing to people and you do not want to get 0v and +5v the wrong way around .

2.) You do not have to do everything from your previous excellent video as stated at @bout 0.40! In that video, because I am usind Arduino IDE V2+ the JPEG tool does not install into tools and so everything after @12.35... ish could not be done . But all in this video did work just fine. So only everything upto 12.35 is required.

Thankyou again for an excellent video and your endeavours bringing it to us.

walterblanc
Автор

Very nice, I figured out my problem with nanf showing for value, it was the wrong pin. Great video

DennisDay
Автор

Great tutorial. The simplest way to avoid the whole screen flickering is to redraw the last values of temperature and humidity by setting text color to black (same as background), and then set the color to green and draw new values.

dzmecano
Автор

Nice. I was able to deduce what board I have from your video.

CodingSync
Автор

Thank you! your video helped me a lot! My first project - watch NTP.

marialewandowska
Автор

Thanks for the tutorial mate, really enjoyed it.

redraushan
Автор

THANK YOU SOOOO MUCH FOR THIS VIDEO, FROM EL SALVADOR, CENTRAL AMARICA

tomasdale
Автор

Great video! Time to order the TTGO!! Thanks!!

keithlakeman
Автор

Very nice.. just got a TTGO T-Display myself, and having fun with it. You should have the program change the color of the Heat Index value as it rises into the danger zone. Green, to yellow to red would be cool... er.. hot, as the case may be.. :-)

chrisw
Автор

Thank you I've been looking for something I could really use this board for. Now do you think adding BT out put to arduino would be difficult to add to it. I'm sure no for you but I'm a little new to this. And thank you for explaining the code like that it definitely helps with understanding the functions and flow of it all

marcocardona
Автор

sweet esp32 display video, would you happen to have one using the esp32 as a Modbus RTU rs485 Master talking to a Modbus Slave-01 reading input registers 30001, 30002?
it would be nice to have an esp32 with on board rs485 😎 fantastic verbal walk through. thank you

qzorn
Автор

The image @1:55 does not match my TTGO, your picture is the inverse of my setup. On mine Gnd, 5v Pin 27 is next to the reset button. Also on the buttons I have use pinMode(0, INPUT_PULLUP);
pinMode(35, INPUT); Then use use digitalRead : if(digitalRead(35)==0){
if(press2==0) {press2=1; [code you want ran]);

lunacyworks
Автор

could You add exactly the steps of programming with all parameters, and a summary of all used libraries? Thank You in advance

klausschirmer
Автор

Can u plz tell, why my pc didnt recognise this ttgo in com port. I show single serial exclamation mark in device manager

suhailraq
Автор

Nice! I tried it.
You could add a WiFi interface, a calibration offset trim function, (my three modules show three different outputs) (trim hard coded).
This module could also be the heart of an A/C thermostat, which needs three (latching) relays; fan, compressor, heater.
Single coil latching relays (low heat around temp sensor) can be buffered with a MAX4821. (APPLICATION NOTE 3288).
Some kind of mech buttons are needed too.

Piccodon
Автор

Thank you! your video helped me a lot! Can you do a tutorial with bme280?

erikamaciel
Автор

First, thanks for this detailled example.
About the "refresh" function for updated values: will a black background color for text do the trick with the TFT_eSPI library?

jean-philippestiee
Автор

Hello, I am using BNO055, I have three datas and every time I use the button it should be switch around these 3 datas. only one of them should be seen on the screen. Like first X then Y then Z and after the third click go back to X again. How can I do that one?

buraksonmez
Автор

Thank you so much for the video. I currently dont have a sholder. Could it work without sholdering?

hlektrikos
Автор

Hi ! Thanks for this great tutorial. how would you erase only the line with temperature and humidity without using fillscreen ?

brunobilame