cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ 4

Anonymous
Not applicable

Hey folks,

   

I am trying to extract data out of a DHT11 Temperature sensor. Can you tell me whether there exists an example project or a library?

   

Trying to write it myself wasn't successful yet...

0 Likes
1 Solution
odissey1
Honored Contributor II

See the code for 1-wire component here. Yes, something like Pin_Write(1) / Pin_Read()

View solution in original post

0 Likes
10 Replies
Bob_Marlowe
Expert II

Wouldn't be too bad to search for at top of this page. You'll get these results.

   

 

   

Bob

0 Likes
odissey1
Honored Contributor II

Bratwust,

   

closest 1-wire library would be one made for DS18B20 by 'pavloven'. See this thread, and this website.

   

You likely have to modify it - timing and reading is different, may be not worth the effort.

   

odissey1

0 Likes
Bob_Marlowe
Expert II

Just looked into the DHT11 datasheet. First approach could be done with counters and a piece of logic.

   

When that works you could try to conquer by using an UDB and the datapath.

   

Challenging!!!

   

 

   

Bob

0 Likes
rola_264706
Honored Contributor II

Here is a  C file program  to read the device you will need to mod it to work on PSOC.  I am not sure the one wire program for the ds18b22 will   work as this device needs a longer delay for the data.

0 Likes
Anonymous
Not applicable

thank you all for help so far 🙂

   

I actually tried to prog it myself but I am not sure about the bidirectional pin. Do I have to switch somehow the data direction or can I just use the readpin and writepin functions?

   

like (pseudocode)

   

writepin(1);

   

CyDelay(20);

   

pinstate = readpin();

   

 

   

Thank you all again 🙂

0 Likes
odissey1
Honored Contributor II

See the code for 1-wire component here. Yes, something like Pin_Write(1) / Pin_Read()

View solution in original post

0 Likes
ETRO_SSN583
Esteemed Contributor

See 7.1 of the following -

   

 

   

http://www.cypress.com/?rID=93401     AN86439 - PSoC® 4 - Using GPIO Pins

   

 

   

Regards, Dana.

Anonymous
Not applicable

Hello Bratwurst, were you successful with the DHT11?

0 Likes
EvPa_264126
Valued Contributor II

I can offer you a simple project for PSoC4.
I used the library from this source:    STM32 + DHT11

   

​DHT11.cywrk.Archive01.zip

I  have corrected the link..

0 Likes
Anonymous
Not applicable

Hi Pavloven. I'm dealing with the DHT22. I'm trying to download your project but the link seems to be not working. Can you share the link again?

   

Thank you.

0 Likes