Page 4 of 4

Re: Measurement of temperature and relative humidity using DHT11

Posted: Wed Nov 21, 2018 11:01 am
by Oderlando
Hi mnf. In the proteus simulator this flowchart is not working. Nothing appears on the display. I used GetHumidityWole, as you said. I simulated the proteus and also did not show the humidity reading. The difference is that now the display lights, but only shows a zero value. I'm posting the flowchart

Re: Measurement of temperature and relative humidity using DHT11

Posted: Wed Nov 21, 2018 12:32 pm
by mnf
Hi,

Not sure about in Proteus - it works in Flowcode simulation.

Can you look at what SampleSensor returns in the simulation - maybe it is never reading the humidity. As a test - set Humidity = 67 (pick a value) at the start of your program - if this is displayed then GetHumidityWhole is never been called - if it changes to 0 then GetHumidityWhole is always returning 0 in simulation.

Martin

Re: Measurement of temperature and relative humidity using DHT11

Posted: Wed Nov 21, 2018 8:43 pm
by Oderlando
Hi mnf. I tested your code and the display remained off. I could not determine why. I made some modifications to the flowchart that I had posted earlier. I used GetHumidityWole, as you said, and got the flowcode simulation to work. When I tested the proteus, the display shows something, but only shows a zero value. I can not understand why this is happening. I am posting the flowchart that I tested.

Re: Measurement of temperature and relative humidity using DHT11

Posted: Wed Nov 21, 2018 8:50 pm
by Oderlando
You were right. GetHumidityWole is not being called. Insert a value for moisture at the beginning of the program and it is appearing in the simulation. Any suggestions on what might be happening?

Re: Measurement of temperature and relative humidity using DHT11

Posted: Tue Dec 04, 2018 12:14 am
by claudemir
Hello
I am having a very similar problem with DHT22, I am mounting a project with DHT22 next to PIC18F4620, where I can only get the checksum error response, in the simulation it works normally, I have another project with the mega 2560 and it runs perfectly on the hardware, but it does not I'm not sure if it will work with pic16f, I've switched the oscillator from 10MHZ to 16 and 20Mhz, I put delay, but nothing works with correct information like temperature and humidity, if you have someone to help me put it to work or inform if it works with PIC18f4620, because I did not understand what is wrong with my project.
In the attachment I have a small project to test, but the official project uses the TMR0, but I believe that it is not the one that is disturbing because in this attachment the DHT22 does not work either.

Re: Measurement of temperature and relative humidity using DHT11

Posted: Tue Dec 04, 2018 9:48 pm
by claudemir
Hello
Today I made a few attempts with the DHT22 with my Pic18f4620, I switched the external oscillator to 4MHZ, but it still does not work, anyhow the DHT22 in the mega arduino 2560 works, but in PIC18F it does not want to work, I always get a checksum error, that's it. I believe that the DHT22 does not work with the pic18f, Personal that sees this component, so that I can use with the PIC18F4620

Re: Measurement of temperature and relative humidity using DHT11

Posted: Wed Dec 05, 2018 10:58 am
by Benj
Hello,
I am mounting a project with DHT22 next to PIC18F4620, where I can only get the checksum error response
Looks like clock speed is your issue. You have set the project options clock speed to 10MHz but in the configuration you are using HS-PLL which will take the input crystal frequency and attempt to multiply it by 4 which probably won't work on the 4620. That is unless you're using a 2.5MHz crystal.

See here for help getting the clock speed correct, Once you have done this hopefully DHT22 should work correctly for you.
https://www.matrixtsl.com/wiki/index.ph ... ED_flasher

Re: Measurement of temperature and relative humidity using DHT11

Posted: Wed Dec 05, 2018 3:10 pm
by claudemir
Thanks for the reply Benj
I already changed the oscillator to 4MHz and set the oscillator to HS and XT. I put a delay of 5 seconds before the "SampleSensor" but none of it solved, the lowest oscillator I have is 4MHz, but I have an aggravation, I use a glcd in the original design and has many variables being updated in glcd, so the oscillator can not be too low, plus I can not give up watching the DHT22 work.

Re: Measurement of temperature and relative humidity using DHT11

Posted: Wed Dec 05, 2018 5:56 pm
by Benj
Hello,

Have you tried the 1 second flasher test to confirm you have set the chip up correctly and you are running at the speed you think you are. If this isn't working then delays in general will be out and therefore anything timing related e.g. the DHT component will not work correctly.

Also 4MHz might be too slow for the uS delays to be accurate. Might be worth trying the 4MHz crystal with the x4 PLL to give you 16MHz, again confirming using the 1 second flash test.

Re: Measurement of temperature and relative humidity using DHT11

Posted: Thu Dec 06, 2018 9:24 pm
by claudemir
Hello benj
I'm sorry for the delay in responding, but I ended up taking a trip to meet a client and I did not have any way to verify the settings, but as soon as I return from the trip I will continue with my project and keep informed of the changes.

Re: Measurement of temperature and relative humidity using DHT11

Posted: Fri Dec 07, 2018 10:03 pm
by Oderlando
I also had problems, but using a DHT Sensor. Only later did I find out that I was using crystals of very low speed (4 and 8 MHz). My problem was solved with a higher speed crystal (20MHz).

Re: Measurement of temperature and relative humidity using DHT11

Posted: Sun Dec 09, 2018 12:45 am
by claudemir
Good night Benj.
I came back from a trip today, and I had the pleasure of seeing the DHT22 working, the only way the sensor worked was to leave the 4MHz crystal and configure the x4 PLL to give 16MHz, I put a 16MHz crystal and I configured it with HS, but this way the sensor does not work, I returned the crystal of 4MHz and x4 PLL.
I also used the Oderlando tip of a 20MHz crystal but it also does not work, the microprocessor speed running at 16MHz is not enough to operate glcd, because it has many variables to update at all times, but I will have to relocate and adapt my software to be able to use the DHT22 being the heart of the control.
Thanks for the tips

Re: Measurement of temperature and relative humidity using DHT11

Posted: Sat Jun 01, 2019 9:58 am
by benchhida
Please have a little help.I have question

(20.0 MHz, the TMR0 increments by 1 in every 0.8 μs (prescaler 1:4)).
without a prescaler =4 in the instruction
st_bit(intcon, TMR0IE);
tmr0=0x00;

Re: Measurement of temperature and relative humidity using DHT11

Posted: Sat Jun 01, 2019 10:28 am
by medelec35
benchhida wrote:Please have a little help.I have question

(20.0 MHz, the TMR0 increments by 1 in every 0.8 μs (prescaler 1:4)).
without a prescaler =4 in the instruction
st_bit(intcon, TMR0IE);
tmr0=0x00;
What has this got to do with Re: Measurement of temperature and relative humidity using DHT11.
Not sure what you are asking?
Please do not make public your personal email address.

Re: Measurement of temperature and relative humidity using DHT11

Posted: Sat Jun 01, 2019 4:17 pm
by benchhida
I do not understand there is not in the program an instriction which defines the prescaler 1/4
thank you
st_bit (intcon, TMR0IE);

Re: Measurement of temperature and relative humidity using DHT11

Posted: Mon Jun 03, 2019 11:45 am
by benchhida