Isn’t it so that some gpio have internal pull ups? Maybe this needs to be changed … ?
-
[solved] From 6 DHT22, only 4 work
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !
-
@Mr-X May be the PIN numbers you’re using are wrong. Can you please post the devices config you have setup?
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig said in From 6 DHT22, only 4 work:
@Mr-X May be the PIN numbers you’re using are wrong. Can you please post the devices config you have setup?
{ "type": 22, "pinType": "BCM GPIO", "pin": 17, "interval": 5000, "xAttributeOptions": [], "id": "wz", "name": "wz", "class": "DHTSensor" }, { "type": 22, "pinType": "BCM GPIO", "pin": 4, "interval": 5000, "xAttributeOptions": [], "id": "ku", "name": "ku", "class": "DHTSensor" }, { "type": 22, "pinType": "BCM GPIO", "pin": 20, "interval": 5000, "xAttributeOptions": [], "id": "wc", "name": "wc", "class": "DHTSensor" }, { "type": 22, "pinType": "BCM GPIO", "pin": 13, "interval": 5000, "xAttributeOptions": [], "id": "ba", "name": "ba", "class": "DHTSensor" }, { "type": 22, "pinType": "BCM GPIO", "pin": 21, "interval": 5000, "xAttributeOptions": [], "id": "az", "name": "az", "class": "DHTSensor" }, { "type": 22, "pinType": "BCM GPIO", "pin": 27, "xAttributeOptions": [], "id": "sz", "name": "sz", "class": "DHTSensor", "interval": 5000 },
-
@Mr-X Thanks. Which PI model do you have? Assuming you have a Raspi 2 or 3 the pinout should be as shown below.
Can you confirm WC and AW are connected to physical pins 38 and 40 or the header?+-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+ | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM | +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+ | | | 3.3v | | | 1 || 2 | | | 5v | | | | 2 | 8 | SDA.1 | ALT0 | 1 | 3 || 4 | | | 5V | | | | 3 | 9 | SCL.1 | ALT0 | 1 | 5 || 6 | | | 0v | | | | 4 | 7 | GPIO. 7 | IN | 1 | 7 || 8 | 0 | IN | TxD | 15 | 14 | | | | 0v | | | 9 || 10 | 1 | IN | RxD | 16 | 15 | | 17 | 0 | GPIO. 0 | IN | 0 | 11 || 12 | 0 | IN | GPIO. 1 | 1 | 18 | | 27 | 2 | GPIO. 2 | IN | 1 | 13 || 14 | | | 0v | | | | 22 | 3 | GPIO. 3 | IN | 0 | 15 || 16 | 0 | IN | GPIO. 4 | 4 | 23 | | | | 3.3v | | | 17 || 18 | 0 | IN | GPIO. 5 | 5 | 24 | | 10 | 12 | MOSI | IN | 0 | 19 || 20 | | | 0v | | | | 9 | 13 | MISO | IN | 0 | 21 || 22 | 0 | IN | GPIO. 6 | 6 | 25 | | 11 | 14 | SCLK | IN | 0 | 23 || 24 | 1 | IN | CE0 | 10 | 8 | | | | 0v | | | 25 || 26 | 1 | IN | CE1 | 11 | 7 | | 0 | 30 | SDA.0 | IN | 1 | 27 || 28 | 1 | IN | SCL.0 | 31 | 1 | | 5 | 21 | GPIO.21 | IN | 1 | 29 || 30 | | | 0v | | | | 6 | 22 | GPIO.22 | IN | 1 | 31 || 32 | 0 | IN | GPIO.26 | 26 | 12 | | 13 | 23 | GPIO.23 | IN | 0 | 33 || 34 | | | 0v | | | | 19 | 24 | GPIO.24 | IN | 0 | 35 || 36 | 1 | IN | GPIO.27 | 27 | 16 | | 26 | 25 | GPIO.25 | IN | 0 | 37 || 38 | 1 | IN | GPIO.28 | 28 | 20 | | | | 0v | | | 39 || 40 | 1 | IN | GPIO.29 | 29 | 21 | +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+ | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM | +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig: Thank you I am using a Raspi 2 Model B, also tried a Raspi 3 for testing.
I can confirm that “WC” is connected to Pin number 38 and “AZ” is connected to Pin number 40.Which I can not explain:
For example the Device “KU” works without any Problem. When i connect the “KU” cable to Pin 38 where the device “AZ” is configured, i get values.
When I connect the “AZ” cable to Pin 7 where the device “KU” is configured, I do not get any values.When I exchange the DHT22 sensors among each other, every sensor connected in KU, WZ, BA or SZ works; so I think the DHT22 sensors are ok and not defective.
For a better understanding how i connected the sensors:
-
Thanks. My suggestion is to test the setup with short cables just to make sure the underlying library is able to deal with 6 DHTs (not sure whether or not anyone has tried this yet). Generally, it should work, but one may run into timing problems.
If the previous step works, my next suggestion is to try a smaller pull-up 4.7k with the long cables. Also make sure the cable shield is connected to ground at one cable-end.
A, perhaps, dumb question: Why do you use an external power supply? The power draw of one sensor should be below 1.5 mA according to the data sheet. So, for the described application using the Raspi to power the sensors should be fine.
https://www.sparkfun.com/datasheets/Sensors/Temperature/DHT22.pdf
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig: Thanks for your answer
yeah, that is the next step I will do. This evening first I want to build a test situation with short cables and try my luck.
The cable shield is not connected to ground - I will try it, also the 4.7k idea; provided the test setup works.In the future i want to connect more devices like relay boards, etc. Thats the reason I use a external power device.
As soon as I have the first test results I will report.
-
Test 1: New installation of Pimatic on Raspi 3; connected 7x DHT22 with pull-up 10k and short cables - it works!
Test 2: Connected the external Power supply: it works!
Test 3: Replaced “old” Pimatic Installation & Raspi 2 with the new one on Raspi 3, connected all network cable grounds to global ground and renewed all GPIO connector cables: it works !Thanks for support !
I have named the devices like the GPIO connector number they were connected.
something surprised me (see Pimatic screenshot):
The DHT22 on Pin 26 has a very high humanity, also the DHT22 on Pin 16.
When I exchange the DHT22 - for example i connect the DHT22 who is Room with Pin 26 to the Room with Pin 19, then Pin 19 as a high humidity. I think it is the sensor.
Is it possible that this DHT22 is defective or does this sensors have a high tolerance?edit:
The Pimatic Picture is from the first test, so all DHT22 sensors where next to each other and each sensor have different values… -
Great, the basic setup is working fine for you know!
@Mr-X said in From 6 DHT22, only 4 work:
Is it possible that this DHT22 is defective or does this sensors have a high tolerance?
Normally, DHT22 has a high accuracy and it is calibrated as part of the production process. However, if you bought cheap ones. e.g. from China for 2 Euros, it may be different story.
Keep an eye on the measured values. If the values are fluctuating it may be a problem with false readings. The following post is suggesting the problem can be mitigated using a certain read method for the sensors: http://forum.arduino.cc/index.php?topic=184356.msg1753894#msg1753894. I haven’t tried this myself and I didn’t find a follow-up on this confirming the method to work,
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
I bought them in germany - for test i replaced the 10k with 4.7k; no changes in the values.
I have now ordered other sensors and will test them.
Thanks for your support !