Skip to content

abiddiscombe/pico-dht22-telemetry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pico-dht22-telemetry

The repo contains my code for connecting a DHT22 temperature and humidity sensor to the internet via a Raspberry Pi Pico W and MicroPython. You can think of it as a very early attempt at IoT / telemetry.

Getting Started

I'm still learning MicroPython and Raspberry Pi Pico - so please expect these instructions to change as I learn better ways of programming the device!

  1. Flash MicroPython onto the Pico. Here's the official guide.
  2. Copy the contents of the /src directory to the root directory of the Pico's internal storage.
  3. In Thonny, add the micropython-mcron package to the board. View source. This package is used for accurate timekeeping between readings.
  4. You'll need to tweak line 200 of lib/mcron/__init__.py to be timer = machine.Timer(). This GitHub thread explains why.
  5. In secrets.py, change the values for WIFI to match your network. You'll also need to reconfigure the HTTP request code in /services/telemetry.py to match your infrastructure.

To-Do

  • Add temeprature data from the onboard temperature chip.
  • Improve handling of situations where the network connection is lost.
  • Better cron-like scheduling of sensor events.
  • Better HTTP telemetry code. Dweet is for testing only.

About

Code for connecting a DHT22 temperature and humidity sensor to the internet via a Raspberry Pi Pico W and MicroPython.

Resources

License

Stars

Watchers

Forks

Contributors

Languages