Comments on: How to Set Up the DHT11 Humidity Sensor on the Raspberry Pi http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/ Raspberry Pi, Arduino, and DIY Electronics Projects and Tutorials Fri, 20 Apr 2018 22:07:56 +0000 hourly 1 By: Aleks http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-25232 Sun, 15 Apr 2018 12:57:49 +0000 http://www.circuitbasics.com/?p=420643#comment-25232 Hello,
I am unable to start the script because of this error:

Traceback (most recent call last):
File “LCD3.py”, line 16, in
lcd.write_string(“Temp: %d C” % temperature)
TypeError: %d format: a number is required, not NoneType

This is the full script:

#!/usr/bin/python
import sys
import Adafruit_DHT
import RPi.GPIO as GPIO
from RPLCD import CharLCD
GPIO.setwarnings(False)

lcd = CharLCD(numbering_mode=GPIO.BOARD,cols=16, rows=2, pin_rs=37, pin_e=35, pins_data=[33, 31, 29, 23])

while True:
humidity, temperature = Adafruit_DHT.read_retry(11, 4)

lcd.cursor_pos = (0, 0)
lcd.write_string(“Temp: %d C” % temperature)
lcd.cursor_pos = (1, 0)
lcd.write_string(“Humidity: %d %%” % humidity)

]]>
By: Autonomus http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-23658 Wed, 04 Apr 2018 22:04:02 +0000 http://www.circuitbasics.com/?p=420643#comment-23658 I found a solution here:
https://www.raspberrypi.org/forums/viewtopic.php?t=197331

changing “counter > 16” to “counter > 50” solved the issue.

]]>
By: Autonomus http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-23656 Wed, 04 Apr 2018 21:51:59 +0000 http://www.circuitbasics.com/?p=420643#comment-23656 Hi,

I’m having a problem in getting the C program to run (on terminal). It only shows “Data not good, skip” and I never get a valid reading.
The only change I did was to use GPIO pin 25 instead of 7 (I tried several GPIO pins including 7)
#define DHTPIN 25

I tested the Python version and it runs without any issues with the same wiring. In this case I entered BCM pin number 26 which corresponds to wiringPi pin 25.

So I guess my jumper cable wiring is correct and my GPIOs are still functional.

Any ideas on how to debug this?

]]>
By: Ian Paulo Perina http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-23576 Wed, 04 Apr 2018 09:06:41 +0000 http://www.circuitbasics.com/?p=420643#comment-23576 It worked for me

Thank you very much πŸ˜‰

]]>
By: Bogd http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-23517 Tue, 03 Apr 2018 17:00:00 +0000 http://www.circuitbasics.com/?p=420643#comment-23517 You’re saying that you’re using a DHT22, but you’re doing read_retry(AM2302)? The first argument to read_retry should be “22” for DHT22

]]>
By: Bogdan Sass http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-23515 Tue, 03 Apr 2018 16:57:12 +0000 http://www.circuitbasics.com/?p=420643#comment-23515 As the output tells you, the error has nothing to do with the DHT11. The error is on the “lcd” line.

It should be like this (copied from the article above):
lcd = CharLCD(cols=16, rows=2, pin_rs=37, pin_e=35, pins_data=[33, 31, 29, 23])

You are missing the equal sign (=) after pins_data, and this creates a function call that is invalid in Python (if you are curious why, look up “keyword arguments”, and you will see that all non-keyword arguments must occur _before_ any keyword argument).

]]>
By: Bogd http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-23513 Tue, 03 Apr 2018 16:53:44 +0000 http://www.circuitbasics.com/?p=420643#comment-23513 Use three different GPIO pins on the raspberry pi, and read them individually. It really is as simple as that πŸ™‚

For example, if you’re using Python, you can read three DHT11 sensors on GPIO 4, 5, and 6 like this:

humidity1, temperature1 = Adafruit_DHT.read_retry(11, 4)
humidity2, temperature2 = Adafruit_DHT.read_retry(11, 5)
humidity3, temperature3 = Adafruit_DHT.read_retry(11, 6)

]]>
By: Ian Paulo Perina http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-23498 Tue, 03 Apr 2018 14:36:01 +0000 http://www.circuitbasics.com/?p=420643#comment-23498 How do i connect 3 DHT11?

