LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading multiple DHT's

Hi there,

So I have a project which, among other things, includes 3 dht sensors (both 11's and 22's). I have managed to get a single one working quite well based on vi's previously uploaded, however, when I try to include more than one into my vi, everything goes haywire, and the readings flash between correct ones and ones way off the map. They are obviously interfering with each other. How can I fix this?

0 Kudos
Message 1 of 9
(5,225 Views)

It depends on how the code to read them was written.  I wrote one once but it has a hardcoded pin and therefore it's not possible to read more than one IIRC.  I don't know which one of the DHT codes that you are using.  It sounds like you must have one that allows you to pick the pin on which you have the sensor.

So, can you provide a link to the DHT code (firmware, VIs, etc.)?  Also, FYI, the .lvproj file does not contain any LabVIEW code.  If you want to have people look at your project, you have to zip up the whole project (including all the LabVIEW files; typically you would keep these all with the .lvproj file).

0 Kudos
Message 2 of 9
(4,196 Views)

Dang, I knew something would be off. I've tried zipping up what files may be needed. Hopefully it is correct.

2-8 is a working sketch for a single dht, 2-7 is a rudimentary attempt to get two funtioning at once on different pins. the LIFA zip file is the original firmware I downloaded offline, in case it is needed.

I'm going to have to get 3 dht's functioning inside of a much larger program.


Thanks!

Download All
0 Kudos
Message 3 of 9
(4,196 Views)

Did you edit the DHT library yourself?  Did you test it with only the Arduino (a simple sketch that outputs the temperature (or raw data) to the serial monitor)?  It looks like it might not have been done correctly to acheive what you want.

I think it would just be easier to triplicate the one that I created (I created that LabVIEW library and the modifications to the firmware).

0 Kudos
Message 4 of 9
(4,196 Views)

I did not edit the dht library myself. I tested it with the arduino, interfacing with labview. It is not a sketch, if I understand your question correctly, but a LIFA vi downloaded from this site.  I did have it backwards, 2-8 is the functioning sketch for a single dht. I tried just copying and pasting it 3 times, but the signals appear to be interfering, and when I do more than one, the measurements vary wildly between readings. I have yet to be able to find a solution

Download All
0 Kudos
Message 5 of 9
(4,196 Views)

Can you provide a link to the library that you downloaded?  I'm curious where it came from and to see other comments regarding it.

If it works for one then it should most likely work for others (if it's coded correctly).  Are you sure that all of your sensors are hooked up correctly and working?  I would recommend taking the VI the VI that works for one sensor and changing the pin to verify the sensor actually works.  Test the first one, test the second one, etc.

0 Kudos
Message 6 of 9
(4,196 Views)

Never mind, I found out there was another, more recent version of the sketch on this forum, I plugged it in, copied and pasted three times, and it worked like magic. Thanks !

Now if only I could have found it this easy a week ago T.T

0 Kudos
Message 7 of 9
(4,196 Views)

I'm glad you got it working!  However, since you got it working, I would really like to know which one you downloaded to see if that will make it easier to implement this sensor in LINX.  Could you provide the link to the post that contains the one that you got working?

0 Kudos
Message 8 of 9
(4,196 Views)
0 Kudos
Message 9 of 9
(4,196 Views)