Using a DHT11 and ATtiny to control humidity moisture and temperature - Anything Arduino ep 4

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ย. 2024
  • In this quite long video tutorial we go through the process of downloading and installing support for the DHT11 humidity/moisture and temperature sensor. We then make a sketch which enables us to control a dehumidifier and a heater to make sure that a washing room wont get too cold and too humid. We then build a circuit around this, and in the end also see the finished "product". This circuit will give you full control of a dehumidifer and heater which usually cant be adjusted to an exact temperature or humidity or moisture level (usually only set by using a dial).
    Find the code and more info at this URL: www.duinos.net/...

ความคิดเห็น • 169

  • @akroutsamo
    @akroutsamo 8 ปีที่แล้ว +9

    hi man , first of all this is a helpful tutorial about shrinking the arduino project into Attiny ,but how about you add an Lcd and some buttons or a rotary encoder for inputs within the relay module , Dht11 and make a simple user interface menu to set and control the temp and humidity .. like a standalone dehumidifier unit
    i hope you like the idea (y)

  • @amtpdb1
    @amtpdb1 8 ปีที่แล้ว +2

    I like the way you showed the process you went through.
    Great video thanks.

    •  8 ปีที่แล้ว

      Thank you! :)

  • @rich.fortune
    @rich.fortune 7 ปีที่แล้ว

    Thanks for taking the time to do this Kristian! And thanks for the explanations and summary of your issues! Super interesting! :)

  • @BilalAhmad-ls6pd
    @BilalAhmad-ls6pd 6 ปีที่แล้ว

    Sir you are the best. I had a problem in including the library and when I saw your video then I did the job

    •  6 ปีที่แล้ว

      Great to hear! Thanks!

  • @Christopher-go4du
    @Christopher-go4du 9 ปีที่แล้ว +3

    yes.... washing room... that's why I need to make this....

    • @kahunajonsen7021
      @kahunajonsen7021 4 ปีที่แล้ว

      hahahah same.... for my washing room of course .....

  • @robertmarkham6558
    @robertmarkham6558 6 ปีที่แล้ว

    //Temprature on PIN 5, rest do with what you will, easier to copy his sketch if you have a base one, This took me about 2 hours to sort out. Have fun guys
    #include
    dht DHT;
    #define DHT11_PIN 5
    int Fan=3;
    int Light=4;
    int LED=5;
    int i = 0;
    void setup()
    {
    Serial.begin(115200);
    Serial.println("DHT TEST PROGRAM ");
    Serial.print("LIBRARY VERSION: ");
    Serial.println(DHT_LIB_VERSION);
    Serial.println();
    Serial.println("Type,\tHumidity (%),\tTemperature (C)");
    pinMode(Fan, OUTPUT);
    pinMode(Light, OUTPUT);
    pinMode(LED, OUTPUT);
    }
    void loop()
    {
    // READ DATA
    Serial.print("DHT11, \t");
    int chk = DHT.read11(DHT11_PIN);

    // DISPLAY DATA
    Serial.print(DHT.humidity, 1);
    Serial.print(",\t");
    Serial.println(DHT.temperature, 1);
    if (DHT.humidity>55){
    digitalWrite(Fan, HIGH);
    }else {
    digitalWrite(Fan, LOW);
    }
    if (DHT.temperature>24) {
    digitalWrite(Light, HIGH);
    }
    else{
    digitalWrite(Light, LOW);
    }
    i=0;
    while(i

  • @jlucasound
    @jlucasound 5 ปีที่แล้ว

    You are awesome, Man! I so need to get an ATtiny and the relays. I only knew about the Atmega 168 chip. I'd be happy with that, but an 8 pin chip is much better. If you only need the few connections and commands, that is really cool in a small enclosure. Thanks! I just Subscribed. Keep up the good work. I thought what you did with the High and Low was correct until you pointed out it wasn't. Showing us what NOT to do!! :-)

    •  5 ปีที่แล้ว

      Thank you. My suggestion nowadays is to use the dht22 instead though as it is more stable and correct than the dht11.

  • @dibraniuk
    @dibraniuk 8 ปีที่แล้ว

    Hi Kristian, finally! I found a way to load the sketch but still having same trouble with the relays...let wait and see!

    •  8 ปีที่แล้ว

      +dibraniuk Great to hear, what troubles with the relays, you didnt mention this before?

    • @dibraniuk
      @dibraniuk 8 ปีที่แล้ว

      both relays are staying on! from the very start

    •  8 ปีที่แล้ว

      +dibraniuk Ah ok, do you have any reference so you know what temp and humidity you have? If you know you are below on both values and the threshold value for temp is higher than 30degrees, then what happens if you blow on it? Does it turn off any relay? If so they can be "reversed"... Or it can be hardware problems. Maybe you dont have a connection to the DHT11?

  • @lavsenoj1092
    @lavsenoj1092 7 ปีที่แล้ว

    This is great!!! I am NOW using this to control my reptile environments. Everything works, thanks to you. One question, isn't it best to have your relay least often energized and faulting to open? Couldn't you swap wires instead of swapping the "HIGH" "LOW " settings? Thanks again, awesome explanation.

  • @plamenpetkov7132
    @plamenpetkov7132 9 หลายเดือนก่อน

    I am having problem getting the ATtiny read correctly the DHT11 sensor. It returns TIMEOUT and displays 255% humidity and 0 deg C temp even with unplugged sensor

  • @axeman2638
    @axeman2638 ปีที่แล้ว +1

    you'll get hunting oscillations doing it this way, you need to use PID

  • @bigzeeification
    @bigzeeification 4 ปีที่แล้ว

    you can replace all the bulky conditional statements and put instead 2 lines of code:
    ```
    tens = temp/10; // division will get you the tens
    ones = temp%10; // modulo operator will get you the ones
    ```
    simple as that!

  • @serkancetiner760
    @serkancetiner760 7 ปีที่แล้ว

    I will make this .THANKS A LOT Kristian Blåsol:))

  • @Lionman-rw7xb
    @Lionman-rw7xb 3 ปีที่แล้ว +1

    Hi Sir. Can you tell me pls from where i can take the code ?
    Thanks

  • @esantidp
    @esantidp 5 ปีที่แล้ว +1

    Hi,
    In command you can do a git clone libraryurl to download whole library folder on the desired folder if you have git downloaded.
    Thanks for showing how to use the Arduino

  • @mozartips
    @mozartips 9 ปีที่แล้ว +1

    Thanks a lot, I just made one like this learned from this video. :)

  • @rahulmoorkoth2395
    @rahulmoorkoth2395 7 ปีที่แล้ว

    complete video. thanks for this tutorial

  • @justaninfiredperson
    @justaninfiredperson 5 ปีที่แล้ว

    This was really good and informative thank you

  • @circle4922
    @circle4922 4 ปีที่แล้ว

    This is great! Thank you.

  • @ksuhuh
    @ksuhuh 9 ปีที่แล้ว

    Cool video! Very helpful thanks!

    •  9 ปีที่แล้ว

      ksuhuh Thank you for your kind words! Let me know of any cool projects you do with it! :)

  • @mattmurphy347
    @mattmurphy347 8 ปีที่แล้ว

    Hello and thank you for the excellent video. One thing that I was wondering which seems to have been done off screen is how you spliced the relays into the dehumidifier and heater - I seem to be having some trouble in finding how to do this. If you could provide some information or a link on how one might go about doing this part of the process it would be much appreciated.

  • @DeeJayh
    @DeeJayh 6 ปีที่แล้ว

    You went through all that trouble to show us the process and then only demonstrated it on the bench. Why didn't you do a wider shot at the end and blow into it to show the dehumidifer coming on at the very least? Anyways, good video. I love these ATtiny projects.

  • @ArcanePath360
    @ArcanePath360 8 ปีที่แล้ว

    I actually found an NTC thermistor which is a fraction of the price far better for measuring temp. It's much quicker at detecting changes and is more accurate. I use that plus this together to get humidity and temp.

    •  8 ปีที่แล้ว

      +ArcanePath360 Do you have the exact part number? So I can try it out aswell? :)

    • @ArcanePath360
      @ArcanePath360 8 ปีที่แล้ว

      +Kristian Blåsol
      Search for MF52 10k thermistor

    • @lilwarthog
      @lilwarthog 8 ปีที่แล้ว

      hey man im just getting into the arduino. With the ntc temp sensor is there much difference in hooking it up. Also would i beable to hook it up for cold and hot responses. For instance if its to hot turn the ac unit on. If it gets too cold than turn the heater on? And how about would i go to do that? Thanks guys for the tips plus the awesome video!

    •  8 ปีที่แล้ว

      As for how the NTC is to work with I dont know, as I havent tried it yet. But yes, you can have different things happening for different temps. Eg. if (temp20) {do something else} else {do something if it is inbetween 10 and 20} for example. Just doing a lot of if, and elseifs and you can do a lot with a simple value... :)

  • @ezeprojects5425
    @ezeprojects5425 7 ปีที่แล้ว +1

    Can you give info about the relay plz. Like part number. Maybe I missed it.

  • @tersamdiyaquarium6284
    @tersamdiyaquarium6284 9 ปีที่แล้ว

    I will try to do exactly the way you do yours, maybe I'm missing out something. I'll get back to you whenever I'm done

  • @Lengchanny1
    @Lengchanny1 6 ปีที่แล้ว

    Thank so much for your useful video.

  • @juanmarryns5360
    @juanmarryns5360 8 ปีที่แล้ว +1

    Hi Kristian , i'm very happy for you video. I would want to ask you something about a sensor of humidity SI 7006-A20 ,to develop in a library C using Udoo which is very similar to arduino. Thanks you for your answer.

  • @Lucanos
    @Lucanos 7 ปีที่แล้ว

    It's a good project, and a good video, but alot of opportunities for improvement. I'd suggest using Fritzing for your circuit illustrations rather than the MSPaint drawings. I'd also suggest shooting the video in smaller snippets, cutting between your footage and the Fritzing illustrations. This would also allow you to redo sections where your dialogue has messed up due to forgetting words or what you wanted to say. (As a viewer, hearing long "errrr"s as you search for the right word is distracting.)

    •  7 ปีที่แล้ว

      Thank you for your input. I agree on some points, but I also dont want to cut too much in the footage, I want to show exactly how easy it is to work with the arduino and not "mask" anythinig by cutting too much. It still happens though. And instead I get a lot of "err" which is bad. As for the mspaint drawings :D It is actually on an ipad where I draw with a pen and explain at the same time. Fritzing is nice for a finished illustration, but as far as I know you cant "draw" the traces as you explain? I might be wrong, but the only good way to do it has been this way. But I will still take your criticism into consideration and see what I can do. A final fritzing drawing would be a good start I guess. Take care!

  • @basmaal-ghali9174
    @basmaal-ghali9174 3 ปีที่แล้ว

    Thank you

  • @tedesco060968
    @tedesco060968 9 ปีที่แล้ว

    Hallo Kristian thanks for you projekt i shrink my sketch from 4,4kb to 3,7kb only change int to byte , test all with Attiny 44 and work fine

    •  9 ปีที่แล้ว

      Thats great to hear Antonio, Great idea to replace the INT with BYTEs as there are no numbers above 255 or negative numbers. And the ATtiny44 explains it, you were just above the threshold to get it into the 4K memory :) Thanks for getting back with your solution.

  • @ezeprojects5425
    @ezeprojects5425 7 ปีที่แล้ว

    There is a lib for Arduino called Softwareserial which will allow printing to the monitor with the ATtiny85 code while connected to Arduino. I developed some code with Arduino that ran great on the 368 chip, and I was printing some debug info, when I uploaded to the ATTiny85 (sans debug prints), whoops! didn't work. So, out of desperation, I found the use of this library. It only takes one pin on the Tiny, which is cheap at half the price, although you are still tethered to the Arduino during the debug process.

    •  7 ปีที่แล้ว

      Good to know. Thank you!

  • @nimaamini9038
    @nimaamini9038 4 ปีที่แล้ว

    ** Suggestion for new video of an automated greenhouse **
    Hey, thanks for the great stuffs.
    I'm sure there are lots of people searching for an automated greenhouse, like I am. Can you make a project on a greenhouse that has a heater, a water pump, hot and cold humidifiers, and a window that gets open when too hot or humid. There are lots of even more complicated greenhouses on youtube, but no one's sharing the code and schematics.
    Wemos d1 mini or Uno and DHT sensors would be great options for the project.
    Thanks in advance.
    Please hit the like if you agree.

  • @sahilbakht
    @sahilbakht 5 ปีที่แล้ว

    Hey Kristian , thanks for such a detailed video. Could it possible to explain the connections you made from relay module to the dehumidifier and power plug ? Would really appreciate some help. Thank you !

    •  5 ปีที่แล้ว +1

      First of all: working with AC power is DANGEROUS! You need to know what you are doing and never work with power plugged in. So AC power in this case is two leads. Just cut one of the leads in the wire (no matter which) and add a relay that can handle voltage and amperage of your AC device on this cable. Depending if you want power to be on when the relay has no signal in on the coil, then you connect one side of the lead to NC. If you want it to be off when no signal on the coil connect it to NO. The other end of the lead you connect to the common pin/screw terminal (usually the one in the middle on relay boards) hope it helps. I have another video explaining in more detail I think.

    • @sahilbakht
      @sahilbakht 5 ปีที่แล้ว

      @ Hi Kristian..Although i couldn't find a video where you have explained it, I almost understood all your points. . So Im trying to control a humidifier and a heater using dht11/dht22 , 2- channel relay and Arduino. This is my first time working with relay and its not very clear from this video of how you have connected dehumidifier and heater. Now since Im trying to control both the heater and humidifier , I am assuming we have to connect both the relay channels with each of the heater and humidifier. I am thinking to integrate an extension chord to connect the power supply and the device with the relay channel. I have made a circuit diagram connecting all the wires and I wanted you to take a quick look at it and tell me if I did something wrong. If you could share me your gmail, it will be very easy for you to understand what i did. If there is any other alternative that you might think is simpler , please feel free to suggest. Thank you so much for all your help :)

    •  5 ปีที่แล้ว

      Sahil Bakht just put a link to the image here. Just so you know that usually you can’t connect a heater to the cheap relays you buy on eBay. They can usually only handle 10amps. My heater could be set at 750, 1250 and 2000w heating. Having it at 750 it worked. When I accidentally set it at a higher watt the relay burned up. So that is why I say BE CAREFUL!

  • @gubuzelaog
    @gubuzelaog 6 ปีที่แล้ว

    Hi firstly wow and secondly very nice .. Can you make me one ? I need to use in my biltong box to control humidity and temperature by controlling 2 fans and a 60w light?

  • @mfalme254
    @mfalme254 5 ปีที่แล้ว

    Kristian thanks for this video very informative. Question: Which microcontroller is that you introduced at 4:34 ? Did you say 801085?

    •  5 ปีที่แล้ว +1

      That would be the Attiny85 which is an atmel chip like the atmega328 but with only 8pins. See previous episode for how to program it.

  • @scrapwomblecreatives6944
    @scrapwomblecreatives6944 6 ปีที่แล้ว

    Ok this is not working, have used two control units neither work it an arduino uno, elegoo uno r3 and 5 sensors all i get when monitoring is 000000 and the odd letter no temp readout

  • @camillion100
    @camillion100 8 ปีที่แล้ว

    Hi Kristian, Great video and very informative thank you, i have just started with arduino & this spurs me on with a project that i am contemplating. What i need to do is to measure oxygen flow and display it to lcd, can you give me any help at all. many thanks

    •  8 ปีที่แล้ว

      What sensor do you use to measure the flow?

    • @camillion100
      @camillion100 8 ปีที่แล้ว

      Hi Kristian,
      Thanks for replying, sorry I havent much for you to go on as I'm really at the early stages here on this. Just looking for some leads on how to start it off, maybe if you had completed something similar. The only sensor that is available to me at present is the one that measures the oxygen amount in an incubator made by Drager Medical, just getting my ideas together.
      John

  • @RandomSnot
    @RandomSnot 9 ปีที่แล้ว

    Annoying how those relay modules invert the logic, for some reason I never thought to fix the problem in software I just fixed it by adding additional hardware lol, but your way is better. Anyway thanks for the video.

    •  9 ปีที่แล้ว

      Thanks! Another way to fix the problem with inverted logic in these modules is to switch from NO (Normally Open) to NC (Normally Closed). That way you only have to move one cable in the scre headers, and not have to change the code even...

  • @tablatronix
    @tablatronix 8 ปีที่แล้ว

    wow my dht11s must be fake, they are all over the place, yours looks pretty stable

    • @lilwarthog
      @lilwarthog 8 ปีที่แล้ว

      i was reading the dht11 is alot less accurate compared to even say the dht22, what im looking into is the thermocouplar or the ntc that op recommend

    • @tablatronix
      @tablatronix 8 ปีที่แล้ว

      Actually i retested my dht11 ( and bought some 22s for comparison ) and the resolution is low, but they are fairly decent and sensitive sensors. I think they are just very susceptible to noise, they are much more stable with decent power and wiring, my error rates went from +-10° to the spec, i blame the breadboard i was using.

  • @eftolis
    @eftolis 9 ปีที่แล้ว

    Nice Video!!! Subscribed.

  • @a.a.a7385
    @a.a.a7385 8 ปีที่แล้ว

    Hello Kristian, Thanks for your tutorial, would you mind please tell me what is the function of (A tiny 85), I mean can the the system works without A tiny 85. Thanks, Adel

    •  8 ปีที่แล้ว

      +adel tbeni Yes, a Tiny 85 should work aswell...

  • @Faisalkhan-ry4eg
    @Faisalkhan-ry4eg 5 ปีที่แล้ว

    Please make a project for egg incubator controller

  • @juansubiry99
    @juansubiry99 2 ปีที่แล้ว

    How did you connect the Arduino to the humidifier/heater?

    •  2 ปีที่แล้ว

      With a relay. A digital pin controls a relay that turns the heater on and off. Keep in mind it is very important that the relay you use can handle the wattage of your heater. Black nasty smoke will be produced if it can’t. And it’s a huge fire hazard!

  • @anthonychan1913
    @anthonychan1913 9 ปีที่แล้ว

    Do you also use the Raspberry Pi? I was looking for a way to control my HVAC system using a DHT11. I see lots of tutorials for the DS18b20.

    •  9 ปีที่แล้ว

      Not for this project no. It would be way overkill to use a RPi for this simple task :) I'll soon make a project using the DS18b20 aswell. It is a good alternative for sensing temp only, i Think a bit more expensive though...

  • @naveenkulasinghe4218
    @naveenkulasinghe4218 7 ปีที่แล้ว

    thnx lot your are the best

  • @GloryanHeadman
    @GloryanHeadman 9 ปีที่แล้ว

    as for beginer I did not understand the last part. how you connect the power supply

    •  9 ปีที่แล้ว

      +Gloryan Headman Sorry for not making that clear enough. I have a wall wart (transformer adapter) that supplies 9V. You can see in this picture: duinos.net/files/2014/humtempcontroller.png there is a powercable connected on the left side of the box. It then connects to a 7805 and two caps as similar to this image: duinos.net/files/2015/mapbh.gif. Hope that helps.

    • @GloryanHeadman
      @GloryanHeadman 9 ปีที่แล้ว

      +Kristian Blåsol yeh)) I can see that, but it looks like a mess to me, it wold be perfect if you will do the second part from the scratch. there are lots of videos , but 90% is rubbish because authors don't pay attention to details. I commented to your video because it is more or less understandable but only first part of it, more to the end it is becoming more foggy like you were in hurry to finish it. thanks

    •  9 ปีที่แล้ว

      +Gloryan Headman :) True and still it was a bit long ;) I'll make a complimentary video for the last part as well. Give me a few days though...

    •  9 ปีที่แล้ว

      +Gloryan Headman Done! :) Hope this video helps. th-cam.com/video/tfAWkH5ogbU/w-d-xo.html

    • @GloryanHeadman
      @GloryanHeadman 9 ปีที่แล้ว

      +Kristian Blåsol thanks!! clear)

  • @ale_1884
    @ale_1884 8 ปีที่แล้ว

    I have one problem Kristian , when the temperature rise the relay go on then the temperature go down the relay dont go off , just stay on all the time .

    •  8 ปีที่แล้ว

      You need another If statement to turn the relay off again I guess. Look in my example code and you should be able to figure it out.

    • @ale_1884
      @ale_1884 8 ปีที่แล้ว

      Thanks Kristian !

  • @dibraniuk
    @dibraniuk 8 ปีที่แล้ว

    do you have the arduino code you adjusted???

  • @rapunzeleh546
    @rapunzeleh546 5 ปีที่แล้ว

    okay, maybe you can help me... can't seem to get it to work and no answers from anyone else... all i want is to turn on a 5v fan from a nano... lots of vids on AC fans with relays, or 12v fans with mosfets etc. but i just want a 5v fan running off the 5v nano.. if i knew the connections (no breadboards, i want this as small and uncomplicated as possible) i can figure out the code.

    •  5 ปีที่แล้ว

      The problem is that if the fan draws a lot of power the nano wont be able to handle the load. Therefor it is better to use a relay or transistor to power the fan. Check back a few episodes in Anything Arduino and you will find an episode where I use a transistor as a switch. You will have to find a correct resistor, but other than that it SHOULDwork with a 3904 or bc547,548,549 NPN transistor, thus protecting your nano from overloading the pin :)

    • @rapunzeleh546
      @rapunzeleh546 5 ปีที่แล้ว

      @ how can it draw a lot of power when it's only a 5v fan... i guess i'm just not getting the problem.

    •  5 ปีที่แล้ว

      Because a fan draws a lot of current (A or mA) and the arduino pins can only supply really low amps. That is why you need power from another source. Look back a few episodes of anything arduino you will find how to use a transistor as a switch. That might help you a bit.

    • @rapunzeleh546
      @rapunzeleh546 5 ปีที่แล้ว

      @ i had it working already with a mosfet and a 12v fan, so i know how that works... the question is, why when i hook up the 5v fan to a nano, with no dht11, and let it run for a few hours, nothing 'bad' happens. doesn't overheat, doesn't stop - nothing. which leads me to believe it would work without the transistor and higher voltage fan.

  • @a.a.a7385
    @a.a.a7385 8 ปีที่แล้ว

    Dear Kristian, I really found an awesome video, so can you tell me is it possible to control whatever temperature and humidity from the sketch because I need to control both temperature and humidity many times with the exist of two relays to do speisfic experiments......
    Thanks, Adel

    •  8 ปีที่แล้ว

      +adel tbeni Yes you can do that. Just add more if statements for the specific temp and humidity threshold as in the video to do different stuff.

    • @a.a.a7385
      @a.a.a7385 8 ปีที่แล้ว

      I do appreaciate your reply

    • @a.a.a7385
      @a.a.a7385 8 ปีที่แล้ว

      +adel tbeni Hi mate, could you please tell me where to buy the whole kit for DHT11 including two relays. Thanks

    •  8 ปีที่แล้ว

      +adel tbeni Ebay is your friend :) I would suggest you buy the DHT22 instead though as it has a better reading on humidity according to someone in the comments below. Just search ebay for 2 relay module to find a similar module.

  • @ghasemzolfaghari
    @ghasemzolfaghari 9 ปีที่แล้ว

    HI. where is the sketch? I need the code (after making the blink program based on the values please).

    •  9 ปีที่แล้ว

      Sorry about that, I forgot the link to the project page... I have updated the description, but also here it is: www.duinos.net/show/?id=172 The code is down a bit in the right column.

    • @ghasemzolfaghari
      @ghasemzolfaghari 9 ปีที่แล้ว

      Kristian Blåsol sorry but i get the error of "The page cannot be found".
      here is the link www.duinos.net/show/?id=180 and it will redirect me to www.duinos.net/files/2014/humtempcontroller.ino

    • @Zubat78
      @Zubat78 9 ปีที่แล้ว

      ghasem zolfaghari
      Still "or again" "The page cannot be found" for the code. Thx for a good tutorial btw :)

    •  9 ปีที่แล้ว

      Zubat78 wow, lots of things that can go wrong :) The server didnt serve .ino files. This is also fixed now, so now you can download sketch files aswell... Thanks for noticing and alerting me! Happy new year!

  • @dibraniuk
    @dibraniuk 8 ปีที่แล้ว

    DHT11 old lib no longer works so it maybe better to modify the DHTtest

  • @a.a.a7385
    @a.a.a7385 8 ปีที่แล้ว

    One more think Kristian, when I order from ebay, do they have a complete Aurdino set to control temperture and humidity I want the whole kit. thanks adel

    •  8 ปีที่แล้ว

      Sorry for late reply. No you probably need to order the parts on their own. Or buy a large sensor set which I have seen on ebay, with "all" sensors available

    • @a.a.a7385
      @a.a.a7385 8 ปีที่แล้ว

      Thanks mate

  • @XoresRock
    @XoresRock 8 ปีที่แล้ว

    Vart brukar du köpa dina elektronikgrejer i Sverige? Personligen handlar jag alltid på Kjell och Company, men jag undrade om det fanns något billigare ställe.

    •  8 ปีที่แล้ว

      +Xores Rock Vet inte om det är billigare, men www.electrokit.se kostar 29kr i frakt och har det mesta i komponentväg... Så när jag behöver nåt fort och kvalitet köper jag där. Annars köper jag det mesta på Ebay... Fast då får man ju inte ha så bråttom ;)

  • @anil001001
    @anil001001 8 ปีที่แล้ว

    Hi Kristian,Can this sensor be used where there is high electrical field?I need to use this sensor inside a chamber where the voltage is 7.2KV!Will this work?

    •  8 ปีที่แล้ว +1

      Unsure if that will work. As it is not that expensive you could just try it out... Or maybe the DS18B20 would be a better choice if you only need temperature?

    • @anil001001
      @anil001001 8 ปีที่แล้ว

      Kristian Blåsol Thanka a lot!I will give it a try

  • @rafaelrchoairy
    @rafaelrchoairy 10 ปีที่แล้ว

    hey #KristianBlasol mine it not appearing numbers but estrange symbols, what should I do?

    •  10 ปีที่แล้ว

      Do you mean when you run the example sketch and watching in the serialmonitor? If so 1. Make sure that it really is a DHT11 you are using, there are many similar chips out there, that look the same, but act differently. 2. Make sure that you have three leads connected to the correct pins between the arduino and the DHT11. And then make sure you dont change anything in the code in the example sketch and try again. Double check so you use the correct pin as defined in the code. If nothing of this helps the DHT11 COULD be broken (that does happen), or we have to continue error searching. What version Arduino board are you using?

    • @AmericanMaking
      @AmericanMaking 9 ปีที่แล้ว +1

      That can also happen if the bit rate is not set correctly. Most of the time it's set to 9600 kb/s.

  • @tedesco060968
    @tedesco060968 9 ปีที่แล้ว

    Hallo Kristian , dein projekt find ich super , allerdings benötigt mein sketch 4400Bytes und hab schon alles weg gekürzt , wie soll das auf den tiny85 passen der kann doch bloss 512Byte

    •  9 ปีที่แล้ว +1

      Hello Antonio, if you only have 512 byte then it cant be an ATtiny85, it must be a smaller version. To minimize the sketch, remove everything between the //=== check what values we have... all those if's and the blinking of the LED is just for visuals on what temp and humidity is in the room at the moment. So it wont affect the control side of things. However I am unsure that you can get it down to 512bytes... That is really little memory. And the DHT-library takes up a lot of space aswell... Hope you get it working, make sure it really is a ATtiny85 and not a ATtiny45 or 25 (it means they have 8, 4 or 2 KB of memory). If you are really sure it is an ATtiny85 you have, then I am using the ATtiny hardware support that is shown in Episode 3 of Anything Arduino I think, make sure you use the same. I am thinking that your hardware support has more overhead than the one I use? Just one thought... Let me know how you get along...

  • @隔壁老吴a
    @隔壁老吴a 7 ปีที่แล้ว

    First of all, many tks, but If you list the staff you uses it would be better as people like me, don't actually know a lot about the type of those things.

    •  7 ปีที่แล้ว

      Sorry, must be a translation thing, but I dont understand what you mean with staff?

    • @隔壁老吴a
      @隔壁老吴a 7 ปีที่แล้ว

      I mean the material u use. And can u make a video about greenhouse control, I don't quite get it. As there are so many to be controlled apart from humid and temp. U will need to control the sprinkler, fan, motors, mixer and so on. It is not just add some delays, right? Maybe the pin will be not enough, so how will u handle this?

    •  7 ปีที่แล้ว

      +a 隔壁老吴 ah ok. :) I usually explain and show all components and how to connect them in the video. When it comes to controlling bigger machines as your examples it is easiest with relays. There are special solenoid valves that can be used to control sprinkler/water systems. Solenoids take a lot of power though so you still need a relay between the arduino and the valve. Again. Output pins can be extended in many ways. A simple one that I have shown in other videos is with a 595 chip. Where three pins can get you almost unlimited digital output pins.

  • @ImranKhan-ow6yr
    @ImranKhan-ow6yr 7 ปีที่แล้ว

    Dear sir,
    With very sorry to that I took your precious time
    I hope in this coments you can understand my requirements.
    I need one circuit that consist different relay using ardunio
    This circuit I need for digital automatically control egg encubeter...
    In this circuit I want to use R1,R2,R3,R4,R5, and DHT11,22 for humidity and temperature controlR1,R2.... represent Relay
    Here now the function is like this R1, I need to used for temperature element that make the temprature according to my requirements inside encobetr
    When the temprature raise up to the set point my hetting elements need to off
    R2, for humidity control same as temerature control
    R3, I will use for one moter that motor need to run 3 time in 24 hours only for 3 to 5 second
    R4, Will be use for one fan that fan must be need to run when the inside encobetr temperature raise up to set point
    R5, need for circulation fan that will be run 24 houre for vaporising inside encobetr
    I hope you understand my requirements and you give me better ieda with you best knowledge
    If now have any questions about it you tell me I will tray to explain more better how much I can I will do.
    And I need the programing ,,circuit diagram for breadboard, , how to lay out
    Sir if it is possible we can also used push button S1,S2,S3,S4 etc further setting for temperature and humidity controlling purpose
    And we can use Arduino UNO, NANO,PRO MINI?which one is better
    Can we used Lcd 4×20 for showing temerature humidity moter running time days start? Day left?
    I hope you respond me better
    Thanks Regards

  • @nageshajifathaliha1385
    @nageshajifathaliha1385 9 ปีที่แล้ว

    what if i want make Arduino to do several processes at the same time ? I mean using more sensors ?

    •  9 ปีที่แล้ว

      Narcisa H. Sure, no problem, just add more code in the void loop() section. Depending on what sensors you want ofcourse. Do you mean more than one DHT11? Then just add another DHT11 to another pin on the arduino and double the code (basically). Since each DHT11 instance in the code has its own name you can get the value from each sensor with its respective name... Hope this helps or get back to me again.

    • @nageshajifathaliha1385
      @nageshajifathaliha1385 9 ปีที่แล้ว

      Thanks a million ! yeah I meant adding more DHT11 several soil moisture sensors, a piezoelectric , water pump and an LCD to have a little greenhouse system in our patio , I have many errors whenever i mix the codes moreover UNO pins are limited i need more pins.
      Kristian Blåsol

    •  9 ปีที่แล้ว +1

      On my todolist for videos there is ways to expand inputs and outputs with MUX:es (for analog signals) and 595/106 chips (for digital signals)... There are other videos and instructions on how to expand inputs. But you need to know what type of input it is you want to read. Also many libraries are locked to specific pins, so you cant change them easily. Hope you get it working or ask again and I'll try to help...

    • @Ed19601
      @Ed19601 9 ปีที่แล้ว

      Narcisa H. I have an attiny do humidity temperature, atmospheric pressure, and light levels and send that to a 433 MHz transmitter. it has 5-6 pins
      BMP180 -> 2 pins (I2C)
      DHT11 -> 1 pin
      LDR -> 1 pin
      Rf -> 1 pin

    • @Ed19601
      @Ed19601 9 ปีที่แล้ว +1

      Narcisa H. if you need more pins than the UNO has to offer, go for an Atmega. Yes a 595 or a portexpander will work aswell, but with the Mega's being very cheap that is hardly worth the trouble

  • @bobbydororo2000
    @bobbydororo2000 8 ปีที่แล้ว

    help please, i've upload the program to my arduino, but it seems, it only run the program once. and the LED it doesnt work
    i'm using arduino uno rev3
    thanks :D

    • @ultraidtech8250
      @ultraidtech8250 5 ปีที่แล้ว

      th-cam.com/video/Eba4Ufz1o40/w-d-xo.html

  • @Jakaria295
    @Jakaria295 6 ปีที่แล้ว

    I want to set on/off temperature by keypad. How can I do it?

    •  6 ปีที่แล้ว +1

      You just need to make a subroutine that changes the threshold value. Example with two buttons, plus and minus. If plus is pressed then add one to threshold. If minus subtract one from threshold. Look at the example denounce button sketch and add that to your sketch.

  • @tersamdiyaquarium6284
    @tersamdiyaquarium6284 9 ปีที่แล้ว

    I connected everything and write the sketches the you, but mine just not working. maybe i'm doing something wrong. i'm using a arduino 2560 board, could that be the case?
    sketch;
    #include
    // Example testing sketch for various DHT humidity/temperature sensors
    // Written by ladyada, public domain
    #include "DHT.h"
    #define DHTPIN 2 // what pin we're connected to
    // Uncomment whatever type you're using!
    //#define DHTTYPE DHT11 // DHT 11
    #define DHTTYPE DHT22 // DHT 22 (AM2302)
    //#define DHTTYPE DHT21 // DHT 21 (AM2301)
    // Connect pin 1 (on the left) of the sensor to +5V
    // NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1
    // to 3.3V instead of 5V!
    // Connect pin 2 of the sensor to whatever your DHTPIN is
    // Connect pin 4 (on the right) of the sensor to GROUND
    // Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
    // Initialize DHT sensor.
    // Note that older versions of this library took an optional third parameter to
    // tweak the timings for faster processors. This parameter is no longer needed
    // as the current DHT reading algorithm adjusts itself to work on faster procs.
    DHT dht(DHTPIN, DHTTYPE);
    int fan = 3;
    int heater = 4;
    int led = 5;
    int i = 0;
    void setup() {
    Serial.begin(9600);
    Serial.println("DHTxx test!");
    dht.begin();
    }
    void loop() {
    // Wait a few seconds between measurements.
    delay(2000);
    // Reading temperature or humidity takes about 250 milliseconds!
    // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
    float h = dht.readHumidity();
    // Read temperature as Celsius (the default)
    float t = dht.readTemperature();
    // Read temperature as Fahrenheit (isFahrenheit = true)
    float f = dht.readTemperature(true);
    // Check if any reads failed and exit early (to try again).
    if (isnan(h) || isnan(t) || isnan(f)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
    }
    // Compute heat index in Fahrenheit (the default)
    float hif = dht.computeHeatIndex(f, h);
    // Compute heat index in Celsius (isFahreheit = false)
    float hic = dht.computeHeatIndex(t, h, false);
    Serial.print("Humidity: ");
    Serial.print(h);
    Serial.print(" %\t");
    Serial.print("Temperature: ");
    Serial.print(t);
    Serial.print(" *C ");
    Serial.print(f);
    Serial.print(" *F\t");
    Serial.print("Heat index: ");
    Serial.print(hic);
    Serial.print(" *C ");
    Serial.print(hif);
    Serial.println(" *F");
    pinMode(fan, OUTPUT);
    pinMode(heater, OUTPUT);
    pinMode(led, OUTPUT);
    }
    void loop()
    (
    //READ DATA
    Serial.println("DHT22, \t");
    //DISPLAY DATA
    Serial.print(DHT.humidity, 1);
    Serial.print(",\t");
    Serial.println(DHT.temperature, 1);
    if (DHT.humidity>50) (
    digitalWrite(fan,HIGH);
    ) else (
    digitalWrite(fan,LOW);
    )
    if (DHT.temperature

    •  9 ปีที่แล้ว

      +Phillip Clarke I see you are using a DHT22 according to your code is this correct?

    •  9 ปีที่แล้ว

      +Kristian Blåsol Which sensor are you using? DHT11 or DHT22?

    • @ccp3442
      @ccp3442 8 ปีที่แล้ว

      +Kristian Blåsol
      he says he is using a DHT22. Could this be the problem?

    •  8 ปีที่แล้ว

      +Christopher Chilcott-Parker Maybe? I still havent ordered a DHT22 to test with... According to +Rickard Bergström it is much more accurate, and the DHT11 isnt good at all, so I really need to buy one and try it out. But as long as you change the code to DHT22 it should work the same...

    •  8 ปีที่แล้ว

      +pablo contreas You cant have Serial.print commands on the ATtiny, if you do, remove them and it should work...

  • @verzinker
    @verzinker 8 ปีที่แล้ว +1

    some Projects also take into account the rise of humidity (showering, ...) , and not the absolute amount of humidity.
    www.codeproject.com/Articles/735864/Arduino-Semi-intelligent-Air-Dryer-Control

  • @noproblema1
    @noproblema1 8 ปีที่แล้ว

    hello. i love what you have done here. i have a pet python and needed to control its humidity because i live in a low humidity area. the only thing i changed in the code was the high and low because i am using a humidifier not dehumidifier. so once the humidity goes higher than 55 percent the humidifier turns off. so everything is hooked up perfect and the humidifier turns off when humidity hits 55 percent but the problem im having is that it wont turn back on after the humidity goes lower than 55 percent. i have tried using different attiny85 boards, and ive used 4 different relay modules but still cant get it to turn the humidifier back on. could you or anyone please help me with this problem, ive been trying for weeks and there arent manygood codes for this type of controller. im new to electronics but have been playing around with arduinos as a hobby for about 6 months now and have a very basic knowledge but enough to get me around. thank you very much

    •  8 ปีที่แล้ว

      Could you supply the code? Maybe there is something wrong in the loop? It sounds like a programming error... Also if the values are cruical, you should look into the DHT22 instead. It seems to have a bit more stable readings.

    • @noproblema1
      @noproblema1 8 ปีที่แล้ว

      i was thinking about using a dht22 but i only have 11 with me. Ill order one later but im not to interested in accuracy, my pythons humidity range can be anywhere from 50-65 percent for healthy conditions. i used the code you supplied, i only changed the high and low.
      //
      // FILE: dht11_test.ino
      // AUTHOR: Rob Tillaart
      // VERSION: 0.1.00
      // PURPOSE: DHT library test sketch for DHT11 && Arduino
      // URL:
      //
      // Released to the public domain
      //
      #include
      dht DHT;
      #define DHT11_PIN 0
      int dehumidifier = 1;
      int heater = 2;
      int led = 3;
      int i = 0;
      int ten = 4;
      int one = 0;
      void setup()
      {
      pinMode(dehumidifier, OUTPUT);
      pinMode(heater, OUTPUT);
      pinMode(led, OUTPUT);
      }
      void loop()
      {
      digitalWrite(led,HIGH);
      delay(5000);
      digitalWrite(led,LOW);
      delay(500);
      // READ DATA
      int chk = DHT.read11(DHT11_PIN);
      int theHumidity = DHT.humidity;
      int theTemperature = DHT.temperature;
      //int theHumidity = DHT.humidity;
      //int theTemperature = DHT.temperature;
      ten=1;
      one=1;
      //=====CHECK WHAT VALUES WE HAVE====
      if (theHumidity==40) { ten=4;one=0; }
      if (theHumidity==41) { ten=4;one=1; }
      if (theHumidity==42) { ten=4;one=2; }
      if (theHumidity==43) { ten=4;one=3; }
      if (theHumidity==44) { ten=4;one=4; }
      if (theHumidity==45) { ten=4;one=5; }
      if (theHumidity==46) { ten=4;one=6; }
      if (theHumidity==47) { ten=4;one=7; }
      if (theHumidity==48) { ten=4;one=8; }
      if (theHumidity==49) { ten=4;one=9; }
      if (theHumidity==50) { ten=5;one=0; }
      if (theHumidity==51) { ten=5;one=1; }
      if (theHumidity==52) { ten=5;one=2; }
      if (theHumidity==53) { ten=5;one=3; }
      if (theHumidity==54) { ten=5;one=4; }
      if (theHumidity==55) { ten=5;one=5; }
      if (theHumidity==56) { ten=5;one=6; }
      if (theHumidity==57) { ten=5;one=7; }
      if (theHumidity==58) { ten=5;one=8; }
      if (theHumidity==59) { ten=5;one=9; }
      if (theHumidity==60) { ten=6;one=0; }
      if (theHumidity==61) { ten=6;one=1; }
      if (theHumidity==62) { ten=6;one=2; }
      if (theHumidity==63) { ten=6;one=3; }
      if (theHumidity==64) { ten=6;one=4; }
      if (theHumidity==65) { ten=6;one=5; }
      if (theHumidity==66) { ten=6;one=6; }
      if (theHumidity==67) { ten=6;one=7; }
      if (theHumidity==68) { ten=6;one=8; }
      if (theHumidity==69) { ten=6;one=9; }
      if (theHumidity==70) { ten=7;one=0; }
      if (theHumidity==71) { ten=7;one=1; }
      if (theHumidity==72) { ten=7;one=2; }
      if (theHumidity==73) { ten=7;one=3; }
      if (theHumidity==74) { ten=7;one=4; }
      if (theHumidity==75) { ten=7;one=5; }
      if (theHumidity==76) { ten=7;one=6; }
      if (theHumidity==77) { ten=7;one=7; }
      if (theHumidity==78) { ten=7;one=8; }
      if (theHumidity==79) { ten=7;one=9; }
      if (theHumidity>79) { ten=8;one=0; }
      while (ten>0) {
      digitalWrite(led,HIGH);
      delay(500);
      digitalWrite(led,LOW);
      delay(500);
      ten--;
      }
      digitalWrite(led,LOW);
      delay(2000);
      while (one>0) {
      digitalWrite(led,HIGH);
      delay(500);
      digitalWrite(led,LOW);
      delay(500);
      one--;
      }
      digitalWrite(led,LOW);
      delay(3000);
      digitalWrite(led,HIGH);
      delay(3000);
      digitalWrite(led,LOW);
      delay(500);
      ten=1;
      one=1;
      //=====CHECK WHAT TEMPERATURE VALUES WE HAVE====
      if (theTemperature==10) { ten=1;one=0; }
      if (theTemperature==11) { ten=1;one=1; }
      if (theTemperature==12) { ten=1;one=2; }
      if (theTemperature==13) { ten=1;one=3; }
      if (theTemperature==14) { ten=1;one=4; }
      if (theTemperature==15) { ten=1;one=5; }
      if (theTemperature==16) { ten=1;one=6; }
      if (theTemperature==17) { ten=1;one=7; }
      if (theTemperature==18) { ten=1;one=8; }
      if (theTemperature==19) { ten=1;one=9; }
      if (theTemperature==20) { ten=2;one=0; }
      if (theTemperature==21) { ten=2;one=1; }
      if (theTemperature==22) { ten=2;one=2; }
      if (theTemperature==23) { ten=2;one=3; }
      if (theTemperature==24) { ten=2;one=4; }
      if (theTemperature==25) { ten=2;one=5; }
      if (theTemperature==26) { ten=2;one=6; }
      if (theTemperature==27) { ten=2;one=7; }
      if (theTemperature==28) { ten=2;one=8; }
      if (theTemperature==29) { ten=2;one=9; }
      while (ten>0) {
      digitalWrite(led,HIGH);
      delay(500);
      digitalWrite(led,LOW);
      delay(500);
      ten--;
      }
      digitalWrite(led,LOW);
      delay(2000);
      while (one>0) {
      digitalWrite(led,HIGH);
      delay(500);
      digitalWrite(led,LOW);
      delay(500);
      one--;
      }
      //============END CHECK VALUES
      digitalWrite(led,LOW);
      delay(5000);


      //if (DHT.humidity>55) {
      if (theHumidity>55) {
      digitalWrite(dehumidifier,HIGH);
      } else {
      digitalWrite(dehumidifier,LOW);
      }
      //if (DHT.temperature

  • @tersamdiyaquarium6284
    @tersamdiyaquarium6284 9 ปีที่แล้ว

    thanks for now

  • @goks5051
    @goks5051 5 ปีที่แล้ว

    Where the code?

  • @dibraniuk
    @dibraniuk 8 ปีที่แล้ว

    you need to show how you loaded your sketch onto attiny as is not working!! you are not showing that on the video are you?

    •  8 ปีที่แล้ว

      +dibraniuk No that is true :) I do show a big information text to look at another video on how to do that (I dont want to show the same thing twice in two videos) :) See video here: th-cam.com/video/TdG0AJY4qLA/w-d-xo.html or just follow this link for a video on how to use the Arduino as an ISP and program an ATtiny: th-cam.com/video/qz-YMPY4_z0/w-d-xo.html ...

    • @dibraniuk
      @dibraniuk 8 ปีที่แล้ว

      +Kristian Blåsol
      i should know that by now! but your schetch not loading on attiny85 and that's the problem

    •  8 ปีที่แล้ว

      Ah, can you tell me again the exact error you get?

    • @dibraniuk
      @dibraniuk 8 ปีที่แล้ว

      it loads on the arduino uno but as soon as attiny85 is connected up then fails to compile
      anyway, i shall try a different route as my be problems with my ide so ignore this for now

    •  8 ปีที่แล้ว

      Ok, a few things, You need to make the Arduino into an ISP (as the ep. 3 video shows). You need to select the Arduino as an ISP as the programmer. You need to select the correct attiny chip from the arduino list they also gets added when doing the steps in the episode 3 video. Then it SHOULD work... :) Ofcourse there may be something else that puts sticks in your wheels... Let me know when you figure it out...

  • @tersamdiyaquarium6284
    @tersamdiyaquarium6284 9 ปีที่แล้ว

    I'm using a dht22

  • @Faisalkhan-ry4eg
    @Faisalkhan-ry4eg 5 ปีที่แล้ว

    Great project please send me the diagram of the project

  • @vickeypiyasang3762
    @vickeypiyasang3762 6 ปีที่แล้ว +2

    damn you side music is scary

  • @hendi2918
    @hendi2918 6 ปีที่แล้ว

    Hi, I would like to talk to you

  • @RickBergs
    @RickBergs 9 ปีที่แล้ว

    Need to send out a warning about the DHT11 relative humidity-sensor. Its measurement values are very inaccurate. When humidity goes down below ~45% it fails badly. Check this graph that I posted on my Twitter account:
    twitter.com/Diodens/status/640440428173639680
    Note that you need a +13 offset for the DHT11 to even measure somewhat correct at any humidity.

    •  9 ปีที่แล้ว

      +Diodens Thanks for the info. That is a bit sad if that is true... Have you made the test with many DHT11 or just one? However in my project I have had similar thoughts that it wasnt accurate enough as I measure the temp and humidity every minute and the humidity could REALLY change during that minute, which didnt feel like "the truth" :)

    • @RickBergs
      @RickBergs 9 ปีที่แล้ว

      +Kristian Blåsol Hi. The data that I made the graph with comes from both me and a friend, so 2 different DHT11 with different hardware and Arduino code (he made his own). Still measures the same. And actually I did replace my DHT11 once because I thought I got a bad one, but the new one measures as inaccurate as the first one.
      Have also tried with different DHT11 libraries and versions for Arduino with no difference in measurments. Have had 1 second delay between readout's, as you should have.

    •  9 ปีที่แล้ว

      +Diodens Do you know if the later models are as bad? Eg the DHT22? It is more expensive, maybe it is more accurate? I'll order one and try it out...

    • @RickBergs
      @RickBergs 9 ปีที่แล้ว +1

      +Kristian Blåsol No, I don't. Have placed an order for 4 pieces of DHT22 but haven't received them yet.

    •  9 ปีที่แล้ว

      Great! Please let me know the results!

  • @ezeprojects5425
    @ezeprojects5425 7 ปีที่แล้ว

    Oh, I found the relay. Sorry.

  • @kevinbyrne4538
    @kevinbyrne4538 7 ปีที่แล้ว

    28:29 -- LOL

  • @williamj7734
    @williamj7734 6 ปีที่แล้ว

    Do you speak English?

    •  6 ปีที่แล้ว

      Yes. Not natively, but good enough to be understood (I hope)

  • @RGPinger
    @RGPinger 6 ปีที่แล้ว

    :D

  • @yekutielbenheshel354
    @yekutielbenheshel354 8 ปีที่แล้ว

    Creepy intro music.