i am making a project with RPi and i need 3 DHT’s

Please Help

]]>
By: SiMON http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-18506 Sun, 28 Jan 2018 01:18:35 +0000 http://www.circuitbasics.com/?p=420643#comment-18506 I moved my python code into the Adafruit source folder and managed to get it working from there

]]>
By: KRISH http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-18488 Sat, 27 Jan 2018 18:47:35 +0000 http://www.circuitbasics.com/?p=420643#comment-18488 Hello, Need help in RaspberryPi-3. I actually worked with dht22 sensor and raspberry-pi but when i ran the code i got this kind of error –
File “/var/www/lab_app/ft1.py”, line 11, in lab_app
humidity,temperature = Adafruit_DHT.read_retry(Adafruit_DHT.AM2302, 18)
File “build/bdist.linux-armv7l/egg/Adafruit_DHT/common.py”, line 94, in read_retry
humidity, temperature = read(sensor, pin, platform)
File “build/bdist.linux-armv7l/egg/Adafruit_DHT/common.py”, line 81, in read
return platform.read(sensor, pin)
File “build/bdist.linux-armv7l/egg/Adafruit_DHT/Raspberry_Pi_2.py”, line 34, in read
raise RuntimeError(‘Error accessing GPIO.’)
RuntimeError: Error accessing GPIO.

*****Please help me out****

]]>
By: Jared http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-18062 Tue, 23 Jan 2018 22:33:01 +0000 http://www.circuitbasics.com/?p=420643#comment-18062 Sorry If this was already answered, but when I run my code, I get the message
File “Tah.py”, line 8
lcd = CharLCD(cols=16, rows=2, pin_rs=37, pin_e=35, pins_data[33, 31, 29, 23])
SyntaxError: non-keyword arg after keyword arg
Here’s the code

#!/usr/bin/python
import sys
import Adafruit_DHT

from RPLCD import CharLCD

lcd = CharLCD(cols=16, rows=2, pin_rs=37, pin_e=35, pins_data[33, 31, 29, 23])

while True:
humidity, temperature = Adafruit_DHT.ready_retry(11, 4)
convert = temperature*1.8+32

lcd.cursor_pos = (0, 0)
lcd.write_string(“Temp: %d F” % temperature)
lcd.cursor_pos = (1, 0)
lcd.write_string(“Humidity: %d %%” % humidity)

Any help would be appreciated!

]]>
By: eDWARD http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-17709 Fri, 19 Jan 2018 16:08:01 +0000 http://www.circuitbasics.com/?p=420643#comment-17709 For me, my case is where 90% are failed check-sum [Data not good, skip] and only 10% data retrieved successfully. I’ve modified the code to “100% eliminated” the [Data not good, skip] statement display during the data retrieving. The code I modified didn’t actually eliminate the fail check-sum, but to decrease the looping m/s for faster refresh rate and removed printf( “Data not good, skip\n” ); to stop displaying the [Data not good, skip]

//Modified code block

if ( (j >= 40) &&
(dht11_dat[4] == ( (dht11_dat[0] + dht11_dat[1] + dht11_dat[2] + dht11_dat[3]) & 0xFF) ) )
{
f = dht11_dat[2] * 9. / 5. + 32;
printf( “Humidity = %d.%d %% Temperature = %d.%d C (%.1f F)\n”,
dht11_dat[0], dht11_dat[1], dht11_dat[2], dht11_dat[3], f );
}else {
//printf( “Data not good, skip\n” );// //<set this line as comment//
}
}

//and//

while ( 1 )
{
read_dht11_dat();
delay( 100 );
}

Correct me if I did a stupid mistake, thank you!

]]>
By: adrew http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-17314 Mon, 08 Jan 2018 19:36:21 +0000 http://www.circuitbasics.com/?p=420643#comment-17314 Hi there,

