Тёмный

SHT21 Digital Temperature & Humidity Sensor Tutorial for ESP8266 

Gadget Reboot
Подписаться 30 тыс.
Просмотров 6 тыс.
50% 1

Using the SHT21 digital temperature and humidity sensor, I put together this tutorial showing how to use the sensor with ESP8266 (same code would work on Arduino).
I'm also using an LCD touch screen to display the temperature and humidity graphically, and showing how to use touch screen buttons to switch between degrees C and F.
The touch screen shield uses Arduino Uno and since it uses up most of the Uno pins, I'm using the SHT21 on NodeMCU, then communicating the data over UART to the Uno. In the future I will adapt the ESP8266 sketch to make sensor data available with WiFi.
Uno Sketch and Schematic:
github.com/GadgetReboot/Ardui...
ESP8266 Sketch:
github.com/GadgetReboot/Ardui...
Previous touch screen thermometer video with more detail about parts of this sketch:
• DS18B20 Digital Thermo...
SHT21 Library:
github.com/markbeee/SHT21
SHT21 Datasheet:
www.sensirion.com/fileadmin/u...
Analog meter sketch reference:
github.com/Bodmer/TFT_eSPI/bl...
Another project that shows how to use the analog humidity meter graphic:
thesolaruniverse.wordpress.co...
Patreon: / gadgetreboot
Pinterest: www.pinterest.ca/GadgetReboot
Twitter: @GadgetReboot / gadgetreboot

Наука

Опубликовано:

 

27 янв 2019

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 23   
@MarcelDiane
@MarcelDiane 5 лет назад
You are having fun with those ESP processors. By the way, from now you are known as FNU at Gadget Reboot. Thanks for your help and support.
@GadgetReboot
@GadgetReboot 5 лет назад
Just wait until I get multiple ESP up and running. I currently have three with more on the way on the slow boat.
@jimb032
@jimb032 5 лет назад
Go go Gadget thermometer! Great video again!
@electronic7979
@electronic7979 5 лет назад
Woow excellent project 👍
@electroniquepassion
@electroniquepassion 5 лет назад
thank
@jasonmhite
@jasonmhite 5 лет назад
I have had a lot of trouble with these sensors over self-heating and/or thermal conduction through the PCB. I wanted to make a temperature reference based on the SHT35 (basically the same sensor, but with better rated accuracy) and ended up having to go through a lot of work to design a 3d printed case that thermally isolated it from the microcontroller and switching off power to the sensor. It seems like the SHT sensor is especially vulnerable to self-heating based on my experience with several of them. Also, the ESP has clamping diodes, you can leave out the level shifter. There was some doubt about it early on, but the Espressif CEO confirmed it was safe to use with 5V logic.
@GadgetReboot
@GadgetReboot 5 лет назад
Is there any published thing about the 5V tolerance? I saw general talk about it when looking it up but then the data sheet suggested it wouldn’t be tolerant so I was playing safe. I noticed weird behaviour with the humidity reading if I tried to touch the sensor to warm it up for testing. The humidity may go way out of expected range and take a while to come back. I think I’ll try doing some characterizing right now when it’s generally colder and less humid and then going towards summer see how things compare with performance and see what’s going on. If controlling it’s power off and on can be a workaround for any self heating, at least that can be a workaround although annoying and requiring another I/O to control it.
@jasonmhite
@jasonmhite 5 лет назад
@@GadgetReboot The CEO confirmed it on Facebook and people have tested it ad nauseum, it's pretty solid. I dunno why they don't publish it more widely, but I've since used them without level shifting without any problems, I have one project that's been going strong for almost 2 years. The one caveat is that you absolutely cannot POWER it from 5V, but the GPIOs are perfectly ok with it. The weird behavior touching it might be moisture or oil from your finger. The sensor element is rather exposed, they actually sell a dedicated semi-permeable cover for the sensor. You can keep the self-heating to a minimum by physically isolating the chip from anything else on the board and powering it from 3.3V. I use mine as a reference to calibrate other temperature sensors and I just set them in close proximity with a fan blowing air across them, which I've found gives me the most accurate reading of air temp and minimizes any remaining self-heating effects.
@GadgetReboot
@GadgetReboot 5 лет назад
Definitely strange that the ESP data sheet doesn’t contain the info because I think the data sheet I looked at was from 2018 so they had lots of opportunity to update. I’ll see if I can dig out anything on Facebook. I think I’ll also dig into that SHT sensor and see if I can find anything about application notes or information about why it might be so sensitive to its own environment. Would be interesting to gather up all the resources for any information about ambiguous things like this so we can all reference it. Thanks for pointing these things out.
@Dancopymus
@Dancopymus 5 лет назад
Very interesting project. What screen are you using, a 3.5-inch ILI9488? What should I change in the sketch to, instead of SHT21, use a bme280 or DHT22? Thank you
@GadgetReboot
@GadgetReboot 5 лет назад
That sounds like my touchscreen, it’s either 3.5 or 3.6 inch and the diagnostic tool said that the display driver is ILI9341, ILI9488. I never did fully understand how to decide which driver it is I just mess around until I get something working and I even have to refer back to other display videos I have done successfully to doublecheck. I have a DHT22 sensor that I haven’t used yet so I’m not sure what needs to change until I work on it and do a video. I will try to do that soon because I need to do garden watering sensor things anyway. Keep checking back and I will try to do the DHT22 using this same display and set up.
@Dancopymus
@Dancopymus 5 лет назад
@@GadgetReboot Okay, I'll wait; thank you
@GadgetReboot
@GadgetReboot 5 лет назад
I’ve started adapting some older temperature sensor projects to use DHT22 now. I hope to have something more presentable later but for now I put one sketch on github that used to use DS18B20 and a slightly different touchscreen printout so you could check that out while I still work on putting one or more videos together and eventually modify this particular SHT21 project. github.com/GadgetReboot/Arduino/tree/master/Uno/DHT22/TFT_480x320
@Dancopymus
@Dancopymus 5 лет назад
@@GadgetReboot Hi friend! Thank you for this sketch, I will try and, when you have some others, if you can, please send me, I will be very grateful. I always comment: there is a great inconvenience regarding the logic pins of these Displays, that resistors (or dedicated ICs) must be used to suit their logic voltage. In case of using Arduino Uno, Nano, for example, that has its logical levels with 5V. Manufacturers should have thought of this - what do you think? Hi friend (Gadget Reboot), thank you for this sketch, I will try and, when you have some others, if you can, please send me, I will be very grateful. I always comment: there is a great inconvenience regarding the logic pins of these Displays, that resistors (or dedicated ICs) must be used to suit their logic voltage. In case of using Arduino Uno, Nano, for example, that has its logical levels with 5V. Manufacturers should have thought of this - what do you think? Thanks again, Daniel Fernandes PS. How should the pins of ILI9488 be connected to Uno or Nano?
@GadgetReboot
@GadgetReboot 5 лет назад
@@Dancopymus The video with the projects included is now posted: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ATROwE9lYHM.html It shows how the pins of my display line up with the Uno pins to plug in correctly. I haven't tried with a Nano so I'm not sure if there's enough pins free because my display has so many pins - there are some that use fewer pins with SPI and those may work better. I should shop for more than just the one that I have with so many pins. Since Uno came out so many years ago, back then 5V and 3.3V were both in use, transitioning toward 3.3V, so since the old 5V technology is still used for some Arduinos, it's hard to know which voltage to support on new hardware that will connect with old, so level shifting may be the only way unless the interfaces are designed backward compatible. For hobby work, we can add the inconvenient level shifters but for market production, I can see why modules would only support 3.3V going forward, being compatible with more modern hardware.
@MindsFree
@MindsFree 4 года назад
May i know if SHT21 can replace with DHT22....because SHT21 not available at my country..tq
@GadgetReboot
@GadgetReboot 4 года назад
I used DHT22 with Arduino Uno and this other video, ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ATROwE9lYHM.html It should work with ESP8266 if the sensor is powered from 3.3 V instead of 5 V because the sensor data sheet says it can operate at 3.3 V which is what ESP8266 needs. So you could try taking this SHT21 sketch and commenting out that sensor information from the sketch and then copy over the DHT22 information from the other sketch and merge it together.
@MrSasha3050
@MrSasha3050 3 года назад
When the sht21 sensor don't communicate with ESP current consumption uA right?
Далее
Sensors - which one to use
17:06
Просмотров 1,3 млн
Best Toilet Gadgets and #Hacks you must try!!💩💩
00:49
Arduino humidity sensors: testing and calibration
11:00
#363 Which ESP32 pins are safe to use?
11:53
Просмотров 127 тыс.
How to Use Arduino Interrupts The Easy Way
33:28
Просмотров 79 тыс.
Round GC9A01 240x240 display and  gauges
11:12
Просмотров 100 тыс.
iPhone socket cleaning #Fixit
0:30
Просмотров 16 млн