From 4d201abdc91c5eebeae0047ed2f1c1c12c2ef3ed Mon Sep 17 00:00:00 2001 From: Tanaes Date: Sat, 8 Jan 2022 19:02:23 -0500 Subject: [PATCH 1/2] added e relay code --- config.py | 1 + lib/oven.py | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/config.py b/config.py index 1931eee..9d7da2d 100644 --- a/config.py +++ b/config.py @@ -30,6 +30,7 @@ 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 ### Thermocouple Adapter selection: # max31855 - bitbang SPI interface diff --git a/lib/oven.py b/lib/oven.py index af2b42f..e20d36a 100644 --- a/lib/oven.py +++ b/lib/oven.py @@ -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) @@ -384,12 +393,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): From f7f63a00f9ca7bc40abbe497cf62bb903cacaf4c Mon Sep 17 00:00:00 2001 From: Tanaes Date: Sat, 8 Jan 2022 19:05:02 -0500 Subject: [PATCH 2/2] added comment --- config.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config.py b/config.py index 9d7da2d..4240f2f 100644 --- a/config.py +++ b/config.py @@ -32,6 +32,13 @@ currency_type = "$" # Currency Symbol to show when calculating cost to run j 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 # max31856 - bitbang SPI interface. must specify thermocouple_type.