How do I transfer this information to the mobile app? Is there a way to code this simply so it shows live on the android app?

]]>
By: Bogd http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-17309 Mon, 08 Jan 2018 18:15:24 +0000 http://www.circuitbasics.com/?p=420643#comment-17309 This has been asked at least 4 times before (and answered). Please search the comments (Ctrl-F, and type “driver”, for example) – you will find possible solutions.

]]>
By: shuou http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-17260 Mon, 08 Jan 2018 08:03:46 +0000 http://www.circuitbasics.com/?p=420643#comment-17260 Hi.

I’m new at Pi3.I have a question. I see this below message. I have no idea what to do.

Traceback (most recent call last):
File “t.py”, line 7, in
humidity, temperature = Adafruit_DHT.read_retry(11, 4)
File “/home/pi/Adafruit_Python_DHT/Adafruit_DHT/common.py”, line 94, in read_retry
humidity, temperature = read(sensor, pin, platform)
File “/home/pi/Adafruit_Python_DHT/Adafruit_DHT/common.py”, line 80, in read
platform = get_platform()
File “/home/pi/Adafruit_Python_DHT/Adafruit_DHT/common.py”, line 55, in get_platform
from . import Raspberry_Pi_2
File “/home/pi/Adafruit_Python_DHT/Adafruit_DHT/Raspberry_Pi_2.py”, line 22, in
from . import Raspberry_Pi_2_Driver as driver
ImportError: cannot import name Raspberry_Pi_2_Driver

Could someone tell me what is problem?
Thank you.

]]>
By: Bogd http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-17139 Sat, 06 Jan 2018 11:38:57 +0000 http://www.circuitbasics.com/?p=420643#comment-17139 Short answer: yes.

Long answer: you will need to read on how to send an email from python, and how to run a program at regular intervals.

For the first part, see here for some examples: https://docs.python.org/2/library/email-examples.html

For the second part, you can run your program at startup and keep it running continuously (a “while True:” loop that simply sends the email, then sleeps for the desired time). Or, even better, you can run your program periodically using cron.

]]>
By: jk http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-17092 Fri, 05 Jan 2018 15:20:54 +0000 http://www.circuitbasics.com/?p=420643#comment-17092 ((((could u make it to send results in our desired regular intervals of time to our mentioned mail from this below program))))

#!/usr/bin/python
import sys
import Adafruit_DHT

while True:

humidity, temperature = Adafruit_DHT.read_retry(11, 4)

print ‘Temp: {0:0.1f} C Humidity: {1:0.1f} %’.format(temperature, humidity)

]]>
By: Bogd http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-16864 Tue, 02 Jan 2018 15:05:01 +0000 http://www.circuitbasics.com/?p=420643#comment-16864 It’s a stray character from the editor you used for the code. Did you by any chance copy/paste the code (including some smart quotes)?

Double-check your quotes, and make sure the editor you use is a text-only (even better, ASCII-only) one πŸ™‚

See here for more details:
https://stackoverflow.com/questions/21639275/python-syntaxerror-non-ascii-character-xe2-in-file

]]>
By: girish pillai http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-16830 Tue, 02 Jan 2018 09:20:13 +0000 http://www.circuitbasics.com/?p=420643#comment-16830 i am getting the o/p as shown below,can someone help me whats wrong in the code?

import sys
import Adafruit_DHT
import RPi.GPIO as GPIO
from RPLCD import CharLCD
GPIO.setwarnings(False)

lcd = CharLCD(numbering_mode=GPIO.BCM,cols=16, rows=2, pin_rs=26, pin_e=19, pins_data=[13,6,5,11])

while True:
humidity , temperature = Adafruit_DHT.read_retry(11, 4)
lcd.cursor_pos = (0, 0)
lcd.write_string(β€œTemp: %d C” %temperature)
lcd.cursor_pos = (1, 0)
lcd.write_string(β€œHumidity: %d %%” %humidity)

pi@piadi:~$ python dhtlcd2.py
File “dhtlcd2.py”, line 14
SyntaxError: Non-ASCII character ‘\xe2’ in file dhtlcd2.py on line 14, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

]]>
By: marius http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-16773 Mon, 01 Jan 2018 12:54:14 +0000 http://www.circuitbasics.com/?p=420643#comment-16773 Well, I think there are two resistors, but on the other side of the sensor, comparing to the image.
My wiring is good, I tried to get input with the sensor disconnected… values were all 0. Right after I connected the sensor back, the values became all 1.
Thanks for trying and sorry for wasting your time! πŸ™‚

]]>
By: Bogd http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-16717 Sun, 31 Dec 2017 19:50:19 +0000 http://www.circuitbasics.com/?p=420643#comment-16717 No, the page is not mine. I’m just another user trying to help people out πŸ™‚

