This commit is contained in:
Jon Sanders 2022-05-13 03:32:54 -04:00 committed by GitHub
commit 6917b21399
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -30,6 +30,14 @@ currency_type = "$" # Currency Symbol to show when calculating cost to run j
### Outputs
gpio_heat = 23 # Switches zero-cross solid-state-relay
gpio_e_relay = 27 # pin 13; emergency cutoff relay
# Note: `gpio_e_relay` is used to and a redundant mechanical relay in series with
# the SSR. Because SSRs normally fail closed (i.e. energized), this provides a
# way for the controller to shut off the kiln in the event that the SSR fails.
# It is designed to be used with the SSR input connected to the safety relay's
# Normally Open (NC) output; thus, the kiln can only heat when the RPi has
# energized the safety relay.
### Thermocouple Adapter selection:
# max31855 - bitbang SPI interface

View File

@ -20,6 +20,7 @@ class Output(object):
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(config.gpio_heat, GPIO.OUT)
GPIO.setup(config.gpio_e_relay, GPIO.OUT)
self.active = True
self.GPIO = GPIO
except:
@ -27,6 +28,14 @@ class Output(object):
log.warning(msg)
self.active = False
def safety_off(self):
'''Energizes the safety relay'''
self.GPIO.output(config.gpio_e_relay, self.GPIO.HIGH)
def safety_on(self):
'''Deenergizes the safety relay'''
self.GPIO.output(config.gpio_e_relay, self.GPIO.LOW)
def heat(self,sleepfor):
self.GPIO.output(config.gpio_heat, self.GPIO.HIGH)
time.sleep(sleepfor)
@ -390,12 +399,14 @@ class RealOven(Oven):
# call parent init
Oven.__init__(self)
self.output.safety_off()
# start thread
self.start()
def reset(self):
super().reset()
self.output.safety_on()
self.output.cool(0)
def heat_then_cool(self):