Connecting an Arduino to MudPi

Often the raspberry pi will meet all of our hardware needs, but there are times we need to extend our system with items such as analog sensors. Unfortunantly the raspberry pi does not have analog GPIO so hooking up an Arduino is a cheap easy way to resolve this.

Connecting to arduinos is easy with MudPi along with the help of Nanpy. Nanpy allows us to issue commands over serial to our Arduino from our raspberry pi running MudPi. Read the nanpy docs on how to install and flash the firmware.

Using a USB to TTL USB serial module you can connect your ardiuno using a USB slot from your raspberry pi. The other option is to hook into the RX and TX lines of the pi GPIO but you still would only have one serial channel available. Using a USB to TTL module lets us have more serial lines.

Once you have an arduino connected, all that you need to do is update your mudpi.config file to include your node configuration and restart MudPi. An example of the node configuration is listed below:

    "nodes": [
            "name": "Name of Your Node",
            "address": "/dev/ttyUSB0",
            "sensors": [
                    "pin": "3",
                    "type": "Humidity",
                    "name": "Weather Station"
                    "pin": "5",
                    "type": "Soil",
                    "name": "Soil Moisture",
                    "key": "garden_soil_moisture"

The most important option to connect to your arduino is the address, which is the USB device path of your arduino. You can run ls /dev in your terminal to get a listing of devices. Typically the value your looking for is one of /dev/AMA0, /dev/ttyUSB0, or /dev/ttyUSB1.

You can read more in the configuration section for details on each of the options available. Additionally the sensors section can be reviewed for all the available sensors MudPi supports out of the box.

MudPi Smart Garden
Getting Started with a Raspberry Pi from Scratch
Preparing the SD Card 4:02
Booting Up & Configuring Raspbian 4:48
SSH and SSH Keys (Video Coming Soon)
Install Redis on Raspberry Pi from Compiled Source (Video Coming Soon)
Updating Python on Raspbian & Installing Useful Packages (Video Coming Soon)