The pull-up resistor should be a 10K resistor connected between Vcc (+5V) and the signal pin of the DHT. The 3-pin version should already have a pull-up resistor on the board (see the first picture of the 3-pin DHT sensor in the article above) – but I did have some 3-pin DHT sensors from China that were missing that resistor.
However, if the sensor works on Arduino, this is probably NOT the issue.

Right now, the only other advice I can give you is “double- and triple-check all your wiring”. Maybe also try with another GPIO pin, to make sure that is not the issue.

]]>
By: MARIUS http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-16712 Sun, 31 Dec 2017 18:29:57 +0000 http://www.circuitbasics.com/?p=420643#comment-16712 Sorry for asking… are this photos and videos made by you? The problem doesn’t seem to be only at me, I made some research and there are plenty of people complaining about exactly the same problem. It’s still doesn’t make any sense since in the datasheet it’s written that the input is digital signal…

]]>
By: Marius http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-16711 Sun, 31 Dec 2017 18:25:59 +0000 http://www.circuitbasics.com/?p=420643#comment-16711 Yes, exactly the code from article.
I have the 3 pin version. Sorry but I don’t know what is exactly a pullup resistor. There is only the sensor and the Raspberry.
Nope, I don’t have another DHT11, but I know 100% that it’s working because I just tested it today on Arduino. I think it’s a configuration problem… I can’t get the LCD display working, neither the gas sensor. The raspberry it’s not broken neither, I have two of them and the problem is the same… also, I can turn on and off leds, and I also can get input from a button, but not from the sensors.
Thanks for your time

]]>
By: Bogd http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-16706 Sun, 31 Dec 2017 17:07:36 +0000 http://www.circuitbasics.com/?p=420643#comment-16706 Many things that could go wrong here…

1) Are you using the code in the article? (exactly that code, or a modified version?)
2) What type of DHT11 do you have (3-pin, or 4-pin)? Do you have a pullup resistor in place?
3) Just in case, do you have another DHT11 you could test with?

]]>
By: Marius http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-16690 Sun, 31 Dec 2017 14:02:41 +0000 http://www.circuitbasics.com/?p=420643#comment-16690 Well I have the + to PIN 2, – to PIN 9 and OUT to pin 7. That’s all… The code should do the magic, but seems like it does not.
I read the datasheet and I understod that input from sensor is actually a message formed by 5 bytes and all the other details, nothing too fancy… the main problem is that every single bit from my message is equal to 1.

]]>
By: Bogd http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-16555 Sat, 30 Dec 2017 13:04:50 +0000 http://www.circuitbasics.com/?p=420643#comment-16555 You _really_ need to provide more details… What is connected to the pin that you are reading? If it is the DHT11 sensor, you don’t simply read the pin – read the datasheet (or the code in the article above) to see what you need to send, and what the sensor sends back to you on that pin.

]]>
By: Marius http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-16554 Sat, 30 Dec 2017 12:56:34 +0000 http://www.circuitbasics.com/?p=420643#comment-16554 digitalRead gives me always 1 as value…

]]>
By: Bogd http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-16376 Fri, 29 Dec 2017 07:27:46 +0000 http://www.circuitbasics.com/?p=420643#comment-16376 @Marius – what are you talking about? Raspberry has TONS of digital I/O pins πŸ™‚

