Closed lawrenceleejr closed 1 year ago
If you want to use this, I would add this other repo as a submodule in this repo. (Good time to learn about submodules. :D)
Dylan agreed to take the lead on the Circuit/Micro/Whatever Python interface for the DHT20. Jacob agreed to take the lead on the physical connections of the DHT20 to the board.
Use this ticket as a log of anything you figure out.
Found out some hardware info. The DHT20 has 4 pins, these are there functions. 1st Pin: VCC (Power) 2nd Pin: DATA 3rd Pin: NULL (Don't connect anything to it) 4th Pin: GND (Ground)
From what I've found people typically connect a 10k ohm resistor between the 1st and second pin. Then we would connect the 1st pin of DHT20 to pin 36 of the Raspberry Pi Pico (3v3 power). Then could use pin 38 on the pico for pin 4 on DHT20 for GND. Still not sure what to use for the data pin. I saw a website for the pico that used pin 4 which is a GPIO and can do I2C SDA and SPI SCK. Not really sure what that all means but I think we'd use the I2C SDA (serial data) functionality.
Website I found for DHT20 and Raspberry Pi Pico
Take a look at the repo linked in the description. This has a little more on the pinout. Note that your link is for the DHT22. I believe the DHT20 does not require the resistor but you can look at the data sheet for it for the manufacturer recommendation.
I uploaded the MicroPython UF2 file to Raspberry Pi Pico W so that we can program it with micropython: rp2-pico-w-20230201-unstable-v1.19.1-850-gfe2a8332f.zip
I tested it out using Thonny to make an LED blink. Pico_LED_blink.zip
And here is the pico reading output from the DHT20 sensor. I copied the necessary files from the github repository @lawrenceleejr found to the pico board.
Then I just ran the example code from the readme file.
GREAT!! So it's all hooked up right. Maybe it's all ready to be laid out in the stick and soldered up and glued down. Want to plan a physical layout and such and post here?
Started working on adding wifi functionality. Biggest challenge is eduroam is WPA2-Enterprise security, which so far I haven't found support for it in the network library
You should use the ut-open network and separately register the MAC address with the UT network (you can ask @Jmgou how to do that). You'll want to choose a system of hostnames that works. Probably a name with an index like popsicl-01
where the index is different for each unit we end up having, and we can write down the hostname on each of the sticks. Design a naming system that is smart and scalable.
Was looking at the wifi code. I uploaded a .py file that will return the pico w's MAC address to github. For example, the MAC address of the pico I have connected to my laptop is:
I sourced the code from this document here:
Houston, we have wifi. The code above is just a test seeing if the pico could access the contents of the URL shown in the script.
I consolidated the files for MAC address finding and connecting to wifi and the temp/humidity sensor all onto one file under my branch
All right, we have the first prototype constructed and it works:
An example written in MicroPython (which would be a fine alternative to CircuitPython) is here:
https://github.com/flrrth/pico-dht20