Low Cost DHT11 Temperature &Humidity Sensor Library Developement | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar
Please consider registering
guest
sp_LogInOut Log In sp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
Low Cost DHT11 Temperature &Humidity Sensor Library Developement
May 24, 2015
9:33 pm
Avatar
Amornthep
Member
Members
Forum Posts: 22
Member Since:
April 8, 2015
sp_UserOfflineSmall Offline

Hi all,

This is my first post here :D

I'm working on DHT11 library (1-wire protocol) and I would like to share with community,

The coding concept is almost done refer as datasheet. But the bad news is I haven't get any data out yet. :(

I think the problem come from timing issue or coding, Due to the compiler not support "Time Loop" so far.

Anyway I'll continue working on it ,If someone can help to get it work and share with community, I really appreciate.

Noted, The main VI is "DHT11 Example.vi"

Amornthep.

May 24, 2015
9:46 pm
Avatar
filipealtoe
Admin
Forum Posts: 98
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Hi Amornthep;

 

Thanks for posting this. In regards to the compiler not supporting Timed Loop, you can take advantage of the timer interrupts in order to implement functionality that would be the equivalent of of a single timed loop in LabVIEW. Refer to the shipping example on timed interrupts for more details on how to use it. That will give you real time execution of a single loop every time the interrupt fires.

Filipe

Cheers
Filipe

May 27, 2015
5:41 am
Avatar
Amornthep
Member
Members
Forum Posts: 22
Member Since:
April 8, 2015
sp_UserOfflineSmall Offline

YES ! , Finally I've done it.

I'll clean-up some of the code and I will upload all VIs to this post.

ภาพหน้าจอ-2015-05-27-11.59.38.pngImage Enlarger

May 27, 2015
11:23 am
Avatar
Amornthep
Member
Members
Forum Posts: 22
Member Since:
April 8, 2015
sp_UserOfflineSmall Offline

Image Enlarger

the $5.00 Low Cost DHT11 Temperature &Humidity Sensor. 