Yes, it doesn’t have any analog pins (no ADC/DAC onboard), but since this is a digital sensor, you don’t need those anyway πŸ™‚

]]>
By: Marius http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-16344 Thu, 28 Dec 2017 21:44:54 +0000 http://www.circuitbasics.com/?p=420643#comment-16344 How the heck do you read digital input for that sensor? Raspberry doesn’t have any digital or analog output.

]]>
By: Baxtex http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-14113 Sat, 09 Dec 2017 20:57:33 +0000 http://www.circuitbasics.com/?p=420643#comment-14113 Managed to solve it, had to increase the delay from 1 micro second to 2 micro seconds.

]]>
By: Baxtex http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-14109 Sat, 09 Dec 2017 20:34:39 +0000 http://www.circuitbasics.com/?p=420643#comment-14109 So I succesfully ran this program, but I always get the message “Data not good, skip”. Is something wrong with my sensor? It works in python…
I might add that this is a cheap module that I bought on ebay, maybe something is wrong?

]]>
By: agron http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-13753 Tue, 05 Dec 2017 13:39:34 +0000 http://www.circuitbasics.com/?p=420643#comment-13753 Hi,

It can’t be 35 in this line

humidity, temperature = Adafruit_DHT.read_retry(35, 2)

That is refering to type of sensor and since this tutorial is about DHT 11 it should be 11

humidity, temperature = Adafruit_DHT.read_retry(11, 2)

]]>
By: AZ http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-13749 Tue, 05 Dec 2017 12:39:18 +0000 http://www.circuitbasics.com/?p=420643#comment-13749 Hi Ikya πŸ™‚

I have the same error as you. Did you ever solve yours ? Can’t seem to find an answer anywhere πŸ™‚

]]>
By: Jimmy http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-13547 Sat, 02 Dec 2017 10:21:54 +0000 http://www.circuitbasics.com/?p=420643#comment-13547 Hi, Thanks for the tutorial. It’s really excellent.
The python code works on the terminal.
When I try to do it with the LCD it won’t work.
I’m using a 1602 LCD, but I think it’s not the problem.
This is the error I got:

Traceback (most recent call last):
File “DHT11_LCD.py”, line 7, in
lcd = CharLCD(cols=16, rows=2, pin_rs=37, pin_e=35, pins_data=[33, 31, 29, 23])
File “/usr/local/lib/python2.7/dist-packages/RPLCD/__init__.py”, line 14, in __init__
super(CharLCD, self).__init__(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/RPLCD/gpio.py”, line 95, in __init__
‘must be either GPIO.BOARD or GPIO.BCM’ % numbering_mode)
ValueError: Invalid GPIO numbering mode: numbering_mode=None, must be either GPIO.BOARD or GPIO.BCM

My RPi.GPIO version is 0.6.3. I hope that this can help you to solve my problem.
I’m sorry that I’m not really good at English.
Thanks for the tutorial again. This is the best tutorial I have seen.
I am looking forward to receive your reply.

]]>
By: agron http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-13483 Fri, 01 Dec 2017 09:32:29 +0000 http://www.circuitbasics.com/?p=420643#comment-13483 If you google a bit there is code and setup to write the values to a google spreadsheet. Easy from there to export to Excel or anything else.

]]>
By: Bogd http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-13472 Fri, 01 Dec 2017 06:40:56 +0000 http://www.circuitbasics.com/?p=420643#comment-13472 You can record them, but you will need to write your own code for that. And decide on how to do that (log to a text file? to a database?). Also, you will need to write your own code to clean up old data. And your own code to recall and display previous values.

The capacity of the card doesn’t really matter – since you’re only storing a few bytes of text for each entry, you can store many years’ worth of data in a single GB πŸ™‚ .

For the PCB I recommend the pre-drilled kind – the size depends only on how close you want (and can πŸ™‚ ) solder everything together.

As for the LCD, the potentiometers are required. I would recommend you to also have a look at the I2C version of the LCDs – basically the same type of screen, but with an I2C “backpack”/”shield” already connected. That shield includes the potentiometers, and allows you to talk to the LCD by using only 4 wires. However, the code will look a bit different – google for “raspberry pi i2c lcd”, and you will find plenty of examples.

]]>
By: boubou http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-13442 Thu, 30 Nov 2017 18:00:12 +0000 http://www.circuitbasics.com/?p=420643#comment-13442 Hi

thank alot for ansering.

Well I will buy an old version of the pi (Raspberry Pi Model A+ 512MB RAM). As I said, less expansive than the newer one.

well, I will love to see what going one with the temperature and humidity … so the LCD screen should be good for me.

