problems with DS18S20/DS18B20 and DHT22 sensors

Any bugs you encounter with Flowcode should be discussed here.
aderito
Posts: 10
http://meble-kuchenne.info.pl
Joined: Sun Jan 29, 2023 12:49 pm
Location: portugal
Has thanked: 6 times

problems with DS18S20/DS18B20 and DHT22 sensors

Post by aderito »

Hello, after updating flowcode version 8 to version 10 I am having problems with the components: DS18S20/DS18B20 and DHT22.
in the new version (10) I can't get either of these two sensors to work even after switching to different clock speeds.
So I come here to ask for help but I suspect there may be a bug in the new version of flowcode because I still have the old version (8) installed and the project works perfectly in this one.

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: problems with DS18S20/DS18B20 and DHT22 sensors

Post by chipfryer27 »

Hi

Can you attach your v10 project

Regards

jgu1
Posts: 615
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 507 times
Been thanked: 132 times

Re: problems with DS18S20/DS18B20 and DHT22 sensors

Post by jgu1 »

sorry DHT22 for me also not working in FC10. I have to go back to FC8, then it work?

The att. project is a project open in FC10 from FC8.

Br Jorgen
Attachments
DHT22_LCD.fcfx
(15.59 KiB) Downloaded 93 times

aderito
Posts: 10
Joined: Sun Jan 29, 2023 12:49 pm
Location: portugal
Has thanked: 6 times

Re: problems with DS18S20/DS18B20 and DHT22 sensors

Post by aderito »

the first attachment is in version 8 and the second is in version 10 which does not work
Attachments
turbomacambuzio V10 DHT22 4620 lcd.fcfx
(107.55 KiB) Downloaded 88 times
turbomacambuzio V8 DHT22 4620 lcd.fcfx
(87.14 KiB) Downloaded 97 times

aderito
Posts: 10
Joined: Sun Jan 29, 2023 12:49 pm
Location: portugal
Has thanked: 6 times

Re: problems with DS18S20/DS18B20 and DHT22 sensors

Post by aderito »

the DS18S20/DS18B20 sensor I can't physically test because at the moment I don't have any available but using PROTEUS I can't get this sensor to work

aderito
Posts: 10
Joined: Sun Jan 29, 2023 12:49 pm
Location: portugal
Has thanked: 6 times

Re: problems with DS18S20/DS18B20 and DHT22 sensors

Post by aderito »

Attached is a simple test created with fcv10 (does not work) and a simple test created with fcv8 that works perfectly.
Furthermore, I made "version 8" from the file created with "version 10" :mrgreen:
Attachments
teste simples dht22 fcv8.fcfx
(14.47 KiB) Downloaded 94 times
teste simples dht22 fcv10.fcfx
(17.92 KiB) Downloaded 79 times

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: problems with DS18S20/DS18B20 and DHT22 sensors

Post by chipfryer27 »

Hi

In the Evil Lab today so I had a look around at what I have but unfortunately I don't have any DHT22 modules but I do have DHT11 modules, both use one-wire so.....

I created charts in v8 and v10.

The charts use an EB083 combo-board connected to a multiprogrammer with a PIC16F1939 running at 19.xxxMHZ.

The chart initialises the display then enters a loop.

In the loop we wait for a button to be pressed before sampling the sensor.

According to the component, SampleSensor returns 0 for success, 1 for No Comms and 2 for Checksum Error.

The chart branched depending on result. If 0 then it would go on to display humidity and temperature, if 1 it would inform of comms error and if 2 it would inform of checksum error.

In both charts the sensor returned 1, meaning No Comms.

Connecting a Logic Analyser set to decode 1-wire / DHT11/22 provided the following information

DHT11_v8.jpg
DHT11_v8.jpg (31.04 KiB) Viewed 1455 times

Zooming in we can see the sensor actually responded with correct readings

DHT11_v8_zoom.jpg
DHT11_v8_zoom.jpg (42.96 KiB) Viewed 1455 times

The same results were obtained using v10.

Changing the chart to display results if a "1" was returned (instead of a 0), the chart displayed the correct readings on hardware on the display.
It would seem that in both v8 and v10, Flowcode is either returning incorrect values, or there is a typo in description in that it should read 1 for success.

I'm not sure if this helps with your DHT22 issue or not.

Although still connected to a DHT11, I changed the component to a DHT22 just to see what happens. Whilst I wasn't expecting much really I was interested to see what was being transmitted. The DHT11/22 decoders didn't register anything but 1-wire caught Resets. Same with v8.

DHT22_v10_zoom.jpg
DHT22_v10_zoom.jpg (29.31 KiB) Viewed 1455 times


Regards

aderito
Posts: 10
Joined: Sun Jan 29, 2023 12:49 pm
Location: portugal
Has thanked: 6 times

Re: problems with DS18S20/DS18B20 and DHT22 sensors

Post by aderito »

Hello, I noticed an error in the flowchart in the Switch icon......
I forgot to declare the variable in this operation so never exit this loop....
my distraction...
Attached I will post the correct flowcharts
Attachments
teste simples dht22 fcv10.fcfx
(18.71 KiB) Downloaded 93 times
teste simples dht11 fcv10.fcfx
(18.71 KiB) Downloaded 84 times

aderito
Posts: 10
Joined: Sun Jan 29, 2023 12:49 pm
Location: portugal
Has thanked: 6 times

Re: problems with DS18S20/DS18B20 and DHT22 sensors

Post by aderito »

hello,
I took some screenshots during the simulation with Proteus and it can be seen that in the "dht22 fc10" capture the times are somewhat different from the other captures.
I emphasize that the dht11 component works well in both fc8 and fc10
Attachments
captura dht22 fc8.png
captura dht22 fc8.png (401.81 KiB) Viewed 1430 times
captura dht11 fc10.png
captura dht11 fc10.png (399.7 KiB) Viewed 1430 times
captura dht11 fc8.png
captura dht11 fc8.png (399.43 KiB) Viewed 1430 times

aderito
Posts: 10
Joined: Sun Jan 29, 2023 12:49 pm
Location: portugal
Has thanked: 6 times

Re: problems with DS18S20/DS18B20 and DHT22 sensors

Post by aderito »

here is what was missing.....
Attachments
captura dht22 fc10.png
captura dht22 fc10.png (402.16 KiB) Viewed 1430 times

Post Reply