Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 14:27 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : WebMite Demo Problems

Author Message
EDNEDN
Senior Member

Joined: 18/02/2023
Location: United States
Posts: 118
Posted: 12:04am 24 May 2024
Copy link to clipboard 
Print this post

I just got a Pico-W in the mail and I figured I would load up the WebMite firmware and put the Humidity and Temperature web page code on it.   I got the web page to show on my browser but I'm getting 1000 for both Humidity and the Temperature.   And the documentation says that is what I will get if I don't have a DHT22 sensor connected.

I'm just curious.   Looking at the demo code it seems like the bit banging should be down on GP28 to match the circuit shown on the demo page.   Of course I tried that, but I'm still getting a temperature of 1000.    

Does anybody have any ideas what I should check?    I'm wondering if I got sent a DHT-11 by accident?   Does anybody know if the initialization and command set are the same for the two parts?






WEB TCP INTERRUPT WebInterrupt
DO
 BITBANG HUMID GP15, CurrentTemp, CurrentHumid
 PAUSE 1000
LOOP

SUB WebInterrupt
LOCAL INTEGER a, p, t, b(4096/8)
FOR a = 1 To MM.INFO(MAX CONNECTIONS)
WEB TCP READ a, b()
p = LINSTR(b(), "GET")
t = LINSTR(b(), "HTTP")
If (p > 0) And (t > p) Then
WEB TRANSMIT PAGE a, "index.html"
ENDIF
NEXT a
END SUB

Edited 2024-05-24 10:19 by EDNEDN
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 12:39am 24 May 2024
Copy link to clipboard 
Print this post

Try increasing the pause to 2000. DHT sensors won't wake up if the pause is too short.
If this is on a breadboard check continuity from the Pico pins to all the DHT pins. Verify that you have 3.3V at the DHT pins. You may also need a pullup resistor, 3.3kΩ to 10kΩ.

See "Measuring Humidity and Temperature" in the manual.

A DHT22 command line test using whatever pin you have it connected to:-
Do :Device Humid GP28, t, h :? t, h :pause 2000 :loop

And for a DHT11:-
Do :Device Humid GP28, t, h, 1 :? t, h :pause 2000 :loop
 
EDNEDN
Senior Member

Joined: 18/02/2023
Location: United States
Posts: 118
Posted: 02:01am 24 May 2024
Copy link to clipboard 
Print this post

Increasing the Pause to 2000 or 2500 doesn't help.   The connections have the pins of the Dupont wire soldered into the Pico-W.  The other side of the Dupont wires are female and go to the circuit board the Alleged DHT-22 is on.  

I'll do the pull up next and see if that helps...


PS.  I messed around a little with:

Do :Device Humid GP28, t, h :? t, h :pause 2000 :loop


The syntax is off.  I don't know what you intended.  I'm going to try that in a program instead of in immediate mode.
Edited 2024-05-24 12:45 by EDNEDN
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6098
Posted: 02:45am 24 May 2024
Copy link to clipboard 
Print this post

What firmware version are you running?
In later versions, BITBANG has been changed to DEVICE
DEVICE HUMID is the same as BITBANG HUMID

If you think it might be a DHT11, se the manual for command syntax

  Quote  DEVICE HUMID pin, tVar, hVar [,DHT11]

If the optional DHT11 parameter is set to 1 then the command will use device timings suitable for that device.


Using a pullup is strongly recommended.
VK7JH
MMedit   MMBasic Help
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 04:24am 24 May 2024
Copy link to clipboard 
Print this post

For a DHT11 with PicoMite MMBasic Version 5.09.00RC3 this is the output when the command line test is pasted into TeraTerm
> Do :Device Humid GP28, t, h, 1 :? t, h :pause 2000 :loop
13      57
13      47
13      58
13      58
13      58

EDIT
If the DHT is on a module it will probably have a 10kΩ pullup.
Data pin = S
Ground = -
3.3v = middle
.
Edited 2024-05-24 14:36 by phil99
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2075
Posted: 09:11am 24 May 2024
Copy link to clipboard 
Print this post

