Voltage fluctuations on the outputs of the RevPi
Posted: 12 Aug 2024, 08:36
Hi everyone,
I'm having trouble with a Python script I'm using to control a vertical farming system on a Raspberry Pi. The script is designed to water the plants daily at 8 AM.
Everything seems to work as expected initially, but during the watering process (opening valves, starting the pump), the voltage is fluctuating rapidly - dropping and rising about once per second. This intermittent voltage drop is disrupting the script's operation.
I've isolated the issue to this script and there are no other programs running that could be interfering.
I've attached the relevant part of the code below for reference:
Any ideas on what might be causing these voltage fluctuations and how to resolve them would be greatly appreciated!
Thanks in advance
Joe
I'm having trouble with a Python script I'm using to control a vertical farming system on a Raspberry Pi. The script is designed to water the plants daily at 8 AM.
Everything seems to work as expected initially, but during the watering process (opening valves, starting the pump), the voltage is fluctuating rapidly - dropping and rising about once per second. This intermittent voltage drop is disrupting the script's operation.
I've isolated the issue to this script and there are no other programs running that could be interfering.
I've attached the relevant part of the code below for reference:
Code: Select all
def main():
while True:
rpi = init_rpi()
if None == rpi:
return 0
try:
while True:
while True:
t = time.localtime()
if (t.tm_min == 59):
break
if (t.tm_hour == 7):
time.sleep(1)
else:
time.sleep(1)
print("run layer3")
floodLayer3(rpi)
time.sleep(900)
drainLayer3(rpi)
time.sleep(72000)
except KeyboardInterrupt:
print("Program interrupted by user")
return 0
main()
Any ideas on what might be causing these voltage fluctuations and how to resolve them would be greatly appreciated!
Thanks in advance
Joe