My question is: with this set up, can we record the datas? I don’t need to see far away back … but if I can see what was the temperature / humidity couple days ago I will be glad (it a projet for my “cheese cave”). That is why I asked for the capacity of the card.

Do you know what kind of PCB I will need? I found a 5 X 7 cm. will it be enough?

I didn’t know we needed potentiometers to control the brightness and contrast of the LCD screen. Tought we can do it with “on screen control”. I will see if I need one or not. (it may not be necessary for my project).

Yes it new for me … but I already read a little bit on this sujet. Like you suggest, I readed some kind of magazines (like the magpi, Raspberry Pi For Beginners or for kids). I may not read it all, but I think I got the picture. The hardest part for me will certainly be the programming section wish I’m completly new to this and never code anything.

But with this kind of project I think I will be able to learn.

]]>
By: Bogd http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-13421 Thu, 30 Nov 2017 07:01:48 +0000 http://www.circuitbasics.com/?p=420643#comment-13421 @boubou – I will try to answer all of your questions.

1) All you need is a raspberry pi, a sensor, a breadboard, and (optionally) an LCD screen. You can make your own connection wires, but it will make things a lot easier for you if you buy them already made (with male or female connectors in the ends, like the ones you see in the pictures)

2) Any Raspberry Pi will do.

3) The LCD used is a generic “1602” (16×2, or 16 characters/2 lines).

4) If you want to solder the completed project, you will also need some kind of PCB to solder everything onto. The types of wires used doesn’t really matter at this point πŸ™‚

5) I would recommend using NOOBS or Raspbian (the two “official” OSs for Raspberry Pi). IIRC, any microSD card of more than 2 GB will work.

6) The “big golden round things” are variable resistors (potentiometers). He’s using them to control the brightness and contrast of the LCD screen.

One more thing – based on your questions, I assume that the Raspberry Pi is a new platform for you. I would strongly recommend that you read some “getting started” guides, and work on some simpler projects (like blinking a LED connected to a GPIO) before tackling this one. While this is not an overly complicated project, it does have multiple parts, and could be a bit overwhelming as a first Pi project πŸ™‚

]]>
By: boubou http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-13400 Wed, 29 Nov 2017 22:52:35 +0000 http://www.circuitbasics.com/?p=420643#comment-13400 Hi

I would like to try this little project as my first one in this new hobby.
But I didn’t see what you use to complet your projet. I know you have a raspberry pi (obviously) and a DHT11 (or 22) sensor, projects boards, but what else?

I would like to know what kind of raspberry pi can we use to build this thing up? (previous versions of pi are usually sold bit cheap than the new version).

what kind of LCD you have used?

What kind of wires will I need to soldering to complet the project? (I’m suppose I will be able to soldering those wire together at the end after all the project work well on the projects boards right?)

What is the capacity of the SDMicro card I need to have? And what OS should I use / boot on this card?

What are those “big golden rounds things” (top right of you largest project board) …. look like a kind of buzzer

Thank

]]>
By: Bogd http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-12563 Thu, 16 Nov 2017 05:47:20 +0000 http://www.circuitbasics.com/?p=420643#comment-12563 You need to install pip for python3:

sudo apt-get install python3-pip

]]>
By: agron http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-12538 Wed, 15 Nov 2017 21:35:52 +0000 http://www.circuitbasics.com/?p=420643#comment-12538 Hi,

Didn’t work
Got an error
Sudo: pip3 unknown command
Or something similar. Thought I posted immediately but apparently not

Thanks

]]>
By: Agron http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-12494 Wed, 15 Nov 2017 04:46:52 +0000 http://www.circuitbasics.com/?p=420643#comment-12494 Thanks!

Will try that later today.

]]>
By: bogd http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-12470 Tue, 14 Nov 2017 20:23:13 +0000 http://www.circuitbasics.com/?p=420643#comment-12470 Typo – I wrote TPLCD, but I meant RPLCD. Sorry about that πŸ™‚

]]>
By: Bogd http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-12469 Tue, 14 Nov 2017 20:22:35 +0000 http://www.circuitbasics.com/?p=420643#comment-12469 See above my previous comment (the one posted on October 30).

You do have TPLCD installed under python2, but you are using python3 to run your code πŸ™‚

