Weather Station

A great way to get started with MudPi is with a straightforward weather station. We will attach a temperature and humidity sensor to our pi and gather readings from MudPi. This project will consist of

  • Raspberry Pi
  • DHT11 Temperature / Humidity Sensor
  • MudPi

Hardware

Here is a basic hardware example to get started with a DHT11 Humidity sensor hooked up to the pi on GPIO pin 25. This will work the the configuration file example listed above and included by default.

MudPi Smart Garden

Software

Now that we have the sensor attached to the pi we need to boot up the pi and configure MudPi. If you have not already setup you pi or need help installing mudpi check out our other starter guides. For this tutorial we assumed you already have a raspberry pi up and running with MudPi installed.

Configuring MudPi

Edit your MudPi configuration file to match the humidity sensor we attached. Your configuration file should look something similar to the one below.

{
    "mudpi": {   
    "name": "MudPi Weather Station",
    "debug": false,
    "unit_system": "imperial",
    "location": {
        "latitude":40,
        "longitude":-20
    },
    "events": {
        "redis": {
            "host": "127.0.0.1",
            "port": 6379
        }
    }
    },
    "sensor": [{
        "key": "dht_sensor_D25",
        "interface": "dht",
        "pin": "D25",
        "model": "11"
    }]
}

Final Results

Now you should be able to run mudpi with the mudpi command and it will load our sensor we attached. MudPi will gather sensor data on a regular interval and publish the data on Redis. Try putting your hand close or breathing on the sensor to see the data change.

Moving forward you could save these readings into a file periodically or log them to a database. You could also take the data and put it into charts and graphs to further visualize data trends. Let me know if you built your own weather station and how you may have expanded on it!