(http://www.adafruit.com/product/386)

Anyone interested on this please find VI and library in .zip file

The zip files include..

1.Weather Station DHT11 with LCD 1.0.0 (Main Application)

2.DHT11 beta 1.0.0 (Library fiels to interface with DHT11 )

3.Document ,Datasheet etc.

 

*Please noted that I only tested with Arduino Uno (ATmega328)

*Keys to improvement for next version.

1.Handling timeout error function

2.Stability of the code

3.Accuracy

4.Verify with others HW target.

wth004.jpgImage Enlarger

Thanks, Amornthep

sp_PlupAttachments Attachments
May 27, 2015
3:20 pm
Avatar
filipealtoe
Admin
Forum Posts: 98
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Good stuff Amornthep! 

Cheers
Filipe

August 9, 2015
1:44 pm
Avatar
threelock
Member
Members
Forum Posts: 5
Member Since:
August 5, 2015
sp_UserOfflineSmall Offline

Thanks for this! It's exactly what I wanted to do with the Arduino and Labview first.

I saw the presentation at NIWeek 2015, I got this up in running really quickly when I got home. 

August 28, 2015
11:37 am
Avatar
AndreasK
New Member
Members
Forum Posts: 1
Member Since:
August 27, 2015
sp_UserOfflineSmall Offline

Hi threeclock,

great that you got your VIs to work with your DHT11 sensor.

One question. Are these VIs specifically for the DHT11 sensor our would they also work
with other digital one wire protocol sensors like for example "DS18S20" ?

Specification Link DS18S20
http://www.maximintegrated.com.....18S20.html

That would be great. I have some of these sensors at home. I worked with these sensors on the NI myRIO.
Worked pretty well.

Thanks a lot
AndreasK

August 28, 2015
2:23 pm
Avatar
filipealtoe
Admin
Forum Posts: 98
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Hello;

If you take a peek inside the Translator.vi; which is the one that contains the C-code that does the glue logic between the corresponding Arduino Library and the LabVIEW API VIs, you will see that the Dallas Temperature library is the one that got ported.

According to this link; https://www.pjrc.com/teensy/td.....eWire.html; the library supports both Maxim and Dallas 1-wire devices. So, my guess is that it would work with the one you are referring to.

Filipe

Cheers
Filipe

September 20, 2015
10:27 pm
Avatar
tronron
Member
Members
Forum Posts: 21
Member Since:
August 5, 2015
sp_UserOfflineSmall Offline

Thank you Amornthep! This is exactly what I was looking for. I'd also be very interested in examples of how to read the Dallas temp sensor.

Where do I get and how do I install the required libraries?. I see a bunch of errors reporting Native functions not supported, when I look at the Arduino code. Even ones I believe are basic labview functions  for example "Native function "Add" not supported" . . .

Any ideas what I am doing wrong? Where is the "Translator.vi" Filipe refers to above? On my PC I can only find the example translator VI provided by ACC4LV.

September 22, 2015
3:59 am
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

You are getting the "not supported" messages because you are trying to view the converted code of functions that you are not allowed to view.  When using the Arduino Code Viewer you must make sure you only have user APIs in the VI as the tool is only meant to help you develop your custom library and show you the converted code for the API VIs only.

Take a look at the example in the user manual section "Porting an Arduino library to LabVIEW" and the Digilent Analog Shield example, which ships with the compiler.  You can find this at “[LABVIEWDIR]\vi.lib\Aledyne-TSXperts\Arduino Compatible Compiler for LabVIEW\addons\Digilent Analog Shield".  The Translator.vi is located in the folder for each user library, including this one.

September 24, 2015
1:34 pm
Avatar
molio
Member
Members
Forum Posts: 5
Member Since:
July 9, 2015
sp_UserOfflineSmall Offline

hi sir

 I found there are diffenence result if I reverse the sequence between the DHT11.vi and RTC.vi.

The seq1 can got correct data from DHT11.vi, but the seq2 return wrong data.

The another issue is I put the DHT11.vi and RTC.vi into the sequence structure.

The compatiler will show not enough memory error.

Can help me to clarity these issues?

I already update to version 1.0.0.19

DHT11_issue.pngImage EnlargerMemory-error.pngImage Enlarger

sp_PlupAttachments Attachments
September 24, 2015
2:30 pm
Avatar
filipealtoe
Admin
Forum Posts: 98
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Can you post the VI you are seeing the out of memory issue?

Cheers
Filipe

September 25, 2015
2:25 pm
Avatar
ehrenfeld
Member
Members
Forum Posts: 4
Member Since:
June 24, 2015
sp_UserOfflineSmall Offline

Hi Amornthep;

i have try  your example DHT11.vi but when i want to compile(verify only) i have this answer

1.0.0.19, Arduino Uno
temp.ino: In function 'void setup()':
temp:70: error: 'Vrai' was not declared in this scope
temp:76: error: 'Faux' was not declared in this scope
temp:93: error: 'Vrai' was not declared in this scope
temp:99: error: 'Faux' was not declared in this scope
'Vrai' was not declared in this scope

 

Do you have an idear

 

thanks for your help

September 25, 2015
4:23 pm
Avatar
Amornthep
Member
Members
Forum Posts: 22
Member Since:
April 8, 2015
sp_UserOfflineSmall Offline

molio said
hi sir

 I found there are diffenence result if I reverse the sequence between the DHT11.vi and RTC.vi.

The seq1 can got correct data from DHT11.vi, but the seq2 return wrong data.

The another issue is I put the DHT11.vi and RTC.vi into the sequence structure.

The compatiler will show not enough memory error.

Can help me to clarity these issues?

I already update to version 1.0.0.19

DHT11_issue.pngImage EnlargerMemory-error.pngImage Enlarger

Hi Molio,

Can you post the VI ? 

Amornthep

September 25, 2015
4:28 pm
Avatar
Amornthep
Member
Members
Forum Posts: 22
Member Since:
April 8, 2015
sp_UserOfflineSmall Offline

ehrenfeld said
Hi Amornthep;

i have try  your example DHT11.vi but when i want to compile(verify only) i have this answer

1.0.0.19, Arduino Uno
temp.ino: In function 'void setup()':
temp:70: error: 'Vrai' was not declared in this scope
temp:76: error: 'Faux' was not declared in this scope
temp:93: error: 'Vrai' was not declared in this scope
temp:99: error: 'Faux' was not declared in this scope
'Vrai' was not declared in this scope

 

Do you have an idear

 

thanks for your help

Hi ehrenfeld,

I haven't tried with 1.0.0.19 yet. but I will give a try.

Amornthep

September 25, 2015
4:34 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

ehrenfeld said
Hi Amornthep;

i have try  your example DHT11.vi but when i want to compile(verify only) i have this answer

1.0.0.19, Arduino Uno
temp.ino: In function 'void setup()':
temp:70: error: 'Vrai' was not declared in this scope
temp:76: error: 'Faux' was not declared in this scope
temp:93: error: 'Vrai' was not declared in this scope
temp:99: error: 'Faux' was not declared in this scope
'Vrai' was not declared in this scope

 

Do you have an idear

 

thanks for your help

It's probably because you have French language setting or French version of LV. Please take a look at the user manual regarding other language support and case statements. This was also discussed in this recent post here:

https://www.geverywhere.com/for.....ndows7uno/

September 26, 2015
12:54 am
Avatar
molio
Member
Members
Forum Posts: 5
Member Since:
July 9, 2015
sp_UserOfflineSmall Offline

hi all sir

 I used the attached vi of this thread to test.

Please see the attached vi.

September 26, 2015
1:13 am
Avatar
filipealtoe
Admin
Forum Posts: 98
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Have you checked the thread that Steffan posted above? Are you running LV on a language than English?

Cheers
Filipe

September 26, 2015
6:09 am
Avatar
molio
Member
Members
Forum Posts: 5
Member Since:
July 9, 2015
sp_UserOfflineSmall Offline

Hi filipealtoe

 My OS is traditional Chinese win8.1(surface pro 3) and installed English version of LabVIEW.

June 20, 2016
2:32 pm
Avatar
xuanthai.vmi
Member
Members
Forum Posts: 5
Member Since:
June 19, 2016
sp_UserOfflineSmall Offline

Amornthep said

Image Enlarger

the $5.00 Low Cost DHT11 Temperature &Humidity Sensor. 

(http://www.adafruit.com/product/386)

Anyone interested on this please find VI and library in .zip file

The zip files include..

1.Weather Station DHT11 with LCD 1.0.0 (Main Application)

2.DHT11 beta 1.0.0 (Library fiels to interface with DHT11 )

3.Document ,Datasheet etc.

 

*Please noted that I only tested with Arduino Uno (ATmega328)

*Keys to improvement for next version.

1.Handling timeout error function

2.Stability of the code

3.Accuracy

4.Verify with others HW target.

wth004.jpgImage Enlarger

Thanks, Amornthep

Hi Amonhep,

First of all, thank you very much for your program.

I have some experience in labview, but working on arduino uno using labview compatible complier

to unload coding from labview to chip is the first time. 

I connect DHT11 to arduino according to your guide. But when i upload that code to arduino but nothing can be shown on LCD.

Could you help me?

Thanks 

Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online: Sam
12
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
miche91: 33
scottj: 28
scadao: 23
Member Stats:
Guest Posters: 5
Members: 202
Moderators: 0
Admins: 3
Forum Stats:
Groups: 1
Forums: 2
Topics: 266
Posts: 1222
Newest Members:
pujacontrol
Administrators: geadmin: 22, filipealtoe: 96, Steffan: 356