Reading analog moisture signal from Arduino over USB to RPi3 and publishing via paho MQTT
Here're some changes that I'd personally do:
PEP8 Guidlines

Be consistent when writing code! You used both camelCase and snake_case conventions when you declared your functions. Chose one of them and keep it that way. PEP8 recommends the second one.
Talking about consistency, you should also have a space after each #. More, when you want to write what your function is doing, you should use the following:


def read_sensor(choice):
    &quot;&quot;&quot;
    Read analog moisture data from moisture probe via Arduino UNO plugged into
    the RPi via USB
    &quot;&quot;&quot;
    # ...


After each comma (or any other operator) you should have a space
This: if moisture &lt;= alert_threshold and moisture &gt; alert_low: can be simplified using a chained expression:


if alert_low &lt; moisture &lt;= alert_threshold:
    ....


Use string format() instead of using the old + operator.
Constants should be UPPER_CASED (but not inside functions). I just took them out.

Personal anecdote:

It feels a bit weird to have the main() function at the beginning and everything within that function after. I'd just move it to the end as it will look more naturally.
You have several magic numbers which should be declared at the beginning. Doing this, you'll be able to modify their value faster than going through all the code and trying to remember what does what.
Don't store variables if you use them only once. It will make you're code harder to follow and it will speed it down (don't think of it as a big speed down but even so...)

The above will lead our code to the following:
import serial
import time
import RPi.GPIO as gpio
import paho.mqtt.client as mqtt

ALERT_LOW = 10
ALERT_HIGH = 90
ALERT_TRESHOLD = 30
RELAY_TIME = 14
TIME_TO_SLEEP = 60 * 1
MIN = 330
MAX = 970
RATE = 9600


def read_sensor(choice):
    &quot;&quot;&quot;
    Read analog moisture data from moisture probe via Arduino UNO plugged into
    the RPi via USB
    &quot;&quot;&quot;
    ser = serial.Serial('/dev/ttyACM0', RATE)

    # Line below handles the problem of the Arduino returning more than 1 reading
    raw_data = int(str.split(ser.readline())[0])
    if choice == &quot;raw&quot;:
        moisture = raw_data

    # Stop readings going over or under 0 or 100%
    if raw_data &lt; MIN:
        raw_data = MIN
    if raw_data &gt; MAX:
        raw_data = MAX
    if choice is &quot;raw_adjusted&quot;:
        moisture = raw_data
    if choice == &quot;clean&quot;:
        # Get moisture as  % reading
        moisture = int(round(100 - (100 / float(MAX - MIN)) * (raw_data - MIN), 0))

    return moisture


def send_mqtt(output, topic):
    &quot;&quot;&quot;Publish to MQTT for given topic&quot;&quot;&quot;
    host, user, password, port = &quot;MQTTBroker.local&quot;, &quot;user&quot;, &quot;password&quot;, 1883

    mqttc = mqtt.Client()
    mqttc.username_pw_set(user, password)
    mqttc.connect(host, port)
    mqttc.publish(topic, output)


def alerts():
    &quot;&quot;&quot; Generates alerts that are humanly readable for certain moisture thresholds&quot;&quot;&quot;
    moisture, output = read_sensor(&quot;clean&quot;), ''

    if moisture &lt;= ALERT_LOW:
        output = &quot;**Moisture is below 10%**&quot;
    if ALERT_LOW &lt; moisture &lt;= ALERT_TRESHOLD:
        output = &quot;***Moisture is between 10%` and 30%, watering***&quot;
        relay(RELAY_TIME)
        time.sleep(TIME_TO_SLEEP)
    if moisture &gt;= ALERT_HIGH:
        output = &quot;***Moisture is above 90%***&quot;
    send_mqtt(output, &quot;Planty/alerts&quot;)
    
    
def debugger():
    &quot;&quot;&quot;This is just to test each reading&quot;&quot;&quot;
    output = &quot;Soil Moisture is: {}%\n&quot; \
             &quot;Raw_adjusted is: {}\n&quot; \
             &quot;Raw is: {}&quot;.format(read_sensor(&quot;clean&quot;), read_sensor(&quot;raw_adjusted&quot;), read_sensor(&quot;raw&quot;))

    send_mqtt(output, &quot;Planty/debug&quot;)


def relay(pin):
    &quot;&quot;&quot;Turn on relay via PIN.HIGH&quot;&quot;&quot;
    try:
        gpio.setmode(gpio.BCM)
        gpio.setwarnings(False)
        gpio.setup(pin, gpio.OUT, initial=1)
        send_mqtt(&quot;Turning Relay1 ON&quot;, &quot;Planty/relay&quot;)
        gpio.output(pin, 0)
        time.sleep(5)
        send_mqtt(&quot;Turning Relay1 OFF&quot;, &quot;Planty/relay&quot;)
        gpio.output(pin, 1)
    finally:
        gpio.cleanup()


def main():
    try:
        while 1:
            send_mqtt(read_sensor(&quot;clean&quot;), &quot;Planty/moisture_readings&quot;)
            alerts()
    except KeyboardInterrupt:
        print(&quot;\n\nExiting via Keyboard Interrupt&quot;)


if __name__ == '__main__':
    main()

Since you're using the try/except in main only for KeyboardInterrupt I'd completely remove it as it seems redundant.
def main():
    while 1:
        send_mqtt(read_sensor(&quot;clean&quot;), &quot;Planty/moisture_readings&quot;)
        alerts()