Try doing a “sudo pip3 install RPLCD”, then try running your program again.

]]>
By: agron http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-12467 Tue, 14 Nov 2017 19:44:35 +0000 http://www.circuitbasics.com/?p=420643#comment-12467 This little thing makes me soon mad …
I get this little import error on the module RPLCD but it claims to be installed …

pi@raspberrypi ~/Adafruit_Python_DHT $ sudo pip install RPLCD
Requirement already satisfied (use –upgrade to upgrade): RPLCD in /usr/local/lib/python2.7/dist-packages/RPLCD-0.4.0-py2.7.egg
Cleaning up…

pi@raspberrypi ~/Adafruit_Python_DHT $ sudo python3 20171114.py
Traceback (most recent call last):
File “20171114.py”, line 6, in
from RPLCD import CharLCD
ImportError: No module named RPLCD
pi@raspberrypi ~/Adafruit_Python_DHT $

a
Any advice?
Thanks

]]>
By: Stephanie http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-12303 Fri, 10 Nov 2017 20:35:13 +0000 http://www.circuitbasics.com/?p=420643#comment-12303 I’ve got an Arduino Mega 2560 R3 running on my Macbook Pro High Sierra with a DHT11 3pin sensor. If I connect the sensor to the Raspberry PI using a breadboard, and via either SSH or a Serial Console cable, this tutorial runs flawlessly. HOWEVER, if I connect the Arduino to the Macbook directly or via the Mac, I receive the following error:

Arduino: 1.8.5 (Mac OS X), Board: “Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”

Sketch uses 6900 bytes (2%) of program storage space. Maximum is 253952 bytes.
Global variables use 318 bytes (3%) of dynamic memory, leaving 7874 bytes for local variables. Maximum is 8192 bytes.
avrdude: ser_open(): can’t open device “/dev/cu.usbserial”: No such file or directory
ioctl(“TIOCMGET”): Inappropriate ioctl for device
ioctl(“TIOCMGET”): Inappropriate ioctl for device
avrdude: ser_send(): write error: Bad file descriptor
avrdude: stk500_send(): failed to send command to serial port
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: Bad file descriptor
avrdude: stk500_send(): failed to send command to serial port
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: Bad file descriptor
avrdude: stk500_send(): failed to send command to serial port
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: Bad file descriptor
avrdude: stk500_send(): failed to send command to serial port
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: Bad file descriptor
avrdude: stk500_send(): failed to send command to serial port
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: Bad file descriptor
avrdude: stk500_send(): failed to send command to serial port
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
the selected serial port avrdude: stk500v2_getsync(): timeout communicating with programmer
does not exist or your board is not connected

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

]]>
By: Stephanie http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-12296 Fri, 10 Nov 2017 15:57:26 +0000 http://www.circuitbasics.com/?p=420643#comment-12296 Hello and greetings from Boston, MA. THANK YOU, THANK YOU, THANK YOU!!!

]]>
By: pete http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-11463 Mon, 30 Oct 2017 13:21:54 +0000 http://www.circuitbasics.com/?p=420643#comment-11463 Awesome,
Sorry Im reading backwards up the list… Yes I am on the latest version of Pi so will try the Python3 setup, thank you,

Pete

]]>
By: pete http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-11462 Mon, 30 Oct 2017 13:19:56 +0000 http://www.circuitbasics.com/?p=420643#comment-11462 HI,
i did follow all of the method, twice but had the same result… That Pi Driver file threw me a curve ball as I cant find one on the pi and cant find what it is to locate one.
Im going to throw some more time at this through this week so if you have any suggestions I would be most grateful.

CHeers
Pete

]]>
By: Bogd http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/#comment-11459 Mon, 30 Oct 2017 12:58:49 +0000 http://www.circuitbasics.com/?p=420643#comment-11459 I have just run into the exact same issue right now, on a brand new Raspberry Pi πŸ™‚

In my case, the issue was related to the fact that the default Python interpreter is Python2, but my Python code was set to use Python3.

I just had to to “python3 setup.py install” when setting up the Adafruit DHT library, to make sure that it gets installed under the correct interpreter.

Maybe this will help you as well πŸ™‚

]]>