doesn't really contribute to help solve your problem but I have to say you are on a hiding to nothing with these ghastly devices. Long term they really suffer with humidity mis-reading and getting them to talk is a chore.

I long ago washed my hands of DHT11/22s in favour of the HTU21 (I think there are updates too - it has been some time) for precisely the pain you are experiencing now. HTU21  is i2c and so much easier to talk to - I got it first time with some code published here (by, I think TassyJim or maybe PalCal?).

If you are not too committed...
Edited 2024-05-24 19:24 by CaptainBoing
 
EDNEDN
Senior Member

Joined: 18/02/2023
Location: United States
Posts: 118
Posted: 02:22pm 24 May 2024
Copy link to clipboard 
Print this post

  TassyJim said  What firmware version are you running?
In later versions, BITBANG has been changed to DEVICE
DEVICE HUMID is the same as BITBANG HUMID


> print mm.ver
5.0707

Thank you for the information about the name change for the command.
That clears up a lot of the confusion I had.   I'm still at the BitBang nomenclature.


  TassyJim said  
If you think it might be a DHT11, see the manual for command syntax

DEVICE HUMID pin, tVar, hVar [,DHT11]

If the optional DHT11 parameter is set to 1 then the command will use device timings suitable for that device.


Score!   Changing the GP15 to GP28 and adding the  ",1" to the end of the line made it work.   Even though I specifically ordered a DHT-22 they decided to send me a DHT-11.   Oh Well...   I got the demo working!!!!


  TassyJim said  
Using a pullup is strongly recommended.


Understood!   It looks like they have two surface mount resistors on the back side of the board.   So that is probably OK now that the web page returns meaningful values.

Thanks Jim!!!
Edited 2024-05-25 00:24 by EDNEDN
 
EDNEDN
Senior Member

Joined: 18/02/2023
Location: United States
Posts: 118
Posted: 02:31pm 24 May 2024
Copy link to clipboard 
Print this post

  phil99 said  For a DHT11 with PicoMite MMBasic Version 5.09.00RC3 this is the output when the command line test is pasted into TeraTerm
> Do :Device Humid GP28, t, h, 1 :? t, h :pause 2000 :loop
13      57
13      47
13      58
13      58
13      58

EDIT
If the DHT is on a module it will probably have a 10kΩ pullup.
Data pin = S
Ground = -
3.3v = middle
.


Thanks... I can now duplicate your suggestion.  

  Quote  >  
> do:bitbang humid gp28, t,h,1: ?t,h:pause 2000:loop
25     56
25     56
25     56
25     56
25     56
25     56
25     56
25     56
25     56
25     56
25     56
>
 
pwillard
Senior Member

Joined: 07/06/2022
Location: United States
Posts: 292
Posted: 03:01pm 24 May 2024
Copy link to clipboard 
Print this post

Sadly, the DHT11's are so much worse than a DHT22 that they are not much better than you using your OWN senses to figure current Humidity and Temperature.  Honest, a guess is about as reliably accurate as the DHT11 sensor.

Nice to see you got it to function though.

I agree with using a different sensor, like the HTU21. I use them now myself.
Edited 2024-05-25 01:02 by pwillard
 
EDNEDN
Senior Member

Joined: 18/02/2023
Location: United States
Posts: 118
Posted: 03:32pm 24 May 2024
Copy link to clipboard 
Print this post

  pwillard said  Sadly, the DHT11's are so much worse than a DHT22 that they are not much better than you using your OWN senses to figure current Humidity and Temperature.  Honest, a guess is about as reliably accurate as the DHT11 sensor.

Nice to see you got it to function though.

I agree with using a different sensor, like the HTU21. I use them now myself.


Yes.   I understand.   I just wanted some working demo code.    I've re-ordered several more DHT-22's off of eBay.   So I'll be able to ditch the DHT-11's soon.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024