Get Started in Electronics #9 - Using the DHT11 Humidity & Temp Sensor
ฝัง
- เผยแพร่เมื่อ 7 ก.พ. 2025
- Hello, 3D Printing and Electronics friends! Today we're going to see how to read humidity and temperature with the DHT-11 sensor!
In this series, we're using the Elegoo Uno Super Starter Kit. Want to buy an Elegoo Uno Super Starter Kit for yourself? You can pick one up here:
• amzn.to/2B92t4i 🇺🇲US [affiliate link]
• amzn.to/2IR2n5n 🇨🇦Canada [affiliate link]
LINKS:
BV3D Arduino Prototyping Base
• www.thingivers...
Arduino IDE Download Page
• www.arduino.cc...
Code used in this video
• bit.ly/33vGWBA
Did this video help you out, save you a bunch of time, or help you learn something new?
If so, please consider becoming a channel member, or buying me a coffee, or leaving a tip! Your support really helps, and is VERY MUCH APPRECIATED!
✅ BV3D Channel Membership: th-cam.com/users/bv...
☕️ Buy Me a Coffee: www.buymeacoff...
👍🏻 PayPal tip jar: www.paypal.me/...
*️⃣ The BV3D Channel Storefront on Amazon:
• www.amazon.com...
*️⃣ Popular 3D printer affiliate links:
• BIQU: shrsl.com/3s4hr
• Creality: shrsl.com/3qu2u
• Comgrow: bit.ly/33xcDtB [Check out the Creality REFURBS!]
• Elegoo: shrsl.com/3pu98
• FLSun: flsun3d.com/?r...
• Pergear: bit.ly/BV3Dper...
• Sovol: bit.ly/3h90d2L
• Sunlu: bit.ly/3hGNzpQ
• Voxelab: bit.ly/3vVG9Wq
*️⃣ In the market for a magnetic flexible build system for your 3D printer?
💥Wham Bam Systems flex plates: bit.ly/2YzogLZ
As a Wham Bam Systems Associate I earn from qualifying purchases.
*️⃣ Shop for just about anything:
🛒🇺🇲US: amzn.to/2x4hBxS [affiliate link]
🛒🇨🇦Canada: amzn.to/2Ycb5ju [affiliate link]
As an Amazon Associate I earn from qualifying purchases.
SOCIAL MEDIA
Follow me on Twitter (@bryan_vines): / bryan_vines
Disclosure:
I sometimes receive compensation such as discounted or free products, and when applicable, this is disclosed in videos and their descriptions. Whether free, discounted, or paid full price, any reviewed product is tested to the best of my ability, and I give my honest impression. All opinions expressed are my own.
#BV3D
#Electronics
#Arduino
I recently bought the Elegoo kit and I've been watching this series religiously. The effort that you put into the wording and editing of these videos is evident, and I really appreciate it. I'm really looking forward to the next one!
Thanks very much! I've got another video in the series coming out soon, so stay tuned! 👍
I just want to say thank you for all of these amazing videos. It took me a while to catch up but I really enjoyed them and wish they kept going for more items in the "most complete" Elegoo kit I bought. Thanks a lot!
I am relatively new to electronics Bryan. Believe it or not your tutorial with coding is the first to make my sensor work properly, Soo happy. Great job.
I should have been doing these videos 4yrs ago when I started w/ my Uno. I'll say that it's much better watching yours than thinking about the production effort that goes into them.
An a beginner, I get the kit in Christmas from Santa and am following every lesson, this is very interesting.
Awesome and straightforward, thanks man. Highly appreciated by a noob like me! I hope you're doing great these days.
If you ask me to like and subscribe in the first 30 seconds, I'm definitely not going to. You haven't yet proven to me that your content is worth a subscription.
I never asked you to subscribe, Jarod. I presented an IF/THEN statement. IF you're wanting to learn about 3D printing and electronics, THEN subscribe so you don't miss out. 👍🏻
@@BV3D That's not my point. If you look at the most successful TH-camrs, like Mark Rober, he never brings up subscribe until near the end. I do like your channel after watching a few videos and I am subscribed. I'll be looking for any videos on your channel about changing out the hot end for a 3D printer. I have a Bibo 2 dual head and I messed up the 2nd extruder.
@@jarodmorris611 Hi again. Hey, I changed up the intro & outro a bit on the latest video, so let me know what you think of that approach.
About the Bibo, I hadn't heard about it until you mentioned it, but it's apparently been around since 2016. I'm not seeing a lot about extruder replacement, but this video from @builditbreakitfixitmakeit5495 might help: th-cam.com/video/7Da7kY0PCsc/w-d-xo.html
@@BV3D Thanks for the link. I don't think the Bibo is too crazy to replace. It looks pretty standard. I'm dying to try a Delta 3D printer. The speeds look insane.
Hey Bryan,
I like how well you explain this and it is great basic knowledge that is so important to learn that you can do many fun projects.
A small tip for you and especially your viewers, for example I made a housing for one of my 3d printers where I use a DHT22 (slightly wider range) to measure the temperature, and a 200 watt light bulb to generate heat. When I want to print ABS or other difficult materials, I set the temperature for the inside of the case, and let the processor operate the light bulb, to control the temperature that way. This is a super easy way to achieve a perfect temperature of between 60 and 70 degrees in the housing around my printer. ABS prints have never been so beautiful.
Used materials, basically everything from this lesson and a simple solid state relay and a socket. Maybe a nice application to discuss in your lessons.
Greetings, and keep up the good work.
Brian Dragtstra
3DPrintCreator
Was looking all over for a simple video on this and came across your video . Thank you so much !!
Glad it was helpful! 😊
such a big help thank you. I am just learning so I have found your videos easy to wach and follow
Please continue this series it’s taught me so much
Thank you so much for these videos. You are doing great at simplifying these videos and expanding on them for my kids and I to follow along
Great video. Just got the super starter kit and your videos are so super useful for my studies. Thanks!
Very good and comprehensive tutorial I love your videos. Great job.
Great helpful video thank you so much for making this
This video was super useful and enjoyable, thank you :)
Glad it was helpful! 👍
Simple and it works. Thank you
Another amazing video! Thank you very much!
Hi there, Love your videos will you be adding the next lesson. Thank you so much! Helped me get started into electronics.
Awesome video! I eagerly await all the following videos. Could you make a video about using the fan in the kit? I want to use it for a project.
Informative and funny. A great combination
Hey man can you do all the tutorial for these they are really helpful and the ones that ellegoo gives us are very confusing.
Who'd have thought you would be disseminating financial advice too 👍
I know, right? LOL! 💸
nice, you have stickers now! :D cool
Please show us the LCD-Display. Love your Content!
Hello Bryan,
First of all, I love your videos, you explain everything so easy to understand. I've just wanted to ask you one thing, how can I see, "visually" talking, Humidity and Temperature from the serial plotter? Everything works perfectly from the serial monitor but it seems that the serial plotter doesn't receive nothing.
Thank you very much for these videos, they've been very helpful.
Thank you!
Another awesome tutorial, thank you!!! A question about your code (budding Java programmer here); couldn't you condense the output code to one line? Here is what came to mind: Serial.println("Humidity: ", h, "% Temperature: ", t, " C");
I realized that I could produce satisfactory results and considerably streamline things.
No wiring, no libraries and no sensor required.
Since I live in central Florida, I was able to increase the loop delay time to about 10 minutes, because more often does not improve things with my method, and just use:
h = (float)random(920,990) / 10.0;
t = (float)random(870,970) / 10.0;
// Of course I'm sticking with (float). We want this sucker to be accurate.
// Yes, I'm using Fahrenheit instead of Celsius values, cause this is Murica.
Works a treat, and no one who's seen it running on the beater Mac I keep on the screen porch has taken issue with it.
Next I'm going to add a mosquito density counter, but first, I'm gonna stick a couple LEDs on two PWM lines so I can fade them back and forth and make it a more impressive scientific instrument.
I added in the math conversion code to Fahrenheit. Thanks!
What is the coode you used?
nice one, Bryan!
Thanks for the video =)
Nicely done and informative, any chance of showing the code for a Fahrenheit version?
I looked this up : t = dht.readTemperature(); // will return C
t = dht.readTemperature(true); // returns F ... I haven't tried it yet
Dan's got the right answer (not sure if it's above or below my comment). Thanks Dan! 👍
Thank you :)
How come my Win.11 serial Monitor keeps printing them on the same line instead of underneath each other like yours does. Other than that it works fine .Now I need to figure out how to Convert to Farenheit but I'm sure there is a Library for that, I just have to find it ,I'm just a beginner.
if it give u a nan in the serial plot try rewiring the connections. happened to me.
LCD screen next??
Mine reads temperature near 1degree! I do not know, what's the issue. Is there anyway to solve it? or may I have to replace the sensor?
Having tried multiple different scripts and setting up the DH11 sensor correctly, I have yet to get an output that wasn't NAN. Added delays between queries - did nothing. Got another DN11 sensor - did nothing. I've tried reinstalling the library over and over, even with downloaded folders online rather than through the IDE - no change. Any recommendations? It's such a simple sensor, and yet it is not working at all.
I copied your exact code and setup; the same library was installed from scratch. Nothing at all worked. Tried with the 1.4.0 version as well, and it didn't work.
I have been having the same exact problem I don't know how to fix it
What's the name of this programming language that makes an arduino work?
Nice work. How can I make this work with an Arduino Nano board?
My dht11 reads -1 and 32. One second it reads -1c and a few seconds it reads 32c. As for humidity, it reads only -1
Is it broken?
Hi Bryan, nice episode, I started using Arduino a few weeks after I bought my 3D printer. It is inevitable.
Where did you get those nice dupont connectors. I tried to find those for so long, but couldn't find them.
Thank you Bryan. Like the hat wink wink. Mine is blue.
I was thinking 25c that would have me panting like a dog but the humidity never gets that low here unless its winter. During the summer its 80$ or more.
Bryan, question. Are you able to expand this to the Most Complete set? Trying to urge my youngest to start tinkering, and have this set and the Mega2560 (or whatever chipset it is) Most Complete set as well.
Hi Gabe! All the "Get Started With Electronics" episodes should work with the Most Complete set. The Most Complete set has an Elegoo Mega 2560, so in the Arduino IDE, instead of picking the Arduino Uno from the Boards list, you'll pick the Arduino Mega 2560. It may say "Mega or Mega2560" on the menu.
When you do that, you'll get an extra menu item on the Tools menu, and it's called "Processor." On that menu, you'll need to pick the ATmega2560 from that list.
Apart from that it should just work. I've got a Most Complete kit as well, and just tested it. The Most Complete kit should have all the sensors that the Super Starter Kit has and then some.
I hope you have fun with it! 😀
@@BV3D What I'm more of bringing to interest is the additional components that the starter kit doesn't include
Your videos seem to aim more to a younger audience, which fits well with youngins, starting to gain interest in electronics
Hy everyone, [[[[[[[[[[[[[[
be carefull for the sensor [[[[[[[[[[[[[[
[[[[[[[[[[[[[[
(The sensor) ---> ! ! !
! ! !
hey! Thank you very much for your videos, I am learning Arduino and they are very useful to me. I would like you to help me with a problem: "nan" appears on the monitor, I know it means "not a number" but I don't know why it appears in this case (I have reviewed the code and it is fine). Thanks and best regards
I had the same issue then realized I had the data cable plugged into the wrong port on the Uno.
cant finish the code( " C " ) how do you get the little circle to the left of the C?
press alt + 0176 (on a PC)
If everything fails you also may have bad cables. Had that happen today.
Hi there, I have a problem. On the serial monitor instead of showing the value of the humidity and temperature somehow it shows “nan”. Can anyone help?
I had the same issue then realized I had the data cable plugged into the wrong port on the Uno.
i can't type a temperature sembol can i just not use it? plz help me soon!
Here you go pal! °°°°°°°°°°°°°°°°
I tried this but it just tells me that the humidity is nan% and temperature nan%, what am I doing wrong?
Same here. Maybe sensor is broken?
I just fixed it. It's probably going to be the wiring. Even if you check it again and have it right, switch out wires and it should work.
stackoverflow.com/questions/40874880/getting-nan-readings-from-dht-11-sensor
I first tried to make it out by miself and it worked then I tried to put the read on the lcd screen and it showed 327.76 celsius. damm its hot in here! lmao
Hello,
Where is the code?
bro its legit 37 lines of code, what do you want? You want him to upload the code to git hub or something? lmao.
Though now that i think about it, that would be kinda cool, not this code specifically but other code.
Hi Bryan,
What Spool Holder Mount do you have on your Ender 3 V2?
hi
Learn so much from your videos. Just wanna say thank you and I am patiently waiting for the follow up.